[SCM] kdeconnect packaging branch, master, updated. upstream/1.0.1-206-gf661872

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 18:27:00 UTC 2017


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

The following commit has been merged in the master branch:
commit f654e75820df7b9f4445f538c1cea51437393a6e
Author: Aleix Pol <aleixpol at kde.org>
Date:   Sun Aug 21 13:05:43 2016 +0200

    Improve how we handle the different plugin pages
---
 app/qml/DevicePage.qml                       | 38 ++++++------------
 app/qml/FindDevicesPage.qml                  |  4 +-
 tests/testdaemon.h => app/qml/PluginItem.qml | 58 ++++++++++++----------------
 app/qml/mousepad.qml                         | 12 +++---
 app/qml/mpris.qml                            | 20 +++++-----
 app/resources.qrc                            |  1 +
 6 files changed, 55 insertions(+), 78 deletions(-)

diff --git a/app/qml/DevicePage.qml b/app/qml/DevicePage.qml
index 213d133..1c5a836 100644
--- a/app/qml/DevicePage.qml
+++ b/app/qml/DevicePage.qml
@@ -59,37 +59,21 @@ Kirigami.Page
                 Layout.fillHeight: true
                 Layout.fillWidth: true
 
-                Kirigami.BasicListItem {
-                    readonly property var fu: PluginChecker {
-                        id: mprisChecker
-                        pluginName: "mpriscontrol"
-                    }
-                    enabled: mprisChecker.available
+                PluginItem {
                     label: i18n("Multimedia control")
-                    onClicked: pageStack.push(
-                        "qrc:/qml/mpris.qml",
-                        { mprisInterface: MprisDbusInterfaceFactory.create(deviceView.currentDevice.id()) }
-                    );
+                    interfaceFactory: MprisDbusInterfaceFactory
+                    component: "qrc:/qml/mpris.qml"
+                    pluginName: "mprisremote"
                 }
-                Kirigami.BasicListItem {
-                    readonly property var fu: PluginChecker {
-                        id: mousepadChecker
-                        pluginName: "mousepad"
-                    }
-                    enabled: mousepadChecker.available
+                PluginItem {
                     label: i18n("Remote input")
-                    onClicked: pageStack.push(
-                        "qrc:/qml/mousepad.qml",
-                        { remoteControlInterface: RemoteControlDbusInterfaceFactory.create(deviceView.currentDevice.id()) }
-                    );
+                    interfaceFactory: RemoteControlDbusInterfaceFactory
+                    component: "qrc:/qml/mousepad.qml"
+                    pluginName: "remotecontrol"
                 }
-                Kirigami.BasicListItem {
-                    readonly property var fu: PluginChecker {
-                        id: lockdeviceChecker
-                        pluginName: "lockdevice"
-                    }
-                    enabled: lockdeviceChecker.available
-                    property var lockIface: LockDeviceDbusInterfaceFactory.create(deviceView.currentDevice.id())
+                PluginItem {
+                    readonly property var lockIface: LockDeviceDbusInterfaceFactory.create(deviceView.currentDevice.id())
+                    pluginName: "lockdevice"
                     label: lockIface.isLocked ? i18n("Unlock") : i18n("Lock")
                     onClicked: {
                         lockIface.isLocked = !lockIface.isLocked;
diff --git a/app/qml/FindDevicesPage.qml b/app/qml/FindDevicesPage.qml
index 622ad42..b555e72 100644
--- a/app/qml/FindDevicesPage.qml
+++ b/app/qml/FindDevicesPage.qml
@@ -55,8 +55,8 @@ Kirigami.Page
                 label: display + "
" + toolTip
                 enabled: !(status & DevicesModel.Paired)
                 onClicked: {
-                    root.pageStack.clear()
-                    root.pageStack.push(
+                    pageStack.clear()
+                    pageStack.push(
                         "qrc:/qml/DevicePage.qml",
                         {currentDevice: device}
                     );
diff --git a/tests/testdaemon.h b/app/qml/PluginItem.qml
similarity index 55%
copy from tests/testdaemon.h
copy to app/qml/PluginItem.qml
index d081a6b..483bbbe 100644
--- a/tests/testdaemon.h
+++ b/app/qml/PluginItem.qml
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright 2015 Aleix Pol Gonzalez <aleixpol at kde.org>
  *
  * This program is free software; you can redistribute it and/or
@@ -18,40 +18,32 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef TESTDAEMON_H
-#define TESTDAEMON_H
+import QtQuick 2.2
+import QtQuick.Controls 1.1
+import QtQuick.Layouts 1.1
+import org.kde.kirigami 1.0 as Kirigami
+import org.kde.kdeconnect 1.0
 
-#include <core/daemon.h>
-#include <core/backends/pairinghandler.h>
-
-class TestDaemon : public Daemon
+Kirigami.BasicListItem
 {
-public:
-    TestDaemon(QObject* parent = Q_NULLPTR)
-        : Daemon(parent, true)
-        , m_nam(Q_NULLPTR)
-    {
-    }
+    property alias pluginName: checker.pluginName
+    property var interfaceFactory
+    property string component
 
-    void reportError(const QString & title, const QString & description) override
-    {
-        qWarning() << "error:" << title << description;
+    readonly property var checker: PluginChecker {
+        id: checker
+        deviceId: deviceView.currentDevice.id()
     }
-
-    void askPairingConfirmation(PairingHandler * d) override {
-        d->acceptPairing();
+    enabled: checker.available
+    onClicked: {
+        if (component === "")
+            return;
+
+        var obj = interfaceFactory.create(checker.deviceId);
+        var page = pageStack.push(
+            component,
+            { pluginInterface: obj }
+        );
+        obj.parent = page
     }
-
-    QNetworkAccessManager* networkAccessManager() override
-    {
-        if (!m_nam) {
-            m_nam = new KIO::AccessManager(this);
-        }
-        return m_nam;
-    }
-
-private:
-    QNetworkAccessManager* m_nam;
-};
-
-#endif
+}
diff --git a/app/qml/mousepad.qml b/app/qml/mousepad.qml
index a3b1f02..1091ff7 100644
--- a/app/qml/mousepad.qml
+++ b/app/qml/mousepad.qml
@@ -27,7 +27,7 @@ Kirigami.Page
 {
     id: mousepad
     title: i18n("Remote Control")
-    property QtObject remoteControlInterface
+    property QtObject pluginInterface
 
     ColumnLayout
     {
@@ -39,14 +39,14 @@ Kirigami.Page
             Layout.fillHeight: true
             property var lastPos: Qt.point(-1, -1)
 
-            onClicked: mousepad.remoteControlInterface.sendCommand("singleclick", true);
+            onClicked: mousepad.pluginInterface.sendCommand("singleclick", true);
 
             onPositionChanged: {
                 if (lastPos.x > -1) {
     //                 console.log("move", mouse.x, mouse.y, lastPos)
                     var delta = Qt.point(mouse.x-lastPos.x, mouse.y-lastPos.y);
 
-                    remoteControlInterface.moveCursor(delta);
+                    pluginInterface.moveCursor(delta);
                 }
                 lastPos = Qt.point(mouse.x, mouse.y);
             }
@@ -59,15 +59,15 @@ Kirigami.Page
 
             Button {
                 Layout.fillWidth: true
-                onClicked: mousepad.remoteControlInterface.sendCommand("singleclick", true);
+                onClicked: mousepad.pluginInterface.sendCommand("singleclick", true);
             }
             Button {
                 Layout.fillWidth: true
-                onClicked: mousepad.remoteControlInterface.sendCommand("middleclick", true);
+                onClicked: mousepad.pluginInterface.sendCommand("middleclick", true);
             }
             Button {
                 Layout.fillWidth: true
-                onClicked: mousepad.remoteControlInterface.sendCommand("rightclick", true);
+                onClicked: mousepad.pluginInterface.sendCommand("rightclick", true);
             }
         }
     }
diff --git a/app/qml/mpris.qml b/app/qml/mpris.qml
index 7c2f6ba..3399de3 100644
--- a/app/qml/mpris.qml
+++ b/app/qml/mpris.qml
@@ -26,7 +26,7 @@ import org.kde.kirigami 1.0 as Kirigami
 Kirigami.Page
 {
     id: root
-    property QtObject mprisInterface
+    property QtObject pluginInterface
     title: i18n("Multimedia Controls")
 
     ColumnLayout
@@ -34,42 +34,42 @@ Kirigami.Page
         anchors.fill: parent
 
         Component.onCompleted: {
-            mprisInterface.requestPlayerList();
+            pluginInterface.requestPlayerList();
         }
 
         Item { Layout.fillHeight: true }
         ComboBox {
             Layout.fillWidth: true
-            model: root.mprisInterface.playerList
-            onCurrentTextChanged: root.mprisInterface.player = currentText
+            model: root.pluginInterface.playerList
+            onCurrentTextChanged: root.pluginInterface.player = currentText
         }
         Label {
             Layout.fillWidth: true
-            text: root.mprisInterface.nowPlaying
+            text: root.pluginInterface.nowPlaying
         }
         RowLayout {
             Layout.fillWidth: true
             Button {
                 Layout.fillWidth: true
                 iconName: "media-skip-backward"
-                onClicked: root.mprisInterface.sendAction("Previous")
+                onClicked: root.pluginInterface.sendAction("Previous")
             }
             Button {
                 Layout.fillWidth: true
-                iconName: root.mprisInterface.isPlaying ? "media-playback-pause" : "media-playback-start"
-                onClicked: root.mprisInterface.sendAction("PlayPause");
+                iconName: root.pluginInterface.isPlaying ? "media-playback-pause" : "media-playback-start"
+                onClicked: root.pluginInterface.sendAction("PlayPause");
             }
             Button {
                 Layout.fillWidth: true
                 iconName: "media-skip-forward"
-                onClicked: root.mprisInterface.sendAction("Next")
+                onClicked: root.pluginInterface.sendAction("Next")
             }
         }
         RowLayout {
             Layout.fillWidth: true
             Label { text: i18n("Volume:") }
             Slider {
-                value: root.mprisInterface.volume
+                value: root.pluginInterface.volume
                 maximumValue: 100
                 Layout.fillWidth: true
             }
diff --git a/app/resources.qrc b/app/resources.qrc
index f9e4832..924e258 100644
--- a/app/resources.qrc
+++ b/app/resources.qrc
@@ -3,6 +3,7 @@
     <file>qml/main.qml</file>
     <file>qml/mpris.qml</file>
     <file>qml/mousepad.qml</file>
+    <file>qml/PluginItem.qml</file>
     <file>qml/DevicePage.qml</file>
     <file>qml/FindDevicesPage.qml</file>
  </qresource>

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list