Fixed some TQString->const char * casts.

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
pull/24/head
Mavridis Philippe 4 years ago
parent 719d2f66db
commit c06676f232
No known key found for this signature in database
GPG Key ID: F8D2D7E2F989A494

@ -213,7 +213,7 @@ int KlamDB::listdb(const char *filename)
KTempFile* tn = new KTempFile(tf->name()); 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"); printf("!listdb(): Can't create temporary file \n");
delete tf; delete tf;
delete tn; delete tn;
@ -231,9 +231,9 @@ int KlamDB::listdb(const char *filename)
fflush(tmpd); fflush(tmpd);
fseek(tmpd, 0L, SEEK_SET); 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"); printf("!listdb(): Can't unpack CVD file.\n");
cli_rmdirs(tf->name()); cli_rmdirs(tf->name().ascii());
delete tf; delete tf;
delete tn; delete tn;
fclose(tmpd); fclose(tmpd);
@ -246,9 +246,9 @@ int KlamDB::listdb(const char *filename)
/* wrapper end */ /* wrapper end */
/* list extracted directory */ /* list extracted directory */
listdir(tf->name()); listdir(tf->name().ascii());
cli_rmdirs(tf->name()); cli_rmdirs(tf->name().ascii());
delete tf; delete tf;
return 0; return 0;
@ -697,7 +697,7 @@ void KlamDB::shouldIShow(TQWidget * current)
if ((current == this) && (!(loadinprogress))){ if ((current == this) && (!(loadinprogress))){
TQString db = tdemain->freshklam->getCurrentDBDir(); TQString db = tdemain->freshklam->getCurrentDBDir();
if (checkdir((const char *)db) == -1){ if (checkdir(db.ascii()) == -1){
kdDebug() << "returned -1" << endl; kdDebug() << "returned -1" << endl;
location = locate("data", "klamav/about/nodb.html"); location = locate("data", "klamav/about/nodb.html");
homepage->openURL(location); homepage->openURL(location);
@ -731,7 +731,7 @@ void KlamDB::shouldIShow(TQWidget * current)
// TQString db = tdemain->freshklam->getCurrentDBDir(); // TQString db = tdemain->freshklam->getCurrentDBDir();
listdir((const char *)db); listdir(db.ascii());
prog->setProgress (sigs); prog->setProgress (sigs);
@ -746,7 +746,7 @@ void KlamDB::shouldIShow(TQWidget * current)
memset(dbstat, 0, sizeof(struct cl_stat)); memset(dbstat, 0, sizeof(struct cl_stat));
cl_statinidir((const char *)db, dbstat); cl_statinidir(db.ascii(), dbstat);
loadinprogress = false; loadinprogress = false;
@ -800,7 +800,7 @@ unsigned int KlamDB::getSigNos()
return 0; 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); cl_engine_free(engine);
kdDebug() << "no of sigs" << no << endl; kdDebug() << "no of sigs" << no << endl;

@ -754,7 +754,7 @@ TQString Freshklam::getCurrentDBDir(){
if (dbdir != dir_combo->url()){ if (dbdir != dir_combo->url()){
/* load all available databases from default directory */ /* 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); //ret = cl_loaddbdir((const char *)dir_combo->url(), &root, &no);
////kdDebug() << "ret " << ret << endl; ////kdDebug() << "ret " << ret << endl;
if (no == 0){ if (no == 0){
@ -791,7 +791,7 @@ void Freshklam::createDBDir(){
if (!klamavqdir.exists() && !klamavqdir.mkdir(path)) if (!klamavqdir.exists() && !klamavqdir.mkdir(path))
ok = false; ok = false;
else else
chmod((const char *)path,0700); chmod(path.ascii(),0700);
} }
if (ok){ if (ok){

@ -232,7 +232,7 @@ void Klamav::updateTabState( int tabId, bool init ) {
} }
if( config->readBoolEntry(optionName, true) ) { if( config->readBoolEntry(optionName, true) ) {
tab->insertTab(tabWidget, i18n(tabName)); tab->insertTab(tabWidget, i18n( tabName.ascii() ));
tabWidget->show(); tabWidget->show();
if(!init) tab->setCurrentPage( tab->indexOf(tabWidget) ); if(!init) tab->setCurrentPage( tab->indexOf(tabWidget) );
@ -411,7 +411,7 @@ void Klamav::createDefaultKlamAVDir(TQString type){
if (!klamavqdir.exists() && !klamavqdir.mkdir(path)) if (!klamavqdir.exists() && !klamavqdir.mkdir(path))
ok = false; ok = false;
else else
chmod((const char *)path,0700); chmod(path.ascii(),0700);
} }
} }

@ -486,7 +486,7 @@ TQStringList Klamscan::pruneSelectedDirs(){
(*it) = (*it).stripWhiteSpace(); (*it) = (*it).stripWhiteSpace();
// replace block devices with mountpoints // replace block devices with mountpoints
lstat( (*it), &sb ); lstat( (*it).ascii(), &sb );
if ( (sb.st_mode & S_IFMT) == S_IFBLK ) { if ( (sb.st_mode & S_IFMT) == S_IFBLK ) {
// This is actually from directorylist.cpp // This is actually from directorylist.cpp
DCOPRef mediamanager("kded", "mediamanager"); DCOPRef mediamanager("kded", "mediamanager");

@ -545,7 +545,7 @@ void Kuarantine::createQuarDir(){
if (!klamavqdir.exists() && !klamavqdir.mkdir(path)) if (!klamavqdir.exists() && !klamavqdir.mkdir(path))
ok = false; ok = false;
else else
chmod((const char *)path,0700); chmod(path.ascii(),0700);
} }
if (ok){ if (ok){

@ -187,7 +187,7 @@ void ScanViewer::processOutput()
int fnameStartPoint = 0; int fnameStartPoint = 0;
int fnameEndPoint = item2.findRev(":"); int fnameEndPoint = item2.findRev(":");
TQString tmpFName = item2.mid(fnameStartPoint,(fnameEndPoint - fnameStartPoint)); TQString tmpFName = item2.mid(fnameStartPoint,(fnameEndPoint - fnameStartPoint));
tmpFName = i18n(tmpFName); tmpFName = i18n(tmpFName.ascii());
if ((pos = (item2.find(" FOUND"))) != -1){ if ((pos = (item2.find(" FOUND"))) != -1){
//if ((pos = buf.section('\n',j,j).find("FOUND")) != -1){ //if ((pos = buf.section('\n',j,j).find("FOUND")) != -1){
TQString tmpVirusName = item2.mid((fnameEndPoint+1),(item2.length() - (fnameEndPoint+1))); TQString tmpVirusName = item2.mid((fnameEndPoint+1),(item2.length() - (fnameEndPoint+1)));
@ -736,7 +736,7 @@ void ScanViewer::Quarantine(){
lastQuarItems.prepend(item2); lastQuarItems.prepend(item2);
(resultview->findItem(fname,0))->setText(2,"Quarantined"); (resultview->findItem(fname,0))->setText(2,"Quarantined");
(resultview->findItem(fname,0))->setPixmap( 0, SmallIcon("klamav") ); (resultview->findItem(fname,0))->setPixmap( 0, SmallIcon("klamav") );
chmod((const char *)qname,0400); chmod(qname.ascii(),0400);
CollectionDB::instance()->insertEvent("Quarantine",TQString("Quarantined"),fname); CollectionDB::instance()->insertEvent("Quarantine",TQString("Quarantined"),fname);
}else{ }else{

@ -393,7 +393,7 @@ TQString Schedule::createScanScript()
ts << "fi" << "\n"; ts << "fi" << "\n";
file.close(); 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(); return file.name();
}else }else
return TQString("Error"); return TQString("Error");
@ -459,7 +459,7 @@ TQString Schedule::createStartupScript()
ts << "Terminal=0" << "\n"; ts << "Terminal=0" << "\n";
file.close(); 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(); return file.name();
}else }else
return TQString("Error"); return TQString("Error");

Loading…
Cancel
Save