[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/runtime/kquitapp
From:       Stefan Monov <logixoul () gmail ! com>
Date:       2008-06-13 6:25:06
Message-ID: 1213338306.547081.12769.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 820072 by logixoul:

error checking


 M  +15 -0     kquitapp.cpp  


--- trunk/KDE/kdebase/runtime/kquitapp/kquitapp.cpp #820071:820072
@@ -21,6 +21,7 @@
 #include <KAboutData>
 #include <KCmdLineArgs>
 #include <KLocale>
+#include <KDebug>
 
 int main(int argc, char* argv[])
 {
@@ -59,7 +60,21 @@
     }
 
     QDBusInterface interface(service, path);
+    // TODO i18n those on string unfreeze
+    if (!interface.isValid()) {
+	kError() << "Application" << args->arg(0)
+                 << "could not be found using service" << service
+                 << "and path" << path << ".";
+        return 1;
+    }
     interface.call("quit");
+    QDBusError error = interface.lastError();
+    if (error.type() != QDBusError::NoError) {
+	kError() << "Quitting application" << args->arg(0)
+                 << "failed. Error reported was:\n\n     " << error.name()
+                 << ": " << error.message();
+        return 1;
+    }
     return 0;
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic