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/utils.cpp | |
parent | d08a0ede1d2cb15bb14b0ff75eacf5c682b1fa0a (diff) | |
download | kvpnc-1b89319fd93b88313cab40f1e9de24c067b04efb.tar.gz kvpnc-1b89319fd93b88313cab40f1e9de24c067b04efb.zip |
Initial TQt conversion
Diffstat (limited to 'src/utils.cpp')
-rw-r--r-- | src/utils.cpp | 504 |
1 files changed, 252 insertions, 252 deletions
diff --git a/src/utils.cpp b/src/utils.cpp index 144422d..48e58ae 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -19,29 +19,29 @@ ***************************************************************************/ //BEGIN INCLUDES #include "utils.h" -#include <qstring.h> -#include <qapplication.h> +#include <tqstring.h> +#include <tqapplication.h> #include <iostream> -#include <qfile.h> -#include <qprocess.h> -#include <qstring.h> +#include <tqfile.h> +#include <tqprocess.h> +#include <tqstring.h> #include <klocale.h> #include <ksimpleconfig.h> -#include <qdir.h> +#include <tqdir.h> #include <kstddirs.h> #include <kdebug.h> #include <kstandarddirs.h> #include <netdb.h> // name resolving #include <arpa/inet.h> -#include <qregexp.h> +#include <tqregexp.h> #include <kmessagebox.h> //END INCLUDES -Utils::Utils( KVpncConfig* config, QObject *parent, const char *name ) - : QObject( parent, name ) +Utils::Utils( KVpncConfig* config, TQObject *parent, const char *name ) + : TQObject( parent, name ) { - env = new QStringList(); + env = new TQStringList(); *env << "LC_ALL=C" << "LANG=C" << "PATH=/bin:/usr/bin:/usr/sbin:/sbin"; this->config = config; retrieveValidNetworkdevice = false; @@ -56,14 +56,14 @@ Utils::~Utils() // delete NetworkDeviceTestProcess; } -bool Utils::isValidIPv4Address( QString Address ) +bool Utils::isValidIPv4Address( TQString Address ) { if ( Address.contains( '.' ) != 3 ) return false; else { //std::cout << "test1 succeed.\n"; - QString addr = Address; + TQString addr = Address; int part0 = addr.section( '.', 0, 0 ).toInt(); int part1 = addr.section( '.', 1, 1 ).toInt(); int part2 = addr.section( '.', 2, 2 ).toInt(); @@ -81,7 +81,7 @@ bool Utils::isValidIPv4Address( QString Address ) } } -bool Utils::isValidIPv4NetworkAddress( QString Address ) +bool Utils::isValidIPv4NetworkAddress( TQString Address ) { if ( isValidIPv4Address ( Address ) ) { @@ -94,7 +94,7 @@ bool Utils::isValidIPv4NetworkAddress( QString Address ) return false; } -bool Utils::isValidIPv4BroadcastAddress( QString Address ) +bool Utils::isValidIPv4BroadcastAddress( TQString Address ) { if ( isValidIPv4Address ( Address ) ) { @@ -108,14 +108,14 @@ bool Utils::isValidIPv4BroadcastAddress( QString Address ) return false; } -bool Utils::isValidIPv4Netmask(QString Netmask) +bool Utils::isValidIPv4Netmask(TQString Netmask) { if ( Netmask.contains( '.' ) != 3 ) return false; else { //std::cout << "test1 succeed.\n"; - QString addr = Netmask; + TQString addr = Netmask; int part0 = addr.section( '.', 0, 0 ).toInt(); int part1 = addr.section( '.', 1, 1 ).toInt(); int part2 = addr.section( '.', 2, 2 ).toInt(); @@ -135,7 +135,7 @@ bool Utils::isValidIPv4Netmask(QString Netmask) bool Utils::tunDevExists() { - if ( QFile ( "/dev/net/tun" ).exists() ) + if ( TQFile ( "/dev/net/tun" ).exists() ) return true; else return false; @@ -143,12 +143,12 @@ bool Utils::tunDevExists() bool Utils::createTunDev() { - createProcess = new QProcess( this ); - connect( createProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutCreateTunDev() ) ); - connect( createProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrCreateTunDev() ) ); + createProcess = new TQProcess( this ); + connect( createProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutCreateTunDev() ) ); + connect( createProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrCreateTunDev() ) ); // step one: create directory - if ( !QDir ( "/dev/net" ).exists() ) + if ( !TQDir ( "/dev/net" ).exists() ) { createProcess->addArgument("mkdir") ; //createProcess->addArgument("-p"); @@ -156,8 +156,8 @@ bool Utils::createTunDev() if ( !createProcess->start(env) ) { - disconnect( createProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutCreateTunDev() ) ); - disconnect( createProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrCreateTunDev() ) ); + disconnect( createProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutCreateTunDev() ) ); + disconnect( createProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrCreateTunDev() ) ); delete createProcess; createProcess=0L; kdError() << "Unable to create tunnel device file!" << endl; @@ -181,8 +181,8 @@ bool Utils::createTunDev() if ( !createProcess->start(env) ) { - disconnect( createProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutCreateTunDev() ) ); - disconnect( createProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrCreateTunDev() ) ); + disconnect( createProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutCreateTunDev() ) ); + disconnect( createProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrCreateTunDev() ) ); delete createProcess; createProcess = 0L; kdError() << "Unable to create tunnel device file!" << endl; @@ -194,8 +194,8 @@ bool Utils::createTunDev() { sleep ( 1 ); } - disconnect( createProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutCreateTunDev() ) ); - disconnect( createProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrCreateTunDev() ) ); + disconnect( createProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutCreateTunDev() ) ); + disconnect( createProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrCreateTunDev() ) ); delete createProcess; createProcess = 0L; return true; @@ -203,20 +203,20 @@ bool Utils::createTunDev() return false; } -bool Utils::loadKernelModule( QString Name, QApplication *app ) +bool Utils::loadKernelModule( TQString Name, TQApplication *app ) { if ( !Name.isEmpty() ) { modprobeSuccess = true; - ModprobeProcess = new QProcess( this ); + ModprobeProcess = new TQProcess( this ); ModprobeProcess->addArgument( "/sbin/modprobe" ); ModprobeProcess->addArgument( Name ); - connect( ModprobeProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutLoadKernelModule() ) ); - connect( ModprobeProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrLoadKernelModule() ) ); + connect( ModprobeProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutLoadKernelModule() ) ); + connect( ModprobeProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrLoadKernelModule() ) ); if ( !ModprobeProcess->start( env ) ) { - disconnect( ModprobeProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutLoadKernelModule() ) ); - disconnect( ModprobeProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrLoadKernelModule() ) ); + disconnect( ModprobeProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutLoadKernelModule() ) ); + disconnect( ModprobeProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrLoadKernelModule() ) ); delete ModprobeProcess; ModprobeProcess = 0L; return modprobeSuccess; @@ -231,8 +231,8 @@ bool Utils::loadKernelModule( QString Name, QApplication *app ) config->appPointer->processEvents(); usleep(250); } - disconnect( ModprobeProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutLoadKernelModule() ) ); - disconnect( ModprobeProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrLoadKernelModule() ) ); + disconnect( ModprobeProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutLoadKernelModule() ) ); + disconnect( ModprobeProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrLoadKernelModule() ) ); delete ModprobeProcess; ModprobeProcess = 0L; return modprobeSuccess; @@ -243,12 +243,12 @@ bool Utils::loadKernelModule( QString Name, QApplication *app ) return false; } -bool Utils::unloadKernelModule( QString Name, QApplication *app , bool force) +bool Utils::unloadKernelModule( TQString Name, TQApplication *app , bool force) { if ( !Name.isEmpty() ) { modprobeSuccess = true; - ModprobeProcess = new QProcess( this ); + ModprobeProcess = new TQProcess( this ); ModprobeProcess->addArgument( "/sbin/rmmod" ); if (force == true) @@ -256,11 +256,11 @@ bool Utils::unloadKernelModule( QString Name, QApplication *app , bool force) ModprobeProcess->addArgument( Name ); - connect( ModprobeProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutLoadKernelModule() ) ); - connect( ModprobeProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrLoadKernelModule() ) ); + connect( ModprobeProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutLoadKernelModule() ) ); + connect( ModprobeProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrLoadKernelModule() ) ); if ( !ModprobeProcess->start( env ) ) { - disconnect( ModprobeProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutLoadKernelModule() ) ); - disconnect( ModprobeProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrLoadKernelModule() ) ); + disconnect( ModprobeProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutLoadKernelModule() ) ); + disconnect( ModprobeProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrLoadKernelModule() ) ); delete ModprobeProcess; ModprobeProcess = 0L; return modprobeSuccess; @@ -275,8 +275,8 @@ bool Utils::unloadKernelModule( QString Name, QApplication *app , bool force) config->appPointer->processEvents(); usleep(250); } - disconnect( ModprobeProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutLoadKernelModule() ) ); - disconnect( ModprobeProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrLoadKernelModule() ) ); + disconnect( ModprobeProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutLoadKernelModule() ) ); + disconnect( ModprobeProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrLoadKernelModule() ) ); delete ModprobeProcess; ModprobeProcess = 0L; return modprobeSuccess; @@ -287,9 +287,9 @@ bool Utils::unloadKernelModule( QString Name, QApplication *app , bool force) return false; } -bool Utils::doChmod( QString file, QString mode ) +bool Utils::doChmod( TQString file, TQString mode ) { - config->appendLogEntry ( i18n( "\"%1\" begin." ).arg("chmod"),config->info ); + config->appendLogEntry ( i18n( "\"%1\" begin." ).tqarg("chmod"),config->info ); KProcess *chmodProcess = new KProcess; *chmodProcess << "/bin/chmod"; *chmodProcess << mode; @@ -297,27 +297,27 @@ bool Utils::doChmod( QString file, QString mode ) if ( !chmodProcess->start() ) { - // KMessageBox::sorry( this, i18n( "\"%1\" start failed!" ).arg( "PppdUpScript" ) ); - config->appendLogEntry( i18n( "Chmod of %1 failed!" ).arg( file ), config->error ); + // KMessageBox::sorry( this, i18n( "\"%1\" start failed!" ).tqarg( "PppdUpScript" ) ); + config->appendLogEntry( i18n( "Chmod of %1 failed!" ).tqarg( file ), config->error ); delete chmodProcess; return false; } else { if ( config->KvpncDebugLevel > 0 ) - config->appendLogEntry ( i18n( "chmod of %1 (%2) started." ).arg( file ).arg( mode ) , config->debug ); + config->appendLogEntry ( i18n( "chmod of %1 (%2) started." ).tqarg( file ).tqarg( mode ) , config->debug ); int max_count = 9; int count=0; while ( count < max_count && chmodProcess->isRunning() ) { if ( config->KvpncDebugLevel > 6 ) - config->appendLogEntry ( i18n( "chmod of %1 (%2) running." ).arg( file ).arg( mode ) , config->debug ); + config->appendLogEntry ( i18n( "chmod of %1 (%2) running." ).tqarg( file ).tqarg( mode ) , config->debug ); usleep ( 250 ); if ( config->appPointer->hasPendingEvents () ) config->appPointer->processEvents(); count++; } - config->appendLogEntry ( i18n( "\"%1\" finished." ).arg("chmod"),config->info ); + config->appendLogEntry ( i18n( "\"%1\" finished." ).tqarg("chmod"),config->info ); delete chmodProcess; return true; } @@ -326,19 +326,19 @@ bool Utils::doChmod( QString file, QString mode ) bool Utils::resolvConfAvailable() { bool resolvConfAvailable=false; - if (QFile("/sbin/resolvconf").exists() && QFile("/etc/init.d/resolvconf").exists()) + if (TQFile("/sbin/resolvconf").exists() && TQFile("/etc/init.d/resolvconf").exists()) resolvConfAvailable=true; else resolvConfAvailable=false; return resolvConfAvailable; } -QPtrList<ToolInfo>* Utils::getToolList() +TQPtrList<ToolInfo>* Utils::getToolList() { - QPtrList<ToolInfo> *ToolList = new QPtrList<ToolInfo>(); + TQPtrList<ToolInfo> *ToolList = new TQPtrList<ToolInfo>(); //TODO move to KVpncConfig - QStringList *ToolNamesList = new QStringList(); + TQStringList *ToolNamesList = new TQStringList(); ToolNamesList->append( "vpnc" ); ToolNamesList->append( "vpnclient" ); ToolNamesList->append( "racoon" ); @@ -371,7 +371,7 @@ QPtrList<ToolInfo>* Utils::getToolList() ToolNamesList->append( "netstat" ); ToolInfo *currentTool; - for ( QStringList::Iterator it = ToolNamesList->begin(); it != ToolNamesList->end(); it++ ) { + for ( TQStringList::Iterator it = ToolNamesList->begin(); it != ToolNamesList->end(); it++ ) { //std::cout << "tool: " << *it << std::endl; currentTool = new ToolInfo( *it ); @@ -447,7 +447,7 @@ QPtrList<ToolInfo>* Utils::getToolList() } -ToolInfo* Utils::getToolInfo( QString name ) +ToolInfo* Utils::getToolInfo( TQString name ) { ToolInfo * Tool = 0; for ( Tool = config->ToolList->first();Tool;Tool = config->ToolList->next() ) @@ -458,7 +458,7 @@ ToolInfo* Utils::getToolInfo( QString name ) return Tool; } -QString Utils::resolveName( QString Name ) +TQString Utils::resolveName( TQString Name ) { resolvedIP = ""; resolveFinished = false; @@ -471,56 +471,56 @@ QString Utils::resolveName( QString Name ) std::cout << "gethostbyname failed" << std::endl; } else - resolvedIP = QString( inet_ntoa( *( struct in_addr* ) server_entry->h_addr_list[ 0 ] ) ); + resolvedIP = TQString( inet_ntoa( *( struct in_addr* ) server_entry->h_addr_list[ 0 ] ) ); return resolvedIP; } -QString Utils::removeSpecialCharsForFilename( QString filename ) +TQString Utils::removeSpecialCharsForFilename( TQString filename ) { - filename.replace( QRegExp( "[*]+" ), "_" ); - filename.replace( QRegExp( "[+] +" ), "_" ); - filename.replace( QRegExp( "[$]+" ), "_" ); - filename.replace( QRegExp( ":+" ), "_" ); - filename.replace( QRegExp( "ᅵ" ), "_" ); - filename.replace( QRegExp( "ᅵ" ), "_" ); - filename.replace( QRegExp( "+" ), "_" ); - filename.replace( QRegExp( "ᅵ" ), "_" ); - filename.replace( QRegExp( "ᅵ" ), "_" ); - filename.replace( QRegExp( "ᅵ" ), "_" ); - filename.replace( QRegExp( "ᅵ" ), "_" ); + filename.replace( TQRegExp( "[*]+" ), "_" ); + filename.replace( TQRegExp( "[+] +" ), "_" ); + filename.replace( TQRegExp( "[$]+" ), "_" ); + filename.replace( TQRegExp( ":+" ), "_" ); + filename.replace( TQRegExp( "ᅵ" ), "_" ); + filename.replace( TQRegExp( "ᅵ" ), "_" ); + filename.replace( TQRegExp( "+" ), "_" ); + filename.replace( TQRegExp( "ᅵ" ), "_" ); + filename.replace( TQRegExp( "ᅵ" ), "_" ); + filename.replace( TQRegExp( "ᅵ" ), "_" ); + filename.replace( TQRegExp( "ᅵ" ), "_" ); filename.replace( "\\" , "_" ); filename.replace( "/" , "_" ); - filename.replace( QRegExp( ";+" ), "_" ); - filename.replace( QRegExp( " " ), "_" ); - filename.replace( QRegExp( "_+" ), "_" ); + filename.replace( TQRegExp( ";+" ), "_" ); + filename.replace( TQRegExp( " " ), "_" ); + filename.replace( TQRegExp( "_+" ), "_" ); filename.replace( ")" , "_" ); filename.replace( "(" , "_" ); filename.replace( " " , "_" ); return filename; } -QStringList Utils::getOpenvpnCiphers() +TQStringList Utils::getOpenvpnCiphers() { OpenvpnCiphers.clear(); retrieveOpenvpnCiphers = false; ToolInfo *OpenvpnInfo = getToolInfo ( "openvpn" ); - QString pathToOpenvpn = OpenvpnInfo->PathToExec; + TQString pathToOpenvpn = OpenvpnInfo->PathToExec; if ( pathToOpenvpn.isEmpty() ) return OpenvpnCiphers; - OpenvpnCiphersProcess = new QProcess( this ); + OpenvpnCiphersProcess = new TQProcess( this ); OpenvpnCiphersProcess->addArgument( pathToOpenvpn ); OpenvpnCiphersProcess->addArgument( "--show-ciphers" ); - connect( OpenvpnCiphersProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutRetriveOpenvpnCiphers() ) ); - connect( OpenvpnCiphersProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrRetriveOpenvpnCiphers() ) ); + connect( OpenvpnCiphersProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutRetriveOpenvpnCiphers() ) ); + connect( OpenvpnCiphersProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrRetriveOpenvpnCiphers() ) ); if ( !OpenvpnCiphersProcess->start( env ) ) { - disconnect( OpenvpnCiphersProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutRetriveOpenvpnCiphers() ) ); - disconnect( OpenvpnCiphersProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrRetriveOpenvpnCiphers() ) ); + disconnect( OpenvpnCiphersProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutRetriveOpenvpnCiphers() ) ); + disconnect( OpenvpnCiphersProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrRetriveOpenvpnCiphers() ) ); delete OpenvpnCiphersProcess; OpenvpnCiphersProcess=0L; kdError() << "Unable to fetch openvpn ciphers!" << endl; @@ -533,8 +533,8 @@ QStringList Utils::getOpenvpnCiphers() config->appPointer->processEvents(); sleep ( 1 ); } - disconnect( OpenvpnCiphersProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutRetriveOpenvpnCiphers() ) ); - disconnect( OpenvpnCiphersProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrRetriveOpenvpnCiphers() ) ); + disconnect( OpenvpnCiphersProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutRetriveOpenvpnCiphers() ) ); + disconnect( OpenvpnCiphersProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrRetriveOpenvpnCiphers() ) ); delete OpenvpnCiphersProcess; OpenvpnCiphersProcess=0L; } @@ -555,22 +555,22 @@ Utils::IpsecAlgos Utils::getIpsecAlgos() retrieveIpsecAlgos = false; ToolInfo *IpsecInfo = getToolInfo ( "ipsec" ); - QString pathToIpsec = IpsecInfo->PathToExec; + TQString pathToIpsec = IpsecInfo->PathToExec; if ( pathToIpsec.isEmpty() ) return salgos; - IpsecAlgosProcess = new QProcess( this ); + IpsecAlgosProcess = new TQProcess( this ); IpsecAlgosProcess->addArgument( pathToIpsec); IpsecAlgosProcess->addArgument( "auto" ); IpsecAlgosProcess->addArgument( "--status" ); - connect( IpsecAlgosProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutRetriveIpsecAlgos() ) ); - connect( IpsecAlgosProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrRetriveIpsecAlgos() ) ); + connect( IpsecAlgosProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutRetriveIpsecAlgos() ) ); + connect( IpsecAlgosProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrRetriveIpsecAlgos() ) ); if ( !IpsecAlgosProcess->start( env ) ) { - disconnect( IpsecAlgosProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutRetriveIpsecAlgos() ) ); - disconnect( IpsecAlgosProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrRetriveIpsecAlgos() ) ); + disconnect( IpsecAlgosProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutRetriveIpsecAlgos() ) ); + disconnect( IpsecAlgosProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrRetriveIpsecAlgos() ) ); delete IpsecAlgosProcess; IpsecAlgosProcess=0L; kdError() << "Unable to fetch ipsec algos!" << endl; @@ -583,8 +583,8 @@ Utils::IpsecAlgos Utils::getIpsecAlgos() config->appPointer->processEvents(); sleep ( 1 ); } - disconnect( IpsecAlgosProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutRetriveIpsecAlgos() ) ); - disconnect( IpsecAlgosProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrRetriveIpsecAlgos() ) ); + disconnect( IpsecAlgosProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutRetriveIpsecAlgos() ) ); + disconnect( IpsecAlgosProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrRetriveIpsecAlgos() ) ); delete IpsecAlgosProcess; IpsecAlgosProcess=0L; } @@ -735,16 +735,16 @@ Utils::PppdCapabilities Utils::checkPppdCapabilities() testOldPppdStyle = false; testPppdRequireMppe=true; testPppdMppeRequired=false; - TestPppdProcess = new QProcess ( this ); + TestPppdProcess = new TQProcess ( this ); TestPppdProcess->addArgument ( config->pathToPppd ); TestPppdProcess->addArgument ( "/dev/null" ); TestPppdProcess->addArgument ( "require-mppe" ); - TestPppdProcess->setCommunication ( QProcess::Stdin | QProcess::Stdout | QProcess::Stderr | QProcess::DupStderr ); + TestPppdProcess->setCommunication ( TQProcess::Stdin | TQProcess::Stdout | TQProcess::Stderr | TQProcess::DupStderr ); TestPppdProcess->closeStdin (); - connect ( TestPppdProcess, SIGNAL ( readyReadStdout() ), this, SLOT ( readPppdtestProcessOutput() ) ); -// connect ( TestPppdProcess, SIGNAL ( readyReadStderr() ), this, SLOT ( readPppdtestProcessOutput() ) ); + connect ( TestPppdProcess, TQT_SIGNAL ( readyReadStdout() ), this, TQT_SLOT ( readPppdtestProcessOutput() ) ); +// connect ( TestPppdProcess, TQT_SIGNAL ( readyReadStderr() ), this, TQT_SLOT ( readPppdtestProcessOutput() ) ); if ( !TestPppdProcess->start ( env ) ) { @@ -772,8 +772,8 @@ Utils::PppdCapabilities Utils::checkPppdCapabilities() config->appendLogEntry ( "pppdHasRequireMppeSupport: false", config->debug ); } - disconnect ( TestPppdProcess, SIGNAL ( readyReadStdout() ), this, SLOT ( readPppdtestProcessOutput() ) ); -// disconnect ( TestPppdProcess, SIGNAL ( readyReadStderr() ), this, SLOT ( readPppdtestProcessOutput() ) ); + disconnect ( TestPppdProcess, TQT_SIGNAL ( readyReadStdout() ), this, TQT_SLOT ( readPppdtestProcessOutput() ) ); +// disconnect ( TestPppdProcess, TQT_SIGNAL ( readyReadStderr() ), this, TQT_SLOT ( readPppdtestProcessOutput() ) ); delete TestPppdProcess; TestPppdProcess=0L; @@ -781,17 +781,17 @@ Utils::PppdCapabilities Utils::checkPppdCapabilities() testPppdMppeRequired=true; - TestPppdProcess = new QProcess ( this ); + TestPppdProcess = new TQProcess ( this ); TestPppdProcess->addArgument ( config->pathToPppd ); TestPppdProcess->addArgument ( "/dev/null" ); TestPppdProcess->addArgument ( "mppe"); TestPppdProcess->addArgument ( "required" ); - TestPppdProcess->setCommunication ( QProcess::Stdin | QProcess::Stdout | QProcess::Stderr | QProcess::DupStderr ); + TestPppdProcess->setCommunication ( TQProcess::Stdin | TQProcess::Stdout | TQProcess::Stderr | TQProcess::DupStderr ); TestPppdProcess->closeStdin (); - connect ( TestPppdProcess, SIGNAL ( readyReadStdout() ), this, SLOT ( readPppdtestProcessOutput() ) ); -// connect ( TestPppdProcess, SIGNAL ( readyReadStderr() ), this, SLOT ( readPppdtestProcessOutput() ) ); + connect ( TestPppdProcess, TQT_SIGNAL ( readyReadStdout() ), this, TQT_SLOT ( readPppdtestProcessOutput() ) ); +// connect ( TestPppdProcess, TQT_SIGNAL ( readyReadStderr() ), this, TQT_SLOT ( readPppdtestProcessOutput() ) ); if ( !TestPppdProcess->start ( env ) ) { @@ -826,8 +826,8 @@ Utils::PppdCapabilities Utils::checkPppdCapabilities() config->appendLogEntry ( "PppdMppeRequired: false", config->debug ); } - disconnect ( TestPppdProcess, SIGNAL ( readyReadStdout() ), this, SLOT ( readPppdtestProcessOutput() ) ); -// disconnect ( TestPppdProcess, SIGNAL ( readyReadStderr() ), this, SLOT ( readPppdtestProcessOutput() ) ); + disconnect ( TestPppdProcess, TQT_SIGNAL ( readyReadStdout() ), this, TQT_SLOT ( readPppdtestProcessOutput() ) ); +// disconnect ( TestPppdProcess, TQT_SIGNAL ( readyReadStderr() ), this, TQT_SLOT ( readPppdtestProcessOutput() ) ); delete TestPppdProcess; testPppdMppeRequired=false; @@ -852,14 +852,14 @@ Utils::PppdCapabilities Utils::checkPppdCapabilities() //unrecognized option 'replacedefaultroute' // test defaultroute support of pppd testPppdReplacedefaultroute = false; - TestPppdProcess = new QProcess ( this ); + TestPppdProcess = new TQProcess ( this ); TestPppdProcess->addArgument ( config->pathToPppd ); TestPppdProcess->addArgument ( "replacedefaultroute" ); - TestPppdProcess->setCommunication ( QProcess::Stdin | QProcess::Stdout | QProcess::Stderr | QProcess::DupStderr ); + TestPppdProcess->setCommunication ( TQProcess::Stdin | TQProcess::Stdout | TQProcess::Stderr | TQProcess::DupStderr ); TestPppdProcess->closeStdin (); - connect ( TestPppdProcess, SIGNAL ( readyReadStdout() ), this, SLOT ( readPppdtestProcessOutput() ) ); - connect ( TestPppdProcess, SIGNAL ( readyReadStderr() ), this, SLOT ( readPppdtestProcessOutput() ) ); + connect ( TestPppdProcess, TQT_SIGNAL ( readyReadStdout() ), this, TQT_SLOT ( readPppdtestProcessOutput() ) ); + connect ( TestPppdProcess, TQT_SIGNAL ( readyReadStderr() ), this, TQT_SLOT ( readPppdtestProcessOutput() ) ); if ( !TestPppdProcess->start ( env ) ) @@ -887,15 +887,15 @@ Utils::PppdCapabilities Utils::checkPppdCapabilities() config->appendLogEntry ( i18n ( "Test support of replacedefaultroute pppd: %1" ).arg ( i18n ( "failed" ) ) , config->debug ); } } - disconnect ( TestPppdProcess, SIGNAL ( readyReadStdout() ), this, SLOT ( readPppdtestProcessOutput() ) ); - disconnect ( TestPppdProcess, SIGNAL ( readyReadStderr() ), this, SLOT ( readPppdtestProcessOutput() ) ); + disconnect ( TestPppdProcess, TQT_SIGNAL ( readyReadStdout() ), this, TQT_SLOT ( readPppdtestProcessOutput() ) ); + disconnect ( TestPppdProcess, TQT_SIGNAL ( readyReadStderr() ), this, TQT_SLOT ( readPppdtestProcessOutput() ) ); delete TestPppdProcess; TestPppdProcess=0L; return pppdcap; } -QStringList Utils::getOpenvpnDigests() +TQStringList Utils::getOpenvpnDigests() { OpenvpnDigests.clear(); retrieveOpenvpnDigests = false; @@ -903,21 +903,21 @@ QStringList Utils::getOpenvpnDigests() OpenvpnDigestString=""; ToolInfo *OpenvpnInfo = getToolInfo ( "openvpn" ); - QString pathToOpenvpn = OpenvpnInfo->PathToExec; + TQString pathToOpenvpn = OpenvpnInfo->PathToExec; if ( pathToOpenvpn.isEmpty() ) return OpenvpnDigests; - OpenvpnDigestProcess = new QProcess( this ); + OpenvpnDigestProcess = new TQProcess( this ); OpenvpnDigestProcess->addArgument( pathToOpenvpn ); OpenvpnDigestProcess->addArgument( "--show-digests" ); - connect( OpenvpnDigestProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutRetriveOpenvpnDigests() ) ); - connect( OpenvpnDigestProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrRetriveOpenvpnDigests() ) ); + connect( OpenvpnDigestProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutRetriveOpenvpnDigests() ) ); + connect( OpenvpnDigestProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrRetriveOpenvpnDigests() ) ); if ( !OpenvpnDigestProcess->start( env ) ) { - disconnect( OpenvpnDigestProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutRetriveOpenvpnDigests() ) ); - disconnect( OpenvpnDigestProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrRetriveOpenvpnDigests() ) ); + disconnect( OpenvpnDigestProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutRetriveOpenvpnDigests() ) ); + disconnect( OpenvpnDigestProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrRetriveOpenvpnDigests() ) ); delete OpenvpnDigestProcess; OpenvpnDigestProcess=0L; kdError() << "Unable to fetch openvpn digests!" << endl; @@ -932,14 +932,14 @@ QStringList Utils::getOpenvpnDigests() } - OpenvpnDigests = QStringList().split("#",OpenvpnDigestString); + OpenvpnDigests = TQStringList().split("#",OpenvpnDigestString); - for ( QStringList::Iterator it = OpenvpnDigests.begin(); it != OpenvpnDigests.end(); ++it ) - *it = QString(*it).section(' ',0,0); + for ( TQStringList::Iterator it = OpenvpnDigests.begin(); it != OpenvpnDigests.end(); ++it ) + *it = TQString(*it).section(' ',0,0); } - disconnect( OpenvpnDigestProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutRetriveOpenvpnDigests() ) ); - disconnect( OpenvpnDigestProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrRetriveOpenvpnDigests() ) ); + disconnect( OpenvpnDigestProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutRetriveOpenvpnDigests() ) ); + disconnect( OpenvpnDigestProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrRetriveOpenvpnDigests() ) ); delete OpenvpnDigestProcess; OpenvpnDigestProcess=0L; return OpenvpnDigests; @@ -954,14 +954,14 @@ Utils::IpsecAlgos Utils::getKernelCrypto() salgos.IpsecEspEncryptionAlgorithms.clear(); salgos.IpsecEspAuthenticationAlgorithms.clear(); salgos.IpsecCompressionAlgorithms.clear(); - QString IpsecAlgoNameCurrent=""; - QString IpsecAlgoTypeCurrent=""; - QFile cryptoprocfile( "/proc/crypto" ); + TQString IpsecAlgoNameCurrent=""; + TQString IpsecAlgoTypeCurrent=""; + TQFile cryptoprocfile( "/proc/crypto" ); if ( cryptoprocfile.open( IO_ReadOnly ) ) { - QTextStream stream( &cryptoprocfile ); - QString line; + TQTextStream stream( &cryptoprocfile ); + TQString line; if (config->KvpncDebugLevel > 4) std::cout << "Kernel crypto list: " << std::endl; while ( !stream.atEnd() ) @@ -1010,12 +1010,12 @@ Utils::IpsecAlgos Utils::getKernelCrypto() } else { - config->appendLogEntry(i18n("%1 cant be opened!").arg("/proc/crypto"),config->error); + config->appendLogEntry(i18n("%1 cant be opened!").tqarg("/proc/crypto"),config->error); } return salgos; } -QString Utils::getNameAndPidOfProgramListen( int port ) +TQString Utils::getNameAndPidOfProgramListen( int port ) { if ( port == 0 ) return ""; @@ -1023,16 +1023,16 @@ QString Utils::getNameAndPidOfProgramListen( int port ) ListenPort = port; retrieveNameAndPidOfProgramListen = false; - NameAndPidOfProgramListenProcess = new QProcess( this ); + NameAndPidOfProgramListenProcess = new TQProcess( this ); NameAndPidOfProgramListenProcess->addArgument( config->pathToNetstat ); NameAndPidOfProgramListenProcess->addArgument( "-ntupl" ); - connect( NameAndPidOfProgramListenProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutGetNameAndPidOfProgramListen() ) ); - connect( NameAndPidOfProgramListenProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrGetNameAndPidOfProgramListen() ) ); + connect( NameAndPidOfProgramListenProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutGetNameAndPidOfProgramListen() ) ); + connect( NameAndPidOfProgramListenProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrGetNameAndPidOfProgramListen() ) ); if ( !NameAndPidOfProgramListenProcess->start( env ) ) { - disconnect( NameAndPidOfProgramListenProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutGetNameAndPidOfProgramListen() ) ); - disconnect( NameAndPidOfProgramListenProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrGetNameAndPidOfProgramListen() ) ); + disconnect( NameAndPidOfProgramListenProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutGetNameAndPidOfProgramListen() ) ); + disconnect( NameAndPidOfProgramListenProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrGetNameAndPidOfProgramListen() ) ); delete NameAndPidOfProgramListenProcess; NameAndPidOfProgramListenProcess=0L; kdError() << "netstat fails!" << endl; @@ -1047,21 +1047,21 @@ QString Utils::getNameAndPidOfProgramListen( int port ) } - disconnect( NameAndPidOfProgramListenProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutGetNameAndPidOfProgramListen() ) ); - disconnect( NameAndPidOfProgramListenProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrGetNameAndPidOfProgramListen() ) ); + disconnect( NameAndPidOfProgramListenProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutGetNameAndPidOfProgramListen() ) ); + disconnect( NameAndPidOfProgramListenProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrGetNameAndPidOfProgramListen() ) ); delete NameAndPidOfProgramListenProcess; NameAndPidOfProgramListenProcess=0L; } return NameAndPidOfProgramListen; } -QString Utils::getEmailAddressOfCert(QString cert) +TQString Utils::getEmailAddressOfCert(TQString cert) { if (cert.isEmpty()) return ""; - GetEmailAddressOfCertProcess = new QProcess ( this ); - GetEmailAddressOfCertProcess->setCommunication( QProcess::Stdin | QProcess::Stdout | QProcess::Stderr | QProcess::DupStderr ); + GetEmailAddressOfCertProcess = new TQProcess ( this ); + GetEmailAddressOfCertProcess->setCommunication( TQProcess::Stdin | TQProcess::Stdout | TQProcess::Stderr | TQProcess::DupStderr ); GetEmailAddressOfCertProcess->addArgument( config->pathToOpenssl ); GetEmailAddressOfCertProcess->addArgument( "x509"); GetEmailAddressOfCertProcess->addArgument( "-noout"); @@ -1069,10 +1069,10 @@ QString Utils::getEmailAddressOfCert(QString cert) GetEmailAddressOfCertProcess->addArgument( cert ); GetEmailAddressOfCertProcess->addArgument( "-subject"); - connect( GetEmailAddressOfCertProcess, SIGNAL( readyReadStdout() ), this, SLOT( readOutGetEmailAddressOfCert() ) ); + connect( GetEmailAddressOfCertProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readOutGetEmailAddressOfCert() ) ); if ( !GetEmailAddressOfCertProcess->start( env ) ) { - disconnect( GetEmailAddressOfCertProcess, SIGNAL( readyReadStdout() ), this, SLOT( readOutGetEmailAddressOfCert() ) ); + disconnect( GetEmailAddressOfCertProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readOutGetEmailAddressOfCert() ) ); delete GetEmailAddressOfCertProcess; GetEmailAddressOfCertProcess=0L; kdError() << "GetEmailAddressOfCertProcess" << endl; @@ -1085,7 +1085,7 @@ QString Utils::getEmailAddressOfCert(QString cert) config->appPointer->processEvents(); sleep ( 1 ); } - disconnect( GetEmailAddressOfCertProcess, SIGNAL( readyReadStdout() ), this, SLOT( readOutGetEmailAddressOfCert() ) ); + disconnect( GetEmailAddressOfCertProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readOutGetEmailAddressOfCert() ) ); delete GetEmailAddressOfCertProcess; GetEmailAddressOfCertProcess=0L; } @@ -1093,7 +1093,7 @@ QString Utils::getEmailAddressOfCert(QString cert) return EmailAddressOfCert; } -QStringList Utils::getSmartcardSlots(QString ProviderLib) +TQStringList Utils::getSmartcardSlots(TQString ProviderLib) { SmartcardSlots.clear(); @@ -1101,7 +1101,7 @@ QStringList Utils::getSmartcardSlots(QString ProviderLib) Pkcs11ToolInfo->collectToolInfo(); // if (Pkcs11ToolInfo == 0) // return SmartcardSlots; - QString pathToPkcs11Tool; + TQString pathToPkcs11Tool; pathToPkcs11Tool = Pkcs11ToolInfo->PathToExec; if ( pathToPkcs11Tool.isEmpty() ) @@ -1117,11 +1117,11 @@ QStringList Utils::getSmartcardSlots(QString ProviderLib) } *GetSmartcardSlotsProcess << "-L" ; - connect( GetSmartcardSlotsProcess, SIGNAL( receivedStdout ( KProcess *, char *, int)), this, SLOT(readOutGetSmartcardSlots())); + connect( GetSmartcardSlotsProcess, TQT_SIGNAL( receivedStdout ( KProcess *, char *, int)), this, TQT_SLOT(readOutGetSmartcardSlots())); if ( !GetSmartcardSlotsProcess->start ( KProcess::NotifyOnExit, KProcess::All ) ) { - disconnect( GetSmartcardSlotsProcess, SIGNAL( receivedStdout ( KProcess *, char *, int)), this, SLOT(readOutGetSmartcardSlots())); + disconnect( GetSmartcardSlotsProcess, TQT_SIGNAL( receivedStdout ( KProcess *, char *, int)), this, TQT_SLOT(readOutGetSmartcardSlots())); delete GetSmartcardSlotsProcess; GetSmartcardCertsFromSlotProcess=0L; config->appendLogEntry(i18n("Unable to fetch smartcard slots via pkcs11-tool!"), config->error); @@ -1137,7 +1137,7 @@ QStringList Utils::getSmartcardSlots(QString ProviderLib) usleep ( 500 ); config->appPointer->processEvents(); } - disconnect( GetSmartcardSlotsProcess, SIGNAL( receivedStdout ( KProcess *, char *, int)), this, SLOT(readOutGetSmartcardSlots())); + disconnect( GetSmartcardSlotsProcess, TQT_SIGNAL( receivedStdout ( KProcess *, char *, int)), this, TQT_SLOT(readOutGetSmartcardSlots())); delete GetSmartcardSlotsProcess; GetSmartcardCertsFromSlotProcess=0L; if (config->KvpncDebugLevel > 5) @@ -1146,7 +1146,7 @@ QStringList Utils::getSmartcardSlots(QString ProviderLib) return SmartcardSlots; } -QStringList Utils::getSmartcardCertsFromSlot(QString slot,QString IdType,QString ProviderLib) +TQStringList Utils::getSmartcardCertsFromSlot(TQString slot,TQString IdType,TQString ProviderLib) { Pkcs11CertFound=false; SmartcardCertsFromSlot.clear(); @@ -1160,14 +1160,14 @@ QStringList Utils::getSmartcardCertsFromSlot(QString slot,QString IdType,QString Pkcs11ToolInfo->collectToolInfo(); // if (Pkcs11ToolInfo == 0) // return SmartcardSlots; - QString pathToPkcs11Tool; + TQString pathToPkcs11Tool; pathToPkcs11Tool = Pkcs11ToolInfo->PathToExec; if ( pathToPkcs11Tool.isEmpty() ) return SmartcardSlots; - GetSmartcardCertsFromSlotProcess = new QProcess( this ); - GetSmartcardCertsFromSlotProcess->setCommunication( QProcess::Stdin | QProcess::Stdout | QProcess::Stderr | QProcess::DupStderr ); + GetSmartcardCertsFromSlotProcess = new TQProcess( this ); + GetSmartcardCertsFromSlotProcess->setCommunication( TQProcess::Stdin | TQProcess::Stdout | TQProcess::Stderr | TQProcess::DupStderr ); GetSmartcardCertsFromSlotProcess->addArgument( pathToPkcs11Tool); if (!ProviderLib.isEmpty()) @@ -1184,10 +1184,10 @@ QStringList Utils::getSmartcardCertsFromSlot(QString slot,QString IdType,QString else GetSmartcardCertsFromSlotProcess->addArgument("0"); - connect( GetSmartcardCertsFromSlotProcess, SIGNAL( readyReadStdout() ), this, SLOT( readOutGetSmartcardCertsFromSlot() ) ); + connect( GetSmartcardCertsFromSlotProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readOutGetSmartcardCertsFromSlot() ) ); if ( !GetSmartcardCertsFromSlotProcess->start( env ) ) { - disconnect( GetSmartcardCertsFromSlotProcess, SIGNAL( readyReadStdout() ), this, SLOT( readOutGetSmartcardCertsFromSlot() ) ); + disconnect( GetSmartcardCertsFromSlotProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readOutGetSmartcardCertsFromSlot() ) ); delete GetSmartcardCertsFromSlotProcess; GetSmartcardCertsFromSlotProcess=0L; kdError() << "Unable to fetch smartcard slots via pkcs11-tool!" << endl; @@ -1201,7 +1201,7 @@ QStringList Utils::getSmartcardCertsFromSlot(QString slot,QString IdType,QString usleep ( 500 ); config->appPointer->processEvents(); } - disconnect( GetSmartcardCertsFromSlotProcess, SIGNAL( readyReadStdout() ), this, SLOT( readOutGetSmartcardCertsFromSlot() ) ); + disconnect( GetSmartcardCertsFromSlotProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readOutGetSmartcardCertsFromSlot() ) ); delete GetSmartcardCertsFromSlotProcess; GetSmartcardCertsFromSlotProcess=0L; } @@ -1209,14 +1209,14 @@ QStringList Utils::getSmartcardCertsFromSlot(QString slot,QString IdType,QString return SmartcardCertsFromSlot; } -QStringList Utils::getCertsFromCiscoCertStore(QString type) +TQStringList Utils::getCertsFromCiscoCertStore(TQString type) { if (type != "user" && type != "ca" && type != "enrollment") type="user"; if (config->KvpncDebugLevel > 2) - config->appendLogEntry("getCertsFromCiscoCertStore: "+i18n("type: %1").arg(type),config->debug ); + config->appendLogEntry("getCertsFromCiscoCertStore: "+i18n("type: %1").tqarg(type),config->debug ); CertsFromCiscoCertStore.clear(); CertsFromCiscoCertPos=0; @@ -1224,8 +1224,8 @@ QStringList Utils::getCertsFromCiscoCertStore(QString type) if ( config->pathToCiscoCertMgr.isEmpty() ) return CertsFromCiscoCertStore; - GetCertsFromCiscoCertStoreProcess = new QProcess( this ); - GetCertsFromCiscoCertStoreProcess->setCommunication( QProcess::Stdin | QProcess::Stdout | QProcess::Stderr | QProcess::DupStderr ); + GetCertsFromCiscoCertStoreProcess = new TQProcess( this ); + GetCertsFromCiscoCertStoreProcess->setCommunication( TQProcess::Stdin | TQProcess::Stdout | TQProcess::Stderr | TQProcess::DupStderr ); GetCertsFromCiscoCertStoreProcess->addArgument( config->pathToCiscoCertMgr ); if (type == "user") @@ -1240,11 +1240,11 @@ QStringList Utils::getCertsFromCiscoCertStore(QString type) GetCertsFromCiscoCertStoreProcess->addArgument( "list"); - connect( GetCertsFromCiscoCertStoreProcess, SIGNAL( readyReadStdout() ), this, SLOT( readOutGetCertsFromCiscoCertStoreSlot() ) ); + connect( GetCertsFromCiscoCertStoreProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readOutGetCertsFromCiscoCertStoreSlot() ) ); if ( !GetCertsFromCiscoCertStoreProcess->start( env ) ) { - disconnect( GetCertsFromCiscoCertStoreProcess, SIGNAL( readyReadStdout() ), this, SLOT( readOutGetCertsFromCiscoCertStoreSlot() ) ); + disconnect( GetCertsFromCiscoCertStoreProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readOutGetCertsFromCiscoCertStoreSlot() ) ); delete GetCertsFromCiscoCertStoreProcess; GetCertsFromCiscoCertStoreProcess=0L; kdError() << "Unable to fetch certificates via cisco_cert_mgr!" << endl; @@ -1259,7 +1259,7 @@ QStringList Utils::getCertsFromCiscoCertStore(QString type) if ( config->appPointer->hasPendingEvents () ) config->appPointer->processEvents(); } - disconnect( GetCertsFromCiscoCertStoreProcess, SIGNAL( readyReadStdout() ), this, SLOT( readOutGetCertsFromCiscoCertStoreSlot() ) ); + disconnect( GetCertsFromCiscoCertStoreProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readOutGetCertsFromCiscoCertStoreSlot() ) ); delete GetCertsFromCiscoCertStoreProcess; GetCertsFromCiscoCertStoreProcess=0L; } @@ -1267,12 +1267,12 @@ QStringList Utils::getCertsFromCiscoCertStore(QString type) return CertsFromCiscoCertStore; } -QStringList Utils::getOpenvpnPkcs11Ids(QString ProviderLib) +TQStringList Utils::getOpenvpnPkcs11Ids(TQString ProviderLib) { Pkcs11CertFound=false; OpenvpnPkcs11Ids.clear(); - OpenvpnPkcs11IdsProcess = new QProcess( this ); - OpenvpnPkcs11IdsProcess->setCommunication( QProcess::Stdin | QProcess::Stdout | QProcess::Stderr | QProcess::DupStderr ); + OpenvpnPkcs11IdsProcess = new TQProcess( this ); + OpenvpnPkcs11IdsProcess->setCommunication( TQProcess::Stdin | TQProcess::Stdout | TQProcess::Stderr | TQProcess::DupStderr ); //openvpn --show-pkcs11-ids /usr/lib/opensc-pkcs11.so OpenvpnPkcs11IdsProcess->addArgument(config->pathToOpenvpn); OpenvpnPkcs11IdsProcess->addArgument("--show-pkcs11-ids"); @@ -1280,10 +1280,10 @@ QStringList Utils::getOpenvpnPkcs11Ids(QString ProviderLib) OpenvpnPkcs11IdsProcess->addArgument( ProviderLib ); - connect( OpenvpnPkcs11IdsProcess, SIGNAL( readyReadStdout() ), this, SLOT( readOutGetOpenvpnPkcs11Ids() ) ); + connect( OpenvpnPkcs11IdsProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readOutGetOpenvpnPkcs11Ids() ) ); if ( !OpenvpnPkcs11IdsProcess->start( env ) ) { - disconnect( OpenvpnPkcs11IdsProcess, SIGNAL( readyReadStdout() ), this, SLOT( readOutGetOpenvpnPkcs11Ids() ) ); + disconnect( OpenvpnPkcs11IdsProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readOutGetOpenvpnPkcs11Ids() ) ); delete OpenvpnPkcs11IdsProcess; OpenvpnPkcs11IdsProcess=0L; kdError() << "Unable to fetch pkcs11 ids via openvpn!" << endl; @@ -1297,7 +1297,7 @@ QStringList Utils::getOpenvpnPkcs11Ids(QString ProviderLib) usleep ( 500 ); config->appPointer->processEvents(); } - disconnect( OpenvpnPkcs11IdsProcess, SIGNAL( readyReadStdout() ), this, SLOT( readOutGetOpenvpnPkcs11Ids() ) ); + disconnect( OpenvpnPkcs11IdsProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readOutGetOpenvpnPkcs11Ids() ) ); delete OpenvpnPkcs11IdsProcess; OpenvpnPkcs11IdsProcess=0L; } @@ -1305,10 +1305,10 @@ QStringList Utils::getOpenvpnPkcs11Ids(QString ProviderLib) return OpenvpnPkcs11Ids; } -bool Utils::getNeedsPassphrase(QString key) +bool Utils::getNeedsPassphrase(TQString key) { - if (key.isEmpty() || !QFile(key).exists()) + if (key.isEmpty() || !TQFile(key).exists()) return false; needsPassphrase=false; @@ -1318,13 +1318,13 @@ bool Utils::getNeedsPassphrase(QString key) ToolInfo *OpensslToolInfo = getToolInfo ( "openssl" ); OpensslToolInfo->collectToolInfo(); - QString pathToOpenssl = OpensslToolInfo->PathToExec; + TQString pathToOpenssl = OpensslToolInfo->PathToExec; if ( pathToOpenssl.isEmpty() ) return needsPassphrase; - NeedsPassphraseProcess = new QProcess( this ); - NeedsPassphraseProcess->setCommunication( QProcess::Stdin | QProcess::Stdout | QProcess::Stderr | QProcess::DupStderr ); + NeedsPassphraseProcess = new TQProcess( this ); + NeedsPassphraseProcess->setCommunication( TQProcess::Stdin | TQProcess::Stdout | TQProcess::Stderr | TQProcess::DupStderr ); NeedsPassphraseProcess->addArgument( pathToOpenssl); NeedsPassphraseProcess->addArgument("rsa"); NeedsPassphraseProcess->addArgument("-noout"); @@ -1334,10 +1334,10 @@ bool Utils::getNeedsPassphrase(QString key) NeedsPassphraseProcess->addArgument("pass:aaa"); - connect( NeedsPassphraseProcess, SIGNAL( readyReadStdout() ), this, SLOT( readOutNeedsPassphrase() ) ); + connect( NeedsPassphraseProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readOutNeedsPassphrase() ) ); if ( !NeedsPassphraseProcess->start( env ) ) { - disconnect( NeedsPassphraseProcess, SIGNAL( readyReadStdout() ), this, SLOT( readOutNeedsPassphrase() ) ); + disconnect( NeedsPassphraseProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readOutNeedsPassphrase() ) ); delete NetworkDeviceTestProcess; NeedsPassphraseProcess=0L; kdError() << "Unable to start openssl!" << endl; @@ -1350,7 +1350,7 @@ bool Utils::getNeedsPassphrase(QString key) usleep ( 500 ); config->appPointer->processEvents(); } - disconnect( NeedsPassphraseProcess, SIGNAL( readyReadStdout() ), this, SLOT( readOutNeedsPassphrase() ) ); + disconnect( NeedsPassphraseProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readOutNeedsPassphrase() ) ); delete NetworkDeviceTestProcess; NeedsPassphraseProcess=0L; } @@ -1358,18 +1358,18 @@ bool Utils::getNeedsPassphrase(QString key) return needsPassphrase; } -QString Utils::getHostname() +TQString Utils::getHostname() { Hostname="linux.local"; - GetHostnameProcess = new QProcess( this ); + GetHostnameProcess = new TQProcess( this ); GetHostnameProcess->addArgument( "hostname" ); - connect( GetHostnameProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutGetHostname() ) ); - connect( GetHostnameProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrGetHostname() ) ); + connect( GetHostnameProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutGetHostname() ) ); + connect( GetHostnameProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrGetHostname() ) ); if ( !GetHostnameProcess->start( env ) ) { - disconnect( GetHostnameProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutGetHostname() ) ); - disconnect( GetHostnameProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrGetHostname() ) ); + disconnect( GetHostnameProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutGetHostname() ) ); + disconnect( GetHostnameProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrGetHostname() ) ); delete GetHostnameProcess; GetHostnameProcess=0L; kdError() << "Unable to start getHostname process!" << endl; @@ -1381,8 +1381,8 @@ QString Utils::getHostname() { usleep(200); } - disconnect( GetHostnameProcess, SIGNAL( readyReadStdout() ), this, SLOT( readStdOutGetHostname() ) ); - disconnect( GetHostnameProcess, SIGNAL( readyReadStderr() ), this, SLOT( readStdErrGetHostname() ) ); + disconnect( GetHostnameProcess, TQT_SIGNAL( readyReadStdout() ), this, TQT_SLOT( readStdOutGetHostname() ) ); + disconnect( GetHostnameProcess, TQT_SIGNAL( readyReadStderr() ), this, TQT_SLOT( readStdErrGetHostname() ) ); delete GetHostnameProcess; GetHostnameProcess=0L; return Hostname; @@ -1393,26 +1393,26 @@ QString Utils::getHostname() /* === Slots === */ void Utils::readStdOutCreateTunDev() { - QString msg = QString( createProcess->readStderr() ); + TQString msg = TQString( createProcess->readStderr() ); kdDebug() << "readStdOutCreateTunDev(): " << msg << endl; } void Utils::readStdErrCreateTunDev() { - QString msg = QString( createProcess->readStderr() ); + TQString msg = TQString( createProcess->readStderr() ); kdError() << "readStdErrCreateTunDev" << msg << endl; } void Utils::readStdOutLoadKernelModule() { - QString msg = QString( ModprobeProcess->readStdout() ); + TQString msg = TQString( ModprobeProcess->readStdout() ); kdDebug() << "readStdErrreadStdOutLoadKernelModule" << msg << endl; } void Utils::readStdErrLoadKernelModule() { - QString msg = QString( ModprobeProcess->readStderr() ); + TQString msg = TQString( ModprobeProcess->readStderr() ); // kdDebug() << "readStdErrreadStderrLoadKernelModule" << msg << endl; /* FATAL: Module <Name> not found. */ @@ -1440,7 +1440,7 @@ void Utils::readStdErrToolsTest() void Utils::readStdOutRetriveOpenvpnCiphers() { while ( OpenvpnCiphersProcess->canReadLineStdout() ) { - QString msg = QString( OpenvpnCiphersProcess->readLineStdout() ); + TQString msg = TQString( OpenvpnCiphersProcess->readLineStdout() ); if ( msg.contains( "default key" ) ) { //std::cout << msg.ascii() << std::endl; OpenvpnCiphers.append( msg.section( ' ', 0, 0 ) ); @@ -1451,7 +1451,7 @@ void Utils::readStdOutRetriveOpenvpnCiphers() void Utils::readStdErrRetriveOpenvpnCiphers() { while ( OpenvpnCiphersProcess->canReadLineStderr() ) { - QString msg = QString( OpenvpnCiphersProcess->readLineStderr() ); + TQString msg = TQString( OpenvpnCiphersProcess->readLineStderr() ); } } @@ -1459,7 +1459,7 @@ void Utils::readStdErrRetriveOpenvpnCiphers() void Utils::readStdOutRetriveIpsecAlgos() { while ( IpsecAlgosProcess->canReadLineStdout() ) { - QString msg = QString( IpsecAlgosProcess->readLineStdout() ); + TQString msg = TQString( IpsecAlgosProcess->readLineStdout() ); bool newIpsecAlgoFound=false; // std::cout << "[ipsec algos raw] "<< msg.ascii() << std::endl; if (msg.find ( "000 algorithm", 0, -1 ) > -1) @@ -1468,12 +1468,12 @@ void Utils::readStdOutRetriveIpsecAlgos() if (msg.find ( "000 algorithm ESP", 0, -1 ) > -1) { - QString Algo = msg.stripWhiteSpace().section(":",1,1).section(",",1,1).section("=",1,1); - QString MinKeySize = msg.stripWhiteSpace().section(":",1,1).section(",",3,3).section("=",1,1); - QString MaxKeySize = msg.stripWhiteSpace().section(":",1,1).section(",",4,4).section("=",1,1); + TQString Algo = msg.stripWhiteSpace().section(":",1,1).section(",",1,1).section("=",1,1); + TQString MinKeySize = msg.stripWhiteSpace().section(":",1,1).section(",",3,3).section("=",1,1); + TQString MaxKeySize = msg.stripWhiteSpace().section(":",1,1).section(",",4,4).section("=",1,1); std::cout << "IKE encryption algo found: \"" << Algo << "\", Min: " << MinKeySize << ", Max: " << MaxKeySize << std::endl; -// QStringList AlgoOptList = QStringList::split("-",AlgoOpt); -// for (QStringList::Iterator it = AlgoOptList.begin(); it != AlgoOptList.end(); ++it) +// TQStringList AlgoOptList = TQStringList::split("-",AlgoOpt); +// for (TQStringList::Iterator it = AlgoOptList.begin(); it != AlgoOptList.end(); ++it) // { // std::cout << "IKE encryption algo subtypes found: \"" << Algo << "-" << *it << "\"" << std::endl; // } @@ -1486,16 +1486,16 @@ void Utils::readStdOutRetriveIpsecAlgos() void Utils::readStdErrRetriveIpsecAlgos() { while ( IpsecAlgosProcess->canReadLineStderr() ) { - QString msg = QString( IpsecAlgosProcess->readLineStderr() ); + TQString msg = TQString( IpsecAlgosProcess->readLineStderr() ); std::cout << "[ipsec algos raw err] "<< msg.ascii() << std::endl; } } void Utils::readPppdtestProcessOutput() { - QString msg = ""; - msg += QString ( TestPppdProcess->readStdout() ); -// msg += QString ( TestPppdProcess->readStderr() ); + TQString msg = ""; + msg += TQString ( TestPppdProcess->readStdout() ); +// msg += TQString ( TestPppdProcess->readStderr() ); // if ( msg == "" ) // return ; @@ -1581,13 +1581,13 @@ void Utils::readPppdtestProcessOutput() pppdcap.pppdHasReplacedefaultrouteSupport = false; if (config->KvpncDebugLevel > 1) - config->appendLogEntry(i18n("Testing %1: %2").arg("replacedefaultroute").arg(i18n("failed")),config->debug); + config->appendLogEntry(i18n("Testing %1: %2").tqarg("replacedefaultroute").tqarg(i18n("failed")),config->debug); } else { pppdcap.pppdHasReplacedefaultrouteSupport = true; if (config->KvpncDebugLevel > 1) - config->appendLogEntry(i18n("Testing %1: %2").arg("replacedefaultroute").arg(i18n("succeded")),config->debug); + config->appendLogEntry(i18n("Testing %1: %2").tqarg("replacedefaultroute").tqarg(i18n("succeded")),config->debug); } } @@ -1597,7 +1597,7 @@ void Utils::readPppdtestProcessOutput() void Utils::readStdOutRetriveOpenvpnDigests() { while ( OpenvpnDigestProcess->canReadLineStdout() ) { - QString msg = QString( OpenvpnDigestProcess->readLineStdout() ); + TQString msg = TQString( OpenvpnDigestProcess->readLineStdout() ); OpenvpnDigestCount+=1; if ( OpenvpnDigestCount > 5 ) { @@ -1610,7 +1610,7 @@ void Utils::readStdOutRetriveOpenvpnDigests() void Utils::readStdErrRetriveOpenvpnDigests() { while ( OpenvpnDigestProcess->canReadLineStderr() ) { - QString msg = QString( OpenvpnDigestProcess->readLineStderr() ); + TQString msg = TQString( OpenvpnDigestProcess->readLineStderr() ); } } @@ -1618,8 +1618,8 @@ void Utils::readStdErrRetriveOpenvpnDigests() void Utils::readStdOutGetNameAndPidOfProgramListen() { while ( NameAndPidOfProgramListenProcess->canReadLineStdout() ) { - QString msg = QString( NameAndPidOfProgramListenProcess->readLineStdout() ); - if ( msg.contains( "/" ) && msg.contains( QString().setNum( ListenPort ) ) && msg.simplifyWhiteSpace().section( ' ', 3, 3 ).section(':',1,1) == QString().setNum( ListenPort ) ) { + TQString msg = TQString( NameAndPidOfProgramListenProcess->readLineStdout() ); + if ( msg.contains( "/" ) && msg.contains( TQString().setNum( ListenPort ) ) && msg.simplifyWhiteSpace().section( ' ', 3, 3 ).section(':',1,1) == TQString().setNum( ListenPort ) ) { std::cout << msg.ascii() << std::endl; NameAndPidOfProgramListen = ( msg.simplifyWhiteSpace().section( ' ', 5, 5 ) ); if (NameAndPidOfProgramListen.contains( "LISTEN")) @@ -1632,7 +1632,7 @@ void Utils::readStdOutGetNameAndPidOfProgramListen() void Utils::readStdErrGetNameAndPidOfProgramListen() { while ( NameAndPidOfProgramListenProcess->canReadLineStderr() ) { - QString msg = QString( NameAndPidOfProgramListenProcess->readLineStderr() ); + TQString msg = TQString( NameAndPidOfProgramListenProcess->readLineStderr() ); } } @@ -1640,19 +1640,19 @@ void Utils::readStdErrGetNameAndPidOfProgramListen() void Utils::readOutGetEmailAddressOfCert() { while ( GetEmailAddressOfCertProcess->canReadLineStdout() ) { - QString msg = QString( GetEmailAddressOfCertProcess->readLineStdout() ); + TQString msg = TQString( GetEmailAddressOfCertProcess->readLineStdout() ); if ( msg.contains( "emailAddress" ) ) { std::cout << "msg: " << msg.ascii() << std::endl; - QStringList fields = QStringList::split( '/', msg); - for ( QStringList::iterator field = fields.begin(); field != fields.end();++field ) + TQStringList fields = TQStringList::split( '/', msg); + for ( TQStringList::iterator field = fields.begin(); field != fields.end();++field ) { - if (QString (*field).contains("emailAddress")) + if (TQString (*field).contains("emailAddress")) { if (config->KvpncDebugLevel > 2) - std::cout << "field: " << QString(*field).ascii() << std::endl; + std::cout << "field: " << TQString(*field).ascii() << std::endl; // subject= /C=de/L=WR/O=crissi/CN=Christoph Thielecke/emailAddress=crissi99@gxm.de // crissi99@gxm.de - EmailAddressOfCert = QString(*field).section('=',1,1); + EmailAddressOfCert = TQString(*field).section('=',1,1); break; } } @@ -1663,28 +1663,28 @@ void Utils::readOutGetEmailAddressOfCert() void Utils::readOutGetSmartcardSlots(KProcess * proc, char * buffer, int buflen) { - QString msg_raw = QString::fromLatin1(buffer, buflen); + TQString msg_raw = TQString::tqfromLatin1(buffer, buflen); if (config->KvpncDebugLevel > 5) - config->appendLogEntry ( QString("[readOutGetSmartcardSlots raw] "+QString(msg_raw)) ,config->debug ); + config->appendLogEntry ( TQString("[readOutGetSmartcardSlots raw] "+TQString(msg_raw)) ,config->debug ); - QStringList msg_raw_list = QStringList::split ( "\n",msg_raw ); + TQStringList msg_raw_list = TQStringList::split ( "\n",msg_raw ); - for ( QStringList::Iterator it = msg_raw_list.begin(); it != msg_raw_list.end(); ++it ) + for ( TQStringList::Iterator it = msg_raw_list.begin(); it != msg_raw_list.end(); ++it ) { - QString msg = *it; + TQString msg = *it; if (config->KvpncDebugLevel > 5) - config->appendLogEntry ( QString("[readOutGetSmartcardSlots] "+QString(msg)) ,config->debug ); + config->appendLogEntry ( TQString("[readOutGetSmartcardSlots] "+TQString(msg)) ,config->debug ); if ( msg.contains( "Slot" ) && !msg.contains("empty") ) { //std::cout << msg.ascii() << std::endl; -// KMessageBox::information( 0, i18n( "msg: %1" ).arg( msg.stripWhiteSpace() ), QString("foo") ); +// KMessageBox::information( 0, i18n( "msg: %1" ).tqarg( msg.stripWhiteSpace() ), TQString("foo") ); // we put in this format: <id>:<name> - QString id = msg.stripWhiteSpace().section( ' ', 1, 1 ); - QString name = msg.stripWhiteSpace().remove(QString("Slot "+id)).stripWhiteSpace(); - QString slot = id+" : "+name; + TQString id = msg.stripWhiteSpace().section( ' ', 1, 1 ); + TQString name = msg.stripWhiteSpace().remove(TQString("Slot "+id)).stripWhiteSpace(); + TQString slot = id+" : "+name; SmartcardSlots.append( slot ); } } @@ -1693,23 +1693,23 @@ void Utils::readOutGetSmartcardSlots(KProcess * proc, char * buffer, int b void Utils::readOutGetSmartcardCertsFromSlot() { while ( GetSmartcardCertsFromSlotProcess->canReadLineStdout() ) { - QString msg = QString( GetSmartcardCertsFromSlotProcess->readLineStdout() ); + TQString msg = TQString( GetSmartcardCertsFromSlotProcess->readLineStdout() ); if (config->KvpncDebugLevel > 5) - config->appendLogEntry ( QString("[readOutGetSmartcardCertsFromSlot] "+QString(msg)) ,config->debug ); + config->appendLogEntry ( TQString("[readOutGetSmartcardCertsFromSlot] "+TQString(msg)) ,config->debug ); if ( msg.contains( "Certificate Object" ) ) { -// KMessageBox::sorry( 0, QString("msg: "+msg), QString("foo1"),0 ); +// KMessageBox::sorry( 0, TQString("msg: "+msg), TQString("foo1"),0 ); Pkcs11CertFound=true; } -// KMessageBox::information( 0, i18n( "msg: %1" ).arg( msg ), QString("foo") ); +// KMessageBox::information( 0, i18n( "msg: %1" ).tqarg( msg ), TQString("foo") ); if (IdType == "id") { if ( msg.contains( "ID:" ) && Pkcs11CertFound==true ) { //std::cout << msg.ascii() << std::endl; - QString msg2 = msg.section( ':', 1, 1 ); + TQString msg2 = msg.section( ':', 1, 1 ); msg2 = msg2.stripWhiteSpace(); -// KMessageBox::sorry( 0, QString("id: "+msg), QString("foo"),0 ); +// KMessageBox::sorry( 0, TQString("id: "+msg), TQString("foo"),0 ); SmartcardCertsFromSlot.append( msg2 ); Pkcs11CertFound=false; } @@ -1718,9 +1718,9 @@ void Utils::readOutGetSmartcardCertsFromSlot() { if ( msg.contains( "label:" ) && Pkcs11CertFound==true ) { //std::cout << msg.ascii() << std::endl; - QString msg2 = msg.section( ':', 1, 1 ); + TQString msg2 = msg.section( ':', 1, 1 ); msg2 = msg2.stripWhiteSpace(); -// KMessageBox::sorry( 0, QString("label: "+msg2), QString("foo"),0 ); +// KMessageBox::sorry( 0, TQString("label: "+msg2), TQString("foo"),0 ); SmartcardCertsFromSlot.append( msg2 ); Pkcs11CertFound=false; } @@ -1729,9 +1729,9 @@ void Utils::readOutGetSmartcardCertsFromSlot() { if ( msg.contains( "Subject:" ) && Pkcs11CertFound==true ) { //std::cout << msg.ascii() << std::endl; - QString msg2 = msg.section( ':', 1, 1 ); + TQString msg2 = msg.section( ':', 1, 1 ); msg2 = msg2.stripWhiteSpace(); -// KMessageBox::sorry( 0, QString("subject: "+msg), QString("foo"),0 ); +// KMessageBox::sorry( 0, TQString("subject: "+msg), TQString("foo"),0 ); SmartcardCertsFromSlot.append( msg2 ); Pkcs11CertFound=false; } @@ -1743,7 +1743,7 @@ void Utils::readOutGetSmartcardCertsFromSlot() void Utils::readOutGetCertsFromCiscoCertStoreSlot() { while ( GetCertsFromCiscoCertStoreProcess->canReadLineStdout() ) { - QString msg = QString( GetCertsFromCiscoCertStoreProcess->readLineStdout() ); + TQString msg = TQString( GetCertsFromCiscoCertStoreProcess->readLineStdout() ); // samle output :( @@ -1787,7 +1787,7 @@ void Utils::readOutGetCertsFromCiscoCertStoreSlot() break; // if (config->KvpncDebugLevel > 2) // std::cout << "readOutGetCertsFromCiscoCertStoreSlot: idx2 " << idx2 << std::endl; - QString common_name = msg.right(msg.length()-idx2); + TQString common_name = msg.right(msg.length()-idx2); if (common_name.length() > 0) { // if (config->KvpncDebugLevel > 2) @@ -1803,7 +1803,7 @@ void Utils::readOutGetOpenvpnPkcs11Ids() { while ( OpenvpnPkcs11IdsProcess->canReadLineStdout() ) { - QString msg = QString( OpenvpnPkcs11IdsProcess->readLineStdout() ); + TQString msg = TQString( OpenvpnPkcs11IdsProcess->readLineStdout() ); /* sample output: @@ -1813,15 +1813,15 @@ void Utils::readOutGetOpenvpnPkcs11Ids() */ if (config->KvpncDebugLevel > 5) - config->appendLogEntry ( QString("[readOutGetOpenvpnPkcs11Ids] "+QString(msg)) ,config->debug ); + config->appendLogEntry ( TQString("[readOutGetOpenvpnPkcs11Ids] "+TQString(msg)) ,config->debug ); -// KMessageBox::information( 0, i18n( "msg: %1" ).arg( msg ), QString("foo") ); +// KMessageBox::information( 0, i18n( "msg: %1" ).tqarg( msg ), TQString("foo") ); if ( msg.contains( "Serialized id:" )) { //std::cout << msg.ascii() << std::endl; - QString msg2 = msg.section( ':', 1, 1 ); + TQString msg2 = msg.section( ':', 1, 1 ); msg2 = msg2.stripWhiteSpace(); -// KMessageBox::sorry( 0, QString("id: "+msg), QString("foo"),0 ); +// KMessageBox::sorry( 0, TQString("id: "+msg), TQString("foo"),0 ); OpenvpnPkcs11Ids.append( msg2 ); } } @@ -1830,8 +1830,8 @@ void Utils::readOutGetOpenvpnPkcs11Ids() void Utils::readOutNeedsPassphrase() { while ( NeedsPassphraseProcess->canReadLineStdout() ) { - QString msg = QString( NeedsPassphraseProcess->readLineStdout() ); -// KMessageBox::sorry( 0, QString("msg: "+msg), QString("foo1"),0 ); + TQString msg = TQString( NeedsPassphraseProcess->readLineStdout() ); +// KMessageBox::sorry( 0, TQString("msg: "+msg), TQString("foo1"),0 ); if ( msg.contains( "unable to load Private Key" ) ) { needsPassphrase=true; } @@ -1842,8 +1842,8 @@ void Utils::readOutNeedsPassphrase() void Utils::readStdOutGetHostname() { while ( GetHostnameProcess->canReadLineStdout() ) { - QString msg = QString( GetHostnameProcess->readLineStdout() ).simplifyWhiteSpace().section(' ',0,0); -// KMessageBox::sorry( 0, QString("msg: "+msg), QString("foo1"),0 ); + TQString msg = TQString( GetHostnameProcess->readLineStdout() ).simplifyWhiteSpace().section(' ',0,0); +// KMessageBox::sorry( 0, TQString("msg: "+msg), TQString("foo1"),0 ); if (!msg.isEmpty()) Hostname=msg; } @@ -1852,12 +1852,12 @@ void Utils::readStdOutGetHostname() void Utils::readStdErrGetHostname() { while ( GetHostnameProcess->canReadLineStderr() ) { - QString msg = QString( GetHostnameProcess->readLineStderr() ); - KMessageBox::error( 0, QString(msg), QString("getHostname()"),0 ); + TQString msg = TQString( GetHostnameProcess->readLineStderr() ); + KMessageBox::error( 0, TQString(msg), TQString("getHostname()"),0 ); } } -QString Utils::dec2bin(int n) +TQString Utils::dec2bin(int n) { if (0 == n) { @@ -1865,8 +1865,8 @@ QString Utils::dec2bin(int n) } else { - QString ret =""; - QString ret2 = dec2bin(n/2); + TQString ret =""; + TQString ret2 = dec2bin(n/2); ret+= ret2; if(n % 2) ret +="1"; @@ -1876,7 +1876,7 @@ QString Utils::dec2bin(int n) } } -int Utils::dottedIpv4Netmask2NetmaskBytes(QString dottedIpv4Netmask) +int Utils::dottedIpv4Netmask2NetmaskBytes(TQString dottedIpv4Netmask) { if (dottedIpv4Netmask.isEmpty() || dottedIpv4Netmask.contains( '.' ) != 3) return 0; @@ -1890,11 +1890,11 @@ int Utils::dottedIpv4Netmask2NetmaskBytes(QString dottedIpv4Netmask) std::cout << "part1: " << part1 << std::endl; std::cout << "part2: " << part2 << std::endl; std::cout << "part3: " << part3 << std::endl; - QString block=""; - QString block0 = dec2bin(part0); - QString block1 = dec2bin(part1); - QString block2 = dec2bin(part2); - QString block3 = dec2bin(part3); + TQString block=""; + TQString block0 = dec2bin(part0); + TQString block1 = dec2bin(part1); + TQString block2 = dec2bin(part2); + TQString block3 = dec2bin(part3); std::cout << "block0: " << block0 << std::endl; std::cout << "block1: " << block1 << std::endl; |