[Merge] lp:~boiko/history-service/cached_contact_matching into lp:history-service
Gustavo Pichorim Boiko
gustavo.boiko at canonical.com
Tue Oct 13 19:12:53 UTC 2015
Diff comments:
>
> === modified file 'src/manager.cpp'
> --- src/manager.cpp 2015-10-13 17:13:27 +0000
> +++ src/manager.cpp 2015-10-13 17:13:27 +0000
> @@ -70,6 +73,25 @@
> connect(d->dbus.data(),
> SIGNAL(eventsRemoved(History::Events)),
> SIGNAL(eventsRemoved(History::Events)));
> +
> + // watch for the service going up and down
> + connect(&d->serviceWatcher, &QDBusServiceWatcher::serviceRegistered, [&](const QString &serviceName) {
> + qDebug() << "HistoryService: service registered:" << serviceName;
> + this->d_ptr->serviceRunning = true;
> + Q_EMIT this->serviceRunningChanged();
> + });
> + connect(&d->serviceWatcher, &QDBusServiceWatcher::serviceUnregistered, [&](const QString &serviceName) {
> + qDebug() << "HistoryService: service unregistered:" << serviceName;
> + this->d_ptr->serviceRunning = false;
> + Q_EMIT this->serviceRunningChanged();
> + });
> +
> + // and fetch the current status
> + d->serviceRunning = false;
I just did that to query for the status and set the serviceRunning value only after connecting to registered & unregistered signals. I can change that if you want.
> + QDBusReply<bool> reply = QDBusConnection::sessionBus().interface()->isServiceRegistered(DBusService);
> + if (reply.isValid()) {
> + d->serviceRunning = reply.value();
> + }
> }
>
> Manager::~Manager()
--
https://code.launchpad.net/~boiko/history-service/cached_contact_matching/+merge/272188
Your team Ubuntu Phablet Team is subscribed to branch lp:history-service.
More information about the Ubuntu-reviews
mailing list