diff --git a/kupdatenotifier/kupdatenotifier.cpp b/kupdatenotifier/kupdatenotifier.cpp index 83444353..e810dc18 100644 --- a/kupdatenotifier/kupdatenotifier.cpp +++ b/kupdatenotifier/kupdatenotifier.cpp @@ -27,9 +27,6 @@ // for reference: // https://www.freedesktop.org/software/PackageKit/gtk-doc/PackageKit.html -#define PACKAGEKIT_SERVICE "org.freedesktop.PackageKit" -#define PACKAGEKIT_PATH "/org/freedesktop/PackageKit" -#define PACKAGEKIT_IFACE "org.freedesktop.PackageKit" KUpdateNotifier::KUpdateNotifier(QObject* parent) : KStatusNotifierItem(parent), diff --git a/kupdatenotifier/kupdatenotifier.h b/kupdatenotifier/kupdatenotifier.h index 3f5e1f46..230fb19f 100644 --- a/kupdatenotifier/kupdatenotifier.h +++ b/kupdatenotifier/kupdatenotifier.h @@ -25,6 +25,10 @@ #include #include +#define PACKAGEKIT_SERVICE "org.freedesktop.PackageKit" +#define PACKAGEKIT_PATH "/org/freedesktop/PackageKit" +#define PACKAGEKIT_IFACE "org.freedesktop.PackageKit" + class KUpdateNotifier : public KStatusNotifierItem { Q_OBJECT diff --git a/kupdatenotifier/main.cpp b/kupdatenotifier/main.cpp index d365b666..f341e67f 100644 --- a/kupdatenotifier/main.cpp +++ b/kupdatenotifier/main.cpp @@ -16,6 +16,7 @@ Boston, MA 02110-1301, USA. */ +#include #include #include #include @@ -48,10 +49,16 @@ int main(int argc, char** argv) KUniqueApplication kupdatenotifierapp; kupdatenotifierapp.setQuitOnLastWindowClosed(false); if (!KUniqueApplication::start()) { - kWarning() << "kupdatenotifier is already running!"; + kDebug() << "kupdatenotifier is already running!"; return 0; } + QDBusConnectionInterface* systembusiface = QDBusConnection::systemBus().interface(); + if (!systembusiface->isServiceRegistered(PACKAGEKIT_SERVICE)) { + kDebug() << "activating" << PACKAGEKIT_SERVICE; + systembusiface->startService(PACKAGEKIT_SERVICE); + } + KUpdateNotifier kupdatenotifier(&kupdatenotifierapp); return kupdatenotifierapp.exec();