summaryrefslogtreecommitdiffstats
path: root/src/plugins/bearer/networkmanager
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/bearer/networkmanager')
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp9
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp45
2 files changed, 49 insertions, 5 deletions
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
index 0af3675..20dee1f 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
@@ -515,6 +515,7 @@ void QNetworkManagerEngine::newAccessPoint(const QString &path, const QDBusObjec
ptr->type = QNetworkConfiguration::InternetAccessPoint;
ptr->purpose = QNetworkConfiguration::PublicPurpose;
ptr->state = QNetworkConfiguration::Undefined;
+ ptr->bearer = QLatin1String("WLAN");
accessPointConfigurations.insert(ptr->id, ptr);
emit configurationAdded(ptr);
@@ -570,6 +571,8 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri
const QString connectionType = map.value("connection").value("type").toString();
if (connectionType == QLatin1String("802-3-ethernet")) {
+ cpPriv->bearer = QLatin1String("Ethernet");
+
foreach (const QDBusObjectPath &devicePath, interface->getDevices()) {
QNetworkManagerInterfaceDevice device(devicePath.path());
if (device.deviceType() == DEVICE_TYPE_802_3_ETHERNET) {
@@ -582,6 +585,8 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri
}
}
} else if (connectionType == QLatin1String("802-11-wireless")) {
+ cpPriv->bearer = QLatin1String("WLAN");
+
const QString connectionSsid = map.value("802-11-wireless").value("ssid").toString();
for (int i = 0; i < accessPoints.count(); ++i) {
@@ -599,6 +604,10 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri
break;
}
}
+ } else if (connectionType == "gsm") {
+ cpPriv->bearer = QLatin1String("2G");
+ } else if (connectionType == "cdma") {
+ cpPriv->bearer = QLatin1String("CDMA2000");
}
return cpPriv;
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp
index 9376324..3843f27 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp
@@ -70,7 +70,7 @@ public:
};
QNetworkManagerInterface::QNetworkManagerInterface(QObject *parent)
- : QObject(parent)
+ : QObject(parent), nmDBusHelper(0)
{
d = new QNetworkManagerInterfacePrivate();
d->connectionInterface = new QDBusInterface(NM_DBUS_SERVICE,
@@ -93,9 +93,10 @@ QNetworkManagerInterface::QNetworkManagerInterface(QObject *parent)
QNetworkManagerInterface::~QNetworkManagerInterface()
{
+ if (nmDBusHelper)
+ delete nmDBusHelper;
delete d->connectionInterface;
delete d;
- delete nmDBusHelper;
}
bool QNetworkManagerInterface::isValid()
@@ -196,7 +197,7 @@ public:
};
QNetworkManagerInterfaceAccessPoint::QNetworkManagerInterfaceAccessPoint(const QString &dbusPathName, QObject *parent)
- : QObject(parent)
+ : QObject(parent), nmDBusHelper(0)
{
d = new QNetworkManagerInterfaceAccessPointPrivate();
d->path = dbusPathName;
@@ -215,6 +216,8 @@ QNetworkManagerInterfaceAccessPoint::QNetworkManagerInterfaceAccessPoint(const Q
QNetworkManagerInterfaceAccessPoint::~QNetworkManagerInterfaceAccessPoint()
{
+ if (nmDBusHelper)
+ delete nmDBusHelper;
delete d->connectionInterface;
delete d;
}
@@ -230,6 +233,9 @@ bool QNetworkManagerInterfaceAccessPoint::setConnections()
return false;
bool allOk = false;
+ if (nmDBusHelper)
+ delete nmDBusHelper;
+ nmDBusHelper = 0;
nmDBusHelper = new QNmDBusHelper;
connect(nmDBusHelper, SIGNAL(pathForPropertiesChanged(const QString &,QMap<QString,QVariant>)),
this,SIGNAL(propertiesChanged( const QString &, QMap<QString,QVariant>)));
@@ -305,7 +311,7 @@ public:
};
QNetworkManagerInterfaceDevice::QNetworkManagerInterfaceDevice(const QString &deviceObjectPath, QObject *parent)
- : QObject(parent)
+ : QObject(parent), nmDBusHelper(0)
{
d = new QNetworkManagerInterfaceDevicePrivate();
d->path = deviceObjectPath;
@@ -323,6 +329,8 @@ QNetworkManagerInterfaceDevice::QNetworkManagerInterfaceDevice(const QString &de
QNetworkManagerInterfaceDevice::~QNetworkManagerInterfaceDevice()
{
+ if (nmDBusHelper)
+ delete nmDBusHelper;
delete d->connectionInterface;
delete d;
}
@@ -338,6 +346,9 @@ bool QNetworkManagerInterfaceDevice::setConnections()
return false;
bool allOk = false;
+ if (nmDBusHelper)
+ delete nmDBusHelper;
+ nmDBusHelper = 0;
nmDBusHelper = new QNmDBusHelper;
connect(nmDBusHelper,SIGNAL(pathForStateChanged(const QString &, quint32)),
this, SIGNAL(stateChanged(const QString&, quint32)));
@@ -397,6 +408,7 @@ public:
};
QNetworkManagerInterfaceDeviceWired::QNetworkManagerInterfaceDeviceWired(const QString &ifaceDevicePath, QObject *parent)
+ : QObject(parent), nmDBusHelper(0)
{
d = new QNetworkManagerInterfaceDeviceWiredPrivate();
d->path = ifaceDevicePath;
@@ -414,6 +426,8 @@ QNetworkManagerInterfaceDeviceWired::QNetworkManagerInterfaceDeviceWired(const Q
QNetworkManagerInterfaceDeviceWired::~QNetworkManagerInterfaceDeviceWired()
{
+ if (nmDBusHelper)
+ delete nmDBusHelper;
delete d->connectionInterface;
delete d;
}
@@ -431,6 +445,9 @@ bool QNetworkManagerInterfaceDeviceWired::setConnections()
bool allOk = false;
+ if (nmDBusHelper)
+ delete nmDBusHelper;
+ nmDBusHelper = 0;
nmDBusHelper = new QNmDBusHelper;
connect(nmDBusHelper, SIGNAL(pathForPropertiesChanged(const QString &,QMap<QString,QVariant>)),
this,SIGNAL(propertiesChanged( const QString &, QMap<QString,QVariant>)));
@@ -474,6 +491,7 @@ public:
};
QNetworkManagerInterfaceDeviceWireless::QNetworkManagerInterfaceDeviceWireless(const QString &ifaceDevicePath, QObject *parent)
+ : QObject(parent), nmDBusHelper(0)
{
d = new QNetworkManagerInterfaceDeviceWirelessPrivate();
d->path = ifaceDevicePath;
@@ -491,6 +509,8 @@ QNetworkManagerInterfaceDeviceWireless::QNetworkManagerInterfaceDeviceWireless(c
QNetworkManagerInterfaceDeviceWireless::~QNetworkManagerInterfaceDeviceWireless()
{
+ if (nmDBusHelper)
+ delete nmDBusHelper;
delete d->connectionInterface;
delete d;
}
@@ -506,6 +526,9 @@ bool QNetworkManagerInterfaceDeviceWireless::setConnections()
return false;
bool allOk = false;
+ if (nmDBusHelper)
+ delete nmDBusHelper;
+ nmDBusHelper = 0;
nmDBusHelper = new QNmDBusHelper;
connect(nmDBusHelper, SIGNAL(pathForPropertiesChanged(const QString &,QMap<QString,QVariant>)),
this,SIGNAL(propertiesChanged( const QString &, QMap<QString,QVariant>)));
@@ -593,7 +616,6 @@ public:
QNetworkManagerSettings::QNetworkManagerSettings(const QString &settingsService, QObject *parent)
: QObject(parent)
{
-// qWarning() << __PRETTY_FUNCTION__;
d = new QNetworkManagerSettingsPrivate();
d->path = settingsService;
d->connectionInterface = new QDBusInterface(settingsService,
@@ -656,6 +678,7 @@ public:
};
QNetworkManagerSettingsConnection::QNetworkManagerSettingsConnection(const QString &settingsService, const QString &connectionObjectPath, QObject *parent)
+ : QObject(parent), nmDBusHelper(0)
{
qDBusRegisterMetaType<QNmSettingsMap>();
d = new QNetworkManagerSettingsConnectionPrivate();
@@ -677,6 +700,8 @@ QNetworkManagerSettingsConnection::QNetworkManagerSettingsConnection(const QStri
QNetworkManagerSettingsConnection::~QNetworkManagerSettingsConnection()
{
+ if (nmDBusHelper)
+ delete nmDBusHelper;
delete d->connectionInterface;
delete d;
}
@@ -701,6 +726,9 @@ bool QNetworkManagerSettingsConnection::setConnections()
qDebug() << error.name() << error.message() << error.type();
}
+ if (nmDBusHelper)
+ delete nmDBusHelper;
+ nmDBusHelper = 0;
nmDBusHelper = new QNmDBusHelper;
connect(nmDBusHelper, SIGNAL(pathForSettingsRemoved(const QString &)),
this,SIGNAL(removed( const QString &)));
@@ -884,6 +912,7 @@ public:
};
QNetworkManagerConnectionActive::QNetworkManagerConnectionActive( const QString &activeConnectionObjectPath, QObject *parent)
+ : QObject(parent), nmDBusHelper(0)
{
d = new QNetworkManagerConnectionActivePrivate();
d->path = activeConnectionObjectPath;
@@ -901,6 +930,8 @@ QNetworkManagerConnectionActive::QNetworkManagerConnectionActive( const QString
QNetworkManagerConnectionActive::~QNetworkManagerConnectionActive()
{
+ if (nmDBusHelper)
+ delete nmDBusHelper;
delete d->connectionInterface;
delete d;
}
@@ -916,6 +947,9 @@ bool QNetworkManagerConnectionActive::setConnections()
return false;
bool allOk = false;
+ if (nmDBusHelper)
+ delete nmDBusHelper;
+ nmDBusHelper = 0;
nmDBusHelper = new QNmDBusHelper;
connect(nmDBusHelper, SIGNAL(pathForPropertiesChanged(const QString &,QMap<QString,QVariant>)),
this,SIGNAL(propertiesChanged( const QString &, QMap<QString,QVariant>)));
@@ -979,6 +1013,7 @@ public:
};
QNetworkManagerIp4Config::QNetworkManagerIp4Config( const QString &deviceObjectPath, QObject *parent)
+ : QObject(parent)
{
d = new QNetworkManagerIp4ConfigPrivate();
d->path = deviceObjectPath;