|
|
|
@ -253,7 +253,7 @@ void Klamscan::slotScan()
|
|
|
|
|
prevdir = listOfUrlsToScan.first();
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
filepattern = pruneSelectedDirs();
|
|
|
|
|
filepattern = setup->pruneSelectedDirs();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
scan( filepattern );
|
|
|
|
@ -302,7 +302,7 @@ void Klamscan::slotAdvOptions(){
|
|
|
|
|
|
|
|
|
|
void Klamscan::slotSchedule(){
|
|
|
|
|
|
|
|
|
|
TQStringList filepattern = pruneSelectedDirs();
|
|
|
|
|
TQStringList filepattern = setup->pruneSelectedDirs();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (filepattern.isEmpty()){
|
|
|
|
@ -470,61 +470,4 @@ void Klamscan::slotManageButtons(TQWidget * current){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQStringList Klamscan::pruneSelectedDirs(){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//This gets rid of redundant sub-directories from the list of dirs to be scanned.
|
|
|
|
|
|
|
|
|
|
TQStringList filepattern;
|
|
|
|
|
TQStringList listOfUrlsToScan = setup->dirs();
|
|
|
|
|
listOfUrlsToScan.sort();
|
|
|
|
|
TQString prev;
|
|
|
|
|
TQStringList prevdirs;
|
|
|
|
|
struct stat sb;
|
|
|
|
|
for (TQStringList::Iterator it = listOfUrlsToScan.begin(); it != listOfUrlsToScan.end(); it++ ){
|
|
|
|
|
//kdDebug() << "dir: " << (*it) << endl;
|
|
|
|
|
(*it) = (*it).stripWhiteSpace();
|
|
|
|
|
|
|
|
|
|
// replace block devices with mountpoints
|
|
|
|
|
lstat( (*it).ascii(), &sb );
|
|
|
|
|
if ( (sb.st_mode & S_IFMT) == S_IFBLK ) {
|
|
|
|
|
// This is actually from directorylist.cpp
|
|
|
|
|
DCOPRef mediamanager("kded", "mediamanager");
|
|
|
|
|
DCOPReply reply = mediamanager.call( "properties", (*it) );
|
|
|
|
|
|
|
|
|
|
TQStringList properties;
|
|
|
|
|
reply.get( properties, "TQStringList" );
|
|
|
|
|
|
|
|
|
|
(*it) = * (properties.at(7) );
|
|
|
|
|
} else {
|
|
|
|
|
(*it) = (*it) + "/";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (prevdirs.isEmpty()){
|
|
|
|
|
//kdDebug() << (*it) << endl;
|
|
|
|
|
filepattern.append(*it);
|
|
|
|
|
prevdirs.append((*it));
|
|
|
|
|
}else{
|
|
|
|
|
filepattern.append(*it);
|
|
|
|
|
bool shouldappend = true;
|
|
|
|
|
for (TQStringList::Iterator it2 = prevdirs.begin(); it2 != prevdirs.end(); it2++ ){
|
|
|
|
|
if ((*it).contains(*it2)){
|
|
|
|
|
//kdDebug() << (*it) << endl;
|
|
|
|
|
filepattern.remove((*it));
|
|
|
|
|
shouldappend = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (shouldappend)
|
|
|
|
|
prevdirs.append((*it));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return filepattern;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "klamscan.moc"
|
|
|
|
|