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

Maximiliano Curia maxy at moszumanska.debian.org
Fri Oct 14 14:28:03 UTC 2016


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

The following commit has been merged in the master branch:
commit f41fb4de2a42b87ee11c4659bf3e6fcf839254ce
Author: Albert Vaca <albertvaka at gmail.com>
Date:   Fri Sep 26 20:39:38 2014 -0700

    Customizable ping messages.
---
 cli/kdeconnect-cli.cpp      | 21 +++++++++++++--------
 plugins/ping/pingplugin.cpp | 11 ++++++++++-
 plugins/ping/pingplugin.h   |  1 +
 3 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/cli/kdeconnect-cli.cpp b/cli/kdeconnect-cli.cpp
index 46dd05c..2eb5acd 100644
--- a/cli/kdeconnect-cli.cpp
+++ b/cli/kdeconnect-cli.cpp
@@ -37,14 +37,15 @@ int main(int argc, char** argv)
     KCmdLineArgs::init(argc, argv, &about);
     KCmdLineOptions options;
     options.add("l")
-           .add("list-devices", ki18n("List all devices"));
+           .add("list-devices", ki18n("List all devices."));
     options.add("refresh", ki18n("Search for devices in the network and re-establish connections."));
-    options.add("pair", ki18n("Request pairing to a said device"));
-    options.add("unpair", ki18n("Stop pairing to a said device"));
-    options.add("ping", ki18n("Sends a ping to said device"));
-    options.add("share <path>", ki18n("Share a file to a said device"));
-    options.add("list-notifications", ki18n("Display the notifications on a said device"));
-    options.add("device <dev>", ki18n("Device ID"));
+    options.add("pair", ki18n("Request pairing to a said device."));
+    options.add("unpair", ki18n("Stop pairing to a said device."));
+    options.add("ping", ki18n("Send a ping to said device."));
+    options.add("ping-msg <message>", ki18n("Same as ping but you can customize the shown message."));
+    options.add("share <path>", ki18n("Share a file to a said device."));
+    options.add("list-notifications", ki18n("Display the notifications on a said device."));
+    options.add("device <dev>", ki18n("Device ID."));
     KCmdLineArgs::addCmdLineOptions( options );
     KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
     KApplication app;
@@ -103,8 +104,12 @@ int main(int argc, char** argv)
                 QDBusPendingReply<void> req = dev.unpair();
                 req.waitForFinished();
             }
-        } else if(args->isSet("ping")) {
+        } else if(args->isSet("ping") || args->isSet("ping-msg")) {
             QDBusMessage msg = QDBusMessage::createMethodCall("org.kde.kdeconnect", "/modules/kdeconnect/devices/"+device+"/ping", "org.kde.kdeconnect.device.ping", "sendPing");
+            if (args->isSet("ping-msg")) {
+                QString message = args->getOption("ping-msg");
+                msg.setArguments(QVariantList() << message);
+            }
             QDBusConnection::sessionBus().call(msg);
         } else if(args->isSet("list-notifications")) {
             NotificationsModel notifications;
diff --git a/plugins/ping/pingplugin.cpp b/plugins/ping/pingplugin.cpp
index b0616e1..042a953 100644
--- a/plugins/ping/pingplugin.cpp
+++ b/plugins/ping/pingplugin.cpp
@@ -52,7 +52,6 @@ bool PingPlugin::receivePackage(const NetworkPackage& np)
     notification->sendEvent();
 
     return true;
-
 }
 
 void PingPlugin::sendPing()
@@ -62,6 +61,16 @@ void PingPlugin::sendPing()
     kDebug(debugArea()) << "sendPing:" << success;
 }
 
+void PingPlugin::sendPing(const QString& customMessage)
+{
+    NetworkPackage np(PACKAGE_TYPE_PING);
+    if (!customMessage.isEmpty()) {
+        np.set("message", customMessage);
+    }
+    bool success = sendPackage(np);
+    kDebug(debugArea()) << "sendPing:" << success;
+}
+
 void PingPlugin::connected()
 {
     QDBusConnection::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportAllContents);
diff --git a/plugins/ping/pingplugin.h b/plugins/ping/pingplugin.h
index 3156307..6893ce5 100644
--- a/plugins/ping/pingplugin.h
+++ b/plugins/ping/pingplugin.h
@@ -36,6 +36,7 @@ public:
     virtual ~PingPlugin();
     
     Q_SCRIPTABLE void sendPing();
+    Q_SCRIPTABLE void sendPing(const QString& customMessage);
 
 public Q_SLOTS:
     virtual bool receivePackage(const NetworkPackage& np);

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list