]> git.meshlink.io Git - catta/commitdiff
Timeout should be called only once and then disable itself
authorJakub Stachowski <qbast@go2.pl>
Thu, 1 Sep 2005 18:44:57 +0000 (18:44 +0000)
committerJakub Stachowski <qbast@go2.pl>
Thu, 1 Sep 2005 18:44:57 +0000 (18:44 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@513 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-qt/qt-watch.cpp

index 3b8ebceb1506b7949e13813f56192e54eb3467eb..c0b21402348722b742cbc74563fac4d444a214b0 100644 (file)
@@ -115,6 +115,9 @@ AvahiTimeout::AvahiTimeout(const struct timeval* tv, AvahiTimeoutCallback callba
     m_callback(callback), m_userdata(userdata)
 {
     connect(&m_timer, SIGNAL(timeout()), this, SLOT(timeout()));
+#ifdef QT4
+    m_timer.setSingleShot(true);
+#endif
     update(tv);
 }
 
@@ -124,7 +127,11 @@ void AvahiTimeout::update(const struct timeval *tv)
     if (tv) {
         struct timeval now;
         gettimeofday(&now, 0);
+#ifdef QT4
         m_timer.start((tv->tv_sec-now.tv_sec)*1000+(tv->tv_usec-now.tv_usec)/1000);
+#else
+        m_timer.start((tv->tv_sec-now.tv_sec)*1000+(tv->tv_usec-now.tv_usec)/1000,true);
+#endif
     }
 }