[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:40 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=a6dfef8
The following commit has been merged in the master branch:
commit a6dfef8bb64e604647140be186887cfe55ac1cbd
Author: Dario Freddi <dario.freddi at collabora.com>
Date: Thu Nov 17 22:46:28 2011 +0100
Remove duplicate of presence sorting
REVIEW: 103177
---
global-presence.cpp | 17 ++++-------------
global-presence.h | 3 ---
kpresence.cpp | 2 +-
kpresence.h | 2 +-
4 files changed, 6 insertions(+), 18 deletions(-)
diff --git a/global-presence.cpp b/global-presence.cpp
index 3bbd5c9..61f1457 100644
--- a/global-presence.cpp
+++ b/global-presence.cpp
@@ -20,6 +20,8 @@
#include "global-presence.h"
+#include "kpresence.h"
+
#include <TelepathyQt4/AccountSet>
#include <TelepathyQt4/Account>
@@ -31,17 +33,6 @@ GlobalPresence::GlobalPresence(QObject *parent)
m_currentPresence(Tp::Presence::offline()),
m_changingPresence(false)
{
- m_presenceSorting[Tp::ConnectionPresenceTypeAvailable] = 0;
- m_presenceSorting[Tp::ConnectionPresenceTypeBusy] = 1;
- m_presenceSorting[Tp::ConnectionPresenceTypeHidden] = 2;
- m_presenceSorting[Tp::ConnectionPresenceTypeAway] = 3;
- m_presenceSorting[Tp::ConnectionPresenceTypeExtendedAway] = 4;
- //don't distinguish between the following three presences
- m_presenceSorting[Tp::ConnectionPresenceTypeError] = 5;
- m_presenceSorting[Tp::ConnectionPresenceTypeUnknown] = 5;
- m_presenceSorting[Tp::ConnectionPresenceTypeUnset] = 5;
- m_presenceSorting[Tp::ConnectionPresenceTypeOffline] = 6;
-
}
void GlobalPresence::setAccountManager(const Tp::AccountManagerPtr &accountManager)
@@ -100,7 +91,7 @@ void GlobalPresence::onCurrentPresenceChanged()
{
Tp::Presence highestCurrentPresence = Tp::Presence::offline();
Q_FOREACH(const Tp::AccountPtr &account, m_enabledAccounts->accounts()) {
- if (m_presenceSorting[account->currentPresence().type()] < m_presenceSorting[highestCurrentPresence.type()]) {
+ if (KPresence::sortPriority(account->currentPresence().type()) < KPresence::sortPriority(highestCurrentPresence.type())) {
highestCurrentPresence = account->currentPresence();
}
}
@@ -120,7 +111,7 @@ void GlobalPresence::onRequestedPresenceChanged()
{
Tp::Presence highestRequestedPresence = Tp::Presence::offline();
Q_FOREACH(const Tp::AccountPtr &account, m_enabledAccounts->accounts()) {
- if (m_presenceSorting[account->requestedPresence().type()] < m_presenceSorting[highestRequestedPresence.type()]) {
+ if (KPresence::sortPriority(account->requestedPresence().type()) < KPresence::sortPriority(highestRequestedPresence.type())) {
highestRequestedPresence = account->requestedPresence();
}
}
diff --git a/global-presence.h b/global-presence.h
index 90c3c65..d782c3e 100644
--- a/global-presence.h
+++ b/global-presence.h
@@ -89,9 +89,6 @@ private:
/** A cache of the last sent presence*/
Tp::Presence m_currentPresence;
bool m_changingPresence;
-
- /// Sets the sorting order of presences
- QHash<uint, int> m_presenceSorting;
};
#endif // GLOBALPRESENCE_H
diff --git a/kpresence.cpp b/kpresence.cpp
index 1a0f3af..032baa2 100644
--- a/kpresence.cpp
+++ b/kpresence.cpp
@@ -82,7 +82,7 @@ QString KPresence::displayString() const
}
}
-int KPresence::sortPriority(const Tp::ConnectionPresenceType &type) const
+int KPresence::sortPriority(const Tp::ConnectionPresenceType &type)
{
switch(type) {
case Tp::ConnectionPresenceTypeAvailable:
diff --git a/kpresence.h b/kpresence.h
index fb5e6da..81e702f 100644
--- a/kpresence.h
+++ b/kpresence.h
@@ -38,7 +38,7 @@ public:
QString displayString() const;
/** Returns an int representation of the presence type sorted by priority. 0 - most online, 7 - offline */
- int sortPriority(const Tp::ConnectionPresenceType &type) const;
+ static int sortPriority(const Tp::ConnectionPresenceType &type);
};
#endif // KPRESENCE_H
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list