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

Maximiliano Curia maxy at moszumanska.debian.org
Fri Oct 14 14:29:53 UTC 2016


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

The following commit has been merged in the master branch:
commit f9406e8afc875114634e69c9b9126081e2209f64
Author: Aleix Pol <aleixpol at kde.org>
Date:   Tue Jun 21 20:07:12 2016 +0200

    Introduce QVariantMap as an argument of NetworkPackage
    
    Makes it possible to specify the different properties sent at once,
    rather than one by one as we used to do.
    
    Also port whenever possible to the initializer-list syntax.
    
    REVIEW: 128269
---
 core/backends/lan/landevicelink.cpp                |  6 +---
 core/backends/lan/landevicelink.h                  |  2 +-
 core/backends/lan/lanpairinghandler.cpp            | 18 ++++------
 core/backends/lan/uploadjob.cpp                    |  5 +--
 core/networkpackage.cpp                            | 12 +++----
 core/networkpackage.h                              |  2 +-
 plugins/battery/batteryplugin.cpp                  |  3 +-
 plugins/clipboard/clipboardplugin.cpp              |  3 +-
 plugins/lockdevice/lockdeviceplugin.cpp            |  9 ++---
 plugins/mpriscontrol/mpriscontrolplugin.cpp        | 11 +++---
 plugins/mprisremote/mprisremoteplugin.cpp          | 39 ++++++++++++----------
 .../notifications/notificationsdbusinterface.cpp   | 13 ++++----
 plugins/notifications/notificationsplugin.cpp      |  3 +-
 plugins/remotecommands/remotecommandsplugin.cpp    |  6 ++--
 plugins/remotecontrol/remotecontrolplugin.cpp      | 10 +++---
 plugins/runcommand/runcommandplugin.cpp            |  3 +-
 .../sendnotifications/notificationslistener.cpp    | 11 +++---
 plugins/sftp/mounter.cpp                           |  3 +-
 plugins/telepathy/telepathyplugin.cpp              |  9 ++---
 plugins/telephony/telephonyplugin.cpp              | 12 +++----
 20 files changed, 82 insertions(+), 98 deletions(-)

diff --git a/core/backends/lan/landevicelink.cpp b/core/backends/lan/landevicelink.cpp
index 14b8510..569b5cc 100644
--- a/core/backends/lan/landevicelink.cpp
+++ b/core/backends/lan/landevicelink.cpp
@@ -79,12 +79,8 @@ bool LanDeviceLink::sendPackage(NetworkPackage& np)
     return (written != -1);
 }
 
-UploadJob* LanDeviceLink::sendPayload(NetworkPackage& np)
+UploadJob* LanDeviceLink::sendPayload(const NetworkPackage& np)
 {
-    QVariantMap transferInfo;
-    //FIXME: The next two lines shouldn't be needed! Why are they here?
-    transferInfo.insert("useSsl", true);
-    transferInfo.insert("deviceId", deviceId());
     UploadJob* job = new UploadJob(np.payload(), deviceId());
     job->start();
     return job;
diff --git a/core/backends/lan/landevicelink.h b/core/backends/lan/landevicelink.h
index 8aa1c79..dfb4f6d 100644
--- a/core/backends/lan/landevicelink.h
+++ b/core/backends/lan/landevicelink.h
@@ -45,7 +45,7 @@ public:
 
     QString name() override;
     bool sendPackage(NetworkPackage& np) override;
-    UploadJob* sendPayload(NetworkPackage& np);
+    UploadJob* sendPayload(const NetworkPackage& np);
 
     void userRequestsPair() override;
     void userRequestsUnpair() override;
diff --git a/core/backends/lan/lanpairinghandler.cpp b/core/backends/lan/lanpairinghandler.cpp
index fbe5ebd..b9e03b8 100644
--- a/core/backends/lan/lanpairinghandler.cpp
+++ b/core/backends/lan/lanpairinghandler.cpp
@@ -91,10 +91,8 @@ bool LanPairingHandler::requestPairing()
             ;
     }
 
-    NetworkPackage np(PACKAGE_TYPE_PAIR);
-    np.set("pair", true);
-    bool success;
-    success = deviceLink()->sendPackage(np);
+    NetworkPackage np(PACKAGE_TYPE_PAIR, {{"pair", true}});
+    const bool success = deviceLink()->sendPackage(np);
     if (success) {
         setInternalPairStatus(Requested);
         m_pairingTimeout.start();
@@ -106,8 +104,7 @@ bool LanPairingHandler::acceptPairing()
 {
     qDebug() << "User accepts pairing";
     m_pairingTimeout.stop(); // Just in case it is started
-    NetworkPackage np(PACKAGE_TYPE_PAIR);
-    np.set("pair", true);
+    NetworkPackage np(PACKAGE_TYPE_PAIR, {{"pair", true}});
     bool success = deviceLink()->sendPackage(np);
     if (success) {
         setInternalPairStatus(Paired);
@@ -118,23 +115,20 @@ bool LanPairingHandler::acceptPairing()
 void LanPairingHandler::rejectPairing()
 {
     qDebug() << "User rejects pairing";
-    NetworkPackage np(PACKAGE_TYPE_PAIR);
-    np.set("pair", false);
+    NetworkPackage np(PACKAGE_TYPE_PAIR, {{"pair", false}});
     deviceLink()->sendPackage(np);
     setInternalPairStatus(NotPaired);
 }
 
 void LanPairingHandler::unpair() {
-    NetworkPackage np(PACKAGE_TYPE_PAIR);
-    np.set("pair", false);
+    NetworkPackage np(PACKAGE_TYPE_PAIR, {{"pair", false}});
     deviceLink()->sendPackage(np);
     setInternalPairStatus(NotPaired);
 }
 
 void LanPairingHandler::pairingTimeout()
 {
-    NetworkPackage np(PACKAGE_TYPE_PAIR);
-    np.set("pair", false);
+    NetworkPackage np(PACKAGE_TYPE_PAIR, {{"pair", false}});
     deviceLink()->sendPackage(np);
     setInternalPairStatus(NotPaired); //Will emit the change as well
     Q_EMIT pairingError(i18n("Timed out"));
diff --git a/core/backends/lan/uploadjob.cpp b/core/backends/lan/uploadjob.cpp
index 4810813..c21a4ba 100644
--- a/core/backends/lan/uploadjob.cpp
+++ b/core/backends/lan/uploadjob.cpp
@@ -109,9 +109,6 @@ void UploadJob::aboutToClose()
 QVariantMap UploadJob::transferInfo()
 {
     Q_ASSERT(mPort != 0);
-
-    QVariantMap ret;
-    ret["port"] = mPort;
-    return ret;
+    return {{"port", mPort}};
 }
 
diff --git a/core/networkpackage.cpp b/core/networkpackage.cpp
index 339640c..0847c7e 100644
--- a/core/networkpackage.cpp
+++ b/core/networkpackage.cpp
@@ -48,13 +48,13 @@ QDebug operator<<(QDebug s, const NetworkPackage& pkg)
 //const QCA::EncryptionAlgorithm NetworkPackage::EncryptionAlgorithm = QCA::EME_PKCS1v15;
 const int NetworkPackage::ProtocolVersion = 7;
 
-NetworkPackage::NetworkPackage(const QString& type)
+NetworkPackage::NetworkPackage(const QString& type, const QVariantMap &body)
+    : mId(QString::number(QDateTime::currentMSecsSinceEpoch()))
+    , mType(type)
+    , mBody(body)
+    , mPayload()
+    , mPayloadSize(0)
 {
-    mId = QString::number(QDateTime::currentMSecsSinceEpoch());
-    mType = type;
-    mBody = QVariantMap();
-    mPayload = QSharedPointer<QIODevice>();
-    mPayloadSize = 0;
 }
 
 void NetworkPackage::createIdentityPackage(NetworkPackage* np)
diff --git a/core/networkpackage.h b/core/networkpackage.h
index b1bf107..dd997fe 100644
--- a/core/networkpackage.h
+++ b/core/networkpackage.h
@@ -49,7 +49,7 @@ public:
     //const static QCA::EncryptionAlgorithm EncryptionAlgorithm;
     const static int ProtocolVersion;
 
-    explicit NetworkPackage(const QString& type);
+    explicit NetworkPackage(const QString& type, const QVariantMap &body = {});
 
     static void createIdentityPackage(NetworkPackage*);
 
diff --git a/plugins/battery/batteryplugin.cpp b/plugins/battery/batteryplugin.cpp
index 732c3a4..c7650e3 100644
--- a/plugins/battery/batteryplugin.cpp
+++ b/plugins/battery/batteryplugin.cpp
@@ -43,8 +43,7 @@ BatteryPlugin::BatteryPlugin(QObject *parent, const QVariantList &args)
 
 void BatteryPlugin::connected()
 {
-    NetworkPackage np(PACKAGE_TYPE_BATTERY_REQUEST);
-    np.set("request",true);
+    NetworkPackage np(PACKAGE_TYPE_BATTERY_REQUEST, {{"request",true}});
     sendPackage(np);
 }
 
diff --git a/plugins/clipboard/clipboardplugin.cpp b/plugins/clipboard/clipboardplugin.cpp
index 656dc72..6d8c65c 100644
--- a/plugins/clipboard/clipboardplugin.cpp
+++ b/plugins/clipboard/clipboardplugin.cpp
@@ -50,8 +50,7 @@ void ClipboardPlugin::clipboardChanged(QClipboard::Mode mode)
 
     currentContent = content;
 
-    NetworkPackage np(PACKAGE_TYPE_CLIPBOARD);
-    np.set("content", content);
+    NetworkPackage np(PACKAGE_TYPE_CLIPBOARD, {{"content", content}});
     sendPackage(np);
 }
 
diff --git a/plugins/lockdevice/lockdeviceplugin.cpp b/plugins/lockdevice/lockdeviceplugin.cpp
index d486260..437c1b3 100644
--- a/plugins/lockdevice/lockdeviceplugin.cpp
+++ b/plugins/lockdevice/lockdeviceplugin.cpp
@@ -52,8 +52,7 @@ bool LockDevicePlugin::isLocked() const
 }
 void LockDevicePlugin::setLocked(bool locked)
 {
-    NetworkPackage np(PACKAGE_TYPE_LOCK_REQUEST);
-    np.set("setLocked", locked);
+    NetworkPackage np(PACKAGE_TYPE_LOCK_REQUEST, {{"setLocked", locked}});
     sendPackage(np);
 }
 
@@ -73,8 +72,7 @@ bool LockDevicePlugin::receivePackage(const NetworkPackage & np)
         sendState = true;
     }
     if (sendState) {
-        NetworkPackage np(PACKAGE_TYPE_LOCK);
-        np.set("isLocked", iface()->GetActive());
+        NetworkPackage np(PACKAGE_TYPE_LOCK, QVariantMap {{"isLocked", QVariant::fromValue<bool>(iface()->GetActive())}});
         sendPackage(np);
     }
 
@@ -95,8 +93,7 @@ void LockDevicePlugin::connected()
 {
     QDBusConnection::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportAllContents);
 
-    NetworkPackage np(PACKAGE_TYPE_LOCK_REQUEST);
-    np.set("requestLocked", QVariant());
+    NetworkPackage np(PACKAGE_TYPE_LOCK_REQUEST, {{"requestLocked", QVariant()}});
     sendPackage(np);
 }
 
diff --git a/plugins/mpriscontrol/mpriscontrolplugin.cpp b/plugins/mpriscontrol/mpriscontrolplugin.cpp
index c83ffb0..73826b1 100644
--- a/plugins/mpriscontrol/mpriscontrolplugin.cpp
+++ b/plugins/mpriscontrol/mpriscontrolplugin.cpp
@@ -98,12 +98,14 @@ void MprisControlPlugin::addPlayer(const QString& service)
 
 void MprisControlPlugin::seeked(qlonglong position){
     //qCDebug(KDECONNECT_PLUGIN_MPRIS) << "Seeked in player";
-    NetworkPackage np(PACKAGE_TYPE_MPRIS);
-    np.set("pos", position/1000); //Send milis instead of nanos
     OrgFreedesktopDBusPropertiesInterface* interface = (OrgFreedesktopDBusPropertiesInterface*)sender();
     const QString& service = interface->service();
     const QString& player = playerList.key(service);
-    np.set("player", player);
+
+    NetworkPackage np(PACKAGE_TYPE_MPRIS, {
+        {"pos", position/1000}, //Send milis instead of nanos
+        {"player", player}
+    });
     sendPackage(np);
 }
 
@@ -279,8 +281,7 @@ bool MprisControlPlugin::receivePackage (const NetworkPackage& np)
 
 void MprisControlPlugin::sendPlayerList()
 {
-    NetworkPackage np(PACKAGE_TYPE_MPRIS);
-    np.set("playerList",playerList.keys());
+    NetworkPackage np(PACKAGE_TYPE_MPRIS, QVariantMap{{"playerList", QVariant::fromValue(playerList.keys())}});
     sendPackage(np);
 }
 
diff --git a/plugins/mprisremote/mprisremoteplugin.cpp b/plugins/mprisremote/mprisremoteplugin.cpp
index b2e669a..78232a0 100644
--- a/plugins/mprisremote/mprisremoteplugin.cpp
+++ b/plugins/mprisremote/mprisremoteplugin.cpp
@@ -97,49 +97,52 @@ QString MprisRemotePlugin::dbusPath() const
 
 void MprisRemotePlugin::requestPlayerStatus()
 {
-    NetworkPackage np(PACKAGE_TYPE_MPRIS_REQUEST);
-    np.set("player",m_player);
-    np.set("requestNowPlaying",true);
-    np.set("requestVolume",true);
+    NetworkPackage np(PACKAGE_TYPE_MPRIS_REQUEST, {
+        {"player", m_player},
+        {"requestNowPlaying", true},
+        {"requestVolume", true}}
+    );
     sendPackage(np);
 }
 
 void MprisRemotePlugin::requestPlayerList()
 {
-    NetworkPackage np(PACKAGE_TYPE_MPRIS_REQUEST);
-    np.set("requestPlayerList", true);
+    NetworkPackage np(PACKAGE_TYPE_MPRIS_REQUEST, {{"requestPlayerList", true}});
     sendPackage(np);
 }
 
 void MprisRemotePlugin::sendAction(const QString& action)
 {
-    NetworkPackage np(PACKAGE_TYPE_MPRIS_REQUEST);
-    np.set("player", m_player);
-    np.set("action", action);
+    NetworkPackage np(PACKAGE_TYPE_MPRIS_REQUEST, {
+        {"player", m_player},
+        {"action", action}
+    });
     sendPackage(np);
 }
 
 void MprisRemotePlugin::seek(int offset) const
 {
-    NetworkPackage np(PACKAGE_TYPE_MPRIS_REQUEST);
-    np.set("player", m_player);
-    np.set("Seek", offset);
+    NetworkPackage np(PACKAGE_TYPE_MPRIS_REQUEST, {
+        {"player", m_player},
+        {"Seek", offset}});
     sendPackage(np);
 }
 
 void MprisRemotePlugin::setVolume(int volume)
 {
-    NetworkPackage np(PACKAGE_TYPE_MPRIS_REQUEST);
-    np.set("player", m_player);
-    np.set("setVolume",volume);
+    NetworkPackage np(PACKAGE_TYPE_MPRIS_REQUEST, {
+        {"player", m_player},
+        {"setVolume",volume}
+    });
     sendPackage(np);
 }
 
 void MprisRemotePlugin::setPosition(int position)
 {
-    NetworkPackage np(PACKAGE_TYPE_MPRIS_REQUEST);
-    np.set("player", m_player);
-    np.set("SetPosition", position);
+    NetworkPackage np(PACKAGE_TYPE_MPRIS_REQUEST, {
+        {"player", m_player},
+        {"SetPosition", position}
+    });
     sendPackage(np);
 
     m_lastPosition = position;
diff --git a/plugins/notifications/notificationsdbusinterface.cpp b/plugins/notifications/notificationsdbusinterface.cpp
index 4b19955..d44440e 100644
--- a/plugins/notifications/notificationsdbusinterface.cpp
+++ b/plugins/notifications/notificationsdbusinterface.cpp
@@ -70,12 +70,13 @@ void NotificationsDbusInterface::processPackage(const NetworkPackage& np)
         removeNotification(id);
     } else if (np.get<bool>("isRequest")) {
         Q_FOREACH (const auto& n, mNotifications) {
-            NetworkPackage np(PACKAGE_TYPE_NOTIFICATION_REQUEST);
-            np.set("id", n->internalId());
-            np.set("appName", n->appName());
-            np.set("ticker", n->ticker());
-            np.set("isClearable", n->dismissable());
-            np.set("requestAnswer", true);
+            NetworkPackage np(PACKAGE_TYPE_NOTIFICATION_REQUEST, {
+                {"id", n->internalId()},
+                {"appName", n->appName()},
+                {"ticker", n->ticker()},
+                {"isClearable", n->dismissable()},
+                {"requestAnswer", true}
+            });
             mPlugin->sendPackage(np);
         }
     } else {
diff --git a/plugins/notifications/notificationsplugin.cpp b/plugins/notifications/notificationsplugin.cpp
index 5cc281d..d10c203 100644
--- a/plugins/notifications/notificationsplugin.cpp
+++ b/plugins/notifications/notificationsplugin.cpp
@@ -37,8 +37,7 @@ NotificationsPlugin::NotificationsPlugin(QObject* parent, const QVariantList& ar
 
 void NotificationsPlugin::connected()
 {
-    NetworkPackage np(PACKAGE_TYPE_NOTIFICATION_REQUEST);
-    np.set("request", true);
+    NetworkPackage np(PACKAGE_TYPE_NOTIFICATION_REQUEST, {{"request", true}});
     sendPackage(np);
 }
 
diff --git a/plugins/remotecommands/remotecommandsplugin.cpp b/plugins/remotecommands/remotecommandsplugin.cpp
index 95d5285..bd1232a 100644
--- a/plugins/remotecommands/remotecommandsplugin.cpp
+++ b/plugins/remotecommands/remotecommandsplugin.cpp
@@ -61,8 +61,7 @@ void RemoteCommandsPlugin::connected()
 {
     QDBusConnection::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportAllContents);
 
-    NetworkPackage np(PACKAGE_TYPE_RUNCOMMAND_REQUEST);
-    np.set("requestCommandList", true);
+    NetworkPackage np(PACKAGE_TYPE_RUNCOMMAND_REQUEST, {{"requestCommandList", true}});
     sendPackage(np);
 }
 
@@ -81,8 +80,7 @@ void RemoteCommandsPlugin::setCommands(const QByteArray &cmds)
 
 void RemoteCommandsPlugin::triggerCommand(const QString &key)
 {
-    NetworkPackage np(PACKAGE_TYPE_RUNCOMMAND_REQUEST);
-    np.set("key", key);
+    NetworkPackage np(PACKAGE_TYPE_RUNCOMMAND_REQUEST, {{ "key", key }});
     sendPackage(np);
 }
 
diff --git a/plugins/remotecontrol/remotecontrolplugin.cpp b/plugins/remotecontrol/remotecontrolplugin.cpp
index 3b20569..43724a4 100644
--- a/plugins/remotecontrol/remotecontrolplugin.cpp
+++ b/plugins/remotecontrol/remotecontrolplugin.cpp
@@ -44,16 +44,16 @@ RemoteControlPlugin::~RemoteControlPlugin()
 
 void RemoteControlPlugin::moveCursor(const QPoint &p)
 {
-    NetworkPackage np(PACKAGE_TYPE_MOUSEPAD_REQUEST);
-    np.set("dx", p.x());
-    np.set("dy", p.y());
+    NetworkPackage np(PACKAGE_TYPE_MOUSEPAD_REQUEST, {
+        {"dx", p.x()},
+        {"dy", p.y()}
+    });
     sendPackage(np);
 }
 
 void RemoteControlPlugin::sendCommand(const QString &name, bool val)
 {
-    NetworkPackage np(PACKAGE_TYPE_MOUSEPAD_REQUEST);
-    np.set(name, val);
+    NetworkPackage np(PACKAGE_TYPE_MOUSEPAD_REQUEST, {{name, val}});
     sendPackage(np);
 }
 
diff --git a/plugins/runcommand/runcommandplugin.cpp b/plugins/runcommand/runcommandplugin.cpp
index 8f071b1..9af464a 100644
--- a/plugins/runcommand/runcommandplugin.cpp
+++ b/plugins/runcommand/runcommandplugin.cpp
@@ -82,8 +82,7 @@ void RunCommandPlugin::connected()
 void RunCommandPlugin::sendConfig()
 {
     QString commands = config()->get<QString>("commands","{}");
-    NetworkPackage np(PACKAGE_TYPE_RUNCOMMAND);
-    np.set("commandList", commands);
+    NetworkPackage np(PACKAGE_TYPE_RUNCOMMAND, {{"commandList", commands}});
     sendPackage(np);
 }
 
diff --git a/plugins/sendnotifications/notificationslistener.cpp b/plugins/sendnotifications/notificationslistener.cpp
index fbd95b1..4da1770 100644
--- a/plugins/sendnotifications/notificationslistener.cpp
+++ b/plugins/sendnotifications/notificationslistener.cpp
@@ -162,11 +162,12 @@ uint NotificationsListener::Notify(const QString &appName, uint replacesId,
         return 0;
 
     //qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Sending notification from" << appName << ":" <<ticker << "; appIcon=" << appIcon;
-    NetworkPackage np(PACKAGE_TYPE_NOTIFICATION);
-    np.set("id", QString::number(replacesId > 0 ? replacesId : ++id));
-    np.set("appName", appName);
-    np.set("ticker", ticker);
-    np.set("isClearable", timeout == 0);  // KNotifications are persistent if
+    NetworkPackage np(PACKAGE_TYPE_NOTIFICATION, {
+        {"id", QString::number(replacesId > 0 ? replacesId : ++id)},
+        {"appName", appName},
+        {"ticker", ticker},
+        {"isClearable", timeout == 0}
+    });                                   // KNotifications are persistent if
                                           // timeout == 0, for other notifications
                                           // clearability is pointless
 
diff --git a/plugins/sftp/mounter.cpp b/plugins/sftp/mounter.cpp
index a77ed4d..9c98dff 100644
--- a/plugins/sftp/mounter.cpp
+++ b/plugins/sftp/mounter.cpp
@@ -189,8 +189,7 @@ void Mounter::onMountTimeout()
 
 void Mounter::start()
 {
-    NetworkPackage np(PACKAGE_TYPE_SFTP_REQUEST);
-    np.set("startBrowsing", true);
+    NetworkPackage np(PACKAGE_TYPE_SFTP_REQUEST, {{"startBrowsing", true}});
     m_sftp->sendPackage(np);
     
     m_connectTimer.start();
diff --git a/plugins/telepathy/telepathyplugin.cpp b/plugins/telepathy/telepathyplugin.cpp
index ef4f0e1..c0dd289 100644
--- a/plugins/telepathy/telepathyplugin.cpp
+++ b/plugins/telepathy/telepathyplugin.cpp
@@ -53,10 +53,11 @@ bool TelepathyPlugin::receivePackage(const NetworkPackage& np)
 
 void TelepathyPlugin::sendSms(const QString& phoneNumber, const QString& messageBody)
 {
-    NetworkPackage np(PACKAGE_TYPE_SMS_REQUEST);
-    np.set("sendSms", true);
-    np.set("phoneNumber", phoneNumber);
-    np.set("messageBody", messageBody);
+    NetworkPackage np(PACKAGE_TYPE_SMS_REQUEST, {
+        {"sendSms", true},
+        {"phoneNumber", phoneNumber},
+        {"messageBody", messageBody}
+    });
     sendPackage(np);
 }
 
diff --git a/plugins/telephony/telephonyplugin.cpp b/plugins/telephony/telephonyplugin.cpp
index 84a3c30..19697bf 100644
--- a/plugins/telephony/telephonyplugin.cpp
+++ b/plugins/telephony/telephonyplugin.cpp
@@ -122,17 +122,17 @@ bool TelephonyPlugin::receivePackage(const NetworkPackage& np)
 
 void TelephonyPlugin::sendMutePackage()
 {
-    NetworkPackage package(PACKAGE_TYPE_TELEPHONY_REQUEST);
-    package.set<QString>( "action", "mute" );
+    NetworkPackage package(PACKAGE_TYPE_TELEPHONY_REQUEST, {{"action", "mute"}});
     sendPackage(package);
 }
 
 void TelephonyPlugin::sendSms(const QString& phoneNumber, const QString& messageBody)
 {
-    NetworkPackage np(PACKAGE_TYPE_SMS_REQUEST);
-    np.set("sendSms", true);
-    np.set("phoneNumber", phoneNumber);
-    np.set("messageBody", messageBody);
+    NetworkPackage np(PACKAGE_TYPE_SMS_REQUEST, {
+        {"sendSms", true},
+        {"phoneNumber", phoneNumber},
+        {"messageBody", messageBody}
+    });
     sendPackage(np);
 }
 

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list