[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=6ddac08

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

    Introduce a device Role
    
    REVIEW: 124067
---
 interfaces/devicesmodel.cpp | 5 ++++-
 interfaces/devicesmodel.h   | 4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/interfaces/devicesmodel.cpp b/interfaces/devicesmodel.cpp
index 90f0b5b..4935755 100644
--- a/interfaces/devicesmodel.cpp
+++ b/interfaces/devicesmodel.cpp
@@ -62,6 +62,7 @@ QHash< int, QByteArray > DevicesModel::roleNames() const
     QHash<int, QByteArray> names = QAbstractItemModel::roleNames();
     names.insert(IdModelRole, "deviceId");
     names.insert(IconNameRole, "iconName");
+    names.insert(DeviceRole, "device");
     return names;
 }
 
@@ -200,7 +201,7 @@ QVariant DevicesModel::data(const QModelIndex& index, int role) const
         return QVariant();
     }
 
-    const DeviceDbusInterface* device = m_deviceList[index.row()];
+    DeviceDbusInterface* device = m_deviceList[index.row()];
 
     //This function gets called lots of times, producing lots of dbus calls. Add a cache?
     switch (role) {
@@ -228,6 +229,8 @@ QVariant DevicesModel::data(const QModelIndex& index, int role) const
         }
         case IconNameRole:
             return device->statusIconName();
+        case DeviceRole:
+            return QVariant::fromValue<QObject*>(device);
         default:
             return QVariant();
     }
diff --git a/interfaces/devicesmodel.h b/interfaces/devicesmodel.h
index e8c1d9e..d86a35c 100644
--- a/interfaces/devicesmodel.h
+++ b/interfaces/devicesmodel.h
@@ -44,8 +44,10 @@ public:
         IconModelRole   = Qt::DecorationRole,
         StatusModelRole = Qt::InitialSortOrderRole,
         IdModelRole     = Qt::UserRole,
-        IconNameRole
+        IconNameRole,
+        DeviceRole
     };
+    Q_ENUMS(ModelRoles);
     enum StatusFlag {
         StatusUnknown   = 0x00,
         StatusPaired    = 0x01,

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list