summaryrefslogtreecommitdiffstats
path: root/tdenetworkmanager/src/main.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-09-10 00:58:52 -0500
committerTimothy Pearson <[email protected]>2012-09-10 00:58:52 -0500
commit2ac42d4b7a4401a42bf90418c330bc23b3c5fee4 (patch)
tree856b14c9aae487a8238f83a7df78b00a4febfb68 /tdenetworkmanager/src/main.cpp
parent323fad1f89abd58c624e73ed03f6399c356fb396 (diff)
downloadtdenetworkmanager-2ac42d4b7a4401a42bf90418c330bc23b3c5fee4.tar.gz
tdenetworkmanager-2ac42d4b7a4401a42bf90418c330bc23b3c5fee4.zip
Fix default device handling and clean up code
Diffstat (limited to 'tdenetworkmanager/src/main.cpp')
-rw-r--r--tdenetworkmanager/src/main.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/tdenetworkmanager/src/main.cpp b/tdenetworkmanager/src/main.cpp
index f8c86cb..02cd662 100644
--- a/tdenetworkmanager/src/main.cpp
+++ b/tdenetworkmanager/src/main.cpp
@@ -23,6 +23,7 @@
**************************************************************************/
// TDE includes
+#include <kglobal.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <dcopclient.h>
@@ -56,10 +57,20 @@ kdemain (int argc, char* argv[])
KCmdLineArgs::init (argc, argv, &aboutData);
- if (TDENetworkManager::start ()) {
+ if (TDENetworkManager::start()) {
TDENetworkManager app;
- app.disableSessionManagement ();
- return app.exec ();
+ app.disableSessionManagement();
+
+ if (!KGlobal::hardwareDevices()) {
+ printf("[ERROR] Unable to load tdenetworkmanager due to invalid KGlobal::hardwareDevices() object\n\r"); fflush(stdout);
+ return -1;
+ }
+ if (!KGlobal::networkManager()) {
+ printf("[ERROR] Unable to load tdenetworkmanager due to invalid KGlobal::hardwareDevices() object\n\r"); fflush(stdout);
+ return -1;
+ }
+
+ return app.exec();
}
return 0;
}