diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-06 14:15:01 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-06 14:15:01 -0600 |
commit | 1b89319fd93b88313cab40f1e9de24c067b04efb (patch) | |
tree | 80132996de993c3dcab4040864d7729842875b2d /src/kvpncconfig.cpp | |
parent | d08a0ede1d2cb15bb14b0ff75eacf5c682b1fa0a (diff) | |
download | kvpnc-1b89319fd93b88313cab40f1e9de24c067b04efb.tar.gz kvpnc-1b89319fd93b88313cab40f1e9de24c067b04efb.zip |
Initial TQt conversion
Diffstat (limited to 'src/kvpncconfig.cpp')
-rw-r--r-- | src/kvpncconfig.cpp | 818 |
1 files changed, 409 insertions, 409 deletions
diff --git a/src/kvpncconfig.cpp b/src/kvpncconfig.cpp index b232d86..802a070 100644 --- a/src/kvpncconfig.cpp +++ b/src/kvpncconfig.cpp @@ -28,12 +28,12 @@ #include <klocale.h> #include <iostream> #include <kstandarddirs.h> -#include <qdom.h> -#include <qdir.h> -#include <qlistview.h> -#include <qcheckbox.h> -#include <qcursor.h> -#include <qregexp.h> +#include <tqdom.h> +#include <tqdir.h> +#include <tqlistview.h> +#include <tqcheckbox.h> +#include <tqcursor.h> +#include <tqregexp.h> #include <kpushbutton.h> #include <klistview.h> #include <kurl.h> @@ -41,7 +41,7 @@ #include <klineedit.h> //END INCLUDES -KVpncConfig::KVpncConfig(QWidget *parent,KStatusBar *statusbar) +KVpncConfig::KVpncConfig(TQWidget *parent,KStatusBar *statusbar) { this->parent = parent; this->statusbar = statusbar; @@ -154,20 +154,20 @@ KVpncConfig::KVpncConfig(QWidget *parent,KStatusBar *statusbar) DebugBackgroundcolor=black; - ToolList = new QPtrList<ToolInfo>(); + ToolList = new TQPtrList<ToolInfo>(); ToolList->setAutoDelete( TRUE ); - AccountList = new QPtrList<VpnAccountData>(); + AccountList = new TQPtrList<VpnAccountData>(); AccountList->setAutoDelete( TRUE ); // the list owns the objects - InfoLogColor=Qt::black; - ErrorLogColor=Qt::red; - SuccessLogColor=Qt::darkGreen; - DebugLogColor=Qt::yellow; + InfoLogColor=TQt::black; + ErrorLogColor=TQt::red; + SuccessLogColor=TQt::darkGreen; + DebugLogColor=TQt::yellow; KStandardDirs *dirs = KGlobal::dirs(); - logfileName = QString(dirs->saveLocation( "data" )); - QString logfilePath = QString(logfileName + "/kvpnc/kvpnc.log"); + logfileName = TQString(dirs->saveLocation( "data" )); + TQString logfilePath = TQString(logfileName + "/kvpnc/kvpnc.log"); logfile.setName( logfilePath ); logFileStream.setDevice( &logfile ); @@ -180,12 +180,12 @@ KVpncConfig::~KVpncConfig() delete ToolList; } -void KVpncConfig::setLogOutput(QTextEdit *LogOutput) +void KVpncConfig::setLogOutput(TQTextEdit *LogOutput) { this->LogOutput = LogOutput; } -void KVpncConfig::appendLogEntry( QString msg, LogType type ) +void KVpncConfig::appendLogEntry( TQString msg, LogType type ) { // write to logfile @@ -194,7 +194,7 @@ void KVpncConfig::appendLogEntry( QString msg, LogType type ) if ( !logfile.isOpen() ) { KStandardDirs * dirs = KGlobal::dirs(); - QString logfileName = dirs->saveLocation( "data" ); + TQString logfileName = dirs->saveLocation( "data" ); logfileName += "/kvpnc/kvpnc.log"; // /root.kde/share/apps/kvpnc.log // KMessageBox::information( this, logfileName, "info" ); logfile.setName( logfileName ); @@ -202,18 +202,18 @@ void KVpncConfig::appendLogEntry( QString msg, LogType type ) KMessageBox::error( 0, i18n( "Log file can not be opened!" ) ); else { - // QTextStream s( &logfile ); + // TQTextStream s( &logfile ); logFileStream << i18n( "Log session started at: " ); - logFileStream << QDateTime::currentDateTime().toString( Qt::TextDate ); + logFileStream << TQDateTime::tqcurrentDateTime().toString( Qt::TextDate ); logFileStream << "\n"; logfile.flush(); } } else { - QString date = QDate().currentDate().toString(Qt::ISODate)+ " "; - QString time = QTime().currentTime().toString(Qt::ISODate)+ " "; - QString prefix=""; + TQString date = TQDate().tqcurrentDate().toString(Qt::ISODate)+ " "; + TQString time = TQTime().currentTime().toString(Qt::ISODate)+ " "; + TQString prefix=""; switch ( type ) { case info: @@ -240,11 +240,11 @@ void KVpncConfig::appendLogEntry( QString msg, LogType type ) } // write into debug console - QString prefix=""; - QString postfix=""; + TQString prefix=""; + TQString postfix=""; // font size - prefix+="<font size=\""+QString().setNum(LogViewerFontSize)+"\">"; + prefix+="<font size=\""+TQString().setNum(LogViewerFontSize)+"\">"; postfix+="<\\font>"; if (useColorizedLogOutput) @@ -304,7 +304,7 @@ void KVpncConfig::appendLogEntry( QString msg, LogType type ) // appPointer->processEvents(); } -void KVpncConfig::slotStatusMsg( const QString &text, int id ) +void KVpncConfig::slotStatusMsg( const TQString &text, int id ) { if ( id != ID_FLASH_MSG ) { @@ -318,13 +318,13 @@ void KVpncConfig::slotStatusMsg( const QString &text, int id ) } -void KVpncConfig::saveOptions(bool saveOneProfile, QString Profile) +void KVpncConfig::saveOptions(bool saveOneProfile, TQString Profile) { if (saveOneProfile && Profile.isEmpty()) return; KStandardDirs * dirs = KGlobal::dirs(); - QString filePath = dirs->findResource ( "config", "kvpncrc" ); - QFile::remove + TQString filePath = dirs->findResource ( "config", "kvpncrc" ); + TQFile::remove ( filePath ); config->setGroup( "Notification Messages" ); @@ -453,13 +453,13 @@ void KVpncConfig::saveOptions(bool saveOneProfile, QString Profile) appendLogEntry(i18n( "Wallet disabled or not available, writing to config file." ),debug); } - QPtrList<VpnAccountData> *TmpAccountList; + TQPtrList<VpnAccountData> *TmpAccountList; if (!saveOneProfile) TmpAccountList = AccountList; else { - TmpAccountList = new QPtrList<VpnAccountData>(); + TmpAccountList = new TQPtrList<VpnAccountData>(); TmpAccountList->setAutoDelete( TRUE ); // the list owns the objects VpnAccountData *ProfileData; @@ -480,8 +480,8 @@ void KVpncConfig::saveOptions(bool saveOneProfile, QString Profile) if ( !it->getName().isEmpty() ) { - QString name = it->getName(); - QString ProfileName = "Profile_"; + TQString name = it->getName(); + TQString ProfileName = "Profile_"; ProfileName += name; config->setGroup( ProfileName ); @@ -496,7 +496,7 @@ void KVpncConfig::saveOptions(bool saveOneProfile, QString Profile) appendLogEntry(i18n( "Wallet enabled and available, writing to wallet." ),debug); if (wallet != 0) { - QString walletname="kvpnc"; + TQString walletname="kvpnc"; // Check if folder exists, otherwise create it bool walletOK=true; if (!wallet->hasFolder(walletname)) @@ -512,22 +512,22 @@ void KVpncConfig::saveOptions(bool saveOneProfile, QString Profile) //std::cout << "[set] account: " << ProfileName << ", loginname: " << loginname << ", password: " << pwd << std::endl; bool UserPasswordOK=true; if ( it->getSaveUserPassword() ) - UserPasswordOK = (wallet->writePassword (QString(name+"__user_pw"), it->getUserPassword()) == 0); + UserPasswordOK = (wallet->writePassword (TQString(name+"__user_pw"), it->getUserPassword()) == 0); else - UserPasswordOK = (wallet->writePassword (QString(name+"__user_pw"), "") == 0); + UserPasswordOK = (wallet->writePassword (TQString(name+"__user_pw"), "") == 0); // wallet->sync(); // appPointer->processEvents(); bool PskOK=true; if ( it->getSavePsk() ) - PskOK = (wallet->writePassword (QString(name+"__psk"), it->getPreSharedKey()) == 0); + PskOK = (wallet->writePassword (TQString(name+"__psk"), it->getPreSharedKey()) == 0); else - PskOK = (wallet->writePassword (QString(name+"__psk"), "") == 0); + PskOK = (wallet->writePassword (TQString(name+"__psk"), "") == 0); // wallet->sync(); // appPointer->processEvents(); - bool PskKeyPassOK = (wallet->writePassword (QString(name+"__priv_key_pwd"), it->getPrivateKeyPass()) == 0); + bool PskKeyPassOK = (wallet->writePassword (TQString(name+"__priv_key_pwd"), it->getPrivateKeyPass()) == 0); // // wallet->sync(); // appPointer->processEvents(); @@ -536,66 +536,66 @@ void KVpncConfig::saveOptions(bool saveOneProfile, QString Profile) { if (UserPasswordOK) if (KvpncDebugLevel > 2) - appendLogEntry(i18n( "write of %1 was ok." ).arg(i18n("user password")), debug); + appendLogEntry(i18n( "write of %1 was ok." ).tqarg(i18n("user password")), debug); else { // if ( KMessageBox::warningContinueCancel( 0, // i18n( "KVpnc is unable to save %1 password securely in your wallet.<br>" - // "Do you want to save the password in the <b>unsafe</b> configuration file instead?" ).arg(i18n("user password")), - // i18n( "Unable to store secure %1" ).arg(i18n("user password")), - // KGuiItem( i18n( "Store &Unsafe" ), QString::fromLatin1( "unlock" ),QString::fromLatin1( "KWalletFallbackToKConfig" ) ) ) == KMessageBox::Continue ) + // "Do you want to save the password in the <b>unsafe</b> configuration file instead?" ).tqarg(i18n("user password")), + // i18n( "Unable to store secure %1" ).tqarg(i18n("user password")), + // KGuiItem( i18n( "Store &Unsafe" ), TQString::tqfromLatin1( "unlock" ),TQString::tqfromLatin1( "KWalletFallbackToKConfig" ) ) ) == KMessageBox::Continue ) // { // config->writeEntry( "User password", it->getUserPassword() ); // } - appendLogEntry(i18n( "write of %1 has failed." ).arg(i18n("user password")), error); + appendLogEntry(i18n( "write of %1 has failed." ).tqarg(i18n("user password")), error); } if (PskOK) if (KvpncDebugLevel > 2) - appendLogEntry(i18n( "write of %1 was successful." ).arg(i18n("preshared key")), debug); + appendLogEntry(i18n( "write of %1 was successful." ).tqarg(i18n("preshared key")), debug); else { // if ( KMessageBox::warningContinueCancel( 0, // i18n( "KVpnc is unable to save %1 password securely in your wallet.<br>" - // "Do you want to save the password in the <b>unsafe</b> configuration file instead?" ).arg(i18n("pre shared key")), - // i18n( "Unable to store secure %1" ).arg(i18n("pre shared key")), - // KGuiItem( i18n( "Store &Unsafe" ), QString::fromLatin1( "unlock" ),QString::fromLatin1( "KWalletFallbackToKConfig" ) ) ) == KMessageBox::Continue ) + // "Do you want to save the password in the <b>unsafe</b> configuration file instead?" ).tqarg(i18n("pre shared key")), + // i18n( "Unable to store secure %1" ).tqarg(i18n("pre shared key")), + // KGuiItem( i18n( "Store &Unsafe" ), TQString::tqfromLatin1( "unlock" ),TQString::tqfromLatin1( "KWalletFallbackToKConfig" ) ) ) == KMessageBox::Continue ) // { // config->writeEntry( "Pre shared key", it->getPreSharedKey() ); // } - appendLogEntry(i18n( "write of %1 has failed." ).arg(i18n("preshared key")),error); + appendLogEntry(i18n( "write of %1 has failed." ).tqarg(i18n("preshared key")),error); } if (PskOK) if (KvpncDebugLevel > 2) - appendLogEntry(i18n( "write of %1 was successful." ).arg(i18n("preshared key")), debug); + appendLogEntry(i18n( "write of %1 was successful." ).tqarg(i18n("preshared key")), debug); else { // if ( KMessageBox::warningContinueCancel( 0, // i18n( "KVpnc is unable to save %1 password securely in your wallet.<br>" - // "Do you want to save the password in the <b>unsafe</b> configuration file instead?" ).arg(i18n("preshared key password")), - // i18n( "Unable to store secure %1" ).arg(i18n("reshared key password")), - // KGuiItem( i18n( "Store &Unsafe" ), QString::fromLatin1( "unlock" ),QString::fromLatin1( "KWalletFallbackToKConfig" ) ) ) == KMessageBox::Continue ) + // "Do you want to save the password in the <b>unsafe</b> configuration file instead?" ).tqarg(i18n("preshared key password")), + // i18n( "Unable to store secure %1" ).tqarg(i18n("reshared key password")), + // KGuiItem( i18n( "Store &Unsafe" ), TQString::tqfromLatin1( "unlock" ),TQString::tqfromLatin1( "KWalletFallbackToKConfig" ) ) ) == KMessageBox::Continue ) // { // config->writeEntry( "Pre shared key", it->getPreSharedKey() ); // } - appendLogEntry(i18n( "write of %1 has failed." ).arg(i18n("preshared key")),error); + appendLogEntry(i18n( "write of %1 has failed." ).tqarg(i18n("preshared key")),error); } if (PskKeyPassOK) if (KvpncDebugLevel > 2) - appendLogEntry(i18n( "write of %1 was successful." ).arg(i18n("preshared key password")), debug); + appendLogEntry(i18n( "write of %1 was successful." ).tqarg(i18n("preshared key password")), debug); else { // if ( KMessageBox::warningContinueCancel( 0, // i18n( "KVpnc is unable to save %1 password securely in your wallet.<br>" - // "Do you want to save the password in the <b>unsafe</b> configuration file instead?" ).arg(i18n("preshared key password")), - // i18n( "Unable to store secure %1" ).arg(i18n("reshared key password")), - // KGuiItem( i18n( "Store &Unsafe" ), QString::fromLatin1( "unlock" ),QString::fromLatin1( "KWalletFallbackToKConfig" ) ) ) == KMessageBox::Continue ) + // "Do you want to save the password in the <b>unsafe</b> configuration file instead?" ).tqarg(i18n("preshared key password")), + // i18n( "Unable to store secure %1" ).tqarg(i18n("reshared key password")), + // KGuiItem( i18n( "Store &Unsafe" ), TQString::tqfromLatin1( "unlock" ),TQString::tqfromLatin1( "KWalletFallbackToKConfig" ) ) ) == KMessageBox::Continue ) // { // config->writeEntry( "Pre shared key", it->getPreSharedKey() ); // } - appendLogEntry(i18n( "write of %1 has failed." ).arg(i18n("preshared key password")),error); + appendLogEntry(i18n( "write of %1 has failed." ).tqarg(i18n("preshared key password")),error); } //std::cout << "success: " << pwdOK << std::endl; } @@ -637,7 +637,7 @@ void KVpncConfig::saveOptions(bool saveOneProfile, QString Profile) // appPointer->processEvents(); -// KMessageBox::information(0,"connection type changed: "+QString().setNum(it->getConnectionType())+QString(" ")+it->getName(),QString("type set")); +// KMessageBox::information(0,"connection type changed: "+TQString().setNum(it->getConnectionType())+TQString(" ")+it->getName(),TQString("type set")); // normal config if ( it->getConnectionType() == VpnAccountData::cisco ) @@ -867,11 +867,11 @@ void KVpncConfig::saveOptions(bool saveOneProfile, QString Profile) // appPointer->processEvents(); - QString AdditionalNetworkRoutesString; - QStringList AdditionalNetworkRoutes = it->getAdditionalNetworkRoutes(); + TQString AdditionalNetworkRoutesString; + TQStringList AdditionalNetworkRoutes = it->getAdditionalNetworkRoutes(); // Networks delimited by a ',' - for ( QStringList::Iterator it2 = AdditionalNetworkRoutes.begin(); it2 != AdditionalNetworkRoutes.end(); ++it2 ) + for ( TQStringList::Iterator it2 = AdditionalNetworkRoutes.begin(); it2 != AdditionalNetworkRoutes.end(); ++it2 ) { AdditionalNetworkRoutesString+=*it2; AdditionalNetworkRoutesString+=","; @@ -881,9 +881,9 @@ void KVpncConfig::saveOptions(bool saveOneProfile, QString Profile) // wallet->sync(); /* give info */ -// slotStatusMsg ( i18n( "Profile \"%1\" saved." ).arg( ProfileName.remove("Profile_") ), ID_FLASH_MSG ); +// slotStatusMsg ( i18n( "Profile \"%1\" saved." ).tqarg( ProfileName.remove("Profile_") ), ID_FLASH_MSG ); - appendLogEntry ( i18n( "Profile \"%1\" saved." ).arg( ProfileName.remove("Profile_") ) , info); + appendLogEntry ( i18n( "Profile \"%1\" saved." ).tqarg( ProfileName.remove("Profile_") ) , info); // appPointer->processEvents(); } appPointer->processEvents(); @@ -916,8 +916,8 @@ void KVpncConfig::loadOptions() enableDebugPppd = config->readBoolEntry( "Enable pppd debug", false ); enableDebugPptpd = config->readBoolEntry( "Enable pptpd debug", false ); enableFreeswanVerbose = config->readBoolEntry( "Enable FreeSWAN verbose", false ); - PlutoDebug = QStringList::split(" ", config->readEntry( "Pluto Debug", "")); - KlipsDebug = QStringList::split(" ", config->readEntry( "Klips Debug", "")); + PlutoDebug = TQStringList::split(" ", config->readEntry( "Pluto Debug", "")); + KlipsDebug = TQStringList::split(" ", config->readEntry( "Klips Debug", "")); Vpnc_pid_file = config->readEntry( "Pid file for vpnc ", "/var/run/vpnc/pid" ); RacoonDebugLevel = config->readEntry( "Racoon debuglevel", "info" ); // we need to correct old int value @@ -974,7 +974,7 @@ void KVpncConfig::loadOptions() checkStandardPathValues(); - tryConnectTimeout = QString( config->readEntry( "Try connect timeout", "10" ) ).toInt(); + tryConnectTimeout = TQString( config->readEntry( "Try connect timeout", "10" ) ).toInt(); lastProfile = config->readEntry( "Last Profile", "" ); writeLogFile = config->readBoolEntry( "Write log file", true ); holdGeneratedScripts = config->readBoolEntry( "Hold generated scripts", true ); @@ -984,20 +984,20 @@ void KVpncConfig::loadOptions() if (programsInPath) useDefaultPaths=true; - InfoLogColor = config->readColorEntry ( "Info logwindow color", new QColor(Qt::black) ); - RemoteLogColor = config->readColorEntry ( "Remote logwindow color", new QColor(Qt::blue) ); - ErrorLogColor = config->readColorEntry( "Error logwindow color", new QColor(Qt::red )); - SuccessLogColor = config->readColorEntry( "Success logwindow color", new QColor(Qt::darkGreen) ); - DebugLogColor = config->readColorEntry( "Debug logwindow color", new QColor(255,175,0 )); - DebugBackgroundcolor = config->readColorEntry("Debug background color", new QColor (Qt::white) ); + InfoLogColor = config->readColorEntry ( "Info logwindow color", new TQColor(TQt::black) ); + RemoteLogColor = config->readColorEntry ( "Remote logwindow color", new TQColor(TQt::blue) ); + ErrorLogColor = config->readColorEntry( "Error logwindow color", new TQColor(TQt::red )); + SuccessLogColor = config->readColorEntry( "Success logwindow color", new TQColor(TQt::darkGreen) ); + DebugLogColor = config->readColorEntry( "Debug logwindow color", new TQColor(255,175,0 )); + DebugBackgroundcolor = config->readColorEntry("Debug background color", new TQColor (TQt::white) ); useColorizedLogOutput = config->readBoolEntry("Use colorized log output", true); showInterfaceIPinTooltip = config->readBoolEntry( "Show interface IP in tooltip", true ); AutoConnectProfile= config->readEntry( "Auto connect profile", "" ); doAutoConnectAtStartup = config->readBoolEntry( "Do auto connect at startup", false ); LogViewerFontSize = config->readNumEntry( "Log viewer font size", 2 ); - WindowSize = QSize( config->readNumEntry( "Mainwindow width", 50 ), this->config->readNumEntry( "Mainwindow height", 50 ) ); - WindowPos = QPoint ( config->readNumEntry( "Mainwindow position x", 10 ), this->config->readNumEntry( "Mainwindow position y", 50 ) ); + WindowSize = TQSize( config->readNumEntry( "Mainwindow width", 50 ), this->config->readNumEntry( "Mainwindow height", 50 ) ); + WindowPos = TQPoint ( config->readNumEntry( "Mainwindow position x", 10 ), this->config->readNumEntry( "Mainwindow position y", 50 ) ); OpenvpnManagementPort = config->readNumEntry("Openvpn management port", 2222 ); @@ -1008,15 +1008,15 @@ void KVpncConfig::loadOptions() { KStandardDirs *dirs = KGlobal::dirs(); - QDir AppFolder (QString(dirs->saveLocation( "data" )+"/kvpnc")); + TQDir AppFolder (TQString(dirs->saveLocation( "data" )+"/kvpnc")); if (!AppFolder.exists()) { - // KMessageBox::error( this, i18n( "creating dir: %1" ).arg(dirs->saveLocation( "data" )+"/kvpnc" )); - QDir AppFolder2(dirs->saveLocation( "data" )); + // KMessageBox::error( this, i18n( "creating dir: %1" ).tqarg(dirs->saveLocation( "data" )+"/kvpnc" )); + TQDir AppFolder2(dirs->saveLocation( "data" )); if(!AppFolder2.mkdir("kvpnc",true)) { - KMessageBox::error( 0, i18n( "The appdir for kvpnc could not be created. Be sure that you have write permission of \"%1\"." ).arg(dirs->saveLocation( "data" )) ); - appendLogEntry( i18n( "The appdir for kvpnc could not be created. Be sure that you have write permission of \"%1\"." ).arg(dirs->saveLocation( "data" )),error); + KMessageBox::error( 0, i18n( "The appdir for kvpnc could not be created. Be sure that you have write permission of \"%1\"." ).tqarg(dirs->saveLocation( "data" )) ); + appendLogEntry( i18n( "The appdir for kvpnc could not be created. Be sure that you have write permission of \"%1\"." ).tqarg(dirs->saveLocation( "data" )),error); } } @@ -1027,12 +1027,12 @@ void KVpncConfig::loadOptions() if ( !logfile.open( IO_WriteOnly | IO_Append ) ) { KMessageBox::error( 0, i18n( "Log file cant be opened!" ) ); - appendLogEntry(i18n( "Unable to find \"%1\"!" ).arg("pppd"),error); + appendLogEntry(i18n( "Unable to find \"%1\"!" ).tqarg("pppd"),error); } else { - QTextStream s( &logfile ); - s << i18n( "Log session started at: " ) << QDateTime::currentDateTime().toString( Qt::TextDate ) << endl; + TQTextStream s( &logfile ); + s << i18n( "Log session started at: " ) << TQDateTime::tqcurrentDateTime().toString( Qt::TextDate ) << endl; } } @@ -1069,14 +1069,14 @@ void KVpncConfig::loadOptions() Profile_XXXXX XXXXX is the account name (important: unique!) */ - QStringList configGroups = config->groupList(); + TQStringList configGroups = config->groupList(); bool oldConfigurationFound = false; bool sessionFound = false; - for ( QStringList::Iterator it = configGroups.begin(); it != configGroups.end(); ++it ) + for ( TQStringList::Iterator it = configGroups.begin(); it != configGroups.end(); ++it ) { - QString name = *it; + TQString name = *it; name.stripWhiteSpace(); if ( name.left( 7 ) == "Profile" && name.length() > 8 ) { @@ -1086,14 +1086,14 @@ void KVpncConfig::loadOptions() if ( KvpncDebugLevel > 2 ) { - QString tmp = i18n( "Profile found: " ); + TQString tmp = i18n( "Profile found: " ); tmp += name.right( ( name.length() ) - 8 ); appendLogEntry ( tmp, debug ); } config->setGroup( name ); - QString UserPassword=""; - QString PrivateKeyPass=""; - QString PreSharedKey =""; + TQString UserPassword=""; + TQString PrivateKeyPass=""; + TQString PreSharedKey =""; /* passwords with kwallet */ if (useKwallet && KWallet::Wallet::isEnabled()) @@ -1104,7 +1104,7 @@ void KVpncConfig::loadOptions() wallet = KWallet::Wallet::openWallet(KWallet::Wallet::LocalWallet()); if (wallet != 0) { - QString walletname="kvpnc"; + TQString walletname="kvpnc"; if (!wallet->hasFolder(walletname)) { @@ -1117,25 +1117,25 @@ void KVpncConfig::loadOptions() if (KvpncDebugLevel > 2) appendLogEntry(i18n( "Folder for kvpnc has been set." ),debug); - QString profilename = name.right( ( name.length() ) - 8 ); + TQString profilename = name.right( ( name.length() ) - 8 ); - if (wallet->readPassword(QString(profilename+"__user_pw"), UserPassword) != 0) - appendLogEntry(i18n( "read of %1 has failed." ).arg(i18n("user password")),error); + if (wallet->readPassword(TQString(profilename+"__user_pw"), UserPassword) != 0) + appendLogEntry(i18n( "read of %1 has failed." ).tqarg(i18n("user password")),error); else if (KvpncDebugLevel > 2) - appendLogEntry(i18n( "read of %1 was successful." ).arg(i18n("user password")),debug); + appendLogEntry(i18n( "read of %1 was successful." ).tqarg(i18n("user password")),debug); - if (wallet->readPassword(QString(profilename+"__psk"), PreSharedKey) != 0) - appendLogEntry(i18n( "read of %1 has failed." ).arg(i18n("preshared key")),error); + if (wallet->readPassword(TQString(profilename+"__psk"), PreSharedKey) != 0) + appendLogEntry(i18n( "read of %1 has failed." ).tqarg(i18n("preshared key")),error); else if (KvpncDebugLevel > 2) - appendLogEntry(i18n( "read of %1 was successful." ).arg(i18n("preshared key")),debug); + appendLogEntry(i18n( "read of %1 was successful." ).tqarg(i18n("preshared key")),debug); - if (wallet->readPassword(QString(profilename+"__priv_key_pwd"), PrivateKeyPass) != 0) - appendLogEntry(i18n( "read of %1 has failed." ).arg(i18n("preshared key password")),error); + if (wallet->readPassword(TQString(profilename+"__priv_key_pwd"), PrivateKeyPass) != 0) + appendLogEntry(i18n( "read of %1 has failed." ).tqarg(i18n("preshared key password")),error); else if (KvpncDebugLevel > 2) - appendLogEntry(i18n( "read of %1 was successful." ).arg(i18n("preshared key password")),debug); + appendLogEntry(i18n( "read of %1 was successful." ).tqarg(i18n("preshared key password")),debug); } else { @@ -1168,7 +1168,7 @@ void KVpncConfig::loadOptions() } VpnAccountData::ConnectionType ConnType = VpnAccountData::ConnectionType( VpnAccountData::cisco ); - QString type_string = config->readEntry( "Connection type", "cisco" ); + TQString type_string = config->readEntry( "Connection type", "cisco" ); if ( type_string == "cisco" ) ConnType = VpnAccountData::cisco; @@ -1193,7 +1193,7 @@ void KVpncConfig::loadOptions() else ConnType = VpnAccountData::other; - QString Name = name.right( name.length() - 8 ); + TQString Name = name.right( name.length() - 8 ); VpnAccountData *data = new VpnAccountData( ConnType, Name ); data->setGateway( config->readEntry( "VPN Gateway", "" )); data->setID( config->readEntry( "VPN ID", "" ) ); @@ -1280,9 +1280,9 @@ void KVpncConfig::loadOptions() data->setPskIsInFile( config->readBoolEntry( "PSK is in file", false )); data->setUseAdditionalNetworkRoutes( config->readBoolEntry( "Use additional network routes", false )); appPointer->processEvents(); - QString AdditionalNetworkRoutesString = config->readEntry( "Additional network routes", "" ); + TQString AdditionalNetworkRoutesString = config->readEntry( "Additional network routes", "" ); // Networks delimited by a ',' - QStringList AdditionalNetworkRoutes(QStringList::split( ",", AdditionalNetworkRoutesString )); + TQStringList AdditionalNetworkRoutes(TQStringList::split( ",", AdditionalNetworkRoutesString )); data->setAdditionalNetworkRoutes(AdditionalNetworkRoutes); data->setHashAlgo( config->readEntry( "Hash algorithm", "md5" )); data->setEncryptionAlgorithm( config->readEntry( "Encryption algorithm", "3des" )); @@ -1299,7 +1299,7 @@ void KVpncConfig::loadOptions() data->setDisableLzoCompression(config->readBoolEntry("Disable LZO compression", true)); data->setUserPassword( UserPassword ); data->setRemoteNetAddr( config->readEntry("Remote net address","") ); - data->setRemoteNetMask( QString().setNum(config->readNumEntry("Remote net mask",24 ))); + data->setRemoteNetMask( TQString().setNum(config->readNumEntry("Remote net mask",24 ))); data->setPreSharedKey( PreSharedKey ); data->setPrivateKeyPass( PrivateKeyPass ); data->setAuthWithUsernameAndPassword( config->readBoolEntry( "AuthWithUsernameAndPassword",false ) ); @@ -1407,13 +1407,13 @@ void KVpncConfig::loadOptions() { // old style configuration found config->setGroup( "Client Options" ); - QString Name = "Default"; + TQString Name = "Default"; VpnAccountData::ConnectionType ConnType = VpnAccountData::cisco; - QString Gateway = config->readEntry( "VPN Gateway", "" ); - QString ID = config->readEntry( "VPN ID", "" ); - QString Psk = config->readEntry( "Group password", "" ); - QString Username = config->readEntry( "Username", "" ); - QString UserPassword = config->readEntry( "Password", "" ); + TQString Gateway = config->readEntry( "VPN Gateway", "" ); + TQString ID = config->readEntry( "VPN ID", "" ); + TQString Psk = config->readEntry( "Group password", "" ); + TQString Username = config->readEntry( "Username", "" ); + TQString UserPassword = config->readEntry( "Password", "" ); bool saveUserPassword = config->readBoolEntry( "Save user password", false ); bool savePsk = config->readBoolEntry( "Save group password", false ); @@ -1438,7 +1438,7 @@ void KVpncConfig::loadOptions() appendLogEntry ( i18n( "Old configuration found, converted." ),info ); if ( KvpncDebugLevel > 2 ) - appendLogEntry( i18n( "Configuration for profile \"%1\" loaded." ).arg( Name ),info ); + appendLogEntry( i18n( "Configuration for profile \"%1\" loaded." ).tqarg( Name ),info ); appPointer->processEvents(); } @@ -1449,8 +1449,8 @@ void KVpncConfig::loadOptions() { // delete configuration file KStandardDirs * dirs = KGlobal::dirs(); - QString filePath = dirs->findResource ( "config", "kvpncrc" ); - QFile::remove + TQString filePath = dirs->findResource ( "config", "kvpncrc" ); + TQFile::remove ( filePath ); if ( KvpncDebugLevel > 2 ) appendLogEntry ( i18n( "Old configuration deleted." ), debug ); @@ -1544,12 +1544,12 @@ void KVpncConfig::checkStandardPathValues() pathToGnomeSshAskpass = "/usr/lib/openssh/gnome-ssh-askpass"; } -bool KVpncConfig::exportKvpncConfig(QString filename) +bool KVpncConfig::exportKvpncConfig(TQString filename) { bool ok=true; int exportCount=0; bool exportGlobal=false; - QFile exportfile (filename); + TQFile exportfile (filename); if (exportfile.exists()) { int res = KMessageBox::questionYesNo ( 0, i18n ( "\"%1\" still exists. Do you really want to overwrite it?" ).arg ( filename ), i18n ( "Overwrite?" ), i18n("&Overwrite") , KStdGuiItem::cancel() ); @@ -1561,7 +1561,7 @@ bool KVpncConfig::exportKvpncConfig(QString filename) { if( exportfile.open(IO_WriteOnly)) { - QPtrList<VpnAccountData> *exportAccountList = new QPtrList<VpnAccountData>(); + TQPtrList<VpnAccountData> *exportAccountList = new TQPtrList<VpnAccountData>(); exportAccountList->setAutoDelete( TRUE ); // the list owns the objects KvpncImportProfileSelectionBase selectdlg; VpnAccountData *it=NULL; @@ -1576,11 +1576,11 @@ bool KVpncConfig::exportKvpncConfig(QString filename) selectdlg.ImportProfileListView->addColumn(i18n("Name")); selectdlg.ImportProfileListView->addColumn(i18n("Type")); selectdlg.ImportProfileListView->addColumn(i18n("Gateway")); - QCheckListItem *item; + TQCheckListItem *item; for ( it = AccountList->first(); it; it = AccountList->next() ) { - QString name = it->getName(); - QString type; + TQString name = it->getName(); + TQString type; if ( it->getConnectionType() == VpnAccountData::cisco ) type = "cisco" ; else if ( it->getConnectionType() == VpnAccountData::ciscoorig ) @@ -1607,7 +1607,7 @@ bool KVpncConfig::exportKvpncConfig(QString filename) // litem->setSelectable(true); - item = new QCheckListItem(selectdlg.ImportProfileListView,it->getName(),QCheckListItem::CheckBox); + item = new TQCheckListItem(selectdlg.ImportProfileListView,it->getName(),TQCheckListItem::CheckBox); item->setText(1,type); item->setText(2,it->getGateway()); selectdlg.ImportProfileListView->insertItem(item); @@ -1618,15 +1618,15 @@ bool KVpncConfig::exportKvpncConfig(QString filename) bool ret = selectdlg.exec(); if (ret == true) { - QListViewItemIterator it2( selectdlg.ImportProfileListView ); + TQListViewItemIterator it2( selectdlg.ImportProfileListView ); for ( ; it2.current(); ++it2 ) { - if ( ( (QCheckListItem*)it2.current() )->isOn() ) + if ( ( (TQCheckListItem*)it2.current() )->isOn() ) { VpnAccountData *data=NULL; it = 0; for ( it = AccountList->first(); it; it = AccountList->next() ) - if ( it->getName() == ( (QCheckListItem*)it2.current() )->text() && ( (QCheckListItem*)it2.current() )->isOn() ) + if ( it->getName() == ( (TQCheckListItem*)it2.current() )->text() && ( (TQCheckListItem*)it2.current() )->isOn() ) data = it; exportAccountList->append(data); } @@ -1650,14 +1650,14 @@ bool KVpncConfig::exportKvpncConfig(QString filename) - QString date (__DATE__); - QString day= date.section(' ',0,0); - QString month= QString().setNum(QDate::fromString(date.section(' ',0,0),Qt::ISODate).month()); - QString year= date.section(' ',2,2); + TQString date (__DATE__); + TQString day= date.section(' ',0,0); + TQString month= TQString().setNum(TQDate::fromString(date.section(' ',0,0),Qt::ISODate).month()); + TQString year= date.section(' ',2,2); - QString currentdate ( date+" "+ QTime().currentTime().toString( "hh:mm" ) ); + TQString currentdate ( date+" "+ TQTime().currentTime().toString( "hh:mm" ) ); - QTextStream ExportStream ( &exportfile ); + TQTextStream ExportStream ( &exportfile ); ExportStream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << "\n"; ExportStream << "<!-- generated by kvpnc at " << currentdate<< ". Do not edit it. -->" << "\n"; ExportStream << "<kvpnc>" << "\n"; @@ -1994,70 +1994,70 @@ bool KVpncConfig::exportKvpncConfig(QString filename) KMessageBox::information ( 0, i18n ( "Export canceled." ) ); return false; } - QString msg=""; + TQString msg=""; if (exportCount > 0 && exportGlobal==true) - msg = i18n("Export was successful. %1 profiles and global settings are exported.").arg(QString::number(exportCount)); + msg = i18n("Export was successful. %1 profiles and global settings are exported.").tqarg(TQString::number(exportCount)); if (exportCount > 0 && exportGlobal==false) - msg = i18n("Export was successful. %1 profiles are exported.").arg(QString::number(exportCount)); + msg = i18n("Export was successful. %1 profiles are exported.").tqarg(TQString::number(exportCount)); if (exportCount < 1 && exportGlobal==true) msg = i18n("Export was successful. Global settings are exported."); KMessageBox::information ( 0, msg,i18n("Export success") ); return true; } -bool KVpncConfig::importKvpncConfig(QString filename, QString& RetName, bool& openProfileManager) +bool KVpncConfig::importKvpncConfig(TQString filename, TQString& RetName, bool& openProfileManager) { - QFile importfile (filename); + TQFile importfile (filename); if (!importfile.exists()) { KMessageBox::error ( 0, i18n ( "Reading of \"%1\" has been failed!" ).arg ( filename ) ); return false; } - QString kvpncexportversion=""; - - QString pathToVpnc; - QString pathToCiscoVpnc; - QString pathToRacoon; - QString pathToRacoonctl; - QString pathToSetkey; - QString pathToIptables; - QString pathToOpenssl; - QString pathToIpsec; - QString pathToPppd; - QString pathToPptp; - QString pathToL2tpd; - QString pathToXl2tpd; - QString pathToOpenl2tp; - QString pathToKill; - QString pathToKillall; - QString pathToPing; - QString pathToOpenvpn; - QString pathToIp; - QString pathToIfconfig; - QString pathToRoute; - QString pathToNetstat; - QString pathToPkcs11Tool; - QString pathToVtund; - QString pathToCiscoCertMgr; - QString pathToTail; - QString pathToSsh; - QString pathToKsshAskpass; - QString pathToGnomeSshAskpass; - QString AutoConnectProfile; - QString RacoonDebugLevel; - QString Vpnc_pid_file; - QString Pppd_pid_file; - QString lastProfile; - QString logfileName; - - QString TmpPassword; //< from enter password dialog - QString TmpGroupPassword; //< from enter password dialog - QString TmpUsername; //< from enter password dialog - QString TmpPrivKeyPassStr; - QString TmpGatewayIP; - QString TmpXauthInterPasscode; //< from Xauth interactive passcode dialog - QString TmpPrivateKeyPass; - QString TmpHttpProxyPassword; + TQString kvpncexportversion=""; + + TQString pathToVpnc; + TQString pathToCiscoVpnc; + TQString pathToRacoon; + TQString pathToRacoonctl; + TQString pathToSetkey; + TQString pathToIptables; + TQString pathToOpenssl; + TQString pathToIpsec; + TQString pathToPppd; + TQString pathToPptp; + TQString pathToL2tpd; + TQString pathToXl2tpd; + TQString pathToOpenl2tp; + TQString pathToKill; + TQString pathToKillall; + TQString pathToPing; + TQString pathToOpenvpn; + TQString pathToIp; + TQString pathToIfconfig; + TQString pathToRoute; + TQString pathToNetstat; + TQString pathToPkcs11Tool; + TQString pathToVtund; + TQString pathToCiscoCertMgr; + TQString pathToTail; + TQString pathToSsh; + TQString pathToKsshAskpass; + TQString pathToGnomeSshAskpass; + TQString AutoConnectProfile; + TQString RacoonDebugLevel; + TQString Vpnc_pid_file; + TQString Pppd_pid_file; + TQString lastProfile; + TQString logfileName; + + TQString TmpPassword; //< from enter password dialog + TQString TmpGroupPassword; //< from enter password dialog + TQString TmpUsername; //< from enter password dialog + TQString TmpPrivKeyPassStr; + TQString TmpGatewayIP; + TQString TmpXauthInterPasscode; //< from Xauth interactive passcode dialog + TQString TmpPrivateKeyPass; + TQString TmpHttpProxyPassword; bool minimizeAfterConnect=true; bool showDebugConsole=true; @@ -2110,41 +2110,41 @@ bool KVpncConfig::importKvpncConfig(QString filename, QString& RetName, bool& op int runningCheckCounter=0; int runningCheckTimeout=0; int OpenvpnManagementPort=2222; - QPtrList<VpnAccountData> *ImportedAccountList; + TQPtrList<VpnAccountData> *ImportedAccountList; - QColor InfoLogColor; - QColor RemoteLogColor; - QColor ErrorLogColor; - QColor SuccessLogColor; - QColor DebugLogColor; - QColor DebugBackgroundcolor; + TQColor InfoLogColor; + TQColor RemoteLogColor; + TQColor ErrorLogColor; + TQColor SuccessLogColor; + TQColor DebugLogColor; + TQColor DebugBackgroundcolor; - QPoint pos; - QPoint WindowPos; - QSize WindowSize; + TQPoint pos; + TQPoint WindowPos; + TQSize WindowSize; bool importGlobal=false; int importCount=0; - QDomDocument doc( "kvpncsettingsdoc" ); + TQDomDocument doc( "kvpncsettingsdoc" ); if( importfile.open(IO_ReadOnly)) { - QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); + TQApplication::setOverrideCursor( TQCursor(TQt::WaitCursor) ); if ( !doc.setContent( &importfile ) ) { importfile.close(); KMessageBox::error ( 0, i18n ( "Reading of \"%1\" has been failed!" ).arg ( filename ) ); appendLogEntry (i18n ( "Reading of \"%1\" has been failed!" ).arg ( filename ), error); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return false; } importfile.close(); - // print out the element names of all elements that are direct children + // print out the element names of all elements that are direct tqchildren // of the outermost element. - QDomElement docElem = doc.documentElement(); + TQDomElement docElem = doc.documentElement(); - QDomNode n = docElem.firstChild(); + TQDomNode n = docElem.firstChild(); if (KvpncDebugLevel > 5) std::cout << "dom doc:" << std::endl; while( !n.isNull() ) @@ -2153,10 +2153,10 @@ bool KVpncConfig::importKvpncConfig(QString filename, QString& RetName, bool& op { if (KvpncDebugLevel > 5) std::cout << "version tag found." << std::endl; - QDomNodeList vsubnodes = n.toElement().childNodes(); + TQDomNodeList vsubnodes = n.toElement().childNodes(); for (int i=0;i<=(int)vsubnodes.count();i++) { - QDomNode n1 = vsubnodes.item(i); + TQDomNode n1 = vsubnodes.item(i); if (n1.toElement().tagName() == "app") { if (KvpncDebugLevel > 5) @@ -2175,10 +2175,10 @@ bool KVpncConfig::importKvpncConfig(QString filename, QString& RetName, bool& op { if (KvpncDebugLevel > 5) std::cout << "gobal tag found." << std::endl; - QDomNodeList vsubnodes = n.toElement().childNodes(); + TQDomNodeList vsubnodes = n.toElement().childNodes(); for (int i=0;i<=(int)vsubnodes.count();i++) { - QDomNode n1 = vsubnodes.item(i); + TQDomNode n1 = vsubnodes.item(i); if (n1.toElement().tagName() != "") { if (KvpncDebugLevel > 5) @@ -2194,8 +2194,8 @@ bool KVpncConfig::importKvpncConfig(QString filename, QString& RetName, bool& op else if ( n1.toElement().tagName() == "Enable xl2tpd debug" ) { enableDebugXl2tpd = n1.toElement().text().toInt(); } else if ( n1.toElement().tagName() == "Enable openl2tp debug" ) { enableDebugOpenl2tp = n1.toElement().text().toInt(); } else if ( n1.toElement().tagName() == "Enable FreeSWAN verbose" ) { enableFreeswanVerbose = n1.toElement().text().toInt(); } - else if ( n1.toElement().tagName() == "Pluto Debug" ) { PlutoDebug = QStringList::split(' ', n1.toElement().text()); } - else if ( n1.toElement().tagName() == "Klips Debug" ) { KlipsDebug = QStringList::split(' ', n1.toElement().text()); } + else if ( n1.toElement().tagName() == "Pluto Debug" ) { PlutoDebug = TQStringList::split(' ', n1.toElement().text()); } + else if ( n1.toElement().tagName() == "Klips Debug" ) { KlipsDebug = TQStringList::split(' ', n1.toElement().text()); } else if ( n1.toElement().tagName() == "Show debugconsole" ) { showDebugConsole = n1.toElement().text().toInt(); } else if ( n1.toElement().tagName() == "Pid file for vpnc " ) { Vpnc_pid_file = n1.toElement().text().toInt(); } else if ( n1.toElement().tagName() == "Vpnc debuglevel" ) { VpncDebugLevel = n1.toElement().text().toInt(); } @@ -2277,35 +2277,35 @@ bool KVpncConfig::importKvpncConfig(QString filename, QString& RetName, bool& op if (KvpncDebugLevel > 5) std::cout << "profiles tag found." << std::endl; - ImportedAccountList = new QPtrList<VpnAccountData>(); + ImportedAccountList = new TQPtrList<VpnAccountData>(); ImportedAccountList->setAutoDelete( TRUE ); // the list owns the objects - QDomNodeList profiles_subnodes = n.toElement().childNodes(); + TQDomNodeList profiles_subnodes = n.toElement().childNodes(); for (int i=0;i<=(int)profiles_subnodes.count();i++) { - QDomNode n1 = profiles_subnodes.item(i); + TQDomNode n1 = profiles_subnodes.item(i); if (n1.toElement().attribute("name") != "") { if (KvpncDebugLevel > 5) std::cout << "profile: " << n1.toElement().attribute("name") << std::endl; - QString name = n1.toElement().attribute("name"); + TQString name = n1.toElement().attribute("name"); VpnAccountData *data = new VpnAccountData( VpnAccountData::cisco, name); // cisco is a dummy here, it will be set later data->setDescription(i18n("import from ")+filename); - QDomNodeList profile_subnodes = n1.toElement().childNodes(); + TQDomNodeList profile_subnodes = n1.toElement().childNodes(); for (int j=0;j<=(int)profile_subnodes.count();j++) { - QDomNode n2 = profile_subnodes.item(j); + TQDomNode n2 = profile_subnodes.item(j); if (n2.toElement().attribute("name") != "") { - QString elementname= n2.toElement().attribute("name"); - QString elementvalue = n2.toElement().text(); + TQString elementname= n2.toElement().attribute("name"); + TQString elementvalue = n2.toElement().text(); if (KvpncDebugLevel > 5) std::cout << " => option: " << elementname << ", value: " << elementvalue << std::endl; // normal config if (elementname == "Connection type") { - QString type = elementvalue; + TQString type = elementvalue; VpnAccountData::ConnectionType ConnType = VpnAccountData::ConnectionType( VpnAccountData::cisco ); if ( type == "cisco" ) ConnType = VpnAccountData::cisco; @@ -2368,7 +2368,7 @@ bool KVpncConfig::importKvpncConfig(QString filename, QString& RetName, bool& op else if (elementname == "Auth type") { - QString Authtype = elementvalue; + TQString Authtype = elementvalue; if (Authtype == "cert") data->setAuthType(VpnAccountData::cert); else if (Authtype == "psk") @@ -2541,7 +2541,7 @@ bool KVpncConfig::importKvpncConfig(QString filename, QString& RetName, bool& op } appPointer->processEvents(); } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); KvpncImportProfileSelectionDialog selectdlg; VpnAccountData *it=NULL; @@ -2553,11 +2553,11 @@ bool KVpncConfig::importKvpncConfig(QString filename, QString& RetName, bool& op selectdlg.ImportProfileListView->addColumn(i18n("Gateway")); selectdlg.ImportNamePrefixLineEdit->setText( "kvpnc_import_"); - QCheckListItem *item; + TQCheckListItem *item; for ( it = ImportedAccountList->first(); it; it = ImportedAccountList->next() ) { - QString name = it->getName(); - QString type; + TQString name = it->getName(); + TQString type; if ( it->getConnectionType() == VpnAccountData::cisco ) type = "cisco" ; else if ( it->getConnectionType() == VpnAccountData::ciscoorig ) @@ -2579,7 +2579,7 @@ bool KVpncConfig::importKvpncConfig(QString filename, QString& RetName, bool& op // litem->setSelectable(true); - item = new QCheckListItem(selectdlg.ImportProfileListView,it->getName(),QCheckListItem::CheckBox); + item = new TQCheckListItem(selectdlg.ImportProfileListView,it->getName(),TQCheckListItem::CheckBox); item->setText(1,type); item->setText(2,it->getGateway()); selectdlg.ImportProfileListView->insertItem(item); @@ -2592,16 +2592,16 @@ bool KVpncConfig::importKvpncConfig(QString filename, QString& RetName, bool& op if (ret == true) { importGlobal=selectdlg.ImportGlobalSettingsCheckBox->isChecked(); - QListViewItemIterator it2( selectdlg.ImportProfileListView ); + TQListViewItemIterator it2( selectdlg.ImportProfileListView ); for ( ; it2.current(); ++it2 ) { - if ( ( (QCheckListItem*)it2.current() )->isOn() ) + if ( ( (TQCheckListItem*)it2.current() )->isOn() ) { VpnAccountData *data=NULL; it = 0; for ( it = ImportedAccountList->first(); it; it = ImportedAccountList->next() ) { - if ( it->getName() == ( (QCheckListItem*)it2.current() )->text() && ( (QCheckListItem*)it2.current() )->isOn() ) + if ( it->getName() == ( (TQCheckListItem*)it2.current() )->text() && ( (TQCheckListItem*)it2.current() )->isOn() ) { data = it; importCount++; @@ -2620,11 +2620,11 @@ bool KVpncConfig::importKvpncConfig(QString filename, QString& RetName, bool& op { if ( it->getName() == data->getName() ) { - //account->setName( QString( account->getName() + "_2" ) ); - // KMessageBox::information ( this, i18n( "Profile name exists!\n It will be renamed to \"%1\"." ).arg( account->getName() ), i18n( "Name exist, renamed" ) ); + //account->setName( TQString( account->getName() + "_2" ) ); + // KMessageBox::information ( this, i18n( "Profile name exists!\n It will be renamed to \"%1\"." ).tqarg( account->getName() ), i18n( "Name exist, renamed" ) ); KMessageBox::error ( 0, i18n ( "Profile name exists!" ), i18n ( "Name Exists" ) ); nameOk = false; - QString newName = KInputDialog::getText ( i18n ( "New Name" ), i18n ( "New name for profile:" ), QString ( data->getName() + "_2" ), &ok ); + TQString newName = KInputDialog::getText ( i18n ( "New Name" ), i18n ( "New name for profile:" ), TQString ( data->getName() + "_2" ), &ok ); if (newName.isEmpty()) { KMessageBox::information ( 0, i18n ( "Import was canceled." ) ); @@ -2662,7 +2662,7 @@ bool KVpncConfig::importKvpncConfig(QString filename, QString& RetName, bool& op } } - QDomElement e = n.toElement(); // try to convert the node to an element. + TQDomElement e = n.toElement(); // try to convert the node to an element. if( !e.isNull() ) { std::cout << e.tagName() << std::endl; // the node really is an element. } @@ -2761,11 +2761,11 @@ bool KVpncConfig::importKvpncConfig(QString filename, QString& RetName, bool& op } saveOptions(); - QString msg=""; + TQString msg=""; if (importCount > 0 && importGlobal==true) - msg = i18n("Import was successful. %1 profiles and global settings are imported.").arg(QString::number(importCount)); + msg = i18n("Import was successful. %1 profiles and global settings are imported.").tqarg(TQString::number(importCount)); if (importCount > 0 && importGlobal==false) - msg = i18n("Import was successful. %1 profiles are imported.").arg(QString::number(importCount)); + msg = i18n("Import was successful. %1 profiles are imported.").tqarg(TQString::number(importCount)); if (importCount < 1 && importGlobal==false) msg = i18n("Import was successful. Global settings are imported."); KMessageBox::information ( 0, msg,i18n("Import success") ); @@ -2774,48 +2774,48 @@ bool KVpncConfig::importKvpncConfig(QString filename, QString& RetName, bool& op { KMessageBox::error ( 0, i18n ( "Reading of \"%1\" has been failed!" ).arg ( filename ) ); appendLogEntry (i18n ( "Reading of \"%1\" has been failed!" ).arg ( filename ), error); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return false; } return true; } -bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& openProfileManager) +bool KVpncConfig::importIpsecConfig(TQString filename, TQString& RetName, bool& openProfileManager) { - QFile importfile (filename); + TQFile importfile (filename); if (!importfile.exists()) { KMessageBox::error ( 0, i18n ( "Reading of \"%1\" has been failed!" ).arg ( filename ) ); return false; } - QPtrList<VpnAccountData> *ImportedAccountList = new QPtrList<VpnAccountData>(); + TQPtrList<VpnAccountData> *ImportedAccountList = new TQPtrList<VpnAccountData>(); ImportedAccountList->setAutoDelete( TRUE ); // the list owns the objects - QPtrList<IpsecImportSection> *IpsecImportSectionList = new QPtrList<IpsecImportSection>(); + TQPtrList<IpsecImportSection> *IpsecImportSectionList = new TQPtrList<IpsecImportSection>(); bool isIpsecGlobalSection=false; bool firstSectionFound=false; bool defaultSectionFound=false; bool useNat=false; bool disableOpportunisticEncryption=true; - QStringList InterfaceList; + TQStringList InterfaceList; int IpsecVersion=1; // bool pskIsInFile=true; - QString PskFile="/etc/ipsec.secrets"; - QString CertPath="/etc/ipsec.d/certs"; + TQString PskFile="/etc/ipsec.secrets"; + TQString CertPath="/etc/ipsec.d/certs"; - QString IpsecConfigSection=""; + TQString IpsecConfigSection=""; bool validLineFound=false; if ( importfile.open(IO_ReadOnly)) { - QString line = NULL; - QString IpsecConfigSectionName=""; - QString IpsecConfigData=""; + TQString line = NULL; + TQString IpsecConfigSectionName=""; + TQString IpsecConfigData=""; bool sectionEndFound=false; // std::cout << "pass1: collecting sections" << std::endl; if (KvpncDebugLevel > 2) appendLogEntry(i18n ("import ipsec config: pass1: collecting sections"),debug); - QTextStream stream(&importfile); + TQTextStream stream(&importfile); while ( !stream.atEnd() ) { line = stream.readLine().replace("\"",""); @@ -2827,7 +2827,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op // end of section found // std::cout << "end of section " << IpsecConfigSectionName << " found." << std::endl; if (KvpncDebugLevel > 2) - appendLogEntry(i18n("import ipsec config: end of section %1 found.").arg(IpsecConfigSectionName), debug); + appendLogEntry(i18n("import ipsec config: end of section %1 found.").tqarg(IpsecConfigSectionName), debug); sectionEndFound=true; IpsecImportSection *section = new IpsecImportSection(); @@ -2877,11 +2877,11 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op } if (line.startsWith("version")) { - IpsecVersion=int(QString(line.simplifyWhiteSpace().section('#',0,0).section(" ",1,1).stripWhiteSpace()).toFloat()); + IpsecVersion=int(TQString(line.simplifyWhiteSpace().section('#',0,0).section(" ",1,1).stripWhiteSpace()).toFloat()); validLineFound=true; // std::cout << "ipsec version found: " << IpsecVersion << std::endl; if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import ipsec config: ipsec version found: ")+ QString().setNum(IpsecVersion) ,debug); + appendLogEntry(i18n ("import ipsec config: ipsec version found: ")+ TQString().setNum(IpsecVersion) ,debug); } if (line.startsWith("config setup")) { @@ -2895,7 +2895,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if (isIpsecGlobalSection==true) { - QString line2 = removeWhiteSpaceAtBegin( line); + TQString line2 = removeWhiteSpaceAtBegin( line); // std::cout << "global section line: " << line2 << std::endl; if (line2.startsWith("plutodebug")) { @@ -2931,7 +2931,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op } else { - InterfaceList = QStringList::split(' ',line2.replace("interfaces=","").replace(QRegExp("ipsec[0-9]="),"")); + InterfaceList = TQStringList::split(' ',line2.replace("interfaces=","").replace(TQRegExp("ipsec[0-9]="),"")); // std::cout << "interface list: " << InterfaceList << std::endl; if (KvpncDebugLevel > 2) appendLogEntry(i18n ("import ipsec config: use interface from list:")+ " "+InterfaceList.join(", "),debug); @@ -2953,7 +2953,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if (!sectionEndFound && firstSectionFound==true) { // collecting data - QString cleanLine = removeWhiteSpaceAtBegin(line)+"\n"; + TQString cleanLine = removeWhiteSpaceAtBegin(line)+"\n"; // std:: cout << "clean line: \"" << cleanLine << "\"" << std::endl; if (!cleanLine.startsWith("#") && !cleanLine.startsWith("include") && cleanLine != "" && !line.startsWith("conn") && cleanLine != "\n") { @@ -2992,15 +2992,15 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op // std::cout << "sections: IpsecImportSectionList: " << IpsecImportSectionList->count() << std::endl; if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import ipsec config: sections: ") + QString().setNum(IpsecImportSectionList->count()),debug); + appendLogEntry(i18n ("import ipsec config: sections: ") + TQString().setNum(IpsecImportSectionList->count()),debug); if (!IpsecImportSectionList->isEmpty()) { for ( int i=0; i< (int)IpsecImportSectionList->count();i++ ) { IpsecImportSection *section = IpsecImportSectionList->at(i); - QString Name= section->SectionName; - QStringList data = QStringList::split('\n',section->SectionData.join("\n")); + TQString Name= section->SectionName; + TQStringList data = TQStringList::split('\n',section->SectionData.join("\n")); // std::cout << " => processing section: \"" << Name << "\"" << std::endl; @@ -3009,9 +3009,9 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if (KvpncDebugLevel > 2) appendLogEntry(i18n ("import ipsec config: => processing section: ")+"\"" + Name + "\"",debug); - for ( QStringList::Iterator it2 = data.begin(); it2 != data.end(); ++it2 ) + for ( TQStringList::Iterator it2 = data.begin(); it2 != data.end(); ++it2 ) { - QString dataline = *it2; + TQString dataline = *it2; // std::cout << "dataline found: \"" << dataline.remove("\n") << "\"" << std::endl; if (removeWhiteSpaceAtBegin( dataline).startsWith("also=")) { @@ -3019,11 +3019,11 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if (KvpncDebugLevel > 2) appendLogEntry(i18n ("import ipsec config: also= found, looking for other section..."),debug); - QString newdata = QString(section->SectionData.join("\n")); - newdata.replace(QRegExp("^.*also=.*$"),""); + TQString newdata = TQString(section->SectionData.join("\n")); + newdata.replace(TQRegExp("^.*also=.*$"),""); section->SectionData= newdata; - QString OtherSection=dataline.simplifyWhiteSpace().section('#',0,0).section("=",1,1); + TQString OtherSection=dataline.simplifyWhiteSpace().section('#',0,0).section("=",1,1); // we have to find the other section and replace this line by the config data of the other section (after the =) bool section_found=false; for (IpsecImportSection * it3 = IpsecImportSectionList->first(); it3; it3 = IpsecImportSectionList->next() ) @@ -3032,29 +3032,29 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op { // std::cout << "section " << OtherSection << " found, appending:" << std::endl; if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import ipsec config: section %1 found, appending:").arg(OtherSection),debug); + appendLogEntry(i18n ("import ipsec config: section %1 found, appending:").tqarg(OtherSection),debug); // std::cout << "other data:" << std::endl << it3->SectionData.join("\n") << "--------" << std::endl; // std::cout << "section data:" << std::endl << section->SectionData.join("\n") << "--------" << std::endl; section_found=true; // data.remove(dataline); dataline=""; - // QStringList otherdata = QStringList::split("\n",QString(it3->SectionData.join("\n"))); - QString OtherData = QString(it3->SectionData.join("\n")); + // TQStringList otherdata = TQStringList::split("\n",TQString(it3->SectionData.join("\n"))); + TQString OtherData = TQString(it3->SectionData.join("\n")); - QStringList newdata; + TQStringList newdata; - for ( QStringList::Iterator it6 = data.begin(); it6 != data.end(); ++it6 ) + for ( TQStringList::Iterator it6 = data.begin(); it6 != data.end(); ++it6 ) { // std::cout << " also line: " << *it6 << std::endl; if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import ipsec config: also line: ") + QString(*it6),debug); + appendLogEntry(i18n ("import ipsec config: also line: ") + TQString(*it6),debug); - if (QString(*it6).find("also=") < 0) + if (TQString(*it6).find("also=") < 0) { // std::cout << " also= found." << std::endl; if (KvpncDebugLevel > 2) appendLogEntry(i18n ("import ipsec config: also= found."),debug); - newdata.append(QString(*it6)); + newdata.append(TQString(*it6)); } else { @@ -3073,7 +3073,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op { // std::cout << "section " << OtherSection << " not found, skipping" << std::endl; if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import ipsec config: section %1 not found, skipping").arg(OtherSection) ,debug); + appendLogEntry(i18n ("import ipsec config: section %1 not found, skipping").tqarg(OtherSection) ,debug); } } @@ -3087,17 +3087,17 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op for ( int i=0; i< (int)IpsecImportSectionList->count();i++ ) { IpsecImportSection *section2 = IpsecImportSectionList->at(i); - QString Name= section2->SectionName; + TQString Name= section2->SectionName; if (Name == "%default") { if (KvpncDebugLevel > 2) appendLogEntry(i18n ("import ipsec config: => appending %default section: ")+"\"" + section2->SectionData.join("\n") ,debug); - QStringList defaultdata = QStringList::split('\n',section2->SectionData.join("\n")); + TQStringList defaultdata = TQStringList::split('\n',section2->SectionData.join("\n")); - for ( QStringList::Iterator defaultit = defaultdata.begin(); defaultit != defaultdata.end(); ++defaultit ) + for ( TQStringList::Iterator defaultit = defaultdata.begin(); defaultit != defaultdata.end(); ++defaultit ) { if (KvpncDebugLevel > 2) appendLogEntry(i18n ("import ipsec config: => appending %default line: ")+"\"" + *defaultit,debug); @@ -3115,8 +3115,8 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op // IpsecImportSection *it5=NULL; // for ( it5 = IpsecImportSectionList->first(); it5; it5 = IpsecImportSectionList->next() ) // { -// QString SectionName= it5->SectionName; -// QStringList data = it5->SectionData; +// TQString SectionName= it5->SectionName; +// TQStringList data = it5->SectionData; // // std::cout << SectionName << std::endl; // std::cout << data.join("\n") << std::endl; @@ -3126,7 +3126,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op for ( int i=0; i< (int)IpsecImportSectionList->count();i++ ) { IpsecImportSection *section = IpsecImportSectionList->at(i); - QString Name= section->SectionName; + TQString Name= section->SectionName; if (Name == "%default") { IpsecImportSectionList->remove(IpsecImportSectionList->at(i)); @@ -3141,8 +3141,8 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op IpsecImportSection *it5=NULL; for ( it5 = IpsecImportSectionList->first(); it5; it5 = IpsecImportSectionList->next() ) { - QString SectionName= it5->SectionName; - QStringList data = it5->SectionData; + TQString SectionName= it5->SectionName; + TQStringList data = it5->SectionData; appendLogEntry(SectionName ,debug); appendLogEntry(data.join("\n") ,debug); @@ -3161,30 +3161,30 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op { IpsecImportSection *section = IpsecImportSectionList->at(i); - QStringList sectiondata = QStringList::split('\n',section->SectionData.join("\n")); + TQStringList sectiondata = TQStringList::split('\n',section->SectionData.join("\n")); // std::cout << " => processing section: \"" << section->SectionName << "\"" << std::endl; // std::cout << " => data: \"" << section->SectionData.join("\n") << "\"" << std::endl; if (KvpncDebugLevel > 2) appendLogEntry(i18n ("import ipsec config: => processing section: ")+"\"" + section->SectionName + "\"" ,debug); - VpnAccountData *profiledata = new VpnAccountData(VpnAccountData::freeswan,QString(section->SectionName)) ; + VpnAccountData *profiledata = new VpnAccountData(VpnAccountData::freeswan,TQString(section->SectionName)) ; - for ( QStringList::Iterator it2 = sectiondata.begin(); it2!= sectiondata.end() ; it2++ ) + for ( TQStringList::Iterator it2 = sectiondata.begin(); it2!= sectiondata.end() ; it2++ ) { - QString dataline = *it2; + TQString dataline = *it2; - QString line2 = removeWhiteSpaceAtBegin ( dataline ); // line of text excluding '\n' and replace all white chars with one blank + TQString line2 = removeWhiteSpaceAtBegin ( dataline ); // line of text excluding '\n' and replace all white chars with one blank // std::cout << "dataline: \"" << line2 << "\""; if ( line2.startsWith ( "rightsubnet=" ) ) { validLineFound=true; - QString RightSubnet=line2.section ( "rightsubnet=",1,-1 ); + TQString RightSubnet=line2.section ( "rightsubnet=",1,-1 ); // std::cout << "right subnet (remote) found: " << RightSubnet << std::endl; if ( KvpncDebugLevel > 2 ) appendLogEntry ( i18n ( "import ipsec config: right subnet (remote) found: " ) + RightSubnet ,debug ); @@ -3199,7 +3199,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "leftsubnet=" ) ) { validLineFound=true; - QString LeftSubnet=line2.section ( "leftsubnet=",1,-1 ); + TQString LeftSubnet=line2.section ( "leftsubnet=",1,-1 ); // std::cout << "left subnet (local) found: " << LeftSubnet << std::endl; if ( KvpncDebugLevel > 2 ) appendLogEntry ( i18n ( "import ipsec config: left subnet (local) found: " ) + LeftSubnet ,debug ); @@ -3212,7 +3212,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "rightnexthop=" ) ) { validLineFound=true; - QString RightNextHop=line2.section ( "rightnexthop=",1,-1 ); + TQString RightNextHop=line2.section ( "rightnexthop=",1,-1 ); // std::cout << "right next hop (remote) found: " << RightNextHop << std::endl; if ( KvpncDebugLevel > 2 ) appendLogEntry ( i18n ( "import ipsec config: right next hop (remote) found: " ) +RightNextHop ,debug ); @@ -3225,7 +3225,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "leftnexthop=" ) ) { validLineFound=true; - QString LeftNextHop=line2.section ( "leftnexthop=",1,-1 ); + TQString LeftNextHop=line2.section ( "leftnexthop=",1,-1 ); std::cout << "left next hop (local) found: " << LeftNextHop << std::endl; if (KvpncDebugLevel > 2) appendLogEntry("import ipsec config: left next hop (local) found: " +LeftNextHop ,debug); @@ -3238,7 +3238,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "left=" ) ) { validLineFound=true; - QString left=line2.section ( "left=",1,-1 ); + TQString left=line2.section ( "left=",1,-1 ); // local ip cant be set yet. // std::cout << "left found: " << left << std::endl; // if (KvpncDebugLevel > 2) @@ -3251,7 +3251,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "right=" ) ) { validLineFound=true; - QString right=line2.section ( "right=",1,-1 ); + TQString right=line2.section ( "right=",1,-1 ); // std::cout << "right (remote gateway) found: " << right << std::endl; if ( KvpncDebugLevel > 2 ) appendLogEntry ( i18n ( "import ipsec config: right (remote gateway) found: " ) + right ,debug ); @@ -3263,7 +3263,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "leftcert=" ) ) { validLineFound=true; - QString LeftCert=line2.section ( "leftcert=",1,-1 ); + TQString LeftCert=line2.section ( "leftcert=",1,-1 ); // std::cout << "left cert (local) found: " << LeftCert << std::endl; if ( KvpncDebugLevel > 2 ) appendLogEntry ( i18n ( "import ipsec config: left cert (local) found: " ) + LeftCert ,debug ); @@ -3275,7 +3275,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "rightcert=" ) ) { validLineFound=true; - QString RightCert=line2.section("rightcert=",1,-1); + TQString RightCert=line2.section("rightcert=",1,-1); // std::cout << "right cert (remote) found: " << RightCert << std::endl; if (KvpncDebugLevel > 2) appendLogEntry(i18n ("import ipsec config: right cert (remote) found: ") + RightCert ,debug); @@ -3288,7 +3288,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "rightca=" ) ) { validLineFound=true; - QString RightCA=line2.section ( "rightca=",1,-1 ); + TQString RightCA=line2.section ( "rightca=",1,-1 ); // std::cout << "right CA (remote) found: " << RightCA << std::endl; if ( KvpncDebugLevel > 2 ) appendLogEntry ( i18n ( "import ipsec config: right CA (remote) found: " ) +RightCA ,debug ); @@ -3300,7 +3300,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "rightid=" ) ) { validLineFound=true; - QString RightID=line2.section ( "rightid=",1,-1 ); + TQString RightID=line2.section ( "rightid=",1,-1 ); // std::cout << "right ID (remote) found: " << RightID << std::endl; if ( KvpncDebugLevel > 2 ) appendLogEntry ( i18n ( "import ipsec config: right ID (remote) found: " ) + RightID ,debug ); @@ -3314,7 +3314,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "leftid=" ) ) { validLineFound=true; - QString LeftID=line2.section ( "leftid=",1,-1 ); + TQString LeftID=line2.section ( "leftid=",1,-1 ); // std::cout << "local ID (local) found: " << LeftID << std::endl; if ( KvpncDebugLevel > 2 ) appendLogEntry ( i18n ( "import ipsec config: local ID (local) found: " ) + LeftID ,debug ); @@ -3328,7 +3328,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "rightrsasigkey=" ) ) { validLineFound=true; - QString RightRsaSigKey=line2.section ( "rightrsasigkey=",1,-1 ); + TQString RightRsaSigKey=line2.section ( "rightrsasigkey=",1,-1 ); // std::cout << "right uses (remote) " << RightRsaSigKey << std::endl; if (RightRsaSigKey=="%cert") { @@ -3355,7 +3355,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "leftrsasigkey=" ) ) { validLineFound=true; - QString LeftRsaSigKey=line2.section ( "leftrsasigkey=",1,-1 ); + TQString LeftRsaSigKey=line2.section ( "leftrsasigkey=",1,-1 ); // std::cout << "right uses (remote) " << LeftRsaSigKey << std::endl; if (LeftRsaSigKey=="%cert") { @@ -3381,7 +3381,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "authby=" ) ) { validLineFound=true; - QString Authby=line2.simplifyWhiteSpace().section ( "authby=",1,1 ); + TQString Authby=line2.simplifyWhiteSpace().section ( "authby=",1,1 ); // std::cout << "left and right use certs " << std::endl; if ( Authby.find ( "rsasig", 0 , FALSE ) > -1 ) { @@ -3415,7 +3415,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "auto=start" ) ) { // validLineFound=true; - // QString Authby=line2.simplifyWhiteSpace().section('#',0,0).section("=",1,1); + // TQString Authby=line2.simplifyWhiteSpace().section('#',0,0).section("=",1,1); // std::cout << "profile should be started" << std::endl; // if (KvpncDebugLevel > 2) // appendLogEntry("import ipsec config: profile should be started" ,debug); @@ -3427,7 +3427,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "leftsourceip=" ) ) { validLineFound=true; - QString leftsourceip=line2.section ( "leftsourceip=",1,-1 ); + TQString leftsourceip=line2.section ( "leftsourceip=",1,-1 ); std::cout << "left (local) have to use IP address " << leftsourceip << std::endl; if (KvpncDebugLevel > 2) appendLogEntry("import ipsec config: left (local) have to use IP address " + leftsourceip ,debug); @@ -3439,7 +3439,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "virtual_private=" ) ) { validLineFound=true; - QString virtualprivate=line2.section ( "virtual_private=",1,-1 ); + TQString virtualprivate=line2.section ( "virtual_private=",1,-1 ); std::cout << "virtual private networks " << virtualprivate << std::endl; if (KvpncDebugLevel > 2) appendLogEntry("import ipsec config: virtual private networks " +virtualprivate ,debug); @@ -3452,7 +3452,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "rightsourceip=" ) ) { validLineFound=true; - QString rightsourceip=line2.section ( "rightsourceip=",1,-1 ); + TQString rightsourceip=line2.section ( "rightsourceip=",1,-1 ); std::cout << "right (remote) have to use IP address " << rightsourceip << std::endl; if (KvpncDebugLevel > 2) appendLogEntry("import ipsec config: right (remote) have to use IP address " + rightsourceip ,debug); @@ -3465,7 +3465,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "esp=" ) ) { validLineFound=true; - QString IpsecEsp=line2.section ( "esp=",1,-1 ); + TQString IpsecEsp=line2.section ( "esp=",1,-1 ); // std::cout << "esp settings found: " << IpsecEsp << std::endl; if ( KvpncDebugLevel > 2 ) appendLogEntry ( i18n ( "import ipsec config: esp settings found: " ) + IpsecEsp ,debug ); @@ -3478,7 +3478,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "ike=" ) ) { validLineFound=true; - QString IpsecIke=line2.section ( "ike=",1,-1 ); + TQString IpsecIke=line2.section ( "ike=",1,-1 ); // std::cout << "ike settings found: " << IpsecIke << std::endl; if ( KvpncDebugLevel > 2 ) appendLogEntry ( i18n ( "import ipsec config: ike settings found: " ) + IpsecIke ,debug ); @@ -3491,7 +3491,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "type=" ) ) { validLineFound=true; - QString IpsecVpnMode=line2.section ( "type=",1,1 ); + TQString IpsecVpnMode=line2.section ( "type=",1,1 ); // std::cout << "IpsecType found: " << IpsecType << std::endl; if ( KvpncDebugLevel > 2 ) appendLogEntry ( i18n ( "import ipsec config: IPsec vpn mode found: " ) + IpsecVpnMode ,debug ); @@ -3506,7 +3506,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "leftxauthclient=" ) ) { validLineFound=true; - QString useXauth=line2.section ( "leftxauthclient=",1,1 ); + TQString useXauth=line2.section ( "leftxauthclient=",1,1 ); if (useXauth=="yes") { //std::cout << "Use XAUTH: " << i18n("yes") << std::endl; @@ -3528,7 +3528,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "rightxauthserver=" ) ) { validLineFound=true; - QString useXauth=line2.section ( "rightxauthserver=",1,-1 ); + TQString useXauth=line2.section ( "rightxauthserver=",1,-1 ); if (useXauth == "yes") { //std::cout << "Use XAUTH: " << i18n("yes") << std::endl; @@ -3550,10 +3550,10 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "keyingtries=" ) ) { validLineFound=true; - int MaxConnectTries=QString(line2.section ( "keyingtries=",1,1 )).toInt(); + int MaxConnectTries=TQString(line2.section ( "keyingtries=",1,1 )).toInt(); // std::cout << "keyingtries found: " << MaxConnectTries << std::endl; if ( KvpncDebugLevel > 2 ) - appendLogEntry ( i18n ( "import ipsec config: keyingtries found: " ) + QString().setNum(MaxConnectTries) ,debug ); + appendLogEntry ( i18n ( "import ipsec config: keyingtries found: " ) + TQString().setNum(MaxConnectTries) ,debug ); profiledata->setMaxConnectTries ( MaxConnectTries ); // std::cout << " => set it for profile " << IpsecConfigSection << " ." << std::endl; // if (KvpncDebugLevel > 2) @@ -3562,7 +3562,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "pfs=" ) ) { validLineFound=true; - QString UsePerfectForwardSecrety=line2.section ( "pfs=",1,1 ).remove ( '"' ); + TQString UsePerfectForwardSecrety=line2.section ( "pfs=",1,1 ).remove ( '"' ); if (UsePerfectForwardSecrety =="yes") { //std::cout << "Use PFS: " << i18n("yes") << std::endl; @@ -3584,7 +3584,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "pfsgroup=" ) ) { validLineFound=true; - QString PerfectForwardSecrety=line2.section ( "pfsgroup=",1,1 ); + TQString PerfectForwardSecrety=line2.section ( "pfsgroup=",1,1 ); // std::cout << "keyingtries found: " << MaxConnectTries << std::endl; if ( KvpncDebugLevel > 2 ) appendLogEntry ( i18n ( "import ipsec config: PFS group found: " ) + PerfectForwardSecrety ,debug ); @@ -3596,7 +3596,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if ( line2.startsWith ( "aggrmode=" ) ) { validLineFound=true; - QString UseAgressiveMode=line2.section ( "aggrmode=",1,1 ).remove ( '"' ); + TQString UseAgressiveMode=line2.section ( "aggrmode=",1,1 ).remove ( '"' ); if (UseAgressiveMode == "yes") { //std::cout << "Exchange mode: " << i18n("aggressive") << std::endl; @@ -3648,11 +3648,11 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op // FIXME we only use the first in list - QString Interface = InterfaceList.first(); + TQString Interface = InterfaceList.first(); profiledata->setNetworkDevice(Interface); profiledata->setName("kvpnc_import_"+profiledata->getName()); - profiledata->setDescription(QString(i18n("import from ")+filename)); + profiledata->setDescription(TQString(i18n("import from ")+filename)); ImportedAccountList->append(profiledata); } } @@ -3671,11 +3671,11 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op selectdlg.ImportProfileListView->addColumn(i18n("Gateway")); selectdlg.ImportProfileListView->addColumn(i18n("Authentication")); selectdlg.ImportProfileListView->addColumn(i18n("Remote network")); - QCheckListItem *item; + TQCheckListItem *item; for ( it = ImportedAccountList->first(); it; it = ImportedAccountList->next() ) { - QString name = it->getName(); - QString type=""; + TQString name = it->getName(); + TQString type=""; if ( it->getConnectionType() == VpnAccountData::cisco ) type = "cisco" ; else if ( it->getConnectionType() == VpnAccountData::ciscoorig ) @@ -3696,7 +3696,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op type = i18n("other"); // litem->setSelectable(true); - item = new QCheckListItem(selectdlg.ImportProfileListView,it->getName(),QCheckListItem::CheckBox); + item = new TQCheckListItem(selectdlg.ImportProfileListView,it->getName(),TQCheckListItem::CheckBox); item->setText(1,type); item->setText(2,it->getGateway()); if (it->getAuthType() == VpnAccountData::cert) @@ -3708,13 +3708,13 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op else item->setText(3,i18n("unknown")); selectdlg.ImportProfileListView->insertItem(item); - QString RemoteNetDiv="/"; + TQString RemoteNetDiv="/"; if (it->getRemoteNetAddr() == "") { it->setRemoteNetMask(""); RemoteNetDiv=""; } - item->setText(4,QString(it->getRemoteNetAddr()+RemoteNetDiv+it->getRemoteNetMask())); + item->setText(4,TQString(it->getRemoteNetAddr()+RemoteNetDiv+it->getRemoteNetMask())); // std::cout << "insert profile into listview: " << name << std::endl; } @@ -3723,16 +3723,16 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op if (ret == true) { - QListViewItemIterator it2( selectdlg.ImportProfileListView ); + TQListViewItemIterator it2( selectdlg.ImportProfileListView ); for ( ; it2.current(); ++it2 ) { - if ( ( (QCheckListItem*)it2.current() )->isOn() ) + if ( ( (TQCheckListItem*)it2.current() )->isOn() ) { VpnAccountData *data=NULL; it = 0; for ( it = ImportedAccountList->first(); it; it = ImportedAccountList->next() ) { - if ( it->getName() == ( (QCheckListItem*)it2.current() )->text() && ( (QCheckListItem*)it2.current() )->isOn() ) + if ( it->getName() == ( (TQCheckListItem*)it2.current() )->text() && ( (TQCheckListItem*)it2.current() )->isOn() ) { data = it; importCount++; @@ -3755,11 +3755,11 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op - QString msg=""; + TQString msg=""; if (importCount > 0 ) - msg = i18n("Import was successful. %1 profiles are imported.").arg(QString::number(importCount)); + msg = i18n("Import was successful. %1 profiles are imported.").tqarg(TQString::number(importCount)); else - msg = i18n("Import was canceled because no profiles are selected.").arg(QString::number(importCount)); + msg = i18n("Import was canceled because no profiles are selected.").tqarg(TQString::number(importCount)); KMessageBox::information ( 0, msg,i18n("Import success") ); @@ -3775,7 +3775,7 @@ bool KVpncConfig::importIpsecConfig(QString filename, QString& RetName, bool& op } -bool KVpncConfig::importFritzboxConfig(QString filename, QString& RetName, bool& openProfileManager) +bool KVpncConfig::importFritzboxConfig(TQString filename, TQString& RetName, bool& openProfileManager) { /* // example of vpn config fritzbox user @@ -3875,7 +3875,7 @@ bool KVpncConfig::importFritzboxConfig(QString filename, QString& RetName, bool& } */ - QFile importfile (filename); + TQFile importfile (filename); if (!importfile.exists()) { KMessageBox::error ( 0, i18n ( "Reading of \"%1\" has been failed!" ).arg ( filename ) ); @@ -3883,9 +3883,9 @@ bool KVpncConfig::importFritzboxConfig(QString filename, QString& RetName, bool& } if ( importfile.open(IO_ReadOnly)) { - QString line = NULL; + TQString line = NULL; VpnAccountData *profiledata = new VpnAccountData(VpnAccountData::freeswan,"fritzbox") ; - QTextStream stream(&importfile); + TQTextStream stream(&importfile); bool datapipecfgFound = false; bool policiesFound = false; bool targetsFound = false; @@ -3895,7 +3895,7 @@ bool KVpncConfig::importFritzboxConfig(QString filename, QString& RetName, bool& bool ipnetFound = false; bool nameFound = false; - profiledata->setDescription(QString(i18n("import from ")+filename)); + profiledata->setDescription(TQString(i18n("import from ")+filename)); profiledata->setConnectionType( VpnAccountData::racoon); profiledata->setUsePerfectForwardSecrety(true); profiledata->setPerfectForwardSecrety("modp1024"); @@ -3916,43 +3916,43 @@ bool KVpncConfig::importFritzboxConfig(QString filename, QString& RetName, bool& { line = removeWhiteSpaceAtBegin(stream.readLine()).simplifyWhiteSpace(); if (KvpncDebugLevel > 6) - appendLogEntry(i18n ("import fritzbox config: line: %1").arg(line), debug); + appendLogEntry(i18n ("import fritzbox config: line: %1").tqarg(line), debug); if (line.startsWith("datapipecfg")) { datapipecfgFound = true; if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import fritzbox config: %1 found").arg("datapipecfg"), debug); + appendLogEntry(i18n ("import fritzbox config: %1 found").tqarg("datapipecfg"), debug); } if (line.startsWith("policies")) { policiesFound = true; if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import fritzbox config: %1 found").arg("policies"), debug); + appendLogEntry(i18n ("import fritzbox config: %1 found").tqarg("policies"), debug); } if (line.startsWith("targets")) { targetsFound = true; if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import fritzbox config: %1 found").arg("targets"), debug); + appendLogEntry(i18n ("import fritzbox config: %1 found").tqarg("targets"), debug); } if (line.startsWith("localid")) { localidFound = true; if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import fritzbox config: %1 found").arg("localid"), debug); + appendLogEntry(i18n ("import fritzbox config: %1 found").tqarg("localid"), debug); } if (line.startsWith("phase2localid")) { phase2localidFound = true; if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import fritzbox config: %1 found").arg("phase2localid"), debug); + appendLogEntry(i18n ("import fritzbox config: %1 found").tqarg("phase2localid"), debug); } if (line.startsWith("phase2remoteid")) { phase2remoteidFound = true; if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import fritzbox config: %1 found").arg("phase2remoteid"), debug); + appendLogEntry(i18n ("import fritzbox config: %1 found").tqarg("phase2remoteid"), debug); } if (line.startsWith("ipnet")) { @@ -3968,9 +3968,9 @@ bool KVpncConfig::importFritzboxConfig(QString filename, QString& RetName, bool& { if (line.startsWith("name = ")) { - QString ProfileName=line.section("= ",1,1).replace("\"","").replace(";","").replace(" ","_"); + TQString ProfileName=line.section("= ",1,1).replace("\"","").replace(";","").replace(" ","_"); if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg("name").arg(ProfileName) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg("name").tqarg(ProfileName) ,debug); profiledata->setName(ProfileName); nameFound = true; } @@ -3981,9 +3981,9 @@ bool KVpncConfig::importFritzboxConfig(QString filename, QString& RetName, bool& reconnectAfterConnectionLost = true; if (KvpncDebugLevel > 2) if (reconnectAfterConnectionLost) - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg("always_renew").arg(i18n("yes")) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg("always_renew").tqarg(i18n("yes")) ,debug); else - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg("always_renew").arg(i18n("no")) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg("always_renew").tqarg(i18n("no")) ,debug); profiledata->setDoReconnectAfterConnectionLost(reconnectAfterConnectionLost); } if (line.startsWith("dont_filter_netbios = ")) @@ -3993,47 +3993,47 @@ bool KVpncConfig::importFritzboxConfig(QString filename, QString& RetName, bool& dont_filter_netbios = true; if (KvpncDebugLevel > 2) if (dont_filter_netbios) - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg("dont_filter_netbios").arg(i18n("yes")) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg("dont_filter_netbios").tqarg(i18n("yes")) ,debug); else - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg("dont_filter_netbios").arg(i18n("no")) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg("dont_filter_netbios").tqarg(i18n("no")) ,debug); // nothing to yet } if (line.startsWith("localip = ")) { - QString LocalIp=line.section("= ",1,1).replace("\"","").replace(";",""); + TQString LocalIp=line.section("= ",1,1).replace("\"","").replace(";",""); if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg("localip").arg(LocalIp) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg("localip").tqarg(LocalIp) ,debug); // nothing to do yet } if (line.startsWith("virtualip = ")) { - QString LocalVirtualIp=line.section("= ",1,1).replace("\"","").replace(";",""); + TQString LocalVirtualIp=line.section("= ",1,1).replace("\"","").replace(";",""); if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg("virtualip").arg(LocalVirtualIp) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg("virtualip").tqarg(LocalVirtualIp) ,debug); profiledata->setUseLeftSourceIp(true); profiledata->setLeftSourceIp(LocalVirtualIp); } if (line.startsWith("remoteip = ")) { - QString RemoteIp=line.section("= ",1,1).replace("\"","").replace(";",""); + TQString RemoteIp=line.section("= ",1,1).replace("\"","").replace(";",""); if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg("remoteip").arg(RemoteIp) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg("remoteip").tqarg(RemoteIp) ,debug); // nothing to do yet } if (line.startsWith("remotehostname = ")) { - QString Gateway=line.section("= ",1,1).replace("\"","").replace(";",""); + TQString Gateway=line.section("= ",1,1).replace("\"","").replace(";",""); if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg("remotehostname").arg(Gateway) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg("remotehostname").tqarg(Gateway) ,debug); profiledata->setGateway(Gateway); } if (localidFound) { if (line.startsWith("user_fqdn = ")) { - QString LocalId=line.section("= ",1,1).replace("\"","").replace(";",""); + TQString LocalId=line.section("= ",1,1).replace("\"","").replace(";",""); if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg(QString("user_fqdn")+" ("+i18n("local id")+")").arg(LocalId) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg(TQString("user_fqdn")+" ("+i18n("local id")+")").tqarg(LocalId) ,debug); profiledata->setSpecialLocalID(LocalId); profiledata->setUseSpecialLocalID(true); profiledata->setLocalIDType("user_fqdn"); @@ -4042,10 +4042,10 @@ bool KVpncConfig::importFritzboxConfig(QString filename, QString& RetName, bool& } if (line.startsWith("mode = ")) { - QString IpsecExchangeMode=line.section("= ",1,1).replace(";",""); + TQString IpsecExchangeMode=line.section("= ",1,1).replace(";",""); if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg(i18n("exchange mode")).arg(IpsecExchangeMode) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg(i18n("exchange mode")).tqarg(IpsecExchangeMode) ,debug); if (IpsecExchangeMode == "mode_aggressive") profiledata->setExchangeMode("aggressive"); @@ -4054,9 +4054,9 @@ bool KVpncConfig::importFritzboxConfig(QString filename, QString& RetName, bool& } if (line.startsWith("keytype = ")) { - QString AuthType=line.section("= ",1,1).replace(";",""); + TQString AuthType=line.section("= ",1,1).replace(";",""); if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg("keytype").arg(AuthType) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg("keytype").tqarg(AuthType) ,debug); if (AuthType == "keytype_pre_shared") profiledata->setAuthType(VpnAccountData::psk); @@ -4065,11 +4065,11 @@ bool KVpncConfig::importFritzboxConfig(QString filename, QString& RetName, bool& } if (line.startsWith("key = ")) { - QString PreshardKey=line.section("= ",1,1).replace("\"","").replace(";",""); + TQString PreshardKey=line.section("= ",1,1).replace("\"","").replace(";",""); if (KvpncDebugLevel > 2 && KvpncDebugLevel < 5) - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg("key").arg("******") ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg("key").tqarg("******") ,debug); if (KvpncDebugLevel > 5) - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg("key").arg(PreshardKey) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg("key").tqarg(PreshardKey) ,debug); profiledata->setPreSharedKey(PreshardKey); profiledata->setPskIsInFile(false); } @@ -4080,9 +4080,9 @@ bool KVpncConfig::importFritzboxConfig(QString filename, QString& RetName, bool& cert_do_server_auth = true; if (KvpncDebugLevel > 2) if (cert_do_server_auth) - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg("cert_do_server_auth").arg(i18n("yes")) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg("cert_do_server_auth").tqarg(i18n("yes")) ,debug); else - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg("cert_do_server_auth").arg(i18n("no")) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg("cert_do_server_auth").tqarg(i18n("no")) ,debug); // nothing to to yet } if (line.startsWith("use_nat_t = ")) @@ -4092,9 +4092,9 @@ bool KVpncConfig::importFritzboxConfig(QString filename, QString& RetName, bool& UseNat = true; if (KvpncDebugLevel > 2) if (UseNat) - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg("use_nat_t").arg(i18n("yes")) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg("use_nat_t").tqarg(i18n("yes")) ,debug); else - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg("use_nat_t").arg(i18n("no")) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg("use_nat_t").tqarg(i18n("no")) ,debug); profiledata->setUseNat(UseNat); profiledata->setUseUdp(true); } @@ -4105,9 +4105,9 @@ bool KVpncConfig::importFritzboxConfig(QString filename, QString& RetName, bool& UseXauth = true; if (KvpncDebugLevel > 2) if (UseXauth) - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg("use_xauth").arg(i18n("yes")) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg("use_xauth").tqarg(i18n("yes")) ,debug); else - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg("use_xauth").arg(i18n("no")) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg("use_xauth").tqarg(i18n("no")) ,debug); profiledata->setAuthWithUsernameAndPassword(UseXauth); } if (line.startsWith("use_cfgmode = ")) @@ -4117,18 +4117,18 @@ bool KVpncConfig::importFritzboxConfig(QString filename, QString& RetName, bool& ModeConfig = true; if (KvpncDebugLevel > 2) if (ModeConfig) - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg("use_cfgmode").arg(i18n("yes")) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg("use_cfgmode").tqarg(i18n("yes")) ,debug); else - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg("use_cfgmode").arg(i18n("no")) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg("use_cfgmode").tqarg(i18n("no")) ,debug); profiledata->setUseModeConfig(ModeConfig); } if (phase2localidFound) { if (line.startsWith("ipaddr = ")) { - QString Phase2LocalId=line.section("= ",1,1).replace("\"","").replace(";",""); + TQString Phase2LocalId=line.section("= ",1,1).replace("\"","").replace(";",""); if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg(i18n("ip addr for phase 2")).arg(Phase2LocalId) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg(i18n("ip addr for phase 2")).tqarg(Phase2LocalId) ,debug); // nothing to do yet } } @@ -4137,20 +4137,20 @@ bool KVpncConfig::importFritzboxConfig(QString filename, QString& RetName, bool& profiledata->setUseRemoteNetwork(true); if (line.startsWith("ipaddr = ")) { - QString RemoteNetWorkAddr=line.section("= ",1,1).replace(";",""); + TQString RemoteNetWorkAddr=line.section("= ",1,1).replace(";",""); if (KvpncDebugLevel > 2) - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg(i18n("remote network ip")).arg(RemoteNetWorkAddr) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg(i18n("remote network ip")).tqarg(RemoteNetWorkAddr) ,debug); profiledata->setRemoteNetAddr(RemoteNetWorkAddr); } if (line.startsWith("mask = ")) { - QString RemoteNetWorkMask=line.section("= ",1,1).replace(";",""); - QString RemoteNetWorkMaskNumeric = QString().setNum(Utils(this).dottedIpv4Netmask2NetmaskBytes(RemoteNetWorkMask)); + TQString RemoteNetWorkMask=line.section("= ",1,1).replace(";",""); + TQString RemoteNetWorkMaskNumeric = TQString().setNum(Utils(this).dottedIpv4Netmask2NetmaskBytes(RemoteNetWorkMask)); if (KvpncDebugLevel > 2) { - appendLogEntry(i18n ("import fritzbox config: %1 found: %2").arg(i18n("remote network netmask")).arg(RemoteNetWorkMask) ,debug); + appendLogEntry(i18n ("import fritzbox config: %1 found: %2").tqarg(i18n("remote network netmask")).tqarg(RemoteNetWorkMask) ,debug); - appendLogEntry(i18n("Netmask (dotted): %1, numeric value: %2").arg(RemoteNetWorkMask).arg(RemoteNetWorkMaskNumeric), debug); + appendLogEntry(i18n("Netmask (dotted): %1, numeric value: %2").tqarg(RemoteNetWorkMask).tqarg(RemoteNetWorkMaskNumeric), debug); } profiledata->setRemoteNetMask(RemoteNetWorkMaskNumeric); } @@ -4169,11 +4169,11 @@ bool KVpncConfig::importFritzboxConfig(QString filename, QString& RetName, bool& { if ( it->getName() == profiledata->getName() ) { - //account->setName( QString( account->getName() + "_2" ) ); - // KMessageBox::information ( this, i18n( "Profile name exists!\n It will be renamed to \"%1\"." ).arg( account->getName() ), i18n( "Name exist, renamed" ) ); + //account->setName( TQString( account->getName() + "_2" ) ); + // KMessageBox::information ( this, i18n( "Profile name exists!\n It will be renamed to \"%1\"." ).tqarg( account->getName() ), i18n( "Name exist, renamed" ) ); KMessageBox::error ( 0, i18n ( "Profile name exists!" ), i18n ( "Name Exists" ) ); nameOk = false; - QString newName = KInputDialog::getText ( i18n ( "New Name" ), i18n ( "New name for profile:" ), QString ( profiledata->getName() + "_2" ), &ok ); + TQString newName = KInputDialog::getText ( i18n ( "New Name" ), i18n ( "New name for profile:" ), TQString ( profiledata->getName() + "_2" ), &ok ); if (newName.isEmpty()) { KMessageBox::information ( 0, i18n ( "Import was canceled." ) ); @@ -4200,7 +4200,7 @@ bool KVpncConfig::importFritzboxConfig(QString filename, QString& RetName, bool& saveOptions(true, RetName); appendLogEntry ( i18n ( "Import of \"%1\" (%2) was successful." ).arg ( profiledata->getName() ).arg ( "Fritzbox" ), info ); - QString bin = "racoon"; + TQString bin = "racoon"; ToolInfo *tool; //std::cout << "Tool (bin): " << bin << std::endl; if ( !ToolList->isEmpty() ) @@ -4227,7 +4227,7 @@ bool KVpncConfig::importFritzboxConfig(QString filename, QString& RetName, bool& } } - QString msg=""; + TQString msg=""; if (policiesFound && nameFound) msg = i18n("Import was successful. 1 profile was imported."); else @@ -4245,7 +4245,7 @@ bool KVpncConfig::importFritzboxConfig(QString filename, QString& RetName, bool& } -VpnAccountData* KVpncConfig::findProfile(QPtrList<VpnAccountData> *list,const QString& Name) +VpnAccountData* KVpncConfig::findProfile(TQPtrList<VpnAccountData> *list,const TQString& Name) { VpnAccountData *it=NULL; bool found=false; @@ -4271,13 +4271,13 @@ VpnAccountData* KVpncConfig::findProfile(QPtrList<VpnAccountData> *list,const QS } } -QString KVpncConfig::removeWhiteSpaceAtBegin(const QString str) +TQString KVpncConfig::removeWhiteSpaceAtBegin(const TQString str) { - QString newstr=""; + TQString newstr=""; int i=0; for (i=0;i<(int)str.length();i++) { - if (!QChar(str.at(i)).isSpace()) + if (!TQChar(str.at(i)).isSpace()) break; } newstr = str.right(str.length()-i); @@ -4287,16 +4287,16 @@ QString KVpncConfig::removeWhiteSpaceAtBegin(const QString str) void KVpncConfig::doBackupConfig() { KStandardDirs * dirs = KGlobal::dirs(); - QString config = QString(dirs->saveLocation( "config" )+"/kvpncrc"); - QFile OriginalConfFile( config ); - QFile backupOriginalConfFile( config+".backup" ); - QTextStream writestream( &backupOriginalConfFile ); - QTextStream readstream( &OriginalConfFile ); + TQString config = TQString(dirs->saveLocation( "config" )+"/kvpncrc"); + TQFile OriginalConfFile( config ); + TQFile backupOriginalConfFile( config+".backup" ); + TQTextStream writestream( &backupOriginalConfFile ); + TQTextStream readstream( &OriginalConfFile ); if ( OriginalConfFile.open( IO_ReadOnly ) ) { if (backupOriginalConfFile.open(IO_WriteOnly)) { - QString OriginalConfFileContent = QString( OriginalConfFile.readAll() ) ; + TQString OriginalConfFileContent = TQString( OriginalConfFile.readAll() ) ; writestream << OriginalConfFileContent; OriginalConfFile.close(); backupOriginalConfFile.close(); @@ -4307,16 +4307,16 @@ void KVpncConfig::doBackupConfig() void KVpncConfig::restoreBackupConfig() { KStandardDirs * dirs = KGlobal::dirs(); - QString config = QString(dirs->saveLocation( "config" )+"/kvpncrc"); - QFile OriginalConfFile( config+".backup" ); - QFile backupOriginalConfFile( config ); - QTextStream writestream( &backupOriginalConfFile ); - QTextStream readstream( &OriginalConfFile ); + TQString config = TQString(dirs->saveLocation( "config" )+"/kvpncrc"); + TQFile OriginalConfFile( config+".backup" ); + TQFile backupOriginalConfFile( config ); + TQTextStream writestream( &backupOriginalConfFile ); + TQTextStream readstream( &OriginalConfFile ); if ( OriginalConfFile.open( IO_ReadOnly ) ) { if (backupOriginalConfFile.open(IO_WriteOnly)) { - QString OriginalConfFileContent = QString( OriginalConfFile.readAll() ) ; + TQString OriginalConfFileContent = TQString( OriginalConfFile.readAll() ) ; writestream << OriginalConfFileContent; OriginalConfFile.close(); backupOriginalConfFile.close(); @@ -4337,10 +4337,10 @@ void KVpncConfig::getToolsInfo() } } -void KVpncConfig::removeEntry(QString Name) +void KVpncConfig::removeEntry(TQString Name) { KStandardDirs * dirs = KGlobal::dirs(); - QString filePath = dirs->findResource ( "config", "kvpncrc" ); + TQString filePath = dirs->findResource ( "config", "kvpncrc" ); appPointer->processEvents(); @@ -4354,11 +4354,11 @@ void KVpncConfig::removeEntry(QString Name) { if ( !it->getName().isEmpty() ) { - QString name = it->getName(); + TQString name = it->getName(); if (it->getName() == Name) { //std::cout << "Remove profile: " << it->getName() << std::endl; - QString ProfileName = "Profile_"; + TQString ProfileName = "Profile_"; ProfileName += name; config->setGroup( ProfileName ); @@ -4371,7 +4371,7 @@ void KVpncConfig::removeEntry(QString Name) wallet = KWallet::Wallet::openWallet(KWallet::Wallet::LocalWallet()); if (wallet != 0) { - QString walletname="kvpnc"; + TQString walletname="kvpnc"; // Check if folder exists, otherwise create it bool walletOK=true; if (!wallet->hasFolder(walletname)) @@ -4383,27 +4383,27 @@ void KVpncConfig::removeEntry(QString Name) { wallet->setFolder(walletname); //std::cout << "[set] account: " << ProfileName << ", loginname: " << loginname << ", password: " << pwd << std::endl; - bool UserPasswordOK = (wallet->removeEntry (QString(name+"__user_pw")) == 0); - bool PskOK= (wallet->removeEntry (QString(name+"__psk")) == 0); - bool PskKeyPassOK = (wallet->removeEntry (QString(name+"__priv_key_pwd")) == 0); + bool UserPasswordOK = (wallet->removeEntry (TQString(name+"__user_pw")) == 0); + bool PskOK= (wallet->removeEntry (TQString(name+"__psk")) == 0); + bool PskKeyPassOK = (wallet->removeEntry (TQString(name+"__priv_key_pwd")) == 0); // wallet->sync(); if (KvpncDebugLevel > 2) { if (UserPasswordOK) - appendLogEntry(i18n( "delete of %1 was ok." ).arg(i18n("user password")), debug); + appendLogEntry(i18n( "delete of %1 was ok." ).tqarg(i18n("user password")), debug); else - appendLogEntry(i18n( "delete of %1 has failed." ).arg(i18n("user password")), debug); + appendLogEntry(i18n( "delete of %1 has failed." ).tqarg(i18n("user password")), debug); // if (PskOK) - appendLogEntry(i18n( "delete of %1 was successful." ).arg(i18n("preshared key")), debug); + appendLogEntry(i18n( "delete of %1 was successful." ).tqarg(i18n("preshared key")), debug); else - appendLogEntry(i18n( "delete of %1 has failed." ).arg(i18n("preshared key")),debug); + appendLogEntry(i18n( "delete of %1 has failed." ).tqarg(i18n("preshared key")),debug); if (PskKeyPassOK) - appendLogEntry(i18n( "delete of %1 was successful." ).arg(i18n("private key password")), debug); + appendLogEntry(i18n( "delete of %1 was successful." ).tqarg(i18n("private key password")), debug); else - appendLogEntry(i18n( "delete of %1 has failed." ).arg(i18n("private key password")),debug); + appendLogEntry(i18n( "delete of %1 has failed." ).tqarg(i18n("private key password")),debug); // //std::cout << "success: " << pwdOK << std::endl; @@ -4509,8 +4509,8 @@ void KVpncConfig::removeEntry(QString Name) config->deleteGroup( ProfileName ); /* give info */ - //slotStatusMsg ( i18n( "Profile \"%1\" removed." ).arg( Name ), ID_FLASH_MSG ); - appendLogEntry ( i18n( "Profile \"%1\" removed." ).arg( Name ) , info); + //slotStatusMsg ( i18n( "Profile \"%1\" removed." ).tqarg( Name ), ID_FLASH_MSG ); + appendLogEntry ( i18n( "Profile \"%1\" removed." ).tqarg( Name ) , info); AccountList->remove(it); break; } |