diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-10-09 06:30:06 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-10-09 06:30:06 +0000 |
commit | 0cddf92b0d7f4c2ba2e11154459e16ca1e163104 (patch) | |
tree | 95a13383ece94b0f38531ee135cdd35a4fa6b2ed | |
parent | 1e8b0cadbd7db83f068ea3f95d213bfab1c92da5 (diff) | |
download | avahi-tqt-0cddf92b0d7f4c2ba2e11154459e16ca1e163104.tar.gz avahi-tqt-0cddf92b0d7f4c2ba2e11154459e16ca1e163104.zip |
TQt port avahi-tqtv3.5.13
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/dependencies/avahi-tqt@1258013 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r-- | avahi-tqt/Makefile.am | 2 | ||||
-rw-r--r-- | avahi-tqt/qt-watch.cpp | 45 | ||||
-rw-r--r-- | avahi-tqt/qt-watch.h | 8 |
3 files changed, 20 insertions, 35 deletions
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 <sys/time.h> -#ifdef QT4 -#include <Qt/qsocketnotifier.h> -#include <Qt/qobject.h> -#include <Qt/qtimer.h> -#else -#include <qsocketnotifier.h> -#include <qobject.h> -#include <qtimer.h> -#endif +#include <tqsocketnotifier.h> +#include <tqobject.h> +#include <tqtimer.h> #include <avahi-common/timeval.h> #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-common/watch.h> 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"))) |