summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Stachowski <qbast@go2.pl>2005-09-01 18:44:57 +0000
committerJakub Stachowski <qbast@go2.pl>2005-09-01 18:44:57 +0000
commit4348780c482f8528a40d4b9bf1ebf8a911a7b416 (patch)
treebacf1812278c2688284ac31dcc36eb7d31c81698
parent3db046c760dbf5c260a4f9d21c8959279ff4cfbf (diff)
Timeout should be called only once and then disable itself
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@513 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
-rw-r--r--avahi-qt/qt-watch.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/avahi-qt/qt-watch.cpp b/avahi-qt/qt-watch.cpp
index 3b8ebce..c0b2140 100644
--- a/avahi-qt/qt-watch.cpp
+++ b/avahi-qt/qt-watch.cpp
@@ -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
}
}