diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2021-01-14 20:40:57 +0200 |
---|---|---|
committer | Mavridis Philippe <mavridisf@gmail.com> | 2021-01-14 20:40:57 +0200 |
commit | f84093be98c2b95e8cad2d56aa8635887dad8faf (patch) | |
tree | ccf19a0c2dffe6526f0f66e7aa1f9686f14020c4 /src/klamscan.cpp | |
parent | 0635dcaa5cdb0e2966135b4d6611ae19f0fab749 (diff) | |
download | klamav-f84093be98c2b95e8cad2d56aa8635887dad8faf.tar.gz klamav-f84093be98c2b95e8cad2d56aa8635887dad8faf.zip |
Implemented slotScanDir(), slotScanFile()
The scan initialisation function in klamscan.* had to be modified a bit.
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
Diffstat (limited to 'src/klamscan.cpp')
-rw-r--r-- | src/klamscan.cpp | 49 |
1 files changed, 36 insertions, 13 deletions
diff --git a/src/klamscan.cpp b/src/klamscan.cpp index e0d9419..bb60d0a 100644 --- a/src/klamscan.cpp +++ b/src/klamscan.cpp @@ -17,6 +17,7 @@ #include <kstatusbar.h> #include <kdebug.h> #include <ksystemtray.h> +#include <tdefiledialog.h> #include <tqpushbutton.h> @@ -196,13 +197,7 @@ Klamscan::~Klamscan() } - - - -void Klamscan::slotScan() -{ - - +void Klamscan::scan( TQStringList filepattern ) { ScanViewer* homepage = new ScanViewer(this, "page"); connect( homepage, SIGNAL( scanFinished(TQWidget *) ), this, @@ -222,8 +217,15 @@ void Klamscan::slotScan() tabBrowser->addTab(homepage,suffix); tabBrowser->setCurrentPage(tabBrowser->count() - 1); - //return; - + + CollectionDB::instance()->insertEvent("Manual Scan",TQString("Commencing Scan"),filepattern.join(" ")); + + homepage->slotScan(filepattern, check_combo->currentItem(),setup->recursive(),false); +} + + +void Klamscan::slotScan() +{ TQStringList filepattern; TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); @@ -240,13 +242,34 @@ void Klamscan::slotScan() }else{ filepattern = pruneSelectedDirs(); } - //kdDebug() << filepattern << endl; - CollectionDB::instance()->insertEvent("Manual Scan",TQString("Commencing Scan"),filepattern.join(" ")); - - homepage->slotScan(filepattern, check_combo->currentItem(),setup->recursive(),false); + scan( filepattern ); +} + + +void Klamscan::slotScanFile() { + KURL::List urls( KFileDialog::getOpenURLs(TQString::null,TQString::null,this) ); + TQStringList filepattern; + + KURL::List::iterator it; + for( it = urls.begin(); it != urls.end(); ++it ) { + filepattern.append( (*it).pathOrURL() ); + } + + if( filepattern.count() == 0 ) + return; + + scan( filepattern ); } +void Klamscan::slotScanDir() { + TQString dir=KFileDialog::getExistingDirectory(TQString::null,this); + + if( dir == TQString::null ) + return; + + scan( TQStringList(dir) ); +} void Klamscan::slotAdvOptions(){ |