diff options
Diffstat (limited to 'tdecore/ksimpledirwatch.cpp')
| -rw-r--r-- | tdecore/ksimpledirwatch.cpp | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/tdecore/ksimpledirwatch.cpp b/tdecore/ksimpledirwatch.cpp index a001b5c06..7d9cfa70c 100644 --- a/tdecore/ksimpledirwatch.cpp +++ b/tdecore/ksimpledirwatch.cpp @@ -1,4 +1,3 @@ -// -*- c-basic-offset: 2 -*- /* This file is part of the KDE libraries Copyright (C) 1998 Sven Radej <sven@lisa.exp.univie.ac.at> @@ -53,11 +52,17 @@ // debug #include <sys/ioctl.h> +#ifdef Q_OS_SOLARIS +#include <sys/filio.h> /* FIONREAD is defined here */ +#endif /* solaris */ + #ifdef HAVE_INOTIFY #include <unistd.h> #include <fcntl.h> #include <sys/syscall.h> +#ifdef Q_OS_LINUX #include <linux/types.h> +#endif /* Linux */ // Linux kernel headers are documented to not compile #define _S390_BITOPS_H #include <sys/inotify.h> @@ -208,7 +213,7 @@ KSimpleDirWatchPrivate::KSimpleDirWatchPrivate() : rescan_timer(0, "KSimpleDirWatchPrivate::rescan_timer") { timer = new TQTimer(this, "KSimpleDirWatchPrivate::timer"); - connect (timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotRescan())); + connect (timer, TQ_SIGNAL(timeout()), this, TQ_SLOT(slotRescan())); freq = 3600000; // 1 hour as upper bound statEntries = 0; delayRemove = false; @@ -222,7 +227,7 @@ KSimpleDirWatchPrivate::KSimpleDirWatchPrivate() // used for FAM and DNOTIFY rescan_all = false; - connect(&rescan_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotRescan())); + connect(&rescan_timer, TQ_SIGNAL(timeout()), this, TQ_SLOT(slotRescan())); #ifdef HAVE_FAM // It's possible that FAM server can't be started @@ -231,8 +236,8 @@ KSimpleDirWatchPrivate::KSimpleDirWatchPrivate() use_fam=true; sn = new TQSocketNotifier( FAMCONNECTION_GETFD(&fc), TQSocketNotifier::Read, this); - connect( sn, TQT_SIGNAL(activated(int)), - this, TQT_SLOT(famEventReceived()) ); + connect( sn, TQ_SIGNAL(activated(int)), + this, TQ_SLOT(famEventReceived()) ); } else { kdDebug(7001) << "Can't use FAM (fam daemon not running?)" << endl; @@ -268,7 +273,7 @@ KSimpleDirWatchPrivate::KSimpleDirWatchPrivate() fcntl(m_inotify_fd, F_SETFD, FD_CLOEXEC); mSn = new TQSocketNotifier( m_inotify_fd, TQSocketNotifier::Read, this ); - connect( mSn, TQT_SIGNAL(activated( int )), this, TQT_SLOT( slotActivated() ) ); + connect( mSn, TQ_SIGNAL(activated( int )), this, TQ_SLOT( slotActivated() ) ); } #endif @@ -302,7 +307,7 @@ KSimpleDirWatchPrivate::KSimpleDirWatchPrivate() fcntl(mPipe[0], F_SETFL, O_NONBLOCK | fcntl(mPipe[0], F_GETFL)); fcntl(mPipe[1], F_SETFL, O_NONBLOCK | fcntl(mPipe[1], F_GETFL)); mSn = new TQSocketNotifier( mPipe[0], TQSocketNotifier::Read, this); - connect(mSn, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotActivated())); + connect(mSn, TQ_SIGNAL(activated(int)), this, TQ_SLOT(slotActivated())); // Install the signal handler only once if ( dnotify_signal == 0 ) { @@ -1213,7 +1218,7 @@ void KSimpleDirWatchPrivate::emitEvent(Entry* e, int event, const TQString &file else #ifdef Q_OS_UNIX path += "/" + fileName; -#elif defined(Q_WS_WIN) +#elif defined(TQ_WS_WIN) //current drive is passed instead of / path += TQDir::currentDirPath().left(2) + "/" + fileName; #endif @@ -1367,7 +1372,7 @@ void KSimpleDirWatchPrivate::slotRescan() if ( timerRunning ) timer->start(freq); - TQTimer::singleShot(0, this, TQT_SLOT(slotRemoveDelayed())); + TQTimer::singleShot(0, this, TQ_SLOT(slotRemoveDelayed())); } bool KSimpleDirWatchPrivate::isNoisyFile( const char * filename ) @@ -1416,7 +1421,7 @@ void KSimpleDirWatchPrivate::famEventReceived() checkFAMEvent(&fe); } - TQTimer::singleShot(0, this, TQT_SLOT(slotRemoveDelayed())); + TQTimer::singleShot(0, this, TQ_SLOT(slotRemoveDelayed())); } void KSimpleDirWatchPrivate::checkFAMEvent(FAMEvent* fe) @@ -1502,10 +1507,14 @@ void KSimpleDirWatchPrivate::checkFAMEvent(FAMEvent* fe) removeEntry(0,e->path,sub_entry); // <e> can be invalid here!! sub_entry->m_status = Normal; if (!useFAM(sub_entry)) + { #ifdef HAVE_INOTIFY if (!useINotify(sub_entry )) #endif + { useStat(sub_entry); + } + } } break; } @@ -1749,7 +1758,3 @@ KSimpleDirWatch::Method KSimpleDirWatch::internalMethod() #include "ksimpledirwatch.moc" #include "ksimpledirwatch_p.moc" - -//sven - -// vim: sw=2 ts=8 et |
