diff options
author | Mavridis Philippe <[email protected]> | 2021-01-25 15:34:56 +0200 |
---|---|---|
committer | Mavridis Philippe <[email protected]> | 2021-01-25 15:34:56 +0200 |
commit | c06676f232466dcc7917299b75f5296ff830b01c (patch) | |
tree | aacf02557175b245b1b68bbc8accda67cda586b3 /src | |
parent | 719d2f66dbdf7a70b084529acc888269a1743c1b (diff) | |
download | klamav-c06676f232466dcc7917299b75f5296ff830b01c.tar.gz klamav-c06676f232466dcc7917299b75f5296ff830b01c.zip |
Fixed some TQString->const char * casts.
Signed-off-by: Mavridis Philippe <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/dbviewer.cpp | 18 | ||||
-rw-r--r-- | src/freshklam.cpp | 4 | ||||
-rw-r--r-- | src/klamav.cpp | 4 | ||||
-rw-r--r-- | src/klamscan.cpp | 2 | ||||
-rw-r--r-- | src/kuarantine.cpp | 2 | ||||
-rw-r--r-- | src/scanviewer.cpp | 4 | ||||
-rw-r--r-- | src/schedule.cpp | 4 |
7 files changed, 19 insertions, 19 deletions
diff --git a/src/dbviewer.cpp b/src/dbviewer.cpp index c61f2d4..e4e9525 100644 --- a/src/dbviewer.cpp +++ b/src/dbviewer.cpp @@ -213,7 +213,7 @@ int KlamDB::listdb(const char *filename) KTempFile* tn = new KTempFile(tf->name()); - if((tmpd = fopen(tn->name(), "wb+")) == NULL) { + if((tmpd = fopen(tn->name().ascii(), "wb+")) == NULL) { printf("!listdb(): Can't create temporary file \n"); delete tf; delete tn; @@ -231,9 +231,9 @@ int KlamDB::listdb(const char *filename) fflush(tmpd); fseek(tmpd, 0L, SEEK_SET); - if(cli_untgz(fileno(tmpd), tf->name())) { + if(cli_untgz(fileno(tmpd), tf->name().ascii())) { printf("!listdb(): Can't unpack CVD file.\n"); - cli_rmdirs(tf->name()); + cli_rmdirs(tf->name().ascii()); delete tf; delete tn; fclose(tmpd); @@ -246,9 +246,9 @@ int KlamDB::listdb(const char *filename) /* wrapper end */ /* list extracted directory */ - listdir(tf->name()); + listdir(tf->name().ascii()); - cli_rmdirs(tf->name()); + cli_rmdirs(tf->name().ascii()); delete tf; return 0; @@ -697,7 +697,7 @@ void KlamDB::shouldIShow(TQWidget * current) if ((current == this) && (!(loadinprogress))){ TQString db = tdemain->freshklam->getCurrentDBDir(); - if (checkdir((const char *)db) == -1){ + if (checkdir(db.ascii()) == -1){ kdDebug() << "returned -1" << endl; location = locate("data", "klamav/about/nodb.html"); homepage->openURL(location); @@ -731,7 +731,7 @@ void KlamDB::shouldIShow(TQWidget * current) // TQString db = tdemain->freshklam->getCurrentDBDir(); - listdir((const char *)db); + listdir(db.ascii()); prog->setProgress (sigs); @@ -746,7 +746,7 @@ void KlamDB::shouldIShow(TQWidget * current) memset(dbstat, 0, sizeof(struct cl_stat)); - cl_statinidir((const char *)db, dbstat); + cl_statinidir(db.ascii(), dbstat); loadinprogress = false; @@ -800,7 +800,7 @@ unsigned int KlamDB::getSigNos() return 0; } - ret = cl_load((const char *)dbdir, engine, &no, CL_DB_STDOPT); + ret = cl_load(dbdir.ascii(), engine, &no, CL_DB_STDOPT); cl_engine_free(engine); kdDebug() << "no of sigs" << no << endl; diff --git a/src/freshklam.cpp b/src/freshklam.cpp index 62e4791..18fc5cd 100644 --- a/src/freshklam.cpp +++ b/src/freshklam.cpp @@ -754,7 +754,7 @@ TQString Freshklam::getCurrentDBDir(){ if (dbdir != dir_combo->url()){ /* load all available databases from default directory */ - ret = cl_load((const char *)dir_combo->url(), engine, &no, CL_DB_STDOPT); + ret = cl_load(dir_combo->url().ascii(), engine, &no, CL_DB_STDOPT); //ret = cl_loaddbdir((const char *)dir_combo->url(), &root, &no); ////kdDebug() << "ret " << ret << endl; if (no == 0){ @@ -791,7 +791,7 @@ void Freshklam::createDBDir(){ if (!klamavqdir.exists() && !klamavqdir.mkdir(path)) ok = false; else - chmod((const char *)path,0700); + chmod(path.ascii(),0700); } if (ok){ diff --git a/src/klamav.cpp b/src/klamav.cpp index 7499a9b..df62cef 100644 --- a/src/klamav.cpp +++ b/src/klamav.cpp @@ -232,7 +232,7 @@ void Klamav::updateTabState( int tabId, bool init ) { } if( config->readBoolEntry(optionName, true) ) { - tab->insertTab(tabWidget, i18n(tabName)); + tab->insertTab(tabWidget, i18n( tabName.ascii() )); tabWidget->show(); if(!init) tab->setCurrentPage( tab->indexOf(tabWidget) ); @@ -411,7 +411,7 @@ void Klamav::createDefaultKlamAVDir(TQString type){ if (!klamavqdir.exists() && !klamavqdir.mkdir(path)) ok = false; else - chmod((const char *)path,0700); + chmod(path.ascii(),0700); } } diff --git a/src/klamscan.cpp b/src/klamscan.cpp index 0015088..784398f 100644 --- a/src/klamscan.cpp +++ b/src/klamscan.cpp @@ -486,7 +486,7 @@ TQStringList Klamscan::pruneSelectedDirs(){ (*it) = (*it).stripWhiteSpace(); // replace block devices with mountpoints - lstat( (*it), &sb ); + lstat( (*it).ascii(), &sb ); if ( (sb.st_mode & S_IFMT) == S_IFBLK ) { // This is actually from directorylist.cpp DCOPRef mediamanager("kded", "mediamanager"); diff --git a/src/kuarantine.cpp b/src/kuarantine.cpp index b25db2c..ac25608 100644 --- a/src/kuarantine.cpp +++ b/src/kuarantine.cpp @@ -545,7 +545,7 @@ void Kuarantine::createQuarDir(){ if (!klamavqdir.exists() && !klamavqdir.mkdir(path)) ok = false; else - chmod((const char *)path,0700); + chmod(path.ascii(),0700); } if (ok){ diff --git a/src/scanviewer.cpp b/src/scanviewer.cpp index bf00eca..3766a0d 100644 --- a/src/scanviewer.cpp +++ b/src/scanviewer.cpp @@ -187,7 +187,7 @@ void ScanViewer::processOutput() int fnameStartPoint = 0; int fnameEndPoint = item2.findRev(":"); TQString tmpFName = item2.mid(fnameStartPoint,(fnameEndPoint - fnameStartPoint)); - tmpFName = i18n(tmpFName); + tmpFName = i18n(tmpFName.ascii()); if ((pos = (item2.find(" FOUND"))) != -1){ //if ((pos = buf.section('\n',j,j).find("FOUND")) != -1){ TQString tmpVirusName = item2.mid((fnameEndPoint+1),(item2.length() - (fnameEndPoint+1))); @@ -736,7 +736,7 @@ void ScanViewer::Quarantine(){ lastQuarItems.prepend(item2); (resultview->findItem(fname,0))->setText(2,"Quarantined"); (resultview->findItem(fname,0))->setPixmap( 0, SmallIcon("klamav") ); - chmod((const char *)qname,0400); + chmod(qname.ascii(),0400); CollectionDB::instance()->insertEvent("Quarantine",TQString("Quarantined"),fname); }else{ diff --git a/src/schedule.cpp b/src/schedule.cpp index 5beed95..580d16f 100644 --- a/src/schedule.cpp +++ b/src/schedule.cpp @@ -393,7 +393,7 @@ TQString Schedule::createScanScript() ts << "fi" << "\n"; file.close(); - chmod((const char *)file.name(), S_IWUSR | S_IRUSR | S_IEXEC ); + chmod(file.name().ascii(), S_IWUSR | S_IRUSR | S_IEXEC ); return file.name(); }else return TQString("Error"); @@ -459,7 +459,7 @@ TQString Schedule::createStartupScript() ts << "Terminal=0" << "\n"; file.close(); - chmod((const char *)file.name(), S_IWUSR | S_IRUSR | S_IEXEC ); + chmod(file.name().ascii(), S_IWUSR | S_IRUSR | S_IEXEC ); return file.name(); }else return TQString("Error"); |