diff options
Diffstat (limited to 'src/freshklam.cpp')
-rw-r--r-- | src/freshklam.cpp | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/src/freshklam.cpp b/src/freshklam.cpp index 77bfe27..341564e 100644 --- a/src/freshklam.cpp +++ b/src/freshklam.cpp @@ -12,11 +12,11 @@ #include "config.h" #include "../config.h" -#include <klocale.h> -#include <kio/netaccess.h> +#include <tdelocale.h> +#include <tdeio/netaccess.h> -#include <kaction.h> +#include <tdeaction.h> #include <tqcheckbox.h> #include <kbuttonbox.h> @@ -24,16 +24,16 @@ #include <kurlcompletion.h> #include <kcombobox.h> #include <tqlayout.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <klineedit.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <ksystemtray.h> #include <ktar.h> #include <kprogress.h> #include <kprocio.h> #include <knotifyclient.h> #include <dom/html_misc.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <dcopclient.h> #include <kuser.h> @@ -88,17 +88,17 @@ Freshklam::Freshklam(TQWidget *parent, const char *name) - kmain->firstDownload = false; + tdemain->firstDownload = false; checkingDirectly = false; freshklamAlive = FALSE; - config = KGlobal::config(); + config = TDEGlobal::config(); config->setGroup("Freshklam"); lastDownloadPaths = config->readListEntry("lastDownloadPaths"); getCurrentVersionOfClamAV( ); - if ((lastDownloadPaths.isEmpty()) || (!(KIO::NetAccess::exists(TQString((*lastDownloadPaths.begin())),TRUE,NULL)))){ + if ((lastDownloadPaths.isEmpty()) || (!(TDEIO::NetAccess::exists(TQString((*lastDownloadPaths.begin())),TRUE,NULL)))){ createDBDir(); } TQString proxyIPText = config->readEntry("ProxyIP"); @@ -310,7 +310,7 @@ Freshklam::~Freshklam() killPID(); } if (!(tempFileName.isEmpty())) - KIO::NetAccess::del(tempFileName,NULL); + TDEIO::NetAccess::del(tempFileName,NULL); } @@ -346,20 +346,20 @@ void Freshklam::processOutput() if ((pos = item2.find("Database updated")) != -1){ CollectionDB::instance()->insertEvent("Updates","Database Updated",dir_combo->url()); - KNotifyClient::event(kmain->_tray->winId(),"UpdatedDatabase", "Virus Database Updated."); + KNotifyClient::event(tdemain->_tray->winId(),"UpdatedDatabase", "Virus Database Updated."); updateMailClient(); } if ((pos = item2.find("daily.cvd is up to date")) != -1){ CollectionDB::instance()->insertEvent("Updates","Database Already Up To Date",dir_combo->url()); - KNotifyClient::event(kmain->_tray->winId(),"DatabaseUpToDate", "Virus Database Up To Date."); + KNotifyClient::event(tdemain->_tray->winId(),"DatabaseUpToDate", "Virus Database Up To Date."); updateMailClient(); } if ((pos = item2.find("Recommended version:")) != -1){ - kmain->_tray->setPixmap(KSystemTray::loadIcon("klamav_update_required")); + tdemain->_tray->setPixmap(KSystemTray::loadIcon("klamav_update_required")); pos2 = item2.find('\n',pos); TQString version = item2.mid((pos+20),pos2 - (pos+20)).stripWhiteSpace(); @@ -374,7 +374,7 @@ void Freshklam::processOutput() updater->downloadComponent("clamav",version,"tar.gz"); } }else if (!(clamav_box->isChecked())) - KNotifyClient::event(kmain->_tray->winId(),"ClamAVOutDated", TQString("Your copy of ClamAV is out of date! Please Upgrade to ClamAV %1!").arg(version)); + KNotifyClient::event(tdemain->_tray->winId(),"ClamAVOutDated", TQString("Your copy of ClamAV is out of date! Please Upgrade to ClamAV %1!").arg(version)); } @@ -421,10 +421,10 @@ void Freshklam::slotSearch() freshklamAlive = TRUE; } - if (!(KApplication::kApplication()->isRestored())){ + if (!(TDEApplication::kApplication()->isRestored())){ - if (kmain->klamd->isKlamdAlive()){ - TQString klamdconf = kmain->klamd->getKlamdConfFile(); + if (tdemain->klamd->isKlamdAlive()){ + TQString klamdconf = tdemain->klamd->getKlamdConfFile(); ////kdDebug() << klamdconf << endl; command += " --daemon-notify="; command += klamdconf; @@ -442,20 +442,20 @@ void Freshklam::slotSearch() //kdDebug() << command << endl; - childproc->start(KProcess::NotifyOnExit, KProcess::Stdout); + childproc->start(TDEProcess::NotifyOnExit, TDEProcess::Stdout); - connect( childproc, SIGNAL(processExited(KProcess *)), + connect( childproc, SIGNAL(processExited(TDEProcess *)), SLOT(childExited()) ); - connect( childproc, SIGNAL(receivedStdout(KProcess *, char *, int)), - SLOT(receivedOutput(KProcess *, char *, int)) ); + connect( childproc, SIGNAL(receivedStdout(TDEProcess *, char *, int)), + SLOT(receivedOutput(TDEProcess *, char *, int)) ); -// if (kmain->klamd->isKlamdAlive()) -// kmain->_tray->setPixmap(KSystemTray::loadIcon("klamavdl")); +// if (tdemain->klamd->isKlamdAlive()) +// tdemain->_tray->setPixmap(KSystemTray::loadIcon("klamavdl")); // else -// kmain->_tray->setPixmap(KSystemTray::loadIcon("klamavbwdl")); +// tdemain->_tray->setPixmap(KSystemTray::loadIcon("klamavbwdl")); - kmain->EnableFreshklam->setEnabled(FALSE); - kmain->DisableFreshklam->setEnabled(TRUE); + tdemain->EnableFreshklam->setEnabled(FALSE); + tdemain->DisableFreshklam->setEnabled(TRUE); } @@ -465,10 +465,10 @@ void Freshklam::finish() cancel_button->setEnabled(false); enableInputs(); - 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")); buf += '\n'; processOutput(); @@ -476,10 +476,10 @@ void Freshklam::finish() childproc = 0; freshklamAlive = FALSE; if (!(tempFileName.isEmpty())) - KIO::NetAccess::del(tempFileName,NULL); + TDEIO::NetAccess::del(tempFileName,NULL); - kmain->EnableFreshklam->setEnabled(TRUE); - kmain->DisableFreshklam->setEnabled(FALSE); + tdemain->EnableFreshklam->setEnabled(TRUE); + tdemain->DisableFreshklam->setEnabled(FALSE); //updateMetaDB(); @@ -530,8 +530,8 @@ void Freshklam::childExited() int status = childproc->exitStatus(); /* int winid = 0; - if (KApplication::kApplication()->mainWidget()) { - winid = KApplication::kApplication()->mainWidget()->winId(); + if (TDEApplication::kApplication()->mainWidget()) { + winid = TDEApplication::kApplication()->mainWidget()->winId(); }*/ finish(); @@ -616,7 +616,7 @@ void Freshklam::updateMailClient() config->sync(); - KConfig* mailconfig = new KConfig("kmailrc"); + TDEConfig* mailconfig = new TDEConfig("kmailrc"); mailconfig->setGroup("General"); TQVariant nooffilters = mailconfig->readEntry("filters"); @@ -654,7 +654,7 @@ void Freshklam::updateMailClient() delete mailconfig; } -void Freshklam::receivedOutput(KProcess */*proc*/, char *buffer, int buflen) +void Freshklam::receivedOutput(TDEProcess */*proc*/, char *buffer, int buflen) { //kdDebug() << buffer << endl; buf += TQCString(buffer, buflen+1); @@ -749,7 +749,7 @@ void Freshklam::initCheckBoxes(){ void Freshklam::handleChecks(){ - config = KGlobal::config(); + config = TDEGlobal::config(); config->setGroup("Freshklam"); if (daemon_box->isChecked()){ config->writeEntry("AutoUpdate","Yes"); @@ -792,7 +792,7 @@ bool Freshklam::killPID(){ else return false; if (!(pidFileName.isEmpty())) - KIO::NetAccess::del(pidFileName,NULL); + TDEIO::NetAccess::del(pidFileName,NULL); return true; } @@ -830,7 +830,7 @@ TQString Freshklam::getCurrentDBDir(){ TQString dbdir; TQString db; - config = KGlobal::config(); + config = TDEGlobal::config(); config->setGroup("Freshklam"); lastDownloadPaths = config->readListEntry("lastDownloadPaths"); for (TQStringList::Iterator ita = lastDownloadPaths.begin(); ita == lastDownloadPaths.begin() ; ita++){ @@ -886,7 +886,7 @@ void Freshklam::createDBDir(){ if (ok){ lastDownloadPaths.prepend( TQString("%1").arg(path)); - config = KGlobal::config(); + config = TDEGlobal::config(); config->setGroup("Freshklam"); config->writeEntry("lastDownloadPaths", lastDownloadPaths); config->sync(); @@ -901,7 +901,7 @@ void Freshklam::createDBDir(){ switch (result) { case 2 : KMessageBox::information (this,i18n( "You should update the database manually at your earliest convenience.") ); break; case 5 : - kmain->firstDownload = true; + tdemain->firstDownload = true; break; } @@ -920,7 +920,7 @@ bool Freshklam::isFreshklamAlive(){ void Freshklam::enableAutoUpdates() { - config = KGlobal::config(); + config = TDEGlobal::config(); config->writeEntry("AutoUpdate","Yes"); config->sync(); daemon_box->setChecked(true); @@ -992,7 +992,7 @@ Freshklam::getCurrentVersionOfClamAV( ) connect( versionproc, SIGNAL(readReady(KProcIO *)), SLOT(readVersionLine(KProcIO *)) ); - connect( versionproc, SIGNAL(processExited(KProcess *)), + connect( versionproc, SIGNAL(processExited(TDEProcess *)), SLOT(versionExited()) ); versionproc->start(KProcIO::NotifyOnExit); |