~ubuntu-branches/ubuntu/precise/networkmanagement/precise-updates

« back to all changes in this revision

Viewing changes to backends/NetworkManager/connectiondbus.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl, Modestas Vainius, Michael Biebl
  • Date: 2011-05-27 12:18:25 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110527121825-vfufwquq3vy0k3zn
Tags: 0.1+git20110526.911025d-1
[ Modestas Vainius ]
* Use official KDE branding in the package descriptions.

[ Michael Biebl ]
* New upstream Git snapshot 911025d81fdfbe09b64705e94e5411f521c38e3e.
* debian/control
  - Bump Build-Depends on kdelibs5-dev and kdebase-workspace-dev to
    (>= 4:4.6.0).
  - Bump Build-Depends on network-manager-dev and libnm-util-dev to
    (>= 0.8.1).
  - Bump Depends on network-manager to (>= 0.8.1).

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
#include "cdmadbus.h"
44
44
#include "settings/gsm.h"
45
45
#include "gsmdbus.h"
 
46
#include "settings/bluetooth.h"
 
47
#include "bluetoothdbus.h"
46
48
#include "settings/ipv4.h"
47
49
#include "ipv4dbus.h"
 
50
#include "settings/ipv6.h"
 
51
#include "ipv6dbus.h"
48
52
#include "settings/ppp.h"
49
53
#include "pppdbus.h"
50
54
#include "settings/pppoe.h"
62
66
    qDBusRegisterMetaType<QList<uint> >();
63
67
    qDBusRegisterMetaType<QVariantMapMap>();
64
68
    qDBusRegisterMetaType<QList<QList<uint> > >();
 
69
 
 
70
    qDBusRegisterMetaType<IpV6AddressMap>();
 
71
    qDBusRegisterMetaType<QList<IpV6AddressMap> >();
 
72
 
 
73
    qDBusRegisterMetaType<IpV6RouteMap>();
 
74
    qDBusRegisterMetaType<QList<IpV6RouteMap> >();
 
75
 
 
76
    qDBusRegisterMetaType<QList<QByteArray> >();
65
77
}
66
78
 
67
79
ConnectionDbus::~ConnectionDbus()
80
92
            case Setting::Gsm:
81
93
                sd = new GsmDbus(static_cast<GsmSetting*>(setting));
82
94
                break;
 
95
            case Setting::Bluetooth:
 
96
                sd = new BluetoothDbus(static_cast<BluetoothSetting*>(setting));
 
97
                break;
83
98
            case Setting::Ipv4:
84
99
                sd = new Ipv4Dbus(static_cast<Ipv4Setting*>(setting));
85
100
                break;
 
101
            case Setting::Ipv6:
 
102
                sd = new Ipv6Dbus(static_cast<Ipv6Setting*>(setting));
 
103
                break;
86
104
            case Setting::Ppp:
87
105
                sd = new PppDbus(static_cast<PppSetting*>(setting));
88
106
                break;
108
126
                sd = new WirelessSecurityDbus(static_cast<WirelessSecuritySetting*>(setting),
109
127
                        static_cast<WirelessSetting*>(m_connection->setting(Setting::Wireless))->ssid());
110
128
                break;
111
 
            case Setting::Ipv6:
112
 
                break;
113
129
        }
114
130
    }
115
131
    if (sd) {
145
161
        case Knm::Connection::Gsm:
146
162
            dbusConnectionType = QLatin1String(NM_SETTING_GSM_SETTING_NAME);
147
163
            break;
 
164
        case Knm::Connection::Bluetooth:
 
165
            dbusConnectionType = QLatin1String(NM_SETTING_BLUETOOTH_SETTING_NAME);
 
166
            break;
148
167
        case Knm::Connection::Cdma:
149
168
            dbusConnectionType = QLatin1String(NM_SETTING_CDMA_SETTING_NAME);
150
169
            break;
154
173
        case Knm::Connection::Pppoe:
155
174
            dbusConnectionType = QLatin1String(NM_SETTING_PPPOE_SETTING_NAME);
156
175
            break;
 
176
        default:
 
177
            break;
157
178
    }
158
179
    connectionMap.insert(QLatin1String(NM_SETTING_CONNECTION_TYPE), dbusConnectionType);
159
180
    connectionMap.insert(QLatin1String(NM_SETTING_CONNECTION_AUTOCONNECT), m_connection->autoConnect());
181
202
                    || (setting->name() == dbusConnectionType)
182
203
                    || (m_connection->type() == Knm::Connection::Gsm && setting->type() == Knm::Setting::Ppp)
183
204
                    || (m_connection->type() == Knm::Connection::Cdma && setting->type() == Knm::Setting::Ppp)
 
205
                    || (m_connection->type() == Knm::Connection::Bluetooth && setting->type() == Knm::Setting::Ppp)
184
206
                    || (m_connection->type() == Knm::Connection::Pppoe && setting->type() == Knm::Setting::Ppp)) {
185
207
                mapMap.insert(setting->name(), map);
186
208
                //kDebug() << "  Settings: " << setting->name();
223
245
    if (connectionSettings.contains(QLatin1String(NM_SETTING_CONNECTION_AUTOCONNECT)))
224
246
        autoconnect = connectionSettings.value(QLatin1String(NM_SETTING_CONNECTION_AUTOCONNECT)).toBool();
225
247
 
 
248
    if (connectionSettings.contains(QLatin1String(NM_SETTING_CONNECTION_TIMESTAMP))) {
 
249
        int timestamp = connectionSettings.value(QLatin1String(NM_SETTING_CONNECTION_TIMESTAMP)).toInt();
 
250
        QDateTime dateTime;
 
251
        dateTime.setTime_t(timestamp);
 
252
        m_connection->setTimestamp(dateTime);
 
253
    }
 
254
 
226
255
    Connection::Type type = Connection::Wired;
227
256
    if (dbusConnectionType == QLatin1String(NM_SETTING_WIRED_SETTING_NAME)) {
228
257
        type = Connection::Wired;
232
261
        type = Connection::Gsm;
233
262
    } else if (dbusConnectionType == QLatin1String(NM_SETTING_CDMA_SETTING_NAME)) {
234
263
        type = Connection::Cdma;
 
264
    } else if (dbusConnectionType == QLatin1String(NM_SETTING_BLUETOOTH_SETTING_NAME)) {
 
265
        type = Connection::Bluetooth;
235
266
    } else if (dbusConnectionType == QLatin1String(NM_SETTING_VPN_SETTING_NAME)) {
236
267
        type = Connection::Vpn;
237
268
    } else if (dbusConnectionType == QLatin1String(NM_SETTING_PPPOE_SETTING_NAME)) {