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

List:       kde-commits
Subject:    KDE/kdebase/runtime/nepomuk/server
From:       Sebastian Trueg <sebastian () trueg ! de>
Date:       2010-12-10 16:33:25
Message-ID: 20101210163325.677B2AC8A6 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1205266 by trueg:

Fixed restart after crash in combination with DrKonqi

 M  +5 -9      processcontrol.cpp  
 M  +3 -4      servicecontroller.cpp  


--- trunk/KDE/kdebase/runtime/nepomuk/server/processcontrol.cpp #1205265:1205266
@@ -1,6 +1,6 @@
 /***************************************************************************
  *   Copyright (C) 2006 by Tobias Koenig <tokoe@kde.org>                   *
- *   Copyright (C) 2008 by Sebastian Trueg <trueg@kde.org>                 *
+ *   Copyright (C) 2008-2010 by Sebastian Trueg <trueg@kde.org>            *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU Library General Public License as       *
@@ -86,7 +86,10 @@
 
 void ProcessControl::slotFinished( int exitCode, QProcess::ExitStatus exitStatus )
 {
-    if ( exitStatus == QProcess::CrashExit ) {
+    // Since Nepomuk services are KApplications and, thus, use DrKonqi QProcess does not
+    // see a crash as an actual CrashExit but as a normal exit with an exit code != 0
+    if ( exitStatus == QProcess::CrashExit ||
+            exitCode != 0 ) {
         if ( mPolicy == RestartOnCrash ) {
              // don't try to start an unstartable application
             if ( !mFailedToStart && --mCrashCount >= 0 ) {
@@ -104,17 +107,10 @@
             qDebug( "Application '%s' crashed. No restart!", qPrintable( commandLine() ) );
         }
     } else {
-        if ( exitCode != 0 ) {
-            qDebug( "ProcessControl: Application '%s' returned with exit code %d (%s)",
-                    qPrintable( commandLine() ), exitCode, qPrintable( mProcess.errorString() ) );
-            mFailedToStart = true;
-            emit finished(false);
-        } else {
             qDebug( "Application '%s' exited normally...", qPrintable( commandLine() ) );
             emit finished(true);
         }
     }
-}
 
 void ProcessControl::slotErrorMessages()
 {
--- trunk/KDE/kdebase/runtime/nepomuk/server/servicecontroller.cpp #1205265:1205266
@@ -204,11 +204,10 @@
                      this, SLOT( slotProcessFinished( bool ) ) );
         }
 
-        // wait for the service to be registered with DBus before creating the service interface
-
-        d->processControl->setCrashPolicy( ProcessControl::RestartOnCrash );
+        // we wait for the service to be registered with DBus before creating the service interface
         return d->processControl->start( KGlobal::dirs()->locate( "exe", "nepomukservicestub" ),
-                                         QStringList() << name() );
+                                         QStringList() << name(),
+                                         ProcessControl::RestartOnCrash );
     }
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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