summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/linux/ofilenotify.cpp
Unidiff
Diffstat (limited to 'libopie2/opiecore/linux/ofilenotify.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/linux/ofilenotify.cpp25
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}