~ubuntu-branches/ubuntu/quantal/akonadi/quantal

« back to all changes in this revision

Viewing changes to server/akonadictl/akonadistarter.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-01-24 23:43:13 UTC
  • mfrom: (1.1.34)
  • Revision ID: package-import@ubuntu.com-20120124234313-qs50ylscxgww141i
Tags: 1.7.0-0ubuntu1
* New upstream release
* Remove x11_not_required.diff, file no longer shipped
* Disable test suite in debian/rules, it requires dbus

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
#include "akonadistarter.h"
21
21
 
22
 
#include "../../libs/protocol_p.h"
 
22
#include <akapplication.h>
 
23
#include <akdbus.h>
23
24
 
24
25
#include <QtCore/QCoreApplication>
25
26
#include <QtCore/QDebug>
32
33
    QObject( parent ),
33
34
    mRegistered( false )
34
35
{
35
 
  QDBusServiceWatcher *watcher = new QDBusServiceWatcher( QLatin1String( AKONADI_DBUS_CONTROL_SERVICE_LOCK ),
 
36
  QDBusServiceWatcher *watcher = new QDBusServiceWatcher( AkDBus::serviceName(AkDBus::ControlLock),
36
37
                                                          QDBusConnection::sessionBus(),
37
38
                                                          QDBusServiceWatcher::WatchForOwnerChange, this );
38
39
 
39
 
  connect( watcher, SIGNAL( serviceOwnerChanged( const QString&, const QString&, const QString& ) ),
40
 
           this, SLOT( serviceOwnerChanged( const QString&, const QString&, const QString& ) ) );
 
40
  connect( watcher, SIGNAL(serviceOwnerChanged(QString,QString,QString)),
 
41
           this, SLOT(serviceOwnerChanged(QString,QString,QString)) );
41
42
}
42
43
 
43
44
bool AkonadiStarter::start()
44
45
{
45
46
  qDebug( "Starting Akonadi Server..." );
46
 
  const bool ok = QProcess::startDetached( QLatin1String("akonadi_control") );
 
47
 
 
48
  QStringList serverArgs;
 
49
  if ( !AkApplication::instanceIdentifier().isEmpty() )
 
50
    serverArgs << QLatin1String("--instance") << AkApplication::instanceIdentifier();
 
51
  
 
52
  const bool ok = QProcess::startDetached( QLatin1String("akonadi_control"), serverArgs );
47
53
  if ( !ok ) {
48
54
    qDebug( "Error: unable to execute binary akonadi_control" );
49
55
    return false;
56
62
 
57
63
  if ( !mRegistered ) {
58
64
    qDebug( "Error: akonadi_control was started but didn't register at D-Bus session bus." );
59
 
    qDebug( "Make sure your system is setup correctly!" );
 
65
    qDebug( "Make sure your system is set up correctly!" );
60
66
    return false;
61
67
  }
62
68