[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498

Maximiliano Curia maxy at moszumanska.debian.org
Fri Oct 14 14:26:46 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=d32a667

The following commit has been merged in the master branch:
commit d32a667f049937262c558929c725fdf4281c640e
Author: Albert Vaca <albertvaka at gmail.com>
Date:   Wed Aug 14 06:46:24 2013 +0200

    Telephony and pausemusic plugins now use kdeconnect.telephony packages (need changes in the Android code to work)
---
 CMakeLists.txt                                 |  1 -
 daemon/networkpackagetypes.h                   |  2 +-
 daemon/plugins/pausemusic/pausemusicplugin.cpp | 24 ++++++++----------------
 daemon/plugins/telephony/telephonyplugin.cpp   |  2 +-
 4 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2f61e83..e0feb63 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,5 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
 add_subdirectory(daemon)
 add_subdirectory(kcm)
-#add_subdirectory(kioslave)
 
 add_subdirectory(test)
diff --git a/daemon/networkpackagetypes.h b/daemon/networkpackagetypes.h
index aff696c..96ccaab 100644
--- a/daemon/networkpackagetypes.h
+++ b/daemon/networkpackagetypes.h
@@ -25,7 +25,7 @@
 #define PACKAGE_TYPE_PING QString("kdeconnect.ping")
 #define PACKAGE_TYPE_NOTIFICATION QString("kdeconnect.notification")
 #define PACKAGE_TYPE_BATTERY QString("kdeconnect.battery")
-#define PACKAGE_TYPE_CALL QString("kdeconnect.call")
+#define PACKAGE_TYPE_TELEPHONY QString("kdeconnect.telephony")
 #define PACKAGE_TYPE_CLIPBOARD QString("kdeconnect.clipboard")
 #define PACKAGE_TYPE_MPRIS QString("kdeconnect.mpris")
 
diff --git a/daemon/plugins/pausemusic/pausemusicplugin.cpp b/daemon/plugins/pausemusic/pausemusicplugin.cpp
index 7226713..bb69a95 100644
--- a/daemon/plugins/pausemusic/pausemusicplugin.cpp
+++ b/daemon/plugins/pausemusic/pausemusicplugin.cpp
@@ -41,28 +41,20 @@ PauseMusicPlugin::PauseMusicPlugin(QObject* parent, const QVariantList& args)
 
 bool PauseMusicPlugin::receivePackage(const NetworkPackage& np)
 {
+    if (np.type() != PACKAGE_TYPE_TELEPHONY) return false;
 
-    bool pauseConditionFulfilled = false;
-
-    //TODO: I have manually tested it and it works for both "pauseWhen" cases, but I should somehow write a test for this logic
+    //TODO: Test this logic again
     if (pauseWhen == PauseWhenRinging) {
-        if (np.type() == PACKAGE_TYPE_NOTIFICATION) {
-            if (np.get<QString>("notificationType") != "ringing") return false;
-            pauseConditionFulfilled = !np.get<bool>("isCancel");
-        } else if (np.type() == PACKAGE_TYPE_CALL) {
-            pauseConditionFulfilled = !np.get<bool>("isCancel");
-        } else {
-            return false;
-        }
+        if (np.get<QString>("event") != "ringing" || np.get<QString>("event") != "talking") return false;
     } else if (pauseWhen == PauseWhenTalking){
-        if (np.type() != PACKAGE_TYPE_CALL) return false;
-        pauseConditionFulfilled = !np.get<bool>("isCancel");
+        if (np.get<QString>("event") != "talking") return false;
     }
 
+
+    bool pauseConditionFulfilled = !np.get<bool>("isCancel");
+
     qDebug() << "PauseMusicPackageReceiver - PauseCondition:" << pauseConditionFulfilled;
 
-    //TODO: Make this async
-    //TODO: Make this not crash if dbus is not working
     if (pauseConditionFulfilled) {
         //Search for interfaces currently playing
         QStringList interfaces = QDBusConnection::sessionBus().interface()->registeredServiceNames().value();
@@ -78,7 +70,7 @@ bool PauseMusicPlugin::receivePackage(const NetworkPackage& np)
                 }
             }
         }
-    } if (!pauseConditionFulfilled) {
+    } else {
         Q_FOREACH (const QString& iface, pausedSources) {
             QDBusInterface mprisInterface(iface, "/org/mpris/MediaPlayer2", "org.mpris.MediaPlayer2.Player");
             //Calling play does not work in spotify
diff --git a/daemon/plugins/telephony/telephonyplugin.cpp b/daemon/plugins/telephony/telephonyplugin.cpp
index 67e8141..656f51a 100644
--- a/daemon/plugins/telephony/telephonyplugin.cpp
+++ b/daemon/plugins/telephony/telephonyplugin.cpp
@@ -125,7 +125,7 @@ void TelephonyPlugin::showPendingNotifications()
 bool TelephonyPlugin::receivePackage(const NetworkPackage& np)
 {
 
-    if (np.type() != PACKAGE_TYPE_NOTIFICATION) return false;
+    if (np.type() != PACKAGE_TYPE_TELEPHONY) return false;
 
     if (np.get<bool>("isCancel")) {
 

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list