author | mickeyl <mickeyl> | 2005-05-31 14:34:02 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-05-31 14:34:02 (UTC) |
commit | 6d2273fb22e10474ae26dd249fa2836e100ffdaf (patch) (unidiff) | |
tree | 52ff0e10b629dab847077a8b3afcd3f8c0d1b830 /libopie2/opiecore/linux/ofilenotify.cpp | |
parent | 930f91069c505082a33e43ce5fdca019531a4b5e (diff) | |
download | opie-6d2273fb22e10474ae26dd249fa2836e100ffdaf.zip opie-6d2273fb22e10474ae26dd249fa2836e100ffdaf.tar.gz opie-6d2273fb22e10474ae26dd249fa2836e100ffdaf.tar.bz2 |
misc. opcmciasystem improvements
start implementing recursve dirlocks in ODirNotification
Diffstat (limited to 'libopie2/opiecore/linux/ofilenotify.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiecore/linux/ofilenotify.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/libopie2/opiecore/linux/ofilenotify.cpp b/libopie2/opiecore/linux/ofilenotify.cpp index 36ec6bf..3096f7e 100644 --- a/libopie2/opiecore/linux/ofilenotify.cpp +++ b/libopie2/opiecore/linux/ofilenotify.cpp | |||
@@ -349,4 +349,2 @@ int ODirNotification::watch( const QString& path, bool sshot, OFileNotificationT | |||
349 | 349 | ||
350 | if ( recurse == 0 ) | ||
351 | { | ||
352 | OFileNotification* fn = new OFileNotification( this, "ODirNotification delegate" ); | 350 | OFileNotification* fn = new OFileNotification( this, "ODirNotification delegate" ); |
@@ -369,10 +367,23 @@ int ODirNotification::watch( const QString& path, bool sshot, OFileNotificationT | |||
369 | connect( fn, SIGNAL( unmounted( const QString& ) ), this, SIGNAL( unmounted( const QString& ) ) ); | 367 | connect( fn, SIGNAL( unmounted( const QString& ) ), this, SIGNAL( unmounted( const QString& ) ) ); |
370 | } | 368 | |
371 | return result; | 369 | if ( recurse ) |
372 | } | ||
373 | else | ||
374 | { | 370 | { |
371 | QDir directory( path ); | ||
372 | QStringList subdirs = directory.entryList( QDir::Dirs ); | ||
375 | 373 | ||
376 | return 1; | 374 | for ( QStringList::Iterator it = subdirs.begin(); it != subdirs.end(); ++it ) |
375 | { | ||
376 | if ( (*it) == "." || (*it) == ".." ) continue; | ||
377 | QString subpath = QString( "%1/%2" ).arg( path ).arg( *it ); | ||
378 | int subresult = watch( subpath, sshot, type, recurse-1 ); | ||
379 | if ( subresult == -1 ) | ||
380 | { | ||
381 | qDebug( "ODirNotification::watch(): subresult for '%s' was -1. Interrupting", (const char*) (*it) ); | ||
382 | return -1; | ||
383 | } | ||
384 | } | ||
385 | } | ||
386 | //connect( fn, SIGNAL( triggered( const QString&, unsigned int, const QString& ) ), this, SIGNAL( triggered( const QString&, unsigned int, const QString& ) ) ); | ||
377 | } | 387 | } |
388 | else return -1; | ||
378 | } | 389 | } |