summaryrefslogtreecommitdiff
path: root/libopie2
authormickeyl <mickeyl>2005-06-02 21:44:41 (UTC)
committer mickeyl <mickeyl>2005-06-02 21:44:41 (UTC)
commitd0f6a0721d7ab67a115d08990143944ee71d54ba (patch) (side-by-side diff)
treeba22ad18027419a6417f3d6439a2faf67917ab74 /libopie2
parentf55a56f54de1d3fa9084160159a379079a317d96 (diff)
downloadopie-d0f6a0721d7ab67a115d08990143944ee71d54ba.zip
opie-d0f6a0721d7ab67a115d08990143944ee71d54ba.tar.gz
opie-d0f6a0721d7ab67a115d08990143944ee71d54ba.tar.bz2
- move addLanguage.sh and mkipks to scripts/ directory
- finish recursive directory locks and mention in ChangeLog beginning with `CVS:' are removed automatically CVS: CVS: Committing in . CVS: CVS: Modified Files: CVS: ChangeLog libopie2/opiecore/linux/ofilenotify.cpp CVS: libopie2/opiecore/linux/ofilenotify.h CVS: examples/opiecore/onotifytest/main.cpp CVS: examples/opiecore/onotifytest/main.h CVS: Added Files: CVS: scripts/addLanguage.sh scripts/mkipks CVS: ----------------------------------------------------------------------
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/linux/ofilenotify.cpp40
-rw-r--r--libopie2/opiecore/linux/ofilenotify.h3
2 files changed, 25 insertions, 18 deletions
diff --git a/libopie2/opiecore/linux/ofilenotify.cpp b/libopie2/opiecore/linux/ofilenotify.cpp
index a7820ee..68c5a96 100644
--- a/libopie2/opiecore/linux/ofilenotify.cpp
+++ b/libopie2/opiecore/linux/ofilenotify.cpp
@@ -236,6 +236,8 @@ bool OFileNotification::activate( const OFileNotificationEvent* e )
{
qDebug( "OFileNotification::activate(): e = ( %s, %d, 0x%08x, %d, %s )", (const char*) _path, e->descriptor(), e->mask(), e->cookie(), (const char*) e->name() );
+ //FIXME: Should we really deliver QueueOverflow and/or Ignore to user level code?
+
// dumb signal
_signal.activate();
@@ -245,23 +247,27 @@ bool OFileNotification::activate( const OFileNotificationEvent* e )
// specialized signals
switch ( e->mask() )
{
- case Access: emit accessed( _path ); break;
- case Modify: emit modified( _path ); break;
- case Attrib: emit attributed( _path); break;
- case CloseWrite: emit closed( _path, true ); break;
- case CloseNoWrite: emit closed( _path, false ); break;
- case Open: emit opened( _path ); break;
- case MovedFrom: emit movedFrom( _path, e->name() ); break;
- case MovedTo: emit movedTo( _path, e->name() ); break;
- case DeleteSubdir: emit deletedSubdir( _path, e->name() ); break;
- case DeleteFile: emit deletedFile( _path, e->name() ); break;
- case CreateSubdir: emit createdSubdir( _path, e->name() ); break;
- case CreateFile: emit createdFile( _path, e->name() ); break;
- case DeleteSelf: emit deleted( _path ); break;
- case Unmount: emit unmounted( _path ); break;
+ case Access: emit accessed( _path ); break;
+ case Modify: emit modified( _path ); break;
+ case Attrib: emit attributed( _path); break;
+ case CloseWrite: emit closed( _path, true ); break;
+ case CloseNoWrite: emit closed( _path, false ); break;
+ case Open: emit opened( _path ); break;
+ case MovedFrom: emit movedFrom( _path, e->name() ); break;
+ case MovedTo: emit movedTo( _path, e->name() ); break;
+ case DeleteSubdir: emit deletedSubdir( _path, e->name() ); break;
+ case DeleteFile: emit deletedFile( _path, e->name() ); break;
+ case CreateSubdir: emit createdSubdir( _path, e->name() ); break;
+ case CreateFile: emit createdFile( _path, e->name() ); break;
+ case DeleteSelf: emit deleted( _path ); break;
+ case Unmount: emit unmounted( _path ); break;
+ case _QueueOverflow: qFatal( "OFileNotification::activate() - Inotify Event Queue Overload!" ); break;
+ case _Ignored: qWarning( "OFileNotification::activate() - Further Events for '%s' will be ignored", (const char*) _path ); break;
default: assert( 0 );
}
+ delete e;
+
if ( !_multi ) stop();
return true;
@@ -317,7 +323,7 @@ bool OFileNotification::registerEventHandler()
return false;
}
- OFileNotification::_sn = new QSocketNotifier( _fd, QSocketNotifier::Read, this, "inotify event" );
+ OFileNotification::_sn = new QSocketNotifier( _fd, QSocketNotifier::Read );
connect( OFileNotification::_sn, SIGNAL( activated(int) ), this, SLOT( inotifyEventHandler() ) );
qDebug( "OFileNotification::registerEventHandler(): done" );
@@ -348,7 +354,7 @@ ODirNotification::~ODirNotification()
qDebug( "ODirNotification::~ODirNotification()" );
}
-/*
+/**
Love-Trowbridge recursive directory scanning algorithm:
Step 1. Start at initial directory foo. Add watch.
@@ -365,7 +371,7 @@ ODirNotification::~ODirNotification()
Step 5. For any CREATE_SUBDIR event on bar, if a watch is
not yet created on bar, repeat step 1 on bar.
-*/
+**/
int ODirNotification::watch( const QString& path, bool sshot, OFileNotificationType type, int recurse )
{
diff --git a/libopie2/opiecore/linux/ofilenotify.h b/libopie2/opiecore/linux/ofilenotify.h
index 17e6b5d..c713b30 100644
--- a/libopie2/opiecore/linux/ofilenotify.h
+++ b/libopie2/opiecore/linux/ofilenotify.h
@@ -257,7 +257,8 @@ class OFileNotification : public QObject
* @brief Represents a directory notification
*
* This class allows to watch for events happening to directories
- * It uses the OFileNotification class
+ * It uses the OFileNotification class and (for recursive watches)
+ * implements the Love-Trowbridge recursive directory scanning algorithm.
*
* @see http://www.kernel.org/pub/linux/kernel/people/rml/inotify/
*