[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9

Maximiliano Curia maxy at moszumanska.debian.org
Mon May 9 09:08:53 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=750a659

The following commit has been merged in the master branch:
commit 750a659a4c71d8740545a96c3af7ad0e01bb56d0
Author: Martin Klapetek <mklapetek at kde.org>
Date:   Mon Jun 8 22:47:11 2015 +0200

    [kaccounts] Replace the MC restarting with working code
---
 kaccounts/CMakeLists.txt           |  1 +
 kaccounts/kaccounts-ktp-plugin.cpp | 21 +++++++++++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/kaccounts/CMakeLists.txt b/kaccounts/CMakeLists.txt
index a89febb..5acb8e7 100644
--- a/kaccounts/CMakeLists.txt
+++ b/kaccounts/CMakeLists.txt
@@ -12,6 +12,7 @@ add_library(kaccounts_ktp_plugin MODULE ${kaccounts_ktp_plugin_SRCS})
 
 target_link_libraries(kaccounts_ktp_plugin
                       Qt5::Core
+                      Qt5::DBus
                       KF5::ConfigCore
                       KF5::CoreAddons
                       KTp::Logger
diff --git a/kaccounts/kaccounts-ktp-plugin.cpp b/kaccounts/kaccounts-ktp-plugin.cpp
index b3c55ce..a5b70b6 100644
--- a/kaccounts/kaccounts-ktp-plugin.cpp
+++ b/kaccounts/kaccounts-ktp-plugin.cpp
@@ -36,6 +36,7 @@
 #include <QTimer>
 #include <QStandardPaths>
 #include <QDir>
+#include <QDBusConnection>
 
 #include <KTp/Logger/log-manager.h>
 
@@ -49,6 +50,9 @@
 #include <KAccounts/getcredentialsjob.h>
 #include <KAccounts/core.h>
 
+// for ::kill
+#include <signal.h>
+
 static QStringList s_knownProviders{QStringLiteral("haze-icq"),
                                     QStringLiteral("jabber"),
                                     QStringLiteral("kde-talk"),
@@ -297,12 +301,17 @@ void KAccountsKTpPlugin::Private::derefMigrationCount()
 {
     migrationRef--;
     if (migrationRef == 0) {
-//         qDebug() << "Killing MC";
-//         QProcess mcKiller;
-//         mcKiller.start(QStringLiteral("killall mission-control-5"));
-//
-//         QProcess mcSpawner;
-//         mcSpawner.start(QStringLiteral("mc-tool list"));
+        qDebug() << "Restarting MC";
+
+        // Get the PID of mission control and then SIGTERM it
+        QProcess pidOf;
+        pidOf.start(QStringLiteral("pidof"), QStringList() << QStringLiteral("mission-control-5"));
+        pidOf.waitForFinished();
+        QByteArray pidOfOutput = pidOf.readAllStandardOutput();
+        int mcPid = pidOfOutput.trimmed().toInt();
+        ::kill(mcPid, SIGTERM);
+
+        QDBusConnection::sessionBus().interface()->startService(QStringLiteral("org.freedesktop.Telepathy.MissionControl5"));
 
         KSharedConfigPtr config = KSharedConfig::openConfig(QStringLiteral("kaccountsrc"));
         KConfigGroup generalGroup = config->group(QStringLiteral("General"));

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list