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

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


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

The following commit has been merged in the master branch:
commit 925e3abb3e0eca92763b6a9ae45a451611c407ac
Author: Albert Vaca <albertvaka at gmail.com>
Date:   Tue Aug 13 23:26:09 2013 +0200

    Migrated notifications to new plugin format. Now it is called 'telephony plugin' because we will have a different plugin for notification syncing
---
 daemon/plugins/CMakeLists.txt                      |  1 +
 daemon/plugins/telephony/CMakeLists.txt            | 20 ++++++++++++
 .../kdeconnect_telephony.desktop}                  | 10 +++---
 .../telephonyplugin.cpp}                           | 36 ++++++++--------------
 .../telephonyplugin.h}                             | 22 ++++++-------
 5 files changed, 49 insertions(+), 40 deletions(-)

diff --git a/daemon/plugins/CMakeLists.txt b/daemon/plugins/CMakeLists.txt
index 5818863..053be07 100644
--- a/daemon/plugins/CMakeLists.txt
+++ b/daemon/plugins/CMakeLists.txt
@@ -5,3 +5,4 @@ add_subdirectory(ping)
 add_subdirectory(pausemusic)
 add_subdirectory(mpriscontrol)
 add_subdirectory(clipboard)
+add_subdirectory(telephony)
\ No newline at end of file
diff --git a/daemon/plugins/telephony/CMakeLists.txt b/daemon/plugins/telephony/CMakeLists.txt
new file mode 100644
index 0000000..c376981
--- /dev/null
+++ b/daemon/plugins/telephony/CMakeLists.txt
@@ -0,0 +1,20 @@
+find_package(KDE4 REQUIRED)
+include (KDE4Defaults)
+include_directories(${KDE4_INCLUDES})
+
+set(kdeconnect_telephony_SRCS
+    telephonyplugin.cpp
+    ../kdeconnectplugin.cpp
+)
+
+kde4_add_plugin(kdeconnect_telephony ${kdeconnect_telephony_SRCS})
+
+target_link_libraries(kdeconnect_telephony
+    ${KDE4_KDECORE_LIBS}
+    ${KDE4_KDEUI_LIBS}
+    ${QT_QTNETWORK_LIBRARY}
+    qjson
+)
+
+install(TARGETS kdeconnect_telephony DESTINATION ${PLUGIN_INSTALL_DIR} )
+install(FILES kdeconnect_telephony.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
diff --git a/daemon/plugins/ping/kdeconnect_ping.desktop b/daemon/plugins/telephony/kdeconnect_telephony.desktop
similarity index 59%
copy from daemon/plugins/ping/kdeconnect_ping.desktop
copy to daemon/plugins/telephony/kdeconnect_telephony.desktop
index c225c8d..ea16130 100644
--- a/daemon/plugins/ping/kdeconnect_ping.desktop
+++ b/daemon/plugins/telephony/kdeconnect_telephony.desktop
@@ -2,14 +2,14 @@
 Encoding=UTF-8
 Type=Service
 ServiceTypes=KdeConnect/Plugin
-X-KDE-Library=kdeconnect_ping
+X-KDE-Library=kdeconnect_telephony
 X-KDE-PluginInfo-Author=Albert Vaca
 X-KDE-PluginInfo-Email=albertvaka at gmail.com
-X-KDE-PluginInfo-Name=kdeconnect_ping
+X-KDE-PluginInfo-Name=kdeconnect_telephony
 X-KDE-PluginInfo-Version=0.1
 X-KDE-PluginInfo-Website=http://albertvaka.wordpress.com
 X-KDE-PluginInfo-License=GPL
 X-KDE-PluginInfo-EnabledByDefault=true
-Icon=dialog-ok
-Name=Ping
-Comment=Send and receive pings
+Icon=preferences-desktop-notification
+Name=Telephony integration
+Comment=Currently it only shows notifications for calls and SMS
diff --git a/daemon/plugins/eventnotifications/notificationpackageinterface.cpp b/daemon/plugins/telephony/telephonyplugin.cpp
similarity index 77%
rename from daemon/plugins/eventnotifications/notificationpackageinterface.cpp
rename to daemon/plugins/telephony/telephonyplugin.cpp
index 48695bd..67e8141 100644
--- a/daemon/plugins/eventnotifications/notificationpackageinterface.cpp
+++ b/daemon/plugins/telephony/telephonyplugin.cpp
@@ -18,23 +18,21 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "notificationpackageinterface.h"
+#include "telephonyplugin.h"
 
 #include <QDebug>
 #include <kicon.h>
 
-NotificationPackageInterface::NotificationPackageInterface(QObject* parent)
-    : PackageInterface(parent)
+TelephonyPlugin::TelephonyPlugin(QObject *parent, const QVariantList &args)
+    : KdeConnectPlugin(parent, args)
 {
-    //TODO: Split in EventNotificationInterface and NotificationDrawerSyncInterface
-    
     trayIcon = new KStatusNotifierItem(parent);
     trayIcon->setIconByName("pda");
     trayIcon->setTitle("KdeConnect");
     connect(trayIcon,SIGNAL(activateRequested(bool,QPoint)),this,SLOT(showPendingNotifications()));
 }
 
-KNotification* NotificationPackageInterface::createNotification(const QString& deviceName, const NetworkPackage& np)
+KNotification* TelephonyPlugin::createNotification(const NetworkPackage& np)
 {
 
     QString id = QString::number(np.id());
@@ -44,8 +42,7 @@ KNotification* NotificationPackageInterface::createNotification(const QString& d
     QString title, content, type, icon;
     bool transient;
 
-    title = deviceName;
-
+    title = device()->name();
 
     if (npType == "ringing") {
         type = "callReceived";
@@ -65,16 +62,6 @@ KNotification* NotificationPackageInterface::createNotification(const QString& d
             + ":
"
             + np.get<QString>("messageBody","");
             transient = true;
-    } else if (npType == "battery") {
-        type = "battery100";
-        icon = "battery-100";
-        content = "Battery at " + np.get<QString>("batteryLevel") + "%";
-        transient = false;
-    } else if (npType == "notification") {
-        type = "pingReceived";
-        icon = "dialog-ok";
-        content = np.get<QString>("notificationContent");
-        transient = false;
     } else {
         //TODO: return NULL if !debug
         type = "unknownEvent";
@@ -89,7 +76,7 @@ KNotification* NotificationPackageInterface::createNotification(const QString& d
     if (transient) {
         trayIcon->setStatus(KStatusNotifierItem::Active);
 
-        KNotification* notification = new KNotification(type); //KNotification::Persistent
+        KNotification* notification = new KNotification(type);
         notification->setPixmap(KIcon(icon).pixmap(48, 48));
         notification->setComponentData(KComponentData("kdeconnect", "kdeconnect"));
         notification->setTitle(title);
@@ -98,7 +85,8 @@ KNotification* NotificationPackageInterface::createNotification(const QString& d
         pendingNotifications.insert(id, notification);
     }
 
-    KNotification* notification = new KNotification(type); //KNotification::Persistent
+
+    KNotification* notification = new KNotification(type); //, KNotification::Persistent
     notification->setPixmap(KIcon(icon).pixmap(48, 48));
     notification->setComponentData(KComponentData("kdeconnect", "kdeconnect"));
     notification->setTitle(title);
@@ -112,7 +100,7 @@ KNotification* NotificationPackageInterface::createNotification(const QString& d
 
 }
 
-void NotificationPackageInterface::notificationAttended()
+void TelephonyPlugin::notificationAttended()
 {
     KNotification* normalNotification = (KNotification*)sender();
     QString id = normalNotification->property("id").toString();
@@ -125,7 +113,7 @@ void NotificationPackageInterface::notificationAttended()
     }
 }
 
-void NotificationPackageInterface::showPendingNotifications()
+void TelephonyPlugin::showPendingNotifications()
 {
     trayIcon->setStatus(KStatusNotifierItem::Passive);
     Q_FOREACH (KNotification* notification, pendingNotifications) {
@@ -134,7 +122,7 @@ void NotificationPackageInterface::showPendingNotifications()
     pendingNotifications.clear();
 }
 
-bool NotificationPackageInterface::receivePackage(const Device& device, const NetworkPackage& np)
+bool TelephonyPlugin::receivePackage(const NetworkPackage& np)
 {
 
     if (np.type() != PACKAGE_TYPE_NOTIFICATION) return false;
@@ -147,7 +135,7 @@ bool NotificationPackageInterface::receivePackage(const Device& device, const Ne
 
     } else {
 
-        KNotification* n = createNotification(device.name(), np);
+        KNotification* n = createNotification(np);
         if (n != NULL) n->sendEvent();
 
     }
diff --git a/daemon/plugins/eventnotifications/notificationpackageinterface.h b/daemon/plugins/telephony/telephonyplugin.h
similarity index 74%
rename from daemon/plugins/eventnotifications/notificationpackageinterface.h
rename to daemon/plugins/telephony/telephonyplugin.h
index b898bcf..d1931e6 100644
--- a/daemon/plugins/eventnotifications/notificationpackageinterface.h
+++ b/daemon/plugins/telephony/telephonyplugin.h
@@ -18,33 +18,33 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef NOTIFICATIONPACKAGEINTERFACE_H
-#define NOTIFICATIONPACKAGEINTERFACE_H
+#ifndef TELEPHONYPLUGIN_H
+#define TELEPHONYPLUGIN_H
 
 #include <knotification.h>
 
-#include "packageinterface.h"
+#include "../kdeconnectplugin.h"
 
 #include <KStatusNotifierItem>
 
-class NotificationPackageInterface
-    : public PackageInterface
+class TelephonyPlugin
+    : public KdeConnectPlugin
 {
     Q_OBJECT
 
 public:
-    NotificationPackageInterface(QObject* parent = 0);
+    explicit TelephonyPlugin(QObject *parent, const QVariantList &args);
 
-    virtual bool receivePackage(const Device&, const NetworkPackage& np);
+public Q_SLOTS:
+    virtual bool receivePackage(const NetworkPackage& np);
+    void showPendingNotifications();
+    void notificationAttended();
 
 private:
-    KNotification* createNotification(const QString& deviceName,const NetworkPackage& np);
+    KNotification* createNotification(const NetworkPackage& np);
     KStatusNotifierItem* trayIcon;
     QHash<QString, KNotification*> pendingNotifications;
 
-public slots:
-    void showPendingNotifications();
-    void notificationAttended();
 };
 
 #endif

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list