[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:36 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=5a0461a
The following commit has been merged in the master branch:
commit 5a0461aa5843991851f6b71b4879e3bc9e64bb3b
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date: Thu Mar 17 16:23:01 2011 +0100
Add group-mode-item files
---
contact-model-item.h => group-model-item.cpp | 64 ++++++++++++++++------------
contact-model-item.h => group-model-item.h | 26 +++++------
2 files changed, 47 insertions(+), 43 deletions(-)
diff --git a/contact-model-item.h b/group-model-item.cpp
similarity index 50%
copy from contact-model-item.h
copy to group-model-item.cpp
index 2bf3f51..9a0d6bc 100644
--- a/contact-model-item.h
+++ b/group-model-item.cpp
@@ -1,8 +1,6 @@
/*
- * Contacts model item, represents a contact in the contactlist tree
- * This file is based on TelepathyQt4Yell Models
+ * Group model item, represents a group in the contactlist tree
*
- * Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
* Copyright (C) 2011 Martin Klapetek <martin dot klapetek at gmail dot com>
*
* This library is free software; you can redistribute it and/or
@@ -20,34 +18,46 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef TELEPATHY_CONTACT_MODEL_ITEM_H
-#define TELEPATHY_CONTACT_MODEL_ITEM_H
+#include "group-model-item.h"
+#include "accounts-model.h"
-#include <TelepathyQt4/Types>
-
-#include "tree-node.h"
-
-class ContactModelItem : public TreeNode
+struct GroupModelItem::Private
{
- Q_OBJECT
- Q_DISABLE_COPY(ContactModelItem)
-
-public:
- ContactModelItem(const Tp::ContactPtr &contact);
- virtual ~ContactModelItem();
+ Private(const QString &groupName)
+ : mGroupName(groupName)
+ {
+ }
- Q_INVOKABLE virtual QVariant data(int role) const;
- Q_INVOKABLE virtual bool setData(int role, const QVariant &value);
+ QString mGroupName;
+};
- Tp::ContactPtr contact() const;
+GroupModelItem::GroupModelItem(const QString &groupName)
+ : mPriv(new Private(groupName))
+{
+}
-public Q_SLOTS:
- void onChanged();
+GroupModelItem::~GroupModelItem()
+{
-private:
- struct Private;
- friend struct Private;
- Private *mPriv;
-};
+}
-#endif // TELEPATHY_CONTACT_MODEL_ITEM_H
\ No newline at end of file
+QVariant GroupModelItem::data(int role) const
+{
+ switch(role) {
+ case AccountsModel::GroupNameRole:
+ return mPriv->mGroupName;
+ default:
+ return QVariant();
+ }
+}
+
+bool GroupModelItem::setData(int role, const QVariant& value)
+{
+ switch(role) {
+ case AccountsModel::GroupNameRole:
+ //mPriv->mGroupName = value.toString();
+ return true;
+ default:
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/contact-model-item.h b/group-model-item.h
similarity index 65%
copy from contact-model-item.h
copy to group-model-item.h
index 2bf3f51..01e9b53 100644
--- a/contact-model-item.h
+++ b/group-model-item.h
@@ -1,8 +1,6 @@
/*
- * Contacts model item, represents a contact in the contactlist tree
- * This file is based on TelepathyQt4Yell Models
+ * Group model item, represents a group in the contactlist tree
*
- * Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
* Copyright (C) 2011 Martin Klapetek <martin dot klapetek at gmail dot com>
*
* This library is free software; you can redistribute it and/or
@@ -20,34 +18,30 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef TELEPATHY_CONTACT_MODEL_ITEM_H
-#define TELEPATHY_CONTACT_MODEL_ITEM_H
+#ifndef GROUP_MODEL_ITEM_H
+#define GROUP_MODEL_ITEM_H
#include <TelepathyQt4/Types>
-#include "tree-node.h"
+#include <tree-node.h>
-class ContactModelItem : public TreeNode
+
+class GroupModelItem : public TreeNode
{
Q_OBJECT
- Q_DISABLE_COPY(ContactModelItem)
+ Q_DISABLE_COPY(GroupModelItem)
public:
- ContactModelItem(const Tp::ContactPtr &contact);
- virtual ~ContactModelItem();
+ GroupModelItem(const QString &groupName);
+ virtual ~GroupModelItem();
Q_INVOKABLE virtual QVariant data(int role) const;
Q_INVOKABLE virtual bool setData(int role, const QVariant &value);
- Tp::ContactPtr contact() const;
-
-public Q_SLOTS:
- void onChanged();
-
private:
struct Private;
friend struct Private;
Private *mPriv;
};
-#endif // TELEPATHY_CONTACT_MODEL_ITEM_H
\ No newline at end of file
+#endif // GROUP_MODEL_ITEM_H
--
ktp-contact-list packaging
More information about the pkg-kde-commits
mailing list