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

List:       kde-commits
Subject:    [nepomuk-core] libnepomukcore/resource: If the service is already running at instantiation time, pro
From:       Till Adam <till () kdab ! com>
Date:       2012-10-22 6:53:03
Message-ID: 20121022065303.EF251A6078 () git ! kde ! org
[Download RAW message or body]

Git commit d119ce353956949444d4a840c8630bc89947daf6 by Till Adam.
Committed on 22/10/2012 at 08:51.
Pushed by tilladam into branch 'master'.

If the service is already running at instantiation time, properly init.

REVIEW: 106835

M  +17   -0    libnepomukcore/resource/resourcemanager.cpp

http://commits.kde.org/nepomuk-core/d119ce353956949444d4a840c8630bc89947daf6

diff --git a/libnepomukcore/resource/resourcemanager.cpp b/libnepomukcore/resource/resourcemanager.cpp
index 2f01e47..66d9fcc 100644
--- a/libnepomukcore/resource/resourcemanager.cpp
+++ b/libnepomukcore/resource/resourcemanager.cpp
@@ -207,6 +207,23 @@ Nepomuk2::ResourceManager::ResourceManager()
                                                             this );
     connect( watcher, SIGNAL(serviceUnregistered(QString)),
              this, SLOT(_k_dbusServiceUnregistered(QString)) );
+
+    // now let's see if the service is already running and init, if so
+    QDBusMessage result = QDBusConnection::sessionBus().call(
+            QDBusMessage::createMethodCall(
+                    QLatin1String("org.kde.NepomukStorage"),
+                    QLatin1String("/servicecontrol"),
+                    QLatin1String("org.kde.nepomuk.ServiceControl"),
+                    QLatin1String("isInitialized")
+                )
+            );
+    if ( result.type() == QDBusMessage::ReplyMessage ) {
+        if ( result.arguments().count() > 0 ) {
+            const bool initialized = result.arguments()[0].toBool();
+            d->_k_storageServiceInitialized( initialized );
+        }
+    }
+
 }
 
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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