[SCM] ktp-contact-list packaging branch, master, updated. debian/15.12.1-2-1070-g6c56f91

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:05:43 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=6526064

The following commit has been merged in the master branch:
commit 6526064b2cb395f35611d14a20df1f819de695e7
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Fri Apr 1 15:55:53 2011 +0100

    Add AccountsModelItem* and ContactModelItem* as QMetaTypes, this allows for fewer casts when storing and retreiving from QVariant.
---
 accounts-model-item.cpp | 4 +---
 accounts-model-item.h   | 4 ++++
 contact-model-item.cpp  | 6 ++----
 contact-model-item.h    | 7 ++++++-
 4 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/accounts-model-item.cpp b/accounts-model-item.cpp
index 536e513..4217942 100644
--- a/accounts-model-item.cpp
+++ b/accounts-model-item.cpp
@@ -137,9 +137,7 @@ QVariant AccountsModelItem::data(int role) const
 {
     switch (role) {
     case AccountsModel::ItemRole:
-        return QVariant::fromValue(
-                   const_cast<QObject *>(
-                       static_cast<const QObject *>(this)));
+        return QVariant::fromValue((AccountsModelItem*)this);
     case AccountsModel::IdRole:
         return mPriv->mAccount->uniqueIdentifier();
     case AccountsModel::AvatarRole:
diff --git a/accounts-model-item.h b/accounts-model-item.h
index 2168775..65e1c82 100644
--- a/accounts-model-item.h
+++ b/accounts-model-item.h
@@ -27,6 +27,8 @@
 #include <TelepathyQt4/Contact>
 #include <TelepathyQt4/Types>
 
+#include <QtCore/QVariant> //needed for declare metatype
+
 #include "tree-node.h"
 
 class AccountsModelItem : public TreeNode
@@ -72,4 +74,6 @@ private:
     Private *mPriv;
 };
 
+Q_DECLARE_METATYPE(AccountsModelItem*);
+
 #endif // TELEPATHY_ACCOUNTS_MODEL_ITEM_H
diff --git a/contact-model-item.cpp b/contact-model-item.cpp
index b24abe3..e77b8ed 100644
--- a/contact-model-item.cpp
+++ b/contact-model-item.cpp
@@ -85,9 +85,7 @@ QVariant ContactModelItem::data(int role) const
 {
     switch (role) {
     case AccountsModel::ItemRole:
-        return QVariant::fromValue(
-                   const_cast<QObject *>(
-                       static_cast<const QObject *>(this)));
+        return QVariant::fromValue((ContactModelItem*)this);
     case AccountsModel::IdRole:
         return mPriv->mContact->id();
     case Qt::DisplayRole:
@@ -173,4 +171,4 @@ void ContactModelItem::onChanged()
 Tp::ContactPtr ContactModelItem::contact() const
 {
     return mPriv->mContact;
-}
\ No newline at end of file
+}
diff --git a/contact-model-item.h b/contact-model-item.h
index 2bf3f51..eceb054 100644
--- a/contact-model-item.h
+++ b/contact-model-item.h
@@ -25,6 +25,8 @@
 
 #include <TelepathyQt4/Types>
 
+#include <QtCore/QVariant> //needed for declare metatype
+
 #include "tree-node.h"
 
 class ContactModelItem : public TreeNode
@@ -50,4 +52,7 @@ private:
     Private *mPriv;
 };
 
-#endif // TELEPATHY_CONTACT_MODEL_ITEM_H
\ No newline at end of file
+Q_DECLARE_METATYPE(ContactModelItem*);
+
+
+#endif // TELEPATHY_CONTACT_MODEL_ITEM_H

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list