X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-qt%2Fqt-watch.cpp;h=c0b21402348722b742cbc74563fac4d444a214b0;hb=fbd822ec8fa4575a61e81e2ecf2c4e6f8266a0ff;hp=c5052fd411f875d720383701bf2e3ff4d8d09a95;hpb=4ddfb3cc4ac10efff11fc58693ae2aacf592fb73;p=catta diff --git a/avahi-qt/qt-watch.cpp b/avahi-qt/qt-watch.cpp index c5052fd..c0b2140 100644 --- a/avahi-qt/qt-watch.cpp +++ b/avahi-qt/qt-watch.cpp @@ -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 } }