[SCM] ktp-contact-list packaging branch, master, updated. debian/15.12.1-2-1070-g6c56f91

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:06:59 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=b5c4a8e

The following commit has been merged in the master branch:
commit b5c4a8ed46df27ed8e704e6988b2055a854ee925
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Sat Jul 16 18:39:57 2011 +0200

    Fix detecting what the user pressed in the stay-online-or-go-offline dialog and also first check if we have anything online at all.
    
    Reviewed-by: David Edmundson
---
 main-widget.cpp | 20 ++++++++++++++++----
 main-widget.h   |  3 ++-
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/main-widget.cpp b/main-widget.cpp
index a3e7fbd..20995f6 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -1301,7 +1301,7 @@ void MainWidget::closeEvent(QCloseEvent* e)
     //the standard KMessageBox control saves "true" if you select the checkbox, therefore the reversed var name
     bool dontCheckForPlasmoid = notifyConigGroup.readEntry("dont_check_for_plasmoid", false);
 
-    if (!dontCheckForPlasmoid) {
+    if (isAnyAccountOnline() && !dontCheckForPlasmoid) {
         if (!isPresencePlasmoidPresent()) {
             if (KMessageBox::warningYesNo(this,
                     i18n("You do not have any other presence controls active (a Presence widget for example).
"
@@ -1309,13 +1309,13 @@ void MainWidget::closeEvent(QCloseEvent* e)
                     i18n("No Other Presence Controls Found"),
                     KGuiItem(i18n("Stay Online"), KIcon("user-online")),
                     KGuiItem(i18n("Go Offline"), KIcon("user-offline")),
-                    QString("dont_check_for_plasmoid")) == KDialog::No) {
+                    QString("dont_check_for_plasmoid")) == KMessageBox::No) {
 
                 generalConfigGroup.writeEntry("go_offline_when_closing", true);
                 goOffline();
             }
         }
-    } else {
+    } else if (isAnyAccountOnline() && dontCheckForPlasmoid) {
         bool shouldGoOffline = generalConfigGroup.readEntry("go_offline_when_closing", false);
         if (shouldGoOffline) {
             goOffline();
@@ -1327,7 +1327,7 @@ void MainWidget::closeEvent(QCloseEvent* e)
     KMainWindow::closeEvent(e);
 }
 
-bool MainWidget::isPresencePlasmoidPresent()
+bool MainWidget::isPresencePlasmoidPresent() const
 {
     QDBusInterface plasmoidOnDbus("org.kde.Telepathy.PresenceEngineActive", "/PresenceEngineActive");
 
@@ -1340,6 +1340,7 @@ bool MainWidget::isPresencePlasmoidPresent()
 
 void MainWidget::goOffline()
 {
+    kDebug() << "Setting all accounts offline...";
     foreach (const Tp::AccountPtr &account, m_accountManager->allAccounts()) {
         if (account->isEnabled() && account->isValid()) {
             account->setRequestedPresence(Tp::Presence::offline());
@@ -1347,4 +1348,15 @@ void MainWidget::goOffline()
     }
 }
 
+bool MainWidget::isAnyAccountOnline() const
+{
+    foreach (const Tp::AccountPtr &account, m_accountManager->allAccounts()) {
+        if (account->isEnabled() && account->isValid() && account->isOnline()) {
+            return true;
+        }
+    }
+
+    return false;
+}
+
 #include "main-widget.moc"
diff --git a/main-widget.h b/main-widget.h
index 87d0811..6fd3e8b 100644
--- a/main-widget.h
+++ b/main-widget.h
@@ -51,7 +51,8 @@ public:
     MainWidget(QWidget *parent = 0);
     ~MainWidget();
 
-    bool isPresencePlasmoidPresent();
+    bool isPresencePlasmoidPresent() const;
+    bool isAnyAccountOnline() const;
 
     enum SystemMessageType {
         /*

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list