Rename KStandard for enhanced compatibility with KDE4

pull/1/head
Timothy Pearson 12 years ago
parent c4eeaf21da
commit f3abc0d1c6

@ -537,7 +537,7 @@ void KVpnc::slotSettings()
{ {
if ( !GlobalConfig->logfile.isOpen() ) if ( !GlobalConfig->logfile.isOpen() )
{ {
KStandardDirs * dirs = TDEGlobal::dirs(); TDEStandardDirs * dirs = TDEGlobal::dirs();
TQString logfileName = TQString ( dirs->saveLocation ( "data" ) ); TQString logfileName = TQString ( dirs->saveLocation ( "data" ) );
TQString logfilePath = TQString ( logfileName + "/kvpnc/kvpnc.log" ); TQString logfilePath = TQString ( logfileName + "/kvpnc/kvpnc.log" );
//KMessageBox::information( this, "info", logfileName ); //KMessageBox::information( this, "info", logfileName );
@ -2910,9 +2910,9 @@ void KVpnc::connectClicked()
// looking for setkey // looking for setkey
if ( GlobalConfig->useDefaultPaths ) if ( GlobalConfig->useDefaultPaths )
{ {
GlobalConfig->pathToSetkey = KStandardDirs::findExe ( "setkey", TQString() ); GlobalConfig->pathToSetkey = TDEStandardDirs::findExe ( "setkey", TQString() );
} }
else if ( GlobalConfig->pathToSetkey.isEmpty() || KStandardDirs::findExe ( GlobalConfig->pathToSetkey.section ( '/', -1, -1 ), GlobalConfig->pathToSetkey.section ( '/', 0, -2 ) ).isEmpty() ) else if ( GlobalConfig->pathToSetkey.isEmpty() || TDEStandardDirs::findExe ( GlobalConfig->pathToSetkey.section ( '/', -1, -1 ), GlobalConfig->pathToSetkey.section ( '/', 0, -2 ) ).isEmpty() )
{ {
KMessageBox::error ( this, i18n ( "Unable to find \"%1\" at \"%2\"!" ).arg ( "setkey" ).arg ( GlobalConfig->pathToSetkey ) ); KMessageBox::error ( this, i18n ( "Unable to find \"%1\" at \"%2\"!" ).arg ( "setkey" ).arg ( GlobalConfig->pathToSetkey ) );
GlobalConfig->appendLogEntry ( i18n ( "Unable to find \"%1\" at \"%2\"!" ).arg ( "setkey" ).arg ( GlobalConfig->pathToSetkey ), GlobalConfig->error ); GlobalConfig->appendLogEntry ( i18n ( "Unable to find \"%1\" at \"%2\"!" ).arg ( "setkey" ).arg ( GlobalConfig->pathToSetkey ), GlobalConfig->error );
@ -6217,7 +6217,7 @@ void KVpnc::connectClicked()
{ {
/* use cert on smartcard */ /* use cert on smartcard */
// Utils(GlobalConfig).getSmartcardInfo(); // Utils(GlobalConfig).getSmartcardInfo();
// if ( GlobalConfig->pathToPkcs11Tool.isEmpty() || KStandardDirs::findExe( GlobalConfig->pathToPkcs11Tool.section( '/', -1, -1 ), GlobalConfig->pathTopathToPkcs11Tool.section( '/', 0, -2 ) ).isEmpty() ) // if ( GlobalConfig->pathToPkcs11Tool.isEmpty() || TDEStandardDirs::findExe( GlobalConfig->pathToPkcs11Tool.section( '/', -1, -1 ), GlobalConfig->pathTopathToPkcs11Tool.section( '/', 0, -2 ) ).isEmpty() )
// { // {
// KMessageBox::error( this, i18n( "Unable to find \"%1\" at \"%2\"!" ).arg( "pkcs11-tool" ).arg( GlobalConfig->pathToPkcs11Tool) ); // KMessageBox::error( this, i18n( "Unable to find \"%1\" at \"%2\"!" ).arg( "pkcs11-tool" ).arg( GlobalConfig->pathToPkcs11Tool) );
// GlobalConfig->appendLogEntry( i18n( "Unable to find \"%1\" at \"%2\"!" ).arg( "pkcs11-tool" ).arg( GlobalConfig->pathToPkcs11Tool ), GlobalConfig->error ); // GlobalConfig->appendLogEntry( i18n( "Unable to find \"%1\" at \"%2\"!" ).arg( "pkcs11-tool" ).arg( GlobalConfig->pathToPkcs11Tool ), GlobalConfig->error );
@ -11131,10 +11131,10 @@ void KVpnc::helpClicked()
// // looking for vpnc // // looking for vpnc
// if ( GlobalConfig->useDefaultPaths ){ // if ( GlobalConfig->useDefaultPaths ){
// GlobalConfig->pathToVpnc= KStandardDirs::findExe("vpnc",TQString()); // GlobalConfig->pathToVpnc= TDEStandardDirs::findExe("vpnc",TQString());
// kdDebug() << "vpnc found at; " << GlobalConfig->pathToVpnc << endl; // kdDebug() << "vpnc found at; " << GlobalConfig->pathToVpnc << endl;
// } // }
// if ( GlobalConfig->pathToVpnc.isEmpty() || KStandardDirs::findExe( GlobalConfig->pathToVpnc.section('/',-1,-1),GlobalConfig->pathToVpnc.section('/',0,-2)).isEmpty()) // if ( GlobalConfig->pathToVpnc.isEmpty() || TDEStandardDirs::findExe( GlobalConfig->pathToVpnc.section('/',-1,-1),GlobalConfig->pathToVpnc.section('/',0,-2)).isEmpty())
// { // {
// kdDebug() << "vpnc not found!" << endl; // kdDebug() << "vpnc not found!" << endl;
// } // }
@ -22918,7 +22918,7 @@ void KVpnc::saveGuiOptions()
void KVpnc::startConnectionStatusCheck() void KVpnc::startConnectionStatusCheck()
{ {
KStandardDirs * dirs = TDEGlobal::dirs(); TDEStandardDirs * dirs = TDEGlobal::dirs();
TQString PingCheckScript = TQString ( dirs->findResource ( "data", "kvpnc/ping_check.sh" ) ); TQString PingCheckScript = TQString ( dirs->findResource ( "data", "kvpnc/ping_check.sh" ) );
//GlobalConfig->appendLogEntry( TQString("PingCheckScript : " +PingCheckScript), GlobalConfig->debug); //GlobalConfig->appendLogEntry( TQString("PingCheckScript : " +PingCheckScript), GlobalConfig->debug);
ConnectionStatusCheckProcess = new TQProcess ( this ); ConnectionStatusCheckProcess = new TQProcess ( this );

@ -165,7 +165,7 @@ KVpncConfig::KVpncConfig(TQWidget *parent,KStatusBar *statusbar)
SuccessLogColor=TQt::darkGreen; SuccessLogColor=TQt::darkGreen;
DebugLogColor=TQt::yellow; DebugLogColor=TQt::yellow;
KStandardDirs *dirs = TDEGlobal::dirs(); TDEStandardDirs *dirs = TDEGlobal::dirs();
logfileName = TQString(dirs->saveLocation( "data" )); logfileName = TQString(dirs->saveLocation( "data" ));
TQString logfilePath = TQString(logfileName + "/kvpnc/kvpnc.log"); TQString logfilePath = TQString(logfileName + "/kvpnc/kvpnc.log");
logfile.setName( logfilePath ); logfile.setName( logfilePath );
@ -193,7 +193,7 @@ void KVpncConfig::appendLogEntry( TQString msg, LogType type )
{ {
if ( !logfile.isOpen() ) if ( !logfile.isOpen() )
{ {
KStandardDirs * dirs = TDEGlobal::dirs(); TDEStandardDirs * dirs = TDEGlobal::dirs();
TQString logfileName = dirs->saveLocation( "data" ); TQString logfileName = dirs->saveLocation( "data" );
logfileName += "/kvpnc/kvpnc.log"; // /root.kde/share/apps/kvpnc.log logfileName += "/kvpnc/kvpnc.log"; // /root.kde/share/apps/kvpnc.log
// KMessageBox::information( this, logfileName, "info" ); // KMessageBox::information( this, logfileName, "info" );
@ -322,7 +322,7 @@ void KVpncConfig::saveOptions(bool saveOneProfile, TQString Profile)
{ {
if (saveOneProfile && Profile.isEmpty()) if (saveOneProfile && Profile.isEmpty())
return; return;
KStandardDirs * dirs = TDEGlobal::dirs(); TDEStandardDirs * dirs = TDEGlobal::dirs();
TQString filePath = dirs->findResource ( "config", "kvpncrc" ); TQString filePath = dirs->findResource ( "config", "kvpncrc" );
TQFile::remove TQFile::remove
( filePath ); ( filePath );
@ -1006,7 +1006,7 @@ void KVpncConfig::loadOptions()
if ( writeLogFile ) if ( writeLogFile )
if ( !logfile.isOpen() ) if ( !logfile.isOpen() )
{ {
KStandardDirs *dirs = TDEGlobal::dirs(); TDEStandardDirs *dirs = TDEGlobal::dirs();
TQDir AppFolder (TQString(dirs->saveLocation( "data" )+"/kvpnc")); TQDir AppFolder (TQString(dirs->saveLocation( "data" )+"/kvpnc"));
if (!AppFolder.exists()) if (!AppFolder.exists())
@ -1448,7 +1448,7 @@ void KVpncConfig::loadOptions()
if ( oldConfigurationFound ) if ( oldConfigurationFound )
{ {
// delete configuration file // delete configuration file
KStandardDirs * dirs = TDEGlobal::dirs(); TDEStandardDirs * dirs = TDEGlobal::dirs();
TQString filePath = dirs->findResource ( "config", "kvpncrc" ); TQString filePath = dirs->findResource ( "config", "kvpncrc" );
TQFile::remove TQFile::remove
( filePath ); ( filePath );
@ -4286,7 +4286,7 @@ TQString KVpncConfig::removeWhiteSpaceAtBegin(const TQString str)
void KVpncConfig::doBackupConfig() void KVpncConfig::doBackupConfig()
{ {
KStandardDirs * dirs = TDEGlobal::dirs(); TDEStandardDirs * dirs = TDEGlobal::dirs();
TQString config = TQString(dirs->saveLocation( "config" )+"/kvpncrc"); TQString config = TQString(dirs->saveLocation( "config" )+"/kvpncrc");
TQFile OriginalConfFile( config ); TQFile OriginalConfFile( config );
TQFile backupOriginalConfFile( config+".backup" ); TQFile backupOriginalConfFile( config+".backup" );
@ -4306,7 +4306,7 @@ void KVpncConfig::doBackupConfig()
void KVpncConfig::restoreBackupConfig() void KVpncConfig::restoreBackupConfig()
{ {
KStandardDirs * dirs = TDEGlobal::dirs(); TDEStandardDirs * dirs = TDEGlobal::dirs();
TQString config = TQString(dirs->saveLocation( "config" )+"/kvpncrc"); TQString config = TQString(dirs->saveLocation( "config" )+"/kvpncrc");
TQFile OriginalConfFile( config+".backup" ); TQFile OriginalConfFile( config+".backup" );
TQFile backupOriginalConfFile( config ); TQFile backupOriginalConfFile( config );
@ -4339,7 +4339,7 @@ void KVpncConfig::getToolsInfo()
void KVpncConfig::removeEntry(TQString Name) void KVpncConfig::removeEntry(TQString Name)
{ {
KStandardDirs * dirs = TDEGlobal::dirs(); TDEStandardDirs * dirs = TDEGlobal::dirs();
TQString filePath = dirs->findResource ( "config", "kvpncrc" ); TQString filePath = dirs->findResource ( "config", "kvpncrc" );
appPointer->processEvents(); appPointer->processEvents();

@ -77,7 +77,7 @@ void LogViewerDialog::accept()
void LogViewerDialog::parseLog() void LogViewerDialog::parseLog()
{ {
KStandardDirs *dirs = TDEGlobal::dirs(); TDEStandardDirs *dirs = TDEGlobal::dirs();
TQString logfileName = dirs->saveLocation( "data" ); TQString logfileName = dirs->saveLocation( "data" );
logfileName += "/kvpnc/kvpnc.log"; logfileName += "/kvpnc/kvpnc.log";
TQFile logfile; TQFile logfile;

Loading…
Cancel
Save