summaryrefslogtreecommitdiffstats
path: root/tdecore/networkbackends
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-07-16 02:08:39 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-07-16 02:08:39 -0500
commitbae793079f00cde6d857b55ef9c2d98ec6e091e6 (patch)
tree0e1f161f9095487ee0cb930d3d208c1267515006 /tdecore/networkbackends
parentefda5c30fc737a49920900ace57a6bfffb9be27b (diff)
downloadtdelibs-bae793079f00cde6d857b55ef9c2d98ec6e091e6.tar.gz
tdelibs-bae793079f00cde6d857b55ef9c2d98ec6e091e6.zip
Fix network-manager backend crash on certain systems when network-manager is not available
Add ability to show buttons in KSMModalDialog
Diffstat (limited to 'tdecore/networkbackends')
-rw-r--r--tdecore/networkbackends/network-manager/network-manager.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/tdecore/networkbackends/network-manager/network-manager.cpp b/tdecore/networkbackends/network-manager/network-manager.cpp
index ac07b8a1a..a7295beac 100644
--- a/tdecore/networkbackends/network-manager/network-manager.cpp
+++ b/tdecore/networkbackends/network-manager/network-manager.cpp
@@ -1689,19 +1689,26 @@ TDENetworkDeviceType::TDENetworkDeviceType TDENetworkConnectionManager_BackendNM
return TDENetworkDeviceType::BackendOnly;
}
else {
- // Query NM for the device type
- TQT_DBusError error;
- d->m_dbusDeviceString = deviceInterfaceString(m_macAddress);
- DBus::DeviceProxy genericDevice(NM_DBUS_SERVICE, d->m_dbusDeviceString);
- genericDevice.setConnection(TQT_DBusConnection::systemBus());
- TDENetworkDeviceType::TDENetworkDeviceType ret = nmDeviceTypeToTDEDeviceType(genericDevice.getDeviceType(error));
- if (error.isValid()) {
- // Error!
- PRINT_ERROR((error.name() + ": " + error.message()))
- return TDENetworkDeviceType::Other;
+ if (d->m_dbusDeviceString != "") {
+ // Query NM for the device type
+ TQT_DBusError error;
+ d->m_dbusDeviceString = deviceInterfaceString(m_macAddress);
+ DBus::DeviceProxy genericDevice(NM_DBUS_SERVICE, d->m_dbusDeviceString);
+ genericDevice.setConnection(TQT_DBusConnection::systemBus());
+ TDENetworkDeviceType::TDENetworkDeviceType ret = nmDeviceTypeToTDEDeviceType(genericDevice.getDeviceType(error));
+ if (error.isValid()) {
+ // Error!
+ PRINT_ERROR((error.name() + ": " + error.message()))
+ return TDENetworkDeviceType::Other;
+ }
+ else {
+ return ret;
+ }
}
else {
- return ret;
+ // Error!
+ PRINT_ERROR(TQString("Invalid DBUS device string '%1'").arg(d->m_dbusDeviceString))
+ return TDENetworkDeviceType::Other;
}
}
}