diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2021-01-13 19:30:17 +0200 |
---|---|---|
committer | Mavridis Philippe <mavridisf@gmail.com> | 2021-01-13 19:30:17 +0200 |
commit | 357ddeb8afd82d69ef871c146f4fc8f2c67fb17e (patch) | |
tree | dc3ef0e6fedd64f5fb177c114f72e1515a07cd1b /src/scanviewer.cpp | |
parent | c6cbd71bc169ac0e927e52325dbbbcb506abbc73 (diff) | |
download | klamav-357ddeb8afd82d69ef871c146f4fc8f2c67fb17e.tar.gz klamav-357ddeb8afd82d69ef871c146f4fc8f2c67fb17e.zip |
Conversion Qt3->TQt
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
Diffstat (limited to 'src/scanviewer.cpp')
-rw-r--r-- | src/scanviewer.cpp | 254 |
1 files changed, 127 insertions, 127 deletions
diff --git a/src/scanviewer.cpp b/src/scanviewer.cpp index 19d1f09..22ccb42 100644 --- a/src/scanviewer.cpp +++ b/src/scanviewer.cpp @@ -21,30 +21,30 @@ #include <kio/netaccess.h> #include <knotifyclient.h> #include <kprocio.h> -#include <qlayout.h> +#include <tqlayout.h> #include <kcmdlineargs.h> #include <kmessagebox.h> #include <kstandarddirs.h> #include <ksystemtray.h> #include <kprogress.h> -#include <qtimer.h> -#include <qpushbutton.h> -#include <qcolor.h> -#include <qtooltip.h> //QToolTip::palette() +#include <tqtimer.h> +#include <tqpushbutton.h> +#include <tqcolor.h> +#include <tqtooltip.h> //TQToolTip::palette() #include <kdebug.h> static int counter = 0; -ScanViewer::ScanViewer(QWidget *parent, const char *name) - : QWidget(parent, name) +ScanViewer::ScanViewer(TQWidget *parent, const char *name) + : TQWidget(parent, name) { scanInProgress = TRUE; multiScan = FALSE; - //QGridLayout *layout = new QGridLayout(this, 6, 3, 10, 4); - layout = new QGridLayout(this, 6, 3, 10, 4); + //TQGridLayout *layout = new TQGridLayout(this, 6, 3, 10, 4); + layout = new TQGridLayout(this, 6, 3, 10, 4); layout->setColStretch(0, 10); layout->addColSpacing(1, 10); layout->setColStretch(1, 0); @@ -57,40 +57,40 @@ ScanViewer::ScanViewer(QWidget *parent, const char *name) - resultview = new QListView(this); + resultview = new TQListView(this); resultview->setShowSortIndicator(true); - QFontMetrics rb_fm(resultview->fontMetrics()); + TQFontMetrics rb_fm(resultview->fontMetrics()); //resultview->setMinimumSize(rb_fm.width("0")*55, // rb_fm.lineSpacing()*15); resultview->addColumn( i18n( "Name of File" ),(resultview->width()/3)); resultview->addColumn( i18n( "Name of Problem Found" ),(resultview->width()/3)); resultview->addColumn( i18n( "Status" ),(resultview->width()/3)); - resultview->setResizeMode(QListView::AllColumns); - resultview->setSelectionMode( QListView::Extended ); + resultview->setResizeMode(TQListView::AllColumns); + resultview->setSelectionMode( TQListView::Extended ); resultview->setAllColumnsShowFocus(true); layout->addMultiCellWidget(resultview, 2, 2, 0, 2); - connect( resultview, SIGNAL(onItem ( QListViewItem * )), - SLOT(slotOnItem ( QListViewItem * ))); + connect( resultview, SIGNAL(onItem ( TQListViewItem * )), + SLOT(slotOnItem ( TQListViewItem * ))); connect( resultview, SIGNAL(onViewport ( )), SLOT(slotOffItem ( ))); - menu = new QPopupMenu( resultview ); + menu = new TQPopupMenu( resultview ); - connect(resultview, SIGNAL( contextMenuRequested( QListViewItem *, const QPoint& , int ) ), - this, SLOT( slotRMB( QListViewItem *, const QPoint &, int ) ) ); + connect(resultview, SIGNAL( contextMenuRequested( TQListViewItem *, const TQPoint& , int ) ), + this, SLOT( slotRMB( TQListViewItem *, const TQPoint &, int ) ) ); - status_frame = new QFrame(this); - status_frame->setFrameStyle(QFrame::Panel | QFrame::Sunken); - QBoxLayout *status_layout = new QHBoxLayout(status_frame, 2); + status_frame = new TQFrame(this); + status_frame->setFrameStyle(TQFrame::Panel | TQFrame::Sunken); + TQBoxLayout *status_layout = new TQHBoxLayout(status_frame, 2); - status_label = new QLabel("", status_frame); + status_label = new TQLabel("", status_frame); status_layout->addWidget(status_label, 10); - //matches_label = new QLabel(status_frame); - //QFontMetrics ml_fm(matches_label->fontMetrics()); + //matches_label = new TQLabel(status_frame); + //TQFontMetrics ml_fm(matches_label->fontMetrics()); //matches_label->setFixedWidth(ml_fm.width(i18n("9999 viruseses/errors found"))); //matches_label->setFixedHeight(ml_fm.lineSpacing()); //status_layout->addWidget(matches_label, 0); @@ -101,11 +101,11 @@ ScanViewer::ScanViewer(QWidget *parent, const char *name) status_frame->setMinimumSize(status_frame->size()); layout->addMultiCellWidget(status_frame, 3, 3, 0, 2); - status2_frame = new QFrame(this); - status2_frame->setFrameStyle(QFrame::Panel | QFrame::Sunken); - status2_layout = new QHBoxLayout(status2_frame, 2); + status2_frame = new TQFrame(this); + status2_frame->setFrameStyle(TQFrame::Panel | TQFrame::Sunken); + status2_layout = new TQHBoxLayout(status2_frame, 2); - status2_label = new QLabel(i18n("Files scanned: 0"), status2_frame); + status2_label = new TQLabel(i18n("Files scanned: 0"), status2_frame); status2_layout->addWidget(status2_label, 10); status2_label->hide(); @@ -119,25 +119,25 @@ ScanViewer::ScanViewer(QWidget *parent, const char *name) prog->hide(); progosd->hide(); - scan_time = new QPushButton( status2_frame ); + scan_time = new TQPushButton( status2_frame ); scan_time->setText(i18n("Calculating Scan Time... (Click To By-Pass)")); status2_layout->addWidget(scan_time,10); scan_time->adjustSize(); scan_time->show(); - //status_frame->setPaletteBackgroundColor(QColor::Yellow); + //status_frame->setPaletteBackgroundColor(TQColor::Yellow); connect( scan_time, SIGNAL(clicked()), SLOT(slotCancelScanTime()) ); - matches2_label = new QLabel(status2_frame); - QFontMetrics ml_fm2(matches2_label->fontMetrics()); + matches2_label = new TQLabel(status2_frame); + TQFontMetrics ml_fm2(matches2_label->fontMetrics()); matches2_label->setFixedWidth(ml_fm2.width(i18n("9999 viruseses/problems found"))); matches2_label->setFixedHeight(ml_fm2.lineSpacing()); status2_layout->addWidget(matches2_label, 0); - QToolTip::add(matches2_label, i18n("cf. 'Flanderseses' - Homer Simpson. This childish joke will be removed when KlamAV is more mature.")); + TQToolTip::add(matches2_label, i18n("cf. 'Flanderseses' - Homer Simpson. This childish joke will be removed when KlamAV is more mature.")); status2_layout->activate(); status2_frame->adjustSize(); @@ -167,7 +167,7 @@ ScanViewer::~ScanViewer() void ScanViewer::processOutput() { int pos; - QString item2; + TQString item2; if (!(childproc)) return; @@ -182,25 +182,25 @@ void ScanViewer::processOutput() //buf.replace("//","/"); // don't know why they're getting two slashes while ((childproc) && ((pos = (childproc->readln(item2,true))) != -1)) { - QListViewItem* tm; + TQListViewItem* tm; //item2 = (buf.section('\n',j,j)).stripWhiteSpace(); item2 = item2.stripWhiteSpace(); int fnameStartPoint = 0; int fnameEndPoint = item2.findRev(":"); - QString tmpFName = item2.mid(fnameStartPoint,(fnameEndPoint - fnameStartPoint)); + TQString tmpFName = item2.mid(fnameStartPoint,(fnameEndPoint - fnameStartPoint)); tmpFName = i18n(tmpFName); if ((pos = (item2.find(" FOUND"))) != -1){ //if ((pos = buf.section('\n',j,j).find("FOUND")) != -1){ - QString tmpVirusName = item2.mid((fnameEndPoint+1),(item2.length() - (fnameEndPoint+1))); - QDate today = QDate::currentDate(); - QTime now = QTime::currentTime(); - QString suffix = QString(":%1 %2") + TQString tmpVirusName = item2.mid((fnameEndPoint+1),(item2.length() - (fnameEndPoint+1))); + TQDate today = TQDate::currentDate(); + TQTime now = TQTime::currentTime(); + TQString suffix = TQString(":%1 %2") .arg(today.toString("ddd MMMM d yyyy")) .arg(now.toString("hh-mm-ss-zzz ap")); if ((tmpVirusName.find("FOUND")) != -1){ tmpVirusName.replace("FOUND",""); - tm = new QListViewItem( resultview, tmpFName, tmpVirusName.stripWhiteSpace(),"Loose"); + tm = new TQListViewItem( resultview, tmpFName, tmpVirusName.stripWhiteSpace(),"Loose"); tm->setPixmap( 0, SmallIcon("klamav_virus") ); //resultview->insertItem(buf.section('\n',j,j)); QuarantineList.append(tmpFName+":"+tmpVirusName+suffix); @@ -213,8 +213,8 @@ void ScanViewer::processOutput() //}else if ((pos = buf.section('\n',j,j).find("ERROR:")) != -1){ }else if ((pos = (item2.find("ERROR:"))) != -1){ - QString tmpVirusName = item2.mid((fnameEndPoint+1),(item2.length() - (fnameEndPoint+1))); - tm = new QListViewItem( resultview, tmpFName, tmpVirusName.stripWhiteSpace(),"Not a Virus"); + TQString tmpVirusName = item2.mid((fnameEndPoint+1),(item2.length() - (fnameEndPoint+1))); + tm = new TQListViewItem( resultview, tmpFName, tmpVirusName.stripWhiteSpace(),"Not a Virus"); tm->setPixmap( 0, SmallIcon("klamav_error") ); //resultview->insertItem(buf.section('\n',j,j)); CollectionDB::instance()->insertEvent("Error Found",tmpVirusName,tmpFName); @@ -225,7 +225,7 @@ void ScanViewer::processOutput() status2_label->setText(i18n("Files scanned: %1").arg(filesscanned)); //}else if ((pos = buf.section('\n',j,j).find("Scanning ")) != -1){ }else if ((pos = (item2.find("Scanning"))) != -1){ - if (status_label->palette() != QToolTip::palette()) + if (status_label->palette() != TQToolTip::palette()) status_label->setText(item2); //}else if ((pos = buf.section('\n',j,j).find(": OK")) != -1){ }else if ((pos = (item2.find(": OK"))) != -1){ @@ -238,7 +238,7 @@ void ScanViewer::processOutput() filesscanned++; if (!(showProgress)) status2_label->setText(i18n("Files scanned: %1").arg(filesscanned)); - KNotifyClient::event(kmain->_tray->winId(),"ScanAccessDenied", QString("Can't scan %1 " + KNotifyClient::event(kmain->_tray->winId(),"ScanAccessDenied", TQString("Can't scan %1 " "- Access Denied!").arg(tmpFName)); CollectionDB::instance()->insertEvent("Error Found","Access Denied",tmpFName); //}else if ((pos = buf.section('\n',j,j).find(": Can't open")) != -1){ @@ -248,7 +248,7 @@ void ScanViewer::processOutput() filesscanned++; if (!(showProgress)) status2_label->setText(i18n("Files scanned: %1").arg(filesscanned)); - KNotifyClient::event(kmain->_tray->winId(),"ScanAccessDenied", QString("Can't scan %1 " + KNotifyClient::event(kmain->_tray->winId(),"ScanAccessDenied", TQString("Can't scan %1 " "- Access Denied!").arg(tmpFName)); CollectionDB::instance()->insertEvent("Error Found","Access Denied",tmpFName); }else if ((pos = (item2.find(": Empty file"))) != -1){ @@ -256,14 +256,14 @@ void ScanViewer::processOutput() filesscanned++; if (!(showProgress)) status2_label->setText(i18n("Files scanned: %1").arg(filesscanned)); - //KNotifyClient::event(kmain->_tray->winId(),"ScanAccessDenied", QString("Can't scan %1 " + //KNotifyClient::event(kmain->_tray->winId(),"ScanAccessDenied", TQString("Can't scan %1 " // "- Empty File!").arg(tmpFName)); CollectionDB::instance()->insertEvent("Error Found","Empty File",tmpFName); } item2 = ""; } - QString str; + TQString str; str.setNum(resultview->childCount()); str += i18n(" viruseses/problems found"); @@ -278,7 +278,7 @@ void ScanViewer::processOutput() } -void ScanViewer::slotScan(const QStringList & filepattern, int mode, bool recursive, bool dcopscan) +void ScanViewer::slotScan(const TQStringList & filepattern, int mode, bool recursive, bool dcopscan) { //KMessageBox::information (this, filepattern); @@ -318,15 +318,15 @@ void ScanViewer::slotScan(const QStringList & filepattern, int mode, bool recurs //progosd->setProgress(0); kdDebug() << filepattern << endl; - QStringList tmpfilepattern = filepattern; + TQStringList tmpfilepattern = filepattern; cnt = 0; - //QStringList temp = QStringList::split(" ", tmpfilepattern.replace("\"","")); + //TQStringList temp = TQStringList::split(" ", tmpfilepattern.replace("\"","")); //kdDebug() << temp << endl; if (calculateTime){ - for ( QStringList::Iterator it = tmpfilepattern.begin(); it != tmpfilepattern.end(); ++it ){ - QDir d( QString((*it).latin1()).stripWhiteSpace() ); - kdDebug() << "dir " << QString((*it).latin1()).stripWhiteSpace() << endl; + for ( TQStringList::Iterator it = tmpfilepattern.begin(); it != tmpfilepattern.end(); ++it ){ + TQDir d( TQString((*it).latin1()).stripWhiteSpace() ); + kdDebug() << "dir " << TQString((*it).latin1()).stripWhiteSpace() << endl; counter = 0; cnt = cnt + countFiles(d); if (scanCancelled) @@ -353,36 +353,36 @@ void ScanViewer::slotScan(const QStringList & filepattern, int mode, bool recurs filesscanned = 0; //status2_label->setText(i18n("Scan in Progress...")); - QString db; + TQString db; if(!( args->isSet( "scanthis" ) ) ) db = kmain->freshklam->getCurrentDBDir(); else{ config->setGroup("Freshklam"); - QStringList lastDownloadPaths = config->readListEntry("lastDownloadPaths"); - for (QStringList::Iterator ita = lastDownloadPaths.begin(); ita == lastDownloadPaths.begin() ; ita++){ + TQStringList lastDownloadPaths = config->readListEntry("lastDownloadPaths"); + for (TQStringList::Iterator ita = lastDownloadPaths.begin(); ita == lastDownloadPaths.begin() ; ita++){ db = *ita; } } ////kdDebug() << "here 2" << endl; - QString dbpath; - QString excludes; - QString options; + TQString dbpath; + TQString excludes; + TQString options; if (!(db.isEmpty())) - dbpath = QString(" -d %1 ").arg(db); + dbpath = TQString(" -d %1 ").arg(db); config->setGroup("Klamscan"); if (config->readEntry("ExcludeQuarantine") == "Yes"){ config->setGroup("Kuarantine"); - QStringList lastQuarLocations = config->readListEntry("KuarantineLocations"); - QString quarloc; - for (QStringList::Iterator ita = lastQuarLocations.begin(); ita == lastQuarLocations.begin() ; ita++){ + TQStringList lastQuarLocations = config->readListEntry("KuarantineLocations"); + TQString quarloc; + for (TQStringList::Iterator ita = lastQuarLocations.begin(); ita == lastQuarLocations.begin() ; ita++){ quarloc = *ita; } - excludes += QString(" --exclude=%1 ").arg(quarloc); + excludes += TQString(" --exclude=%1 ").arg(quarloc); } @@ -394,23 +394,23 @@ void ScanViewer::slotScan(const QStringList & filepattern, int mode, bool recurs if (KlamavConfig::noFilesToExtract() > 0) - options += "--max-files=" + QString("%1").arg(KlamavConfig::noFilesToExtract()) + " "; + options += "--max-files=" + TQString("%1").arg(KlamavConfig::noFilesToExtract()) + " "; // if (KlamavConfig::mBsToExtract() > 0) -// options += "--max-space=" + QString("%1").arg(KlamavConfig::mBsToExtract()) + " "; +// options += "--max-space=" + TQString("%1").arg(KlamavConfig::mBsToExtract()) + " "; // // if (KlamavConfig::compressionRatio() > 0) -// options += "--max-ratio=" + QString("%1").arg(KlamavConfig::compressionRatio()) + " "; +// options += "--max-ratio=" + TQString("%1").arg(KlamavConfig::compressionRatio()) + " "; if (KlamavConfig::recursionLevel() > 0) - options += "--max-recursion=" + QString("%1").arg(KlamavConfig::recursionLevel()) + " "; + options += "--max-recursion=" + TQString("%1").arg(KlamavConfig::recursionLevel()) + " "; if (KlamavConfig::maxFileSize() > 0) - options += "--max-filesize=" + QString("%1").arg(KlamavConfig::maxFileSize()) + "M "; + options += "--max-filesize=" + TQString("%1").arg(KlamavConfig::maxFileSize()) + "M "; if (KlamavConfig::maxScanSize() > 0) - options += "--max-scansize=" + QString("%1").arg(KlamavConfig::maxScanSize()) + "M "; + options += "--max-scansize=" + TQString("%1").arg(KlamavConfig::maxScanSize()) + "M "; //config->setGroup("Klamscan"); // if (KlamavConfig::virusLimitsExceeded()) @@ -588,7 +588,7 @@ void ScanViewer::slotCancel() //status2_frame->adjustSize(); status2_label->setText(i18n("Cancelled")); - CollectionDB::instance()->insertEvent("Manual Scan",QString("Scan Cancelled"),m_filepattern.join(" ")); + CollectionDB::instance()->insertEvent("Manual Scan",TQString("Scan Cancelled"),m_filepattern.join(" ")); } @@ -607,11 +607,11 @@ void ScanViewer::childExited() int result; status2_label->setText( i18n("Scan Complete") ); - CollectionDB::instance()->insertEvent("Manual Scan",QString("Scan Complete"),m_filepattern.join(" ")); + CollectionDB::instance()->insertEvent("Manual Scan",TQString("Scan Complete"),m_filepattern.join(" ")); if (status == 0){ kmain->_tray->setPixmap(KSystemTray::loadIcon("klamav_scan_safe")); - QTimer::singleShot( 10000, this, SLOT(resetSysTray()) ); + TQTimer::singleShot( 10000, this, SLOT(resetSysTray()) ); if (!(errorsEncountered)) KNotifyClient::event(kmain->_tray->winId(),i18n( "ScanCompleteNoVirus" ), i18n( "Scan Complete - No Viruses Found!" )); else @@ -624,7 +624,7 @@ void ScanViewer::childExited() progosd->setText("Problems found!"); result = KMessageBox::warningContinueCancelList(this, i18n( "I'm going to quarantine this lot, you can restore them later if you want. If you don't want to quarantine, just press cancel."),QuarantineList,i18n( "Quarantine Infected Files" ),i18n( "Quarantine" )); switch (result) { - case 2 :KNotifyClient::event(kmain->_tray->winId(),"ScanAccessDenied", QString("Suspicious Items Not " + case 2 :KNotifyClient::event(kmain->_tray->winId(),"ScanAccessDenied", TQString("Suspicious Items Not " "Quarantined!")); break; case 5 : Quarantine(); break; } @@ -681,7 +681,7 @@ void ScanViewer::childExited() void ScanViewer::receivedOutput(KProcIO *) { - //buf += QCString(buffer, buflen+1); + //buf += TQCString(buffer, buflen+1); processOutput(); //childproc->ackRead(); @@ -699,7 +699,7 @@ void ScanViewer::slotClear() } -// void ScanViewer::setDirName(QString dir){ +// void ScanViewer::setDirName(TQString dir){ // // dir_combo->setEditText(dir); // dir_combo->setCurrentText(dir); // } @@ -707,30 +707,30 @@ void ScanViewer::slotClear() void ScanViewer::Quarantine(){ bool allQuarantined=TRUE; config->setGroup("Kuarantine"); - QStringList lastQuarLocations = config->readListEntry("KuarantineLocations"); + TQStringList lastQuarLocations = config->readListEntry("KuarantineLocations"); kmain->_tray->setPixmap(KSystemTray::loadIcon("klamav_quarantining")); - QString quarloc; - for (QStringList::Iterator it = lastQuarLocations.begin(); it == lastQuarLocations.begin() ; it++){ + TQString quarloc; + for (TQStringList::Iterator it = lastQuarLocations.begin(); it == lastQuarLocations.begin() ; it++){ quarloc = *it; } - lastQuarItems = config->readListEntry(QString("Items %1").arg(quarloc)); + lastQuarItems = config->readListEntry(TQString("Items %1").arg(quarloc)); - for (QStringList::Iterator it = QuarantineList.begin(); it != QuarantineList.end(); it++ ){ + for (TQStringList::Iterator it = QuarantineList.begin(); it != QuarantineList.end(); it++ ){ if (lastQuarItems.contains(*it) != 0) { lastQuarItems.remove(*it); } - QString item2 = (*it).stripWhiteSpace(); + TQString item2 = (*it).stripWhiteSpace(); int fnameStartPoint = 0; int dtStartPoint = item2.findRev(":"); int fnameEndPoint = item2.findRev(":", (signed int)-((item2.length() - dtStartPoint)+1)); - QString fname = item2.mid(fnameStartPoint,(fnameEndPoint - fnameStartPoint)); - QString itemName = item2.mid((fnameEndPoint+1),((dtStartPoint+1) - (fnameEndPoint+2))); - QString when = item2.mid((dtStartPoint+1),(item2.length() - (dtStartPoint+1))); + TQString fname = item2.mid(fnameStartPoint,(fnameEndPoint - fnameStartPoint)); + TQString itemName = item2.mid((fnameEndPoint+1),((dtStartPoint+1) - (fnameEndPoint+2))); + TQString when = item2.mid((dtStartPoint+1),(item2.length() - (dtStartPoint+1))); if (!(fname.isEmpty())){ - QStringList tokens = QStringList::split ( "/", fname, FALSE ); - QString qname = tokens.last(); + TQStringList tokens = TQStringList::split ( "/", fname, FALSE ); + TQString qname = tokens.last(); qname.prepend("/"); qname.prepend(quarloc); qname.append(":"+when); @@ -741,7 +741,7 @@ void ScanViewer::Quarantine(){ (resultview->findItem(fname,0))->setText(2,"Quarantined"); (resultview->findItem(fname,0))->setPixmap( 0, SmallIcon("klamav") ); chmod((const char *)qname,0400); - CollectionDB::instance()->insertEvent("Quarantine",QString("Quarantined"),fname); + CollectionDB::instance()->insertEvent("Quarantine",TQString("Quarantined"),fname); }else{ KMessageBox::information (this,i18n("<p>There was a problem quarantining <b>%1</b>. Check your diskspace, the permissions on your quarantine location and whether a file with the same name already exists in the quarantine. </p>").arg(fname)); @@ -757,7 +757,7 @@ void ScanViewer::Quarantine(){ kmain->_tray->setPixmap(KSystemTray::loadIcon("klamav_on_acc_disabled")); }else kmain->_tray->setPixmap(KSystemTray::loadIcon("klamav_scan_found")); - config->writeEntry(QString("Items %1").arg(quarloc), lastQuarItems); + config->writeEntry(TQString("Items %1").arg(quarloc), lastQuarItems); config->sync(); //kmain->kuarantine->refresh(); @@ -766,38 +766,38 @@ void ScanViewer::Quarantine(){ } -void ScanViewer::slotRMB( QListViewItem* Item, const QPoint & point, int ) +void ScanViewer::slotRMB( TQListViewItem* Item, const TQPoint & point, int ) { if( Item ){ - QPixmap gicon; - QPixmap vicon; - QPixmap vlicon; - QPixmap ticon; + TQPixmap gicon; + TQPixmap vicon; + TQPixmap vlicon; + TQPixmap ticon; - QString iconPath = locate("cache", KMimeType::favIconForURL("http://www.viruspool.net")+".png"); + TQString iconPath = locate("cache", KMimeType::favIconForURL("http://www.viruspool.net")+".png"); if ( iconPath.isEmpty() ) vicon = SmallIcon("find"); else - vicon = QPixmap( iconPath ); + vicon = TQPixmap( iconPath ); iconPath = locate("cache", KMimeType::favIconForURL("http://www.google.com")+".png"); if ( iconPath.isEmpty() ) gicon = SmallIcon("find"); else - gicon = QPixmap( iconPath ); + gicon = TQPixmap( iconPath ); iconPath = locate("cache", KMimeType::favIconForURL("http://www.trendmicro.com")+".png"); if ( iconPath.isEmpty() ) ticon = SmallIcon("find"); else - ticon = QPixmap( iconPath ); + ticon = TQPixmap( iconPath ); iconPath = locate("cache", KMimeType::favIconForURL("http://www.viruslist.com")+".png"); if ( iconPath.isEmpty() ) vlicon = SmallIcon("find"); else - vlicon = QPixmap( iconPath ); + vlicon = TQPixmap( iconPath ); menu->clear(); menu->insertItem( "Quarantine Selected", this,SLOT(slotQuarantineSelected()) ); @@ -814,16 +814,16 @@ void ScanViewer::slotRMB( QListViewItem* Item, const QPoint & point, int ) void ScanViewer::slotQuarantineSelected() { - QPtrList<QListViewItem> list; - QListViewItemIterator it( resultview, QListViewItemIterator::Selected ); + TQPtrList<TQListViewItem> list; + TQListViewItemIterator it( resultview, TQListViewItemIterator::Selected ); QuarantineList = ""; while ( it.current() ) { - QListViewItem* tItem = it.current(); + TQListViewItem* tItem = it.current(); - QDate today = QDate::currentDate(); - QTime now = QTime::currentTime(); - QString suffix = QString(":%1 %2") + TQDate today = TQDate::currentDate(); + TQTime now = TQTime::currentTime(); + TQString suffix = TQString(":%1 %2") .arg(today.toString("ddd MMMM d yyyy")) .arg(now.toString("hh-mm-ss ap")); @@ -838,25 +838,25 @@ void ScanViewer::slotQuarantineSelected() void ScanViewer::slotGoogle() { - QString name = resultview->currentItem()->text(1); + TQString name = resultview->currentItem()->text(1); kmain->klamdb->slotExternal(name, "Google"); } void ScanViewer::slotVirusPool() { - QString name = resultview->currentItem()->text(1); + TQString name = resultview->currentItem()->text(1); kmain->klamdb->slotExternal(name, "VirusPool"); } void ScanViewer::slotTrendMicro() { - QString name = resultview->currentItem()->text(1); + TQString name = resultview->currentItem()->text(1); kmain->klamdb->slotExternal(name, "TrendMicro"); } void ScanViewer::slotVirusList() { - QString name = resultview->currentItem()->text(1); + TQString name = resultview->currentItem()->text(1); kmain->klamdb->slotExternal(name, "VirusList"); } @@ -889,7 +889,7 @@ void ScanViewer::slotCancelScanTime() // // cnt = 0; // //kdDebug() << "m_filepattern" << m_filepattern << endl; -// QDir d( m_filepattern ); +// TQDir d( m_filepattern ); // // int num = countFiles(d); // // if (countFiles(d) > 0) // // //kdDebug() << "count" << num << endl; @@ -904,7 +904,7 @@ void ScanViewer::slotCancelScanTime() // // } -int ScanViewer::countFiles( QDir & root) +int ScanViewer::countFiles( TQDir & root) { kapp->processEvents(); @@ -913,38 +913,38 @@ int ScanViewer::countFiles( QDir & root) // kapp->processEvents(); return 0; } - QStringList entries = root.entryList( QDir::Dirs | QDir::Files | QDir::Hidden); + TQStringList entries = root.entryList( TQDir::Dirs | TQDir::Files | TQDir::Hidden); ////kdDebug() << "count" << counter << endl; - for (QStringList::size_type j = 0; j < entries.size(); j++ ) + for (TQStringList::size_type j = 0; j < entries.size(); j++ ) { - QString entry = entries[j]; + TQString entry = entries[j]; if( entry == "." || entry == "..") continue; - QFileInfo fi(root, entry ); + TQFileInfo fi(root, entry ); entry = fi.absFilePath(); - entry = QDir::convertSeparators(entry); + entry = TQDir::convertSeparators(entry); if ((fi.isFile()) && !(fi.isSymLink())){ counter++; }else if ((fi.isDir()) && !(fi.isSymLink())){ - QDir temp(entry); + TQDir temp(entry); countFiles(temp); } } return counter; } -void ScanViewer::startProgressDialog( const QString & text ) +void ScanViewer::startProgressDialog( const TQString & text ) { //if ( progressDialog ) // delete progressDialog; - progressDialog = new KProgressDialog( this, "progress_dialog", QString::null, text, false ); + progressDialog = new KProgressDialog( this, "progress_dialog", TQString::null, text, false ); progressDialog->setAllowCancel( true ); progressDialog->showCancelButton( true ); @@ -956,7 +956,7 @@ void ScanViewer::startProgressDialog( const QString & text ) progressDialog->setMinimumDuration( 500 ); progressDialog->show(); - timer = new QTimer( this ); + timer = new TQTimer( this ); connect( timer, SIGNAL( timeout() ), this, SLOT( slotProg() ) ); timer->start( 200, FALSE ); @@ -969,17 +969,17 @@ void ScanViewer::slotProg() progressDialog->progressBar()->setProgress(progressDialog->progressBar()->progress() + 4 ); } -void ScanViewer::slotOnItem( QListViewItem * lineitem) +void ScanViewer::slotOnItem( TQListViewItem * lineitem) { - status_label->setPalette(QToolTip::palette()); + status_label->setPalette(TQToolTip::palette()); - QString problem = lineitem->text(1).stripWhiteSpace(); - QString message = problem + " is probably a virus. Right-click and select a service to research it."; + TQString problem = lineitem->text(1).stripWhiteSpace(); + TQString message = problem + " is probably a virus. Right-click and select a service to research it."; - QString path( lineitem->text(0).stripWhiteSpace() ); - QString file = path.section( '/', -1 ); + TQString path( lineitem->text(0).stripWhiteSpace() ); + TQString file = path.section( '/', -1 ); if ((problem.contains("ExceededFile")) || (problem == "Archive.ExceededRecursionLimit") || |