diff --git a/avahi-tqt/Makefile.am b/avahi-tqt/Makefile.am index 14b823c..aa30f57 100644 --- a/avahi-tqt/Makefile.am +++ b/avahi-tqt/Makefile.am @@ -15,7 +15,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA. -AM_CFLAGS=-I$(top_srcdir) +AM_CFLAGS=-I$(top_srcdir) -I/usr/include/tqt lib_LTLIBRARIES = BUILT_SOURCES = diff --git a/avahi-tqt/qt-watch.cpp b/avahi-tqt/qt-watch.cpp index dac9dcc..6f8fd39 100644 --- a/avahi-tqt/qt-watch.cpp +++ b/avahi-tqt/qt-watch.cpp @@ -18,21 +18,16 @@ ***/ #include -#ifdef QT4 -#include -#include -#include -#else -#include -#include -#include -#endif +#include +#include +#include #include #include "qt-watch.h" -class AvahiWatch : public QObject +class AvahiWatch : public TQObject { Q_OBJECT + TQ_OBJECT public: AvahiWatch(int fd, AvahiWatchEvent event, AvahiWatchCallback callback, void* userdata); ~AvahiWatch() {} @@ -44,8 +39,8 @@ private slots: void gotOut(); private: - QSocketNotifier* m_in; - QSocketNotifier* m_out; + TQSocketNotifier* m_in; + TQSocketNotifier* m_out; //FIXME: ERR and HUP? AvahiWatchCallback m_callback; AvahiWatchEvent m_lastEvent; @@ -54,9 +49,10 @@ private: bool m_incallback; }; -class AvahiTimeout : public QObject +class AvahiTimeout : public TQObject { Q_OBJECT + TQ_OBJECT public: AvahiTimeout(const struct timeval* tv, AvahiTimeoutCallback callback, void* userdata); @@ -67,7 +63,7 @@ private slots: void timeout(); private: - QTimer m_timer; + TQTimer m_timer; AvahiTimeoutCallback m_callback; void* m_userdata; }; @@ -101,22 +97,19 @@ void AvahiWatch::setWatchedEvents(AvahiWatchEvent event) if (!(event & AVAHI_WATCH_IN)) { delete m_in; m_in=0; } if (!(event & AVAHI_WATCH_OUT)) { delete m_out; m_out=0; } if (event & AVAHI_WATCH_IN) { - m_in = new QSocketNotifier(m_fd,QSocketNotifier::Read, this); - connect(m_in,SIGNAL(activated(int)),SLOT(gotIn())); + m_in = new TQSocketNotifier(m_fd,TQSocketNotifier::Read, this); + connect(m_in,TQT_SIGNAL(activated(int)),TQT_SLOT(gotIn())); } if (event & AVAHI_WATCH_OUT) { - m_out = new QSocketNotifier(m_fd,QSocketNotifier::Write, this); - connect(m_out,SIGNAL(activated(int)),SLOT(gotOut())); + m_out = new TQSocketNotifier(m_fd,TQSocketNotifier::Write, this); + connect(m_out,TQT_SIGNAL(activated(int)),TQT_SLOT(gotOut())); } } AvahiTimeout::AvahiTimeout(const struct timeval* tv, AvahiTimeoutCallback callback, void *userdata) : m_callback(callback), m_userdata(userdata) { - connect(&m_timer, SIGNAL(timeout()), this, SLOT(timeout())); -#ifdef QT4 - m_timer.setSingleShot(true); -#endif + connect(&m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timeout())); update(tv); } @@ -125,11 +118,7 @@ void AvahiTimeout::update(const struct timeval *tv) m_timer.stop(); if (tv) { AvahiUsec u = avahi_age(tv)/1000; -#ifdef QT4 - m_timer.start( (u>0) ? 0 : -u); -#else m_timer.start( (u>0) ? 0 : -u,true); -#endif } } @@ -191,8 +180,4 @@ const AvahiPoll* avahi_qt_poll_get(void) return &qt_poll; } -#ifdef QT4 -#include "qt-watch.moc4" -#else #include "qt-watch.moc3" -#endif diff --git a/avahi-tqt/qt-watch.h b/avahi-tqt/qt-watch.h index cd7130d..01886b3 100644 --- a/avahi-tqt/qt-watch.h +++ b/avahi-tqt/qt-watch.h @@ -1,5 +1,5 @@ -#ifndef QAVAHI_H -#define QAVAHI_H +#ifndef TQAVAHI_H +#define TQAVAHI_H /*** This file is part of avahi. @@ -20,13 +20,13 @@ USA. ***/ -/** \file qt-watch.h Qt main loop adapter */ +/** \file qt-watch.h TQt main loop adapter */ #include AVAHI_C_DECL_BEGIN -/** Setup abstract poll structure for integration with Qt main loop */ +/** Setup abstract poll structure for integration with TQt main loop */ const AvahiPoll* avahi_qt_poll_get(void) #ifdef HAVE_VISIBILITY_HIDDEN __attribute__ ((visibility("default")))