[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:36 UTC 2016


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

The following commit has been merged in the master branch:
commit b9722c0fcdfa2bcf617703ac50252362f286172f
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Mon Oct 24 17:04:44 2011 +0200

    Merge in global-presence from kded
---
 global-presence.cpp | 24 ++++++++++++++++++++++++
 global-presence.h   | 23 ++++++++++++++++++-----
 2 files changed, 42 insertions(+), 5 deletions(-)

diff --git a/global-presence.cpp b/global-presence.cpp
index ba772b8..2d66dbf 100644
--- a/global-presence.cpp
+++ b/global-presence.cpp
@@ -145,4 +145,28 @@ void GlobalPresence::onChangingPresence()
     }
 }
 
+bool GlobalPresence::hasEnabledAccounts() const
+{
+    if (m_enabledAccounts->accounts().isEmpty()) {
+        return false;
+    }
+
+    return true;
+}
+
+void GlobalPresence::saveCurrentPresence()
+{
+    m_savedPresence = m_currentPresence;
+}
+
+void GlobalPresence::restoreSavedPresence()
+{
+    setPresence(m_savedPresence);
+}
+
+Tp::AccountSetPtr GlobalPresence::onlineAccounts() const
+{
+    return m_onlineAccounts;
+}
+
 #include "global-presence.moc"
diff --git a/global-presence.h b/global-presence.h
index 3ffe8b7..90c3c65 100644
--- a/global-presence.h
+++ b/global-presence.h
@@ -34,7 +34,6 @@ class GlobalPresence : public QObject
 {
     Q_OBJECT
 public:
-
     explicit GlobalPresence(QObject *parent = 0);
 
     /** Set the account manager to use
@@ -53,15 +52,26 @@ public:
     /** Returns true if any account is changing state (i.e connecting*/
     bool isChangingPresence() const;
 
-    /** Set all enabled accounts to the specified presence*/
-    void setPresence(const Tp::Presence &presence);
+    /** Returns true if there is any enabled account */
+    bool hasEnabledAccounts() const;
+
+    Tp::AccountSetPtr onlineAccounts() const;
 
-signals:
+Q_SIGNALS:
     void requestedPresenceChanged(const Tp::Presence &customPresence);
     void currentPresenceChanged(const Tp::Presence &presence);
     void changingPresence(bool isChanging);
 
-private slots:
+public Q_SLOTS:
+    /** Set all enabled accounts to the specified presence*/
+    void setPresence(const Tp::Presence &presence);
+
+    /**Saves the current presence to memory*/
+    void saveCurrentPresence();
+    /**Restores the saved presence from memory */
+    void restoreSavedPresence();
+
+private Q_SLOTS:
     void onCurrentPresenceChanged();
     void onRequestedPresenceChanged();
     void onChangingPresence();
@@ -70,7 +80,10 @@ private slots:
 
 private:
     Tp::AccountSetPtr m_enabledAccounts;
+    Tp::AccountSetPtr m_onlineAccounts;
 
+    /**Saved presence for later restoration (for example after returning from auto-away) */
+    Tp::Presence m_savedPresence;
     /** A cache of the last sent requested presence, to avoid resignalling*/
     Tp::Presence m_requestedPresence;
     /** A cache of the last sent presence*/

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list