]> git.meshlink.io Git - catta/blobdiff - avahi-qt/qt-watch.cpp
s/AVAHI_LOOKUP_CALLBACK/AVAHI_LOOKUP_RESULT/g
[catta] / avahi-qt / qt-watch.cpp
index 407a9055a972c8f072d17202f404e62426a62e20..c0b21402348722b742cbc74563fac4d444a214b0 100644 (file)
@@ -1,3 +1,5 @@
+/* $Id$ */
+
 /***
   This file is part of avahi.
  
@@ -113,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);
 }
 
@@ -122,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
     }
 }
 
@@ -170,7 +179,7 @@ static void q_timeout_free(AvahiTimeout *t)
 
 static AvahiPoll qt_poll;
 
-const AvahiPoll* avahi_qt_poll_get() 
+const AvahiPoll* avahi_qt_poll_get(void
 {
     qt_poll.userdata=0;
     qt_poll.watch_new = q_watch_new;
@@ -184,4 +193,8 @@ const AvahiPoll* avahi_qt_poll_get()
     return &qt_poll;
 }
 
-#include "qt-watch.moc"
+#ifdef QT4
+#include "qt-watch.moc4"
+#else
+#include "qt-watch.moc3"
+#endif