[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9

Maximiliano Curia maxy at moszumanska.debian.org
Mon May 9 09:04:43 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=9e4b9e6

The following commit has been merged in the master branch:
commit 9e4b9e64eb082074198e71b6cdd7787685b7c894
Author: Dominik Cermak <d.cermak at arcor.de>
Date:   Fri Dec 16 10:51:31 2011 +0100

    Add filtering for filetransfer-capability and make filtering more generic
    
    Add the possibility to filter for contacts with filetransfer capability
    as it is needed for send-file.
    Filtering for name now respects showOfflineUsers.
    
    REVIEW: 103409
---
 KTelepathy/Models/accounts-filter-model.cpp | 15 +++++++++++++--
 KTelepathy/Models/accounts-filter-model.h   |  2 ++
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/KTelepathy/Models/accounts-filter-model.cpp b/KTelepathy/Models/accounts-filter-model.cpp
index ca7aa91..859c673 100644
--- a/KTelepathy/Models/accounts-filter-model.cpp
+++ b/KTelepathy/Models/accounts-filter-model.cpp
@@ -34,7 +34,8 @@
 AccountsFilterModel::AccountsFilterModel(QObject *parent)
     : QSortFilterProxyModel(parent),
       m_showOfflineUsers(false),
-      m_filterByName(false)
+      m_filterByName(false),
+      m_filterByFileTransferCapability(false)
 {
 }
 
@@ -49,6 +50,12 @@ bool AccountsFilterModel::showOfflineUsers() const
     return m_showOfflineUsers;
 }
 
+void AccountsFilterModel::setFilterByFileTransferCapability(bool filterByFileTransferCapability)
+{
+    m_filterByFileTransferCapability = filterByFileTransferCapability;
+    invalidateFilter();
+}
+
 bool AccountsFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
 {
     QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
@@ -92,6 +99,11 @@ bool AccountsFilterModel::filterAcceptsContact(const QModelIndex &index) const
         rowAccepted = false;
     }
 
+    //check if contact has file-transfer capability
+    if (m_filterByFileTransferCapability && !index.data(AccountsModel::FileTransferCapabilityRole).toBool()) {
+        rowAccepted = false;
+    }
+
     //filter offline users out
     if (!m_showOfflineUsers &&
             ((index.data(AccountsModel::PresenceTypeRole).toUInt()
@@ -118,7 +130,6 @@ void AccountsFilterModel::setFilterString(const QString &str)
 {
     m_filterString = str;
     m_filterByName = true;
-    m_showOfflineUsers = true;
     invalidateFilter();
 }
 
diff --git a/KTelepathy/Models/accounts-filter-model.h b/KTelepathy/Models/accounts-filter-model.h
index 5a058e2..9c799b1 100644
--- a/KTelepathy/Models/accounts-filter-model.h
+++ b/KTelepathy/Models/accounts-filter-model.h
@@ -56,6 +56,7 @@ public:
 
 public Q_SLOTS:
     void setShowOfflineUsers(bool showOfflineUsers);
+    void setFilterByFileTransferCapability(bool filterByFileTransferCapability);
     void setFilterString(const QString &str);
     /// This overloaded method takes into account showing/hiding offline users
     void clearFilterStringAndHideOfflineUsers(const bool& showOfflineUsers);
@@ -82,6 +83,7 @@ private:
 
     /// Used when searching for contact
     bool m_filterByName;
+    bool m_filterByFileTransferCapability;
 
     /// Holds the string which is searched in the model
     QString m_filterString;

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list