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/klamscan.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/klamscan.cpp')
-rw-r--r-- | src/klamscan.cpp | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/src/klamscan.cpp b/src/klamscan.cpp index bb32553..a5dc91c 100644 --- a/src/klamscan.cpp +++ b/src/klamscan.cpp @@ -20,22 +20,22 @@ #include <ksystemtray.h> -#include <qpushbutton.h> -#include <qlayout.h> +#include <tqpushbutton.h> +#include <tqlayout.h> #include <kcmdlineargs.h> #include <kmessagebox.h> -#include <qtooltip.h> -#include <qtoolbutton.h> +#include <tqtooltip.h> +#include <tqtoolbutton.h> #include <dcopclient.h> -#include <qdir.h> +#include <tqdir.h> #include <kprogress.h> #include <dcopref.h> #include <dcopclient.h> using namespace KlamAV; -Klamscan::Klamscan(QWidget *parent, const char *name) - : QWidget(parent, name), DCOPObject( "DCOPKlamscan" ) +Klamscan::Klamscan(TQWidget *parent, const char *name) + : TQWidget(parent, name), DCOPObject( "DCOPKlamscan" ) { @@ -43,7 +43,7 @@ Klamscan::Klamscan(QWidget *parent, const char *name) /* scanInProgress = FALSE; multiScan = FALSE; */ setDefaults(); - QBoxLayout *top = new QVBoxLayout(this,10,10); + TQBoxLayout *top = new TQVBoxLayout(this,10,10); tabBrowser = new TabWidget(this); @@ -53,10 +53,10 @@ Klamscan::Klamscan(QWidget *parent, const char *name) /* dblayout->addMultiCellWidget( tabBrowser, 0, 1, 1, 1 );*/ - //QGridLayout *layout = new QGridLayout(this, 6, 3, 10, 4); - QWidget* privateLayoutWidget2 = new QWidget( this, "dblayout" ); + //TQGridLayout *layout = new TQGridLayout(this, 6, 3, 10, 4); + TQWidget* privateLayoutWidget2 = new TQWidget( this, "dblayout" ); - QGridLayout *layout = new QGridLayout(privateLayoutWidget2, 6, 6, 10, 4); + TQGridLayout *layout = new TQGridLayout(privateLayoutWidget2, 6, 6, 10, 4); layout->setColStretch(0, 10); layout->addColSpacing(1, 10); layout->setColStretch(1, 0); @@ -74,12 +74,12 @@ Klamscan::Klamscan(QWidget *parent, const char *name) KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - QLabel *combo_label = new QLabel(i18n("When a virus is found:"), privateLayoutWidget2); + TQLabel *combo_label = new TQLabel(i18n("When a virus is found:"), privateLayoutWidget2); //combo_label->setFixedSize(combo_label->sizeHint()); layout->addWidget(combo_label,0,0); combo_label->adjustSize(); - check_combo = new QComboBox(false, privateLayoutWidget2); + check_combo = new TQComboBox(false, privateLayoutWidget2); check_combo->insertItem( i18n( "Ask me" ) ); check_combo->insertItem( i18n( "Quarantine file" ) ); check_combo->insertItem( i18n( "Just report" ) ); @@ -88,18 +88,18 @@ Klamscan::Klamscan(QWidget *parent, const char *name) layout->addWidget(check_combo,0,1); - recursive_box = new QCheckBox(i18n("&Scan Folders Recursively"), privateLayoutWidget2); + recursive_box = new TQCheckBox(i18n("&Scan Folders Recursively"), privateLayoutWidget2); recursive_box->setMinimumWidth(recursive_box->sizeHint().width()); recursive_box->setChecked(true); // dir_layout2->addSpacing(10); layout->addWidget(recursive_box,0,3); - QToolTip::add( recursive_box, i18n( "Scan all directories under the specified path." ) ); + TQToolTip::add( recursive_box, i18n( "Scan all directories under the specified path." ) ); - QToolButton* schedule = new QToolButton( privateLayoutWidget2,"play" ); + TQToolButton* schedule = new TQToolButton( privateLayoutWidget2,"play" ); schedule->setIconSet( SmallIconSet( "xclock" ) ); schedule->setTextLabel(i18n( "Schedule" )); - schedule->setTextPosition(QToolButton::Right); + schedule->setTextPosition(TQToolButton::Right); schedule->setUsesTextLabel(true); schedule->adjustSize(); layout->addWidget(schedule,0,4); @@ -108,10 +108,10 @@ Klamscan::Klamscan(QWidget *parent, const char *name) SLOT(slotSchedule()) ); - QToolButton* adv_options = new QToolButton( privateLayoutWidget2,"play" ); + TQToolButton* adv_options = new TQToolButton( privateLayoutWidget2,"play" ); adv_options->setIconSet( SmallIconSet( "configure" ) ); adv_options->setTextLabel(i18n("Options")); - adv_options->setTextPosition(QToolButton::Right); + adv_options->setTextPosition(TQToolButton::Right); adv_options->setUsesTextLabel(true); layout->addWidget(adv_options,0,5); //adv_options->setFixedSize(adv_options->sizeHint()); @@ -127,30 +127,30 @@ Klamscan::Klamscan(QWidget *parent, const char *name) - QHBox* controls = new QHBox(tabBrowser); + TQHBox* controls = new TQHBox(tabBrowser); //controls->setSpacing(5); controls->setMargin(2); - play = new QToolButton( controls,"play" ); + play = new TQToolButton( controls,"play" ); play->setIconSet( SmallIconSet( "player_play" ) ); play->setTextLabel(i18n( "Scan" )); - play->setTextPosition(QToolButton::Right); + play->setTextPosition(TQToolButton::Right); play->setUsesTextLabel(true); play->adjustSize(); play->setFixedHeight(play->height() - 1); - stop = new QToolButton( controls,"stop" ); + stop = new TQToolButton( controls,"stop" ); stop->setIconSet( SmallIconSet( "player_stop" ) ); stop->setTextLabel(i18n( "Stop" )); - stop->setTextPosition(QToolButton::Right); + stop->setTextPosition(TQToolButton::Right); stop->setUsesTextLabel(true); stop->adjustSize(); stop->setFixedHeight(stop->height() - 1); - m_tabsClose = new QToolButton( controls,"tab_remove" ); + m_tabsClose = new TQToolButton( controls,"tab_remove" ); m_tabsClose->setIconSet( SmallIconSet( "tab_remove" ) ); m_tabsClose->setTextLabel(i18n( "Close" )); - m_tabsClose->setTextPosition(QToolButton::Right); + m_tabsClose->setTextPosition(TQToolButton::Right); m_tabsClose->setUsesTextLabel(true); m_tabsClose->adjustSize(); m_tabsClose->setFixedHeight(m_tabsClose->height() - 1); @@ -174,8 +174,8 @@ Klamscan::Klamscan(QWidget *parent, const char *name) layout->activate(); - connect(tabBrowser, SIGNAL(currentChanged(QWidget *)),this, - SLOT(slotManageButtons(QWidget *)) ); + connect(tabBrowser, SIGNAL(currentChanged(TQWidget *)),this, + SLOT(slotManageButtons(TQWidget *)) ); // Register with DCOP @@ -206,18 +206,18 @@ void Klamscan::slotScan() ScanViewer* homepage = new ScanViewer(this, "page"); - connect( homepage, SIGNAL( scanFinished(QWidget *) ), this, - SLOT( slotManageButtons(QWidget *) ) ); + connect( homepage, SIGNAL( scanFinished(TQWidget *) ), this, + SLOT( slotManageButtons(TQWidget *) ) ); - connect( homepage, SIGNAL( scanStartingAgain(QWidget *) ), this, - SLOT( slotManageButtons(QWidget *) ) ); + connect( homepage, SIGNAL( scanStartingAgain(TQWidget *) ), this, + SLOT( slotManageButtons(TQWidget *) ) ); kmain->_tray->setPixmap(KSystemTray::loadIcon("klamav_scanning")); - 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 ap")); @@ -225,16 +225,16 @@ void Klamscan::slotScan() tabBrowser->setCurrentPage(tabBrowser->count() - 1); //return; - QStringList filepattern; + TQStringList filepattern; KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); if( args->isSet( "scanthis" ) ) { listOfUrlsToScan.clear(); for( int i = 0; i < args->count(); i++ ) { - //KMessageBox::information (this,QString(args->arg(i))); + //KMessageBox::information (this,TQString(args->arg(i))); filepattern.append(args->arg(i)); - listOfUrlsToScan.prepend(QString(args->arg(i))); + listOfUrlsToScan.prepend(TQString(args->arg(i))); } prevdir = listOfUrlsToScan.first(); @@ -242,7 +242,7 @@ void Klamscan::slotScan() filepattern = pruneSelectedDirs(); } //kdDebug() << filepattern << endl; - CollectionDB::instance()->insertEvent("Manual Scan",QString("Commencing Scan"),filepattern.join(" ")); + CollectionDB::instance()->insertEvent("Manual Scan",TQString("Commencing Scan"),filepattern.join(" ")); homepage->slotScan(filepattern, check_combo->currentItem(),setup->recursive(),false); @@ -267,7 +267,7 @@ void Klamscan::slotAdvOptions(){ void Klamscan::slotSchedule(){ - QStringList filepattern = pruneSelectedDirs(); + TQStringList filepattern = pruneSelectedDirs(); if (filepattern.isEmpty()){ @@ -341,36 +341,36 @@ void Klamscan::setDefaults(){ } -void Klamscan::scanURLs(const QString &urls) +void Klamscan::scanURLs(const TQString &urls) { setActiveWindow(); raise(); kmain->tab->setCurrentPage(0); - QString tmpurls = urls; + TQString tmpurls = urls; //urlsToScan = urlsToScan.replace("*"," "); - urlsToScan = QStringList::split("*", tmpurls); - //for ( QStringList::Iterator it = temp.begin(); it != temp.end(); ++it ) + urlsToScan = TQStringList::split("*", tmpurls); + //for ( TQStringList::Iterator it = temp.begin(); it != temp.end(); ++it ) // (*it).sprintf("\"%s\"", (*it).latin1()); //urlsToScan = temp; ScanViewer* homepage = new ScanViewer(this, "page"); - connect( homepage, SIGNAL( scanFinished(QWidget *) ), this, - SLOT( slotManageButtons(QWidget *) ) ); - connect( homepage, SIGNAL( scanStartingAgain(QWidget *) ), this, - SLOT( slotManageButtons(QWidget *) ) ); + connect( homepage, SIGNAL( scanFinished(TQWidget *) ), this, + SLOT( slotManageButtons(TQWidget *) ) ); + connect( homepage, SIGNAL( scanStartingAgain(TQWidget *) ), this, + SLOT( slotManageButtons(TQWidget *) ) ); - 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 ap")); tabBrowser->addTab(homepage,suffix); tabBrowser->setCurrentPage(tabBrowser->count() - 1); - CollectionDB::instance()->insertEvent("Manual Scan",QString("Commencing Scan"),urlsToScan.join(" ")); + CollectionDB::instance()->insertEvent("Manual Scan",TQString("Commencing Scan"),urlsToScan.join(" ")); homepage->slotScan(urlsToScan, check_combo->currentItem(),setup->recursive(),true); @@ -419,7 +419,7 @@ void Klamscan::slotRemoveTab(){ } } -void Klamscan::slotManageButtons(QWidget * current){ +void Klamscan::slotManageButtons(TQWidget * current){ ScanViewer* cur = static_cast<ScanViewer*>(current); @@ -441,17 +441,17 @@ void Klamscan::slotManageButtons(QWidget * current){ } -QStringList Klamscan::pruneSelectedDirs(){ +TQStringList Klamscan::pruneSelectedDirs(){ //This gets rid of redundant sub-directories from the list of dirs to be scanned. - QStringList filepattern; - QStringList listOfUrlsToScan = setup->dirs(); + TQStringList filepattern; + TQStringList listOfUrlsToScan = setup->dirs(); listOfUrlsToScan.sort(); - QString prev; - QStringList prevdirs; - for (QStringList::Iterator it = listOfUrlsToScan.begin(); it != listOfUrlsToScan.end(); it++ ){ + TQString prev; + TQStringList prevdirs; + for (TQStringList::Iterator it = listOfUrlsToScan.begin(); it != listOfUrlsToScan.end(); it++ ){ //kdDebug() << "dir: " << (*it) << endl; (*it) = (*it).stripWhiteSpace() + "/"; if (prevdirs.isEmpty()){ @@ -461,7 +461,7 @@ QStringList Klamscan::pruneSelectedDirs(){ }else{ filepattern.append(*it); bool shouldappend = true; - for (QStringList::Iterator it2 = prevdirs.begin(); it2 != prevdirs.end(); it2++ ){ + for (TQStringList::Iterator it2 = prevdirs.begin(); it2 != prevdirs.end(); it2++ ){ if ((*it).contains(*it2)){ //kdDebug() << (*it) << endl; filepattern.remove((*it)); |