[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498
Maximiliano Curia
maxy at moszumanska.debian.org
Fri Oct 14 14:26:45 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=1328048
The following commit has been merged in the master branch:
commit 132804835c629fe9d0b58056d822e624a7e3734a
Author: Albert Vaca <albertvaka at gmail.com>
Date: Wed Aug 14 00:09:46 2013 +0200
Added stubs for futurible plugins
---
.../{telephony => filetransfer}/CMakeLists.txt | 2 +-
.../filetransferplugin.cpp} | 20 ++++++++--------
.../filetransferplugin.h} | 10 ++++----
.../kdeconnect_filetransfer.desktop} | 10 ++++----
daemon/plugins/notifications/CMakeLists.txt | 20 ++++++++++++++++
.../kdeconnect_notifications.desktop} | 10 ++++----
.../notificationsplugin.cpp} | 28 ++++++++++++++--------
.../notificationsplugin.h} | 15 ++++++------
8 files changed, 72 insertions(+), 43 deletions(-)
diff --git a/daemon/plugins/telephony/CMakeLists.txt b/daemon/plugins/filetransfer/CMakeLists.txt
similarity index 94%
copy from daemon/plugins/telephony/CMakeLists.txt
copy to daemon/plugins/filetransfer/CMakeLists.txt
index c376981..2ffb4fc 100644
--- a/daemon/plugins/telephony/CMakeLists.txt
+++ b/daemon/plugins/filetransfer/CMakeLists.txt
@@ -3,7 +3,7 @@ include (KDE4Defaults)
include_directories(${KDE4_INCLUDES})
set(kdeconnect_telephony_SRCS
- telephonyplugin.cpp
+ filetransferplugin.cpp
../kdeconnectplugin.cpp
)
diff --git a/daemon/plugins/battery/batterydbusinterface.cpp b/daemon/plugins/filetransfer/filetransferplugin.cpp
similarity index 68%
copy from daemon/plugins/battery/batterydbusinterface.cpp
copy to daemon/plugins/filetransfer/filetransferplugin.cpp
index d44a998..8562cc4 100644
--- a/daemon/plugins/battery/batterydbusinterface.cpp
+++ b/daemon/plugins/filetransfer/filetransferplugin.cpp
@@ -18,22 +18,22 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "batterydbusinterface.h"
+#include "filetransferplugin.h"
-#include <QDebug>
+K_PLUGIN_FACTORY( KdeConnectPluginFactory, registerPlugin< FileTransferPlugin >(); )
+K_EXPORT_PLUGIN( KdeConnectPluginFactory("kdeconnect_filetransfer", "kdeconnect_filetransfer") )
-BatteryDbusInterface::BatteryDbusInterface(QObject *parent)
- : QDBusAbstractAdaptor(parent)
+
+FileTransferPlugin::FileTransferPlugin(QObject* parent, const QVariantList& args)
+ : KdeConnectPlugin(parent, args)
{
+
}
-void BatteryDbusInterface::updateValues(bool isCharging, int currentCharge)
+bool FileTransferPlugin::receivePackage(const NetworkPackage& np)
{
- mIsCharging = isCharging;
- mCharge = currentCharge;
-
- Q_EMIT chargingChange();
-}
+ return false;
+}
diff --git a/daemon/plugins/ping/pingplugin.h b/daemon/plugins/filetransfer/filetransferplugin.h
similarity index 85%
copy from daemon/plugins/ping/pingplugin.h
copy to daemon/plugins/filetransfer/filetransferplugin.h
index d8d6924..2f21427 100644
--- a/daemon/plugins/ping/pingplugin.h
+++ b/daemon/plugins/filetransfer/filetransferplugin.h
@@ -18,20 +18,20 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef PINGPLUGIN_H
-#define PINGPLUGIN_H
+#ifndef FILETRANFERPLUGIN_H
+#define FILETRANFERPLUGIN_H
-#include <QObject>
+#include <knotification.h>
#include "../kdeconnectplugin.h"
-class KDE_EXPORT PingPlugin
+class FileTransferPlugin
: public KdeConnectPlugin
{
Q_OBJECT
public:
- explicit PingPlugin(QObject *parent, const QVariantList &args);
+ explicit FileTranferPlugin(QObject *parent, const QVariantList &args);
public Q_SLOTS:
virtual bool receivePackage(const NetworkPackage& np);
diff --git a/daemon/plugins/pausemusic/kdeconnect_pausemusic.desktop b/daemon/plugins/filetransfer/kdeconnect_filetransfer.desktop
similarity index 62%
copy from daemon/plugins/pausemusic/kdeconnect_pausemusic.desktop
copy to daemon/plugins/filetransfer/kdeconnect_filetransfer.desktop
index f28563c..ba1306e 100644
--- a/daemon/plugins/pausemusic/kdeconnect_pausemusic.desktop
+++ b/daemon/plugins/filetransfer/kdeconnect_filetransfer.desktop
@@ -2,14 +2,14 @@
Encoding=UTF-8
Type=Service
ServiceTypes=KdeConnect/Plugin
-X-KDE-Library=kdeconnect_pausemusic
+X-KDE-Library=kdeconnect_filetransfer
X-KDE-PluginInfo-Author=Albert Vaca
X-KDE-PluginInfo-Email=albertvaka at gmail.com
-X-KDE-PluginInfo-Name=kdeconnect_pausemusic
+X-KDE-PluginInfo-Name=kdeconnect_filetransfer
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=speaker
-Name=Pause music on call
-Comment=Pause music during a phone call
+Icon=preferences-desktop-notification
+Name=File transfer
+Comment=Allows to send and receive files
diff --git a/daemon/plugins/notifications/CMakeLists.txt b/daemon/plugins/notifications/CMakeLists.txt
new file mode 100644
index 0000000..00a747c
--- /dev/null
+++ b/daemon/plugins/notifications/CMakeLists.txt
@@ -0,0 +1,20 @@
+find_package(KDE4 REQUIRED)
+include (KDE4Defaults)
+include_directories(${KDE4_INCLUDES})
+
+set(kdeconnect_notifications_SRCS
+ notificationsplugin.cpp
+ ../kdeconnectplugin.cpp
+)
+
+kde4_add_plugin(kdeconnect_notifications ${kdeconnect_notifications_SRCS})
+
+target_link_libraries(kdeconnect_notifications
+ ${KDE4_KDECORE_LIBS}
+ ${KDE4_KDEUI_LIBS}
+ ${QT_QTNETWORK_LIBRARY}
+ qjson
+)
+
+install(TARGETS kdeconnect_notifications DESTINATION ${PLUGIN_INSTALL_DIR} )
+install(FILES kdeconnect_notifications.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
diff --git a/daemon/plugins/pausemusic/kdeconnect_pausemusic.desktop b/daemon/plugins/notifications/kdeconnect_notifications.desktop
similarity index 59%
copy from daemon/plugins/pausemusic/kdeconnect_pausemusic.desktop
copy to daemon/plugins/notifications/kdeconnect_notifications.desktop
index f28563c..916e6de 100644
--- a/daemon/plugins/pausemusic/kdeconnect_pausemusic.desktop
+++ b/daemon/plugins/notifications/kdeconnect_notifications.desktop
@@ -2,14 +2,14 @@
Encoding=UTF-8
Type=Service
ServiceTypes=KdeConnect/Plugin
-X-KDE-Library=kdeconnect_pausemusic
+X-KDE-Library=kdeconnect_notifications
X-KDE-PluginInfo-Author=Albert Vaca
X-KDE-PluginInfo-Email=albertvaka at gmail.com
-X-KDE-PluginInfo-Name=kdeconnect_pausemusic
+X-KDE-PluginInfo-Name=kdeconnect_notifications
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=speaker
-Name=Pause music on call
-Comment=Pause music during a phone call
+Icon=preferences-desktop-notification
+Name=Notification sync
+Comment=Show every notification in KDE and keep them in sync
diff --git a/daemon/plugins/telephony/telephonyplugin.cpp b/daemon/plugins/notifications/notificationsplugin.cpp
similarity index 81%
copy from daemon/plugins/telephony/telephonyplugin.cpp
copy to daemon/plugins/notifications/notificationsplugin.cpp
index 67e8141..d712053 100644
--- a/daemon/plugins/telephony/telephonyplugin.cpp
+++ b/daemon/plugins/notifications/notificationsplugin.cpp
@@ -18,21 +18,29 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "telephonyplugin.h"
+#include "notificationsplugin.h"
#include <QDebug>
#include <kicon.h>
-TelephonyPlugin::TelephonyPlugin(QObject *parent, const QVariantList &args)
+
+K_PLUGIN_FACTORY( KdeConnectPluginFactory, registerPlugin< NotificationPlugin >(); )
+K_EXPORT_PLUGIN( KdeConnectPluginFactory("kdeconnect_notifications", "kdeconnect_notifications") )
+
+
+NotificationsPlugin::NotificationsPlugin(QObject* parent, const QVariantList& args)
: KdeConnectPlugin(parent, args)
{
+ //TODO: Split in EventNotificationInterface and NotificationDrawerSyncInterface
+ //TODO: Add low battery notifications
+
trayIcon = new KStatusNotifierItem(parent);
trayIcon->setIconByName("pda");
trayIcon->setTitle("KdeConnect");
connect(trayIcon,SIGNAL(activateRequested(bool,QPoint)),this,SLOT(showPendingNotifications()));
}
-KNotification* TelephonyPlugin::createNotification(const NetworkPackage& np)
+KNotification* NotificationsPlugin::createNotification(const QString& deviceName, const NetworkPackage& np)
{
QString id = QString::number(np.id());
@@ -42,7 +50,7 @@ KNotification* TelephonyPlugin::createNotification(const NetworkPackage& np)
QString title, content, type, icon;
bool transient;
- title = device()->name();
+ title = deviceName;
if (npType == "ringing") {
type = "callReceived";
@@ -76,7 +84,7 @@ KNotification* TelephonyPlugin::createNotification(const NetworkPackage& np)
if (transient) {
trayIcon->setStatus(KStatusNotifierItem::Active);
- KNotification* notification = new KNotification(type);
+ KNotification* notification = new KNotification(type); //KNotification::Persistent
notification->setPixmap(KIcon(icon).pixmap(48, 48));
notification->setComponentData(KComponentData("kdeconnect", "kdeconnect"));
notification->setTitle(title);
@@ -86,7 +94,7 @@ KNotification* TelephonyPlugin::createNotification(const NetworkPackage& np)
}
- 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);
@@ -100,7 +108,7 @@ KNotification* TelephonyPlugin::createNotification(const NetworkPackage& np)
}
-void TelephonyPlugin::notificationAttended()
+void NotificationsPlugin::notificationAttended()
{
KNotification* normalNotification = (KNotification*)sender();
QString id = normalNotification->property("id").toString();
@@ -113,7 +121,7 @@ void TelephonyPlugin::notificationAttended()
}
}
-void TelephonyPlugin::showPendingNotifications()
+void NotificationsPlugin::showPendingNotifications()
{
trayIcon->setStatus(KStatusNotifierItem::Passive);
Q_FOREACH (KNotification* notification, pendingNotifications) {
@@ -122,7 +130,7 @@ void TelephonyPlugin::showPendingNotifications()
pendingNotifications.clear();
}
-bool TelephonyPlugin::receivePackage(const NetworkPackage& np)
+bool NotificationsPlugin::receivePackage(const Device& device, const NetworkPackage& np)
{
if (np.type() != PACKAGE_TYPE_NOTIFICATION) return false;
@@ -135,7 +143,7 @@ bool TelephonyPlugin::receivePackage(const NetworkPackage& np)
} else {
- KNotification* n = createNotification(np);
+ KNotification* n = createNotification(device.name(), np);
if (n != NULL) n->sendEvent();
}
diff --git a/daemon/plugins/telephony/telephonyplugin.h b/daemon/plugins/notifications/notificationsplugin.h
similarity index 82%
copy from daemon/plugins/telephony/telephonyplugin.h
copy to daemon/plugins/notifications/notificationsplugin.h
index d1931e6..1f07b0e 100644
--- a/daemon/plugins/telephony/telephonyplugin.h
+++ b/daemon/plugins/notifications/notificationsplugin.h
@@ -18,8 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef TELEPHONYPLUGIN_H
-#define TELEPHONYPLUGIN_H
+#ifndef NOTIFICATIONPACKAGEINTERFACE_H
+#define NOTIFICATIONPACKAGEINTERFACE_H
#include <knotification.h>
@@ -27,24 +27,25 @@
#include <KStatusNotifierItem>
-class TelephonyPlugin
+class NotificationPlugin
: public KdeConnectPlugin
{
Q_OBJECT
public:
- explicit TelephonyPlugin(QObject *parent, const QVariantList &args);
+ explicit NotificationPlugin(QObject *parent, const QVariantList &args);
public Q_SLOTS:
virtual bool receivePackage(const NetworkPackage& np);
- void showPendingNotifications();
- void notificationAttended();
private:
- KNotification* createNotification(const NetworkPackage& np);
+ KNotification* createNotification(const QString& deviceName,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