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

List:       kde-commits
Subject:    kdesupport/akonadi/server
From:       David Faure <faure () kde ! org>
Date:       2010-02-08 17:26:10
Message-ID: 1265649970.409754.29187.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1087237 by dfaure:

Fix confusing error message: unable to register service %s ""
 due to trying to write into a file that ended with akonadi_control's full path.
Reviewed by Volker once I managed to drag him away from Jesper :-)


 M  +8 -2      control/main.cpp  
 M  +5 -4      shared/akdebug.cpp  
 M  +2 -2      shared/akdebug.h  


--- trunk/kdesupport/akonadi/server/control/main.cpp #1087236:1087237
@@ -52,8 +52,14 @@
   app.setDescription( "Akonadi Control Process\nDo not run this manually, use \
'akonadictl' instead to start/stop Akonadi." );  app.parseCommandLine();
 
-  if ( !QDBusConnection::sessionBus().registerService( AKONADI_DBUS_CONTROL_SERVICE \
                ) )
-    akFatal() << "Unable to register service: " << \
QDBusConnection::sessionBus().lastError().message(); +  if ( \
!QDBusConnection::sessionBus().registerService( AKONADI_DBUS_CONTROL_SERVICE ) ) { +  \
// We couldn't register. Most likely, it's already running. +    const QString \
lastError = QDBusConnection::sessionBus().lastError().message(); +    if \
(lastError.isEmpty()) +      akFatal() << "Unable to register service as" << \
AKONADI_DBUS_CONTROL_SERVICE << "Maybe it's already running?"; +    else
+      akFatal() << "Unable to register service as" << AKONADI_DBUS_CONTROL_SERVICE \
<< "Error was:" << lastError; +  }
 
   new ControlManager;
 
--- trunk/kdesupport/akonadi/server/shared/akdebug.cpp #1087236:1087237
@@ -105,9 +105,10 @@
       return QDebug( fileStream );
     }
 
-    void setName( const QString &baseName )
+    void setName( const QString &appName )
     {
-      name = baseName;
+      // Keep only the executable name, e.g. akonadi_control
+      name = appName.mid( appName.lastIndexOf( QLatin1Char('/') ) + 1 );
       fileStream->setFileName( errorLogFileName() );
     }
 
@@ -133,10 +134,10 @@
   return sInstance()->stream( QtDebugMsg );
 }
 
-void akInit( const QString &baseName )
+void akInit( const QString &appName )
 {
   AkonadiCrash::init();
-  sInstance()->setName( baseName );
+  sInstance()->setName( appName );
 
   QFileInfo infoOld( sInstance()->errorLogFileName() + QString::fromLatin1(".old") \
);  if ( infoOld.exists() ) {
--- trunk/kdesupport/akonadi/server/shared/akdebug.h #1087236:1087237
@@ -39,9 +39,9 @@
 QDebug akDebug();
 
 /**
- * Rotate error logs.
+ * Init and rotate error logs.
  */
-void akInit( const QString &baseName );
+void akInit( const QString &appName );
 
 /**
  * Returns the contents of @p name environment variable if it is defined,


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

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