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

Maximiliano Curia maxy at moszumanska.debian.org
Fri Oct 14 14:27:21 UTC 2016


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

The following commit has been merged in the master branch:
commit a72547096f6015761781d4c2cd9ea4746a7479e0
Author: Samoilenko Yuri <kinnalru at gmail.com>
Date:   Mon Feb 3 21:06:47 2014 +0400

    browse button moved to separate class
---
 .../kdeconnectdeclarativeplugin.cpp                |  2 +-
 plasmoid/package/contents/ui/BrowseButton.qml      | 94 ++++++++++++++++++++++
 plasmoid/package/contents/ui/DeviceDelegate.qml    | 64 +--------------
 3 files changed, 99 insertions(+), 61 deletions(-)

diff --git a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp
index 9fb0f80..7c63a5c 100644
--- a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp
+++ b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp
@@ -54,7 +54,7 @@ void KdeConnectDeclarativePlugin::registerTypes(const char* uri)
     qmlRegisterType<NotificationsModel>("org.kde.kdeconnect", 1, 0, "NotificationsModel");
     qmlRegisterType<BatteryInterface>("org.kde.kdeconnect", 1, 0, "BatteryInterface");
     
-    qmlRegisterType<DBusAsyncResponse>("org.kde.kdeconnect", 1, 0, "DBusResponse");
+    qmlRegisterType<DBusAsyncResponse>("org.kde.kdeconnect", 1, 0, "DBusAsyncResponse");
 }
 
 void KdeConnectDeclarativePlugin::initializeEngine(QDeclarativeEngine* engine, const char* uri)
diff --git a/plasmoid/package/contents/ui/BrowseButton.qml b/plasmoid/package/contents/ui/BrowseButton.qml
new file mode 100644
index 0000000..bba9644
--- /dev/null
+++ b/plasmoid/package/contents/ui/BrowseButton.qml
@@ -0,0 +1,94 @@
+/**
+ * Copyright 2014 Samoilenko Yuri <kinnalru at gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License or (at your option) version 3 or any later version
+ * accepted by the membership of KDE e.V. (or its successor approved
+ * by the membership of KDE e.V.), which shall act as a proxy
+ * defined in Section 14 of version 3 of the license.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 1.1
+import org.kde.plasma.core 0.1 as PlasmaCore
+import org.kde.plasma.components 0.1 as PlasmaComponents
+import org.kde.kdeconnect 1.0
+
+PlasmaComponents.Button
+{
+    id: button
+    checkable: true
+    property string deviceId: ""
+    property variant sftp: SftpDbusInterfaceFactory.create(deviceId)
+
+    state: "UNMOUNTED"
+                
+    states: [
+        State {
+            name: "UNMOUNTED"
+            PropertyChanges { target: button; checked: false; text: "Browse" }
+        },
+        State {
+            name: "MOUNTING"
+            PropertyChanges { target: button; checked: true; text: "Mounting..." }
+        },
+        State {
+            name: "MOUNTED"
+            PropertyChanges { target: button; checked: false; text: "Unmount" }
+        }
+    ]
+    
+    onClicked: {
+        if (state == "UNMOUNTED") {
+            state = "MOUNTING"
+            sftp.startBrowsing()
+        }
+        else if (state == "MOUNTED") {
+            sftp.umount()
+            state = "UNMOUNTED"
+        }
+    }
+    
+
+    DBusAsyncResponse {
+        id: startupCheck
+        onSuccess: {
+            console.log("222SUCC:" + result)
+            if (result) {
+                button.state = "MOUNTED"
+            }
+            else {
+                button.state = "UNMOUNTED"
+            }
+        }
+        onError: {
+            console.log("Error:" + message)
+            state = "UNMOUNTED"
+        }
+    }
+    
+    Component.onCompleted: {
+      
+        console.log("onCompleted device:" + deviceId)
+        
+        sftp.mounted.connect(function() {
+            browse.state = "MOUNTED"
+        })
+        
+        sftp.unmounted.connect(function() {
+            browse.state = "UNMOUNTED"
+        })
+        
+        startupCheck.pendingCall = sftp.isMounted()
+    }
+    
+}
diff --git a/plasmoid/package/contents/ui/DeviceDelegate.qml b/plasmoid/package/contents/ui/DeviceDelegate.qml
index 8851bf8..d37cfc1 100644
--- a/plasmoid/package/contents/ui/DeviceDelegate.qml
+++ b/plasmoid/package/contents/ui/DeviceDelegate.qml
@@ -27,38 +27,9 @@ PlasmaComponents.ListItem
 {
     id: root
     property string deviceId: model.deviceId
-    property variant sftp: SftpDbusInterfaceFactory.create(deviceId)
+   
 
-
-    Component.onCompleted: {
-      
-        sftp.mounted.connect( function() {
-            browse.state = "MOUNTED"
-        })
-        
-        sftp.unmounted.connect( function() {
-          console.log(222)
-            browse.state = "UNMOUNTED"
-        })
-        
-        var response = DBusResponseFactory.create()
-        response.success.connect( function(result) {
-            if (result) {
-                browse.state = "MOUNTED"
-            }
-            else {
-                browse.state = "UNMOUNTED"
-            }
-        })
-                        
-        response.error.connect( function(message) {
-            console.error("Error:" + message)
-            state = "UNMOUNTED"
-        })
-                        
-        response.pendingCall = sftp.isMounted()
-    }
-    
+   
     Column {
         width: parent.width
         
@@ -70,36 +41,9 @@ PlasmaComponents.ListItem
                 text: display
             }
             
-            PlasmaComponents.Button {
+            BrowseButton {
                 id: browse
-                checkable: true
-                state: "UNMOUNTED"
-                
-                onClicked: {
-                    if (state == "UNMOUNTED") {
-                        state = "MOUNTING"
-                        sftp.startBrowsing()
-                    }
-                    else {
-                        sftp.umount()
-                    }
-                }
-                
-                states: [
-                  State {
-                      name: "UNMOUNTED"
-                      PropertyChanges { target: browse; checked: false; text: "Browse"}
-                  },
-                  State {
-                      name: "MOUNTING"
-                      PropertyChanges { target: browse; checked: true; text: "Mounting..."}
-                  },
-                  State {
-                      name: "MOUNTED"
-                      PropertyChanges { target: browse; checked: false; text: "Unmount"}
-                  }
-              ]
-                
+                deviceId: root.deviceId
             }
  
             height: browse.height

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list