diff options
author | Jakub Stachowski <qbast@go2.pl> | 2005-09-30 21:53:04 +0000 |
---|---|---|
committer | Jakub Stachowski <qbast@go2.pl> | 2005-09-30 21:53:04 +0000 |
commit | ee4ab29edd9a7257962444d001283d4ae69c5fbb (patch) | |
tree | b8ff2e4795a30b375ec4ae8173e99be9896cf110 /avahi-qt | |
parent | 6db4ef959b20614f8c71d2d2e9dd652610cf7a9a (diff) | |
download | avahi-ee4ab29edd9a7257962444d001283d4ae69c5fbb.tar.gz |
Adapt to undocumented hack (passing 0:0 in tv to mean "now") that probably got introduced in dbus update.
This fix is critical for service browsing in all qt apps.
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@667 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-qt')
-rw-r--r-- | avahi-qt/qt-watch.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/avahi-qt/qt-watch.cpp b/avahi-qt/qt-watch.cpp index c0b2140..627d3d9 100644 --- a/avahi-qt/qt-watch.cpp +++ b/avahi-qt/qt-watch.cpp @@ -124,15 +124,17 @@ AvahiTimeout::AvahiTimeout(const struct timeval* tv, AvahiTimeoutCallback callba void AvahiTimeout::update(const struct timeval *tv) { m_timer.stop(); - if (tv) { - struct timeval now; - gettimeofday(&now, 0); + if (tv) + if (tv->tv_sec==0 && tv->tv_usec==0) timeout(); // absolute timeval they say ... + else { + 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); + 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); + m_timer.start((tv->tv_sec-now.tv_sec)*1000+(tv->tv_usec-now.tv_usec)/1000,true); #endif - } + } } void AvahiTimeout::timeout() |