[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:33 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=928becd
The following commit has been merged in the master branch:
commit 928becd9854f84b62d4340907ab77383a9f4b5f6
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date: Tue Sep 13 16:40:05 2011 +0200
Show offline users while searching in contact list. Also fixes some code style issues.
Reviewed-by: David Edmundson
FEATURE: 279006
---
models/accounts-filter-model.cpp | 12 +++++++++---
models/accounts-filter-model.h | 4 +++-
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/models/accounts-filter-model.cpp b/models/accounts-filter-model.cpp
index 8c31686..a830d06 100644
--- a/models/accounts-filter-model.cpp
+++ b/models/accounts-filter-model.cpp
@@ -27,7 +27,6 @@
#include "contact-model-item.h"
#include "accounts-model-item.h"
-
#include <KDebug>
AccountsFilterModel::AccountsFilterModel(QObject *parent)
@@ -47,7 +46,7 @@ AccountsFilterModel::AccountsFilterModel(QObject *parent)
m_presenceSorting[Tp::ConnectionPresenceTypeOffline] = 6;
}
-void AccountsFilterModel::showOfflineUsers(bool showOfflineUsers)
+void AccountsFilterModel::setShowOfflineUsers(bool showOfflineUsers)
{
m_showOfflineUsers = showOfflineUsers;
invalidateFilter();
@@ -127,9 +126,16 @@ void AccountsFilterModel::setFilterString(const QString &str)
{
m_filterString = str;
m_filterByName = true;
+ m_showOfflineUsers = true;
invalidateFilter();
}
+void AccountsFilterModel::clearFilterStringAndHideOfflineUsers(const bool &showOfflineUsers)
+{
+ m_showOfflineUsers = showOfflineUsers;
+ clearFilterString();
+}
+
void AccountsFilterModel::clearFilterString()
{
m_filterString.clear();
@@ -137,7 +143,7 @@ void AccountsFilterModel::clearFilterString()
invalidateFilter();
}
-bool AccountsFilterModel::lessThan( const QModelIndex &left, const QModelIndex &right ) const
+bool AccountsFilterModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
{
uint leftPresence;
uint rightPresence;
diff --git a/models/accounts-filter-model.h b/models/accounts-filter-model.h
index ffe936d..1796f51 100644
--- a/models/accounts-filter-model.h
+++ b/models/accounts-filter-model.h
@@ -53,8 +53,10 @@ public:
bool isSortedByPresence() const;
public slots:
- void showOfflineUsers(bool showOfflineUsers);
+ void setShowOfflineUsers(bool showOfflineUsers);
void setFilterString(const QString &str);
+ /// This overloaded method takes into account showing/hiding offline users
+ void clearFilterStringAndHideOfflineUsers(const bool& showOfflineUsers);
void clearFilterString();
/**
* rief Lets the proxy know whether the model should get sorted by presence or not.
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list