Klamscan, Scheduler: Reset DirectoryList after use

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
pull/25/head
Mavridis Philippe 4 years ago
parent 78b3377194
commit 69817f0eae
No known key found for this signature in database
GPG Key ID: F8D2D7E2F989A494

@ -98,6 +98,7 @@ Item::Item( TQListView *parent, CollectionSetup *collection, const TQString &nam
else else
setPixmap( 0, SmallIcon( "folder" ) ); setPixmap( 0, SmallIcon( "folder" ) );
setVisible( true ); setVisible( true );
connect( collectionSetup, SIGNAL(resetDirs()), this, SLOT(reset()) );
} }
@ -115,6 +116,7 @@ Item::Item( TQListViewItem *parent, CollectionSetup *collection, const KURL &url
connect( &m_lister, SIGNAL(newItems( const KFileItemList& )), SLOT(newItems( const KFileItemList& )) ); connect( &m_lister, SIGNAL(newItems( const KFileItemList& )), SLOT(newItems( const KFileItemList& )) );
connect( &m_lister, SIGNAL(completed()), SLOT(completed()) ); connect( &m_lister, SIGNAL(completed()), SLOT(completed()) );
connect( &m_lister, SIGNAL(canceled()), SLOT(completed()) ); connect( &m_lister, SIGNAL(canceled()), SLOT(completed()) );
connect( collectionSetup, SIGNAL(resetDirs()), this, SLOT(reset()) );
} }
@ -225,6 +227,8 @@ Item::paintCell( TQPainter * p, const TQColorGroup & cg, int column, int width,
setOn(false); setOn(false);
} }
void Item::reset() { this->setOn(false); }
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// CLASS DeviceItem // CLASS DeviceItem
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
@ -237,6 +241,7 @@ DeviceItem::DeviceItem( TQListView *parent, CollectionSetup *collection )
collectionSetup = collection; collectionSetup = collection;
m_lister.setDirOnlyMode( true ); m_lister.setDirOnlyMode( true );
connect( &m_lister, SIGNAL(newItems( const KFileItemList& )), SLOT(newItems( const KFileItemList& )) ); connect( &m_lister, SIGNAL(newItems( const KFileItemList& )), SLOT(newItems( const KFileItemList& )) );
connect( collectionSetup, SIGNAL(resetDirs()), this, SLOT(reset()) );
if ( KDE::versionMajor() == 3 && KDE::versionMinor() < 4 ) if ( KDE::versionMajor() == 3 && KDE::versionMinor() < 4 )
{ {
@ -299,6 +304,7 @@ DeviceItem::DeviceItem( TQListViewItem *parent, CollectionSetup *collection, con
connect( &m_lister, SIGNAL(newItems( const KFileItemList& )), SLOT(newItems( const KFileItemList& )) ); connect( &m_lister, SIGNAL(newItems( const KFileItemList& )), SLOT(newItems( const KFileItemList& )) );
connect( &m_lister, SIGNAL(completed()), SLOT(completed()) ); connect( &m_lister, SIGNAL(completed()), SLOT(completed()) );
connect( &m_lister, SIGNAL(canceled()), SLOT(completed()) ); connect( &m_lister, SIGNAL(canceled()), SLOT(completed()) );
connect( collectionSetup, SIGNAL(resetDirs()), this, SLOT(reset()) );
} }
@ -475,6 +481,8 @@ DeviceItem::mountDevice( const TQString & device)
} }
} }
void DeviceItem::reset() { this->setOn(false); }
TQStringList CollectionSetup::pruneSelectedDirs( TQStringList listOfUrls ){ TQStringList CollectionSetup::pruneSelectedDirs( TQStringList listOfUrls ){
// This gets rid of redundant sub-directories // This gets rid of redundant sub-directories
// from the list of dirs to be scanned. // from the list of dirs to be scanned.
@ -538,4 +546,9 @@ void CollectionSetup::writeConfig( const char* optGroup, const char* optName )
config->sync(); config->sync();
} }
void CollectionSetup::reset()
{
emit resetDirs();
}
#include "directorylist.moc" #include "directorylist.moc"

@ -48,9 +48,11 @@ public:
static TQStringList pruneSelectedDirs( TQStringList listOfUrls = 0 ); static TQStringList pruneSelectedDirs( TQStringList listOfUrls = 0 );
void writeConfig( const char* optGroup, const char* optName ); void writeConfig( const char* optGroup, const char* optName );
void reset();
signals: signals:
void dirsSelected(TQStringList& dirs); void dirsSelected(TQStringList& dirs);
void resetDirs();
public slots: public slots:
@ -85,6 +87,7 @@ public:
public slots: public slots:
void newItems( const KFileItemList& ); void newItems( const KFileItemList& );
void completed() { if( childCount() == 0 ) { setExpandable( false ); repaint(); } } void completed() { if( childCount() == 0 ) { setExpandable( false ); repaint(); } }
void reset();
private: private:
CollectionSetup *collectionSetup; CollectionSetup *collectionSetup;
@ -113,6 +116,7 @@ class DeviceItem : public TQObject, public TQCheckListItem
public slots: public slots:
void newItems( const KFileItemList& ); void newItems( const KFileItemList& );
void completed() { if( childCount() == 0 ) { setExpandable( false ); repaint(); } } void completed() { if( childCount() == 0 ) { setExpandable( false ); repaint(); } }
void reset();
private: private:
void mountDevice(const TQString & device); void mountDevice(const TQString & device);
CollectionSetup *collectionSetup; CollectionSetup *collectionSetup;

@ -415,6 +415,8 @@ void Klamscan::slotStartAgain(){
}else }else
slotScan(); slotScan();
setup->reset();
//slotManageButtons(tabBrowser->currentPage()); //slotManageButtons(tabBrowser->currentPage());
} }

@ -198,6 +198,7 @@ void Schedule::slotScheduleScan()
{ {
// Update directory list // Update directory list
filepattern = setup->dirs(); filepattern = setup->dirs();
setup->reset();
/* cthost = new CTHost();*/ /* cthost = new CTHost();*/
/* const CTHost& cth(*cthost); /* const CTHost& cth(*cthost);

Loading…
Cancel
Save