summaryrefslogtreecommitdiffstats
path: root/src/klamscan.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/klamscan.cpp')
-rw-r--r--src/klamscan.cpp49
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(){