diff options
-rw-r--r-- | avahi-common/Makefile.am | 2 | ||||
-rw-r--r-- | avahi-common/watch.h | 2 | ||||
-rw-r--r-- | avahi-qt/qt-watch.cpp | 7 |
3 files changed, 5 insertions, 6 deletions
diff --git a/avahi-common/Makefile.am b/avahi-common/Makefile.am index a580a9d..133d165 100644 --- a/avahi-common/Makefile.am +++ b/avahi-common/Makefile.am @@ -63,7 +63,7 @@ libavahi_common_la_SOURCES = \ watch.h gccmacro.h libavahi_common_la_CFLAGS = $(AM_CFLAGS) -libavahi_common_la_LDFLAGS = $(AM_LDFLAGS) -export-dynamic -version-info $(LIBAVAHI_COMMON_VERSION_INFO) 1:0:1 +libavahi_common_la_LDFLAGS = $(AM_LDFLAGS) -export-dynamic -version-info $(LIBAVAHI_COMMON_VERSION_INFO) strlst_test_SOURCES = \ strlst.c strlst.h \ diff --git a/avahi-common/watch.h b/avahi-common/watch.h index 7bab4f8..9f82729 100644 --- a/avahi-common/watch.h +++ b/avahi-common/watch.h @@ -36,7 +36,7 @@ AVAHI_C_DECL_BEGIN /** An I/O watch object */ typedef struct AvahiWatch AvahiWatch; -/** An I/O watch object */ +/** A timeout watch object */ typedef struct AvahiTimeout AvahiTimeout; /** An event polling abstraction object */ diff --git a/avahi-qt/qt-watch.cpp b/avahi-qt/qt-watch.cpp index c0b2140..2426798 100644 --- a/avahi-qt/qt-watch.cpp +++ b/avahi-qt/qt-watch.cpp @@ -125,12 +125,11 @@ void AvahiTimeout::update(const struct timeval *tv) { m_timer.stop(); if (tv) { - struct timeval now; - gettimeofday(&now, 0); + AvahiUsec u = avahi_age(tv)/1000; #ifdef QT4 - m_timer.start((tv->tv_sec-now.tv_sec)*1000+(tv->tv_usec-now.tv_usec)/1000); + m_timer.start( (u>0) ? 0 : -u); #else - m_timer.start((tv->tv_sec-now.tv_sec)*1000+(tv->tv_usec-now.tv_usec)/1000,true); + m_timer.start( (u>0) ? 0 : -u,true); #endif } } |