From 9bbac10f3cbbb5b2ae94309149cf91f28cb8707d Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Fri, 19 Feb 2021 12:41:58 +0200 Subject: [PATCH] CollectionSetup: modified pruneSelectedDirs() to accept an argument instead of reading the widget by itself. It is now possible to call CollectionSetup::pruneSelectedDirs(dirs) independently from a CollectionSetup object. Signed-off-by: Mavridis Philippe --- src/directorylist.cpp | 3 +-- src/directorylist.h | 2 +- src/klamscan.cpp | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/directorylist.cpp b/src/directorylist.cpp index a817e2e..c24d552 100644 --- a/src/directorylist.cpp +++ b/src/directorylist.cpp @@ -476,13 +476,12 @@ DeviceItem::mountDevice( const TQString & device) } } -TQStringList CollectionSetup::pruneSelectedDirs(){ +TQStringList CollectionSetup::pruneSelectedDirs( TQStringList listOfUrls ){ // This gets rid of redundant sub-directories // from the list of dirs to be scanned. TQStringList filepattern; - TQStringList listOfUrls = dirs(); listOfUrls.sort(); TQString prev; diff --git a/src/directorylist.h b/src/directorylist.h index 8b15f22..3aaaf0b 100644 --- a/src/directorylist.h +++ b/src/directorylist.h @@ -48,7 +48,7 @@ public: TQStringList m_dirs; TQMap m_refcount; - TQStringList pruneSelectedDirs(); + static TQStringList pruneSelectedDirs( TQStringList listOfUrls = 0 ); void writeConfig( const char* optGroup, const char* optName ); signals: diff --git a/src/klamscan.cpp b/src/klamscan.cpp index 0e0812e..1b04aca 100644 --- a/src/klamscan.cpp +++ b/src/klamscan.cpp @@ -253,7 +253,7 @@ void Klamscan::slotScan() prevdir = listOfUrlsToScan.first(); }else{ - filepattern = setup->pruneSelectedDirs(); + filepattern = setup->pruneSelectedDirs(setup->dirs()); } scan( filepattern ); @@ -302,7 +302,7 @@ void Klamscan::slotAdvOptions(){ void Klamscan::slotSchedule(){ - TQStringList filepattern = setup->pruneSelectedDirs(); + TQStringList filepattern = setup->pruneSelectedDirs(setup->dirs()); if (filepattern.isEmpty()){