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

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


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

The following commit has been merged in the master branch:
commit a83bf73a4dbf646b1946431bad99fbcbb6bef250
Author: Aleix Pol <aleixpol at kde.org>
Date:   Thu Jun 11 16:09:27 2015 +0200

    Move the DevicesSortProxyModel to interfaces/
    
    This way it can be used by other parts of the project. It belongs with the
    DevicesModel.
    
    REVIEW: 124067
---
 interfaces/CMakeLists.txt                                  |  1 +
 {kcm => interfaces}/devicessortproxymodel.cpp              | 12 +++++++++---
 {kcm => interfaces}/devicessortproxymodel.h                |  6 ++++--
 kcm/CMakeLists.txt                                         |  1 -
 plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp |  2 ++
 5 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/interfaces/CMakeLists.txt b/interfaces/CMakeLists.txt
index eb72363..7879b35 100644
--- a/interfaces/CMakeLists.txt
+++ b/interfaces/CMakeLists.txt
@@ -11,6 +11,7 @@ set(libkdeconnect_SRC
     dbusinterfaces.cpp
     devicesmodel.cpp
     notificationsmodel.cpp
+    devicessortproxymodel.cpp
 #    modeltest.cpp
 )
 
diff --git a/kcm/devicessortproxymodel.cpp b/interfaces/devicessortproxymodel.cpp
similarity index 86%
rename from kcm/devicessortproxymodel.cpp
rename to interfaces/devicessortproxymodel.cpp
index 02d02a6..4588dd6 100644
--- a/kcm/devicessortproxymodel.cpp
+++ b/interfaces/devicessortproxymodel.cpp
@@ -27,9 +27,15 @@ DevicesSortProxyModel::DevicesSortProxyModel(DevicesModel* devicesModel)
     : QSortFilterProxyModel(devicesModel)
 {
     setSourceModel(devicesModel);
-    setSortRole(DevicesModel::StatusModelRole);
-    connect(devicesModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
-            this, SLOT(sourceDataChanged(QModelIndex,QModelIndex)));
+}
+
+void DevicesSortProxyModel::setSourceModel(QAbstractItemModel *devicesModel)
+{
+    QSortFilterProxyModel::setSourceModel(devicesModel);
+    if (devicesModel) {
+        setSortRole(DevicesModel::StatusModelRole);
+        connect(devicesModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(sourceDataChanged(QModelIndex,QModelIndex)));
+    }
     sort(0);
 }
 
diff --git a/kcm/devicessortproxymodel.h b/interfaces/devicessortproxymodel.h
similarity index 83%
rename from kcm/devicessortproxymodel.h
rename to interfaces/devicessortproxymodel.h
index 1b6249b..54b7a0b 100644
--- a/kcm/devicessortproxymodel.h
+++ b/interfaces/devicessortproxymodel.h
@@ -22,16 +22,18 @@
 #define DEVICESSORTPROXYMODEL_H
 
 #include <QSortFilterProxyModel>
+#include "interfaces/kdeconnectinterfaces_export.h"
 
 class DevicesModel;
 
-class DevicesSortProxyModel : public QSortFilterProxyModel
+class KDECONNECTINTERFACES_EXPORT DevicesSortProxyModel : public QSortFilterProxyModel
 {
     Q_OBJECT
 public:
-    DevicesSortProxyModel(DevicesModel* devicesModel);
+    DevicesSortProxyModel(DevicesModel* devicesModel = Q_NULLPTR);
     virtual bool lessThan(const QModelIndex& left, const QModelIndex& right) const;
     virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const;
+    virtual void setSourceModel(QAbstractItemModel *sourceModel);
 
 public Q_SLOTS:
     void sourceDataChanged(QModelIndex,QModelIndex);
diff --git a/kcm/CMakeLists.txt b/kcm/CMakeLists.txt
index 568972b..b596e76 100644
--- a/kcm/CMakeLists.txt
+++ b/kcm/CMakeLists.txt
@@ -9,7 +9,6 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}
 
 set(kcm_SRCS
     kcm.cpp
-    devicessortproxymodel.cpp
 )
 
 ki18n_wrap_ui(kcm_SRCS kcm.ui)
diff --git a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp
index 28892f9..76a7601 100644
--- a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp
+++ b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp
@@ -30,6 +30,7 @@
 #include "responsewaiter.h"
 #include "processrunner.h"
 
+#include "interfaces/devicessortproxymodel.h"
 #include "interfaces/devicesmodel.h"
 #include "interfaces/notificationsmodel.h"
 
@@ -59,6 +60,7 @@ void KdeConnectDeclarativePlugin::registerTypes(const char* uri)
     qmlRegisterType<NotificationsModel>(uri, 1, 0, "NotificationsModel");
     qmlRegisterType<DBusAsyncResponse>(uri, 1, 0, "DBusAsyncResponse");
     qmlRegisterType<ProcessRunner>(uri, 1, 0, "ProcessRunner");
+    qmlRegisterType<DevicesSortProxyModel>(uri, 1, 0, "DevicesSortProxyModel");
     qmlRegisterUncreatableType<DeviceDbusInterface>(uri, 1, 0, "DeviceDbusInterface", QStringLiteral("You're not supposed to instantiate interfacess"));
 }
 

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list