[SCM] ktp-filetransfer-handler packaging branch, master, updated. debian/15.12.1-2-226-g825cd93

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:11:38 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-filetransfer-handler.git;a=commitdiff;h=c81de1d

The following commit has been merged in the master branch:
commit c81de1d4697ed291771175bd13fcfcb3fecbc1ff
Author: Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
Date:   Wed Sep 28 19:34:53 2011 +0100

    Handle initialTimeout and timeout only if >= 0
---
 src/telepathy-handler-application.cpp | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/src/telepathy-handler-application.cpp b/src/telepathy-handler-application.cpp
index 921cb17..27a2859 100644
--- a/src/telepathy-handler-application.cpp
+++ b/src/telepathy-handler-application.cpp
@@ -48,6 +48,7 @@ public:
     static bool s_persist;
     static bool s_debug;
 
+    int initialTimeout;
     int timeout;
     QTimer *timer;
     bool firstJobStarted;
@@ -99,7 +100,14 @@ KComponentData TelepathyHandlerApplication::Private::initHack()
 
 void TelepathyHandlerApplication::Private::init(int initialTimeout, int timeout)
 {
-    q->setQuitOnLastWindowClosed(false);
+    this->initialTimeout = timeout;
+    this->timeout = timeout;
+
+    // If timeout < 0 we let the application exit when the last window is closed,
+    // Otherwise we handle it with the timeout
+    if (timeout >= 0) {
+        q->setQuitOnLastWindowClosed(false);
+    }
 
     Tp::registerTypes();
     //Enable telepathy-Qt4 debug
@@ -111,10 +119,11 @@ void TelepathyHandlerApplication::Private::init(int initialTimeout, int timeout)
     }
 
     if (!Private::s_persist) {
-        this->timeout = timeout;
         timer = new QTimer(q);
-        q->connect(timer, SIGNAL(timeout()), q, SLOT(_k_onInitialTimeout()));
-        timer->start(initialTimeout);
+        if (initialTimeout >= 0) {
+            q->connect(timer, SIGNAL(timeout()), q, SLOT(_k_onInitialTimeout()));
+            timer->start(initialTimeout);
+        }
     }
 }
 
@@ -158,8 +167,12 @@ int TelepathyHandlerApplication::newJob()
             d->timer->stop();
         }
         if (!d->firstJobStarted) {
-            disconnect(d->timer, SIGNAL(timeout()), app, SLOT(_k_onInitialTimeout()));
-            connect(d->timer, SIGNAL(timeout()), app, SLOT(_k_onTimeout()));
+            if (d->initialTimeout) {
+                disconnect(d->timer, SIGNAL(timeout()), app, SLOT(_k_onInitialTimeout()));
+            }
+            if (d->timeout >= 0) {
+                connect(d->timer, SIGNAL(timeout()), app, SLOT(_k_onTimeout()));
+            }
             d->firstJobStarted = true;
         }
     }
@@ -173,7 +186,7 @@ void TelepathyHandlerApplication::jobFinished()
 
     if (d->jobCount.fetchAndAddOrdered(-1) <= 1) {
         kDebug() << "No other jobs at the moment. Starting timer.";
-        if (!Private::s_persist) {
+        if (!Private::s_persist && d->timeout >= 0) {
             d->timer->start(d->timeout);
         }
     }

-- 
ktp-filetransfer-handler packaging



More information about the pkg-kde-commits mailing list