[SCM] ktp-contact-applet packaging branch, master, updated. debian/15.12.1-1-966-gde83ac5

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


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=83c9106

The following commit has been merged in the master branch:
commit 83c9106873a33f12515d860d55dd48706989c500
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Thu Mar 15 00:44:32 2012 +0000

    Working sorting + filtering
---
 declarative-plugin/contact-list.cpp                | 32 +++++++++++++++++-----
 declarative-plugin/contact-list.h                  | 10 +++++++
 .../contents/ui/ContactList.qml                    |  6 ++++
 3 files changed, 41 insertions(+), 7 deletions(-)

diff --git a/declarative-plugin/contact-list.cpp b/declarative-plugin/contact-list.cpp
index 74217bd..89ce633 100644
--- a/declarative-plugin/contact-list.cpp
+++ b/declarative-plugin/contact-list.cpp
@@ -27,11 +27,17 @@
 ContactList::ContactList(QObject *parent)
     : QObject(parent),
       m_accountsModel(new AccountsModel(this)),
-      m_flatModel(new FlatModelProxy(m_accountsModel))
+      m_filterModel(new AccountsFilterModel(this)),
+      m_flatModel(0)
 {
+    m_filterModel->setSourceModel(m_accountsModel);
+    //flat model takes the source as a constructor parameter, the other's don't.
+    //due to a bug somewhere creating the flat model proxy with the filter model as a source before the filter model has a source means the rolenames do not get propgated up
+    m_flatModel = new FlatModelProxy(m_filterModel);
+
     Tp::registerTypes();
 
-        // Start setting up the Telepathy AccountManager.
+    // Start setting up the Telepathy AccountManager.
     Tp::AccountFactoryPtr  accountFactory = Tp::AccountFactory::create(QDBusConnection::sessionBus(),
                                                                        Tp::Features() << Tp::Account::FeatureCore
                                                                        << Tp::Account::FeatureAvatar
@@ -54,11 +60,13 @@ ContactList::ContactList(QObject *parent)
 
     Tp::ChannelFactoryPtr channelFactory = Tp::ChannelFactory::create(QDBusConnection::sessionBus());
 
-     m_accountManager = Tp::AccountManager::create(QDBusConnection::sessionBus(),
-                                                   accountFactory,
-                                                   connectionFactory,
-                                                   channelFactory,
-                                                   contactFactory);
+    m_accountManager = Tp::AccountManager::create(QDBusConnection::sessionBus(),
+                                                  accountFactory,
+                                                  connectionFactory,
+                                                  channelFactory,
+                                                  contactFactory);
+
+    m_filterModel->setDynamicSortFilter(true);
 
     connect(m_accountManager->becomeReady(),
             SIGNAL(finished(Tp::PendingOperation*)),
@@ -76,3 +84,13 @@ FlatModelProxy * ContactList::flatModel() const
 {
     return m_flatModel;
 }
+
+AccountsFilterModel * ContactList::filterModel() const
+{
+    return m_filterModel;
+}
+
+void ContactList::startChat(ContactModelItem *contact)
+{
+}
+
diff --git a/declarative-plugin/contact-list.h b/declarative-plugin/contact-list.h
index dd7f3eb..fdf4c88 100644
--- a/declarative-plugin/contact-list.h
+++ b/declarative-plugin/contact-list.h
@@ -21,6 +21,8 @@
 
 #include <KTp/Models/accounts-model.h>
 #include <KTp/Models/flat-model-proxy.h>
+#include <KTp/Models/accounts-filter-model.h>
+
 
 #include <TelepathyQt/Types>
 
@@ -30,15 +32,23 @@ class ContactList : public QObject
     Q_OBJECT
 public:
     Q_PROPERTY(QObject* model READ flatModel)
+    Q_PROPERTY(QObject* filter READ filterModel)
+
     
     ContactList(QObject *parent=0);
     FlatModelProxy* flatModel() const;
+    AccountsFilterModel* filterModel() const;
+
     
+public slots:
+    void startChat(ContactModelItem *contact);
+
 private slots:
     void onAccountManagerReady(Tp::PendingOperation *op);
     
 private:
     AccountsModel* m_accountsModel;
+    AccountsFilterModel* m_filterModel;
     FlatModelProxy* m_flatModel; 
     Tp::AccountManagerPtr m_accountManager;
 };
diff --git a/org.kde.ktp.contactlist/contents/ui/ContactList.qml b/org.kde.ktp.contactlist/contents/ui/ContactList.qml
index 9ee83b5..c5c2ecf 100644
--- a/org.kde.ktp.contactlist/contents/ui/ContactList.qml
+++ b/org.kde.ktp.contactlist/contents/ui/ContactList.qml
@@ -40,6 +40,7 @@ Item {
     
     KtpContactList.ContactList {
         id: contactList
+        
     }
     
     ListView {
@@ -73,5 +74,10 @@ Item {
         opacity: 1
         orientation: Qt.Vertical
     }
+    
+    Component.onCompleted : {
+         contactList.filter.sortMode = SortByPresence;
+         contactList.filter.presenceTypeFilterFlags = HideAllOffline;
+    }
 
 }

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list