diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2021-01-13 19:34:09 +0200 |
---|---|---|
committer | Mavridis Philippe <mavridisf@gmail.com> | 2021-01-13 19:34:09 +0200 |
commit | 4c04a441814c7d1dda08f6075ab4e09dc05541df (patch) | |
tree | cf8a3dbd77114c416255d3995cd1b047072ef26a /src/scanviewer.cpp | |
parent | 357ddeb8afd82d69ef871c146f4fc8f2c67fb17e (diff) | |
download | klamav-4c04a441814c7d1dda08f6075ab4e09dc05541df.tar.gz klamav-4c04a441814c7d1dda08f6075ab4e09dc05541df.zip |
Conversion KDE3->TDE
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
Diffstat (limited to 'src/scanviewer.cpp')
-rw-r--r-- | src/scanviewer.cpp | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/src/scanviewer.cpp b/src/scanviewer.cpp index 22ccb42..bce8d72 100644 --- a/src/scanviewer.cpp +++ b/src/scanviewer.cpp @@ -14,16 +14,16 @@ #include "klamavconfig.h" -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> -#include <kmenubar.h> +#include <tdemenubar.h> #include <kstatusbar.h> -#include <kio/netaccess.h> +#include <tdeio/netaccess.h> #include <knotifyclient.h> #include <kprocio.h> #include <tqlayout.h> -#include <kcmdlineargs.h> -#include <kmessagebox.h> +#include <tdecmdlineargs.h> +#include <tdemessagebox.h> #include <kstandarddirs.h> #include <ksystemtray.h> #include <kprogress.h> @@ -112,7 +112,7 @@ ScanViewer::ScanViewer(TQWidget *parent, const char *name) prog = new KProgress(status2_frame); progosd = new K3bJobProgressOSD(); progosd->setText("Scanning.."); - progosd->readSettings(KGlobal::config()); + progosd->readSettings(TDEGlobal::config()); status2_layout->addWidget(prog, 10); prog->adjustSize(); @@ -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", TQString("Can't scan %1 " + KNotifyClient::event(tdemain->_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", TQString("Can't scan %1 " + KNotifyClient::event(tdemain->_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,7 +256,7 @@ void ScanViewer::processOutput() filesscanned++; if (!(showProgress)) status2_label->setText(i18n("Files scanned: %1").arg(filesscanned)); - //KNotifyClient::event(kmain->_tray->winId(),"ScanAccessDenied", TQString("Can't scan %1 " + //KNotifyClient::event(tdemain->_tray->winId(),"ScanAccessDenied", TQString("Can't scan %1 " // "- Empty File!").arg(tmpFName)); CollectionDB::instance()->insertEvent("Error Found","Empty File",tmpFName); } @@ -282,7 +282,7 @@ void ScanViewer::slotScan(const TQStringList & filepattern, int mode, bool recur { //KMessageBox::information (this, filepattern); - KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); if(( args->isSet( "scanthis" ) ) || (dcopscan)) { calculateTime = FALSE; @@ -344,7 +344,7 @@ void ScanViewer::slotScan(const TQStringList & filepattern, int mode, bool recur prog->setTotalSteps(cnt); kdDebug() << "COUNT" << cnt << endl; - config = KGlobal::config(); + config = TDEGlobal::config(); slotClear(); QuarantineList.clear(); @@ -356,7 +356,7 @@ void ScanViewer::slotScan(const TQStringList & filepattern, int mode, bool recur TQString db; if(!( args->isSet( "scanthis" ) ) ) - db = kmain->freshklam->getCurrentDBDir(); + db = tdemain->freshklam->getCurrentDBDir(); else{ config->setGroup("Freshklam"); TQStringList lastDownloadPaths = config->readListEntry("lastDownloadPaths"); @@ -525,16 +525,16 @@ void ScanViewer::slotScan(const TQStringList & filepattern, int mode, bool recur *childproc << "'" + m_filepattern.join("' '") + "'"; -/* connect( childproc, SIGNAL(processExited(KProcess *)), +/* connect( childproc, SIGNAL(processExited(TDEProcess *)), SLOT(childExited()) ); - connect( childproc, SIGNAL(receivedStdout(KProcess *, char *, int)), - SLOT(receivedOutput(KProcess *, char *, int)) ); - childproc->start(KProcess::NotifyOnExit, KProcess::Stdout);*/ + connect( childproc, SIGNAL(receivedStdout(TDEProcess *, char *, int)), + SLOT(receivedOutput(TDEProcess *, char *, int)) ); + childproc->start(TDEProcess::NotifyOnExit, TDEProcess::Stdout);*/ connect( childproc, SIGNAL(readReady(KProcIO *)), SLOT(receivedOutput(KProcIO *)) ); childproc->start(KProcIO::NotifyOnExit); - connect( childproc, SIGNAL(processExited(KProcess *)), + connect( childproc, SIGNAL(processExited(TDEProcess *)), SLOT(childExited()) ); scanInProgress = TRUE; @@ -568,7 +568,7 @@ void ScanViewer::finish() scan_time->hide(); prog->hide(); progosd->hide(); - progosd->saveSettings(KGlobal::config()); + progosd->saveSettings(TDEGlobal::config()); status2_label->show(); multiScan = FALSE; @@ -594,10 +594,10 @@ void ScanViewer::slotCancel() void ScanViewer::resetSysTray() { - if (kmain->klamd->isKlamdAlive()) - kmain->_tray->setPixmap(KSystemTray::loadIcon("klamav_on_acc_enabled")); + if (tdemain->klamd->isKlamdAlive()) + tdemain->_tray->setPixmap(KSystemTray::loadIcon("klamav_on_acc_enabled")); else - kmain->_tray->setPixmap(KSystemTray::loadIcon("klamav_on_acc_disabled")); + tdemain->_tray->setPixmap(KSystemTray::loadIcon("klamav_on_acc_disabled")); } void ScanViewer::childExited() @@ -610,21 +610,21 @@ void ScanViewer::childExited() CollectionDB::instance()->insertEvent("Manual Scan",TQString("Scan Complete"),m_filepattern.join(" ")); if (status == 0){ - kmain->_tray->setPixmap(KSystemTray::loadIcon("klamav_scan_safe")); + tdemain->_tray->setPixmap(KSystemTray::loadIcon("klamav_scan_safe")); TQTimer::singleShot( 10000, this, SLOT(resetSysTray()) ); if (!(errorsEncountered)) - KNotifyClient::event(kmain->_tray->winId(),i18n( "ScanCompleteNoVirus" ), i18n( "Scan Complete - No Viruses Found!" )); + KNotifyClient::event(tdemain->_tray->winId(),i18n( "ScanCompleteNoVirus" ), i18n( "Scan Complete - No Viruses Found!" )); else - KNotifyClient::event(kmain->_tray->winId(),i18n( "ScanCompleteNoVirusButErrors" ), i18n( "Scan Complete - No Viruses Found But Some Errors Encountered!" )); + KNotifyClient::event(tdemain->_tray->winId(),i18n( "ScanCompleteNoVirusButErrors" ), i18n( "Scan Complete - No Viruses Found But Some Errors Encountered!" )); }else if(status == 1){ - kmain->_tray->setPixmap(KSystemTray::loadIcon("klamav_scan_found")); + tdemain->_tray->setPixmap(KSystemTray::loadIcon("klamav_scan_found")); switch (m_mode) { case 0: 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", TQString("Suspicious Items Not " + case 2 :KNotifyClient::event(tdemain->_tray->winId(),"ScanAccessDenied", TQString("Suspicious Items Not " "Quarantined!")); break; case 5 : Quarantine(); break; } @@ -709,7 +709,7 @@ void ScanViewer::Quarantine(){ config->setGroup("Kuarantine"); TQStringList lastQuarLocations = config->readListEntry("KuarantineLocations"); - kmain->_tray->setPixmap(KSystemTray::loadIcon("klamav_quarantining")); + tdemain->_tray->setPixmap(KSystemTray::loadIcon("klamav_quarantining")); TQString quarloc; for (TQStringList::Iterator it = lastQuarLocations.begin(); it == lastQuarLocations.begin() ; it++){ @@ -734,7 +734,7 @@ void ScanViewer::Quarantine(){ qname.prepend("/"); qname.prepend(quarloc); qname.append(":"+when); - if (KIO::NetAccess::file_move(fname,qname)){ + if (TDEIO::NetAccess::file_move(fname,qname)){ if (lastQuarItems.contains(item2)) lastQuarItems.remove(item2); lastQuarItems.prepend(item2); @@ -751,16 +751,16 @@ void ScanViewer::Quarantine(){ } } if (allQuarantined) { - if (kmain->klamd->isKlamdAlive()) - kmain->_tray->setPixmap(KSystemTray::loadIcon("klamav_on_acc_enabled")); + if (tdemain->klamd->isKlamdAlive()) + tdemain->_tray->setPixmap(KSystemTray::loadIcon("klamav_on_acc_enabled")); else - kmain->_tray->setPixmap(KSystemTray::loadIcon("klamav_on_acc_disabled")); + tdemain->_tray->setPixmap(KSystemTray::loadIcon("klamav_on_acc_disabled")); }else - kmain->_tray->setPixmap(KSystemTray::loadIcon("klamav_scan_found")); + tdemain->_tray->setPixmap(KSystemTray::loadIcon("klamav_scan_found")); config->writeEntry(TQString("Items %1").arg(quarloc), lastQuarItems); config->sync(); - //kmain->kuarantine->refresh(); + //tdemain->kuarantine->refresh(); @@ -777,25 +777,25 @@ void ScanViewer::slotRMB( TQListViewItem* Item, const TQPoint & point, int ) TQString iconPath = locate("cache", KMimeType::favIconForURL("http://www.viruspool.net")+".png"); if ( iconPath.isEmpty() ) - vicon = SmallIcon("find"); + vicon = SmallIcon("edit-find"); else vicon = TQPixmap( iconPath ); iconPath = locate("cache", KMimeType::favIconForURL("http://www.google.com")+".png"); if ( iconPath.isEmpty() ) - gicon = SmallIcon("find"); + gicon = SmallIcon("edit-find"); else gicon = TQPixmap( iconPath ); iconPath = locate("cache", KMimeType::favIconForURL("http://www.trendmicro.com")+".png"); if ( iconPath.isEmpty() ) - ticon = SmallIcon("find"); + ticon = SmallIcon("edit-find"); else ticon = TQPixmap( iconPath ); iconPath = locate("cache", KMimeType::favIconForURL("http://www.viruslist.com")+".png"); if ( iconPath.isEmpty() ) - vlicon = SmallIcon("find"); + vlicon = SmallIcon("edit-find"); else vlicon = TQPixmap( iconPath ); @@ -839,25 +839,25 @@ void ScanViewer::slotQuarantineSelected() void ScanViewer::slotGoogle() { TQString name = resultview->currentItem()->text(1); - kmain->klamdb->slotExternal(name, "Google"); + tdemain->klamdb->slotExternal(name, "Google"); } void ScanViewer::slotVirusPool() { TQString name = resultview->currentItem()->text(1); - kmain->klamdb->slotExternal(name, "VirusPool"); + tdemain->klamdb->slotExternal(name, "VirusPool"); } void ScanViewer::slotTrendMicro() { TQString name = resultview->currentItem()->text(1); - kmain->klamdb->slotExternal(name, "TrendMicro"); + tdemain->klamdb->slotExternal(name, "TrendMicro"); } void ScanViewer::slotVirusList() { TQString name = resultview->currentItem()->text(1); - kmain->klamdb->slotExternal(name, "VirusList"); + tdemain->klamdb->slotExternal(name, "VirusList"); } void ScanViewer::slotStartAgain() |