diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-15 15:32:36 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-15 15:32:36 -0600 |
commit | 44ec35d6f3ec0bf8067f31896d7721ac3082f66f (patch) | |
tree | 36cf001e28520682c374f6721059fc0a06447525 /krArc/krarc.cpp | |
parent | 6ea934c9e490098aa988e33aa6ee29ca924666e3 (diff) | |
download | krusader-44ec35d6f3ec0bf8067f31896d7721ac3082f66f.tar.gz krusader-44ec35d6f3ec0bf8067f31896d7721ac3082f66f.zip |
Rename a number of old tq methods that are no longer tq specific
Diffstat (limited to 'krArc/krarc.cpp')
-rw-r--r-- | krArc/krarc.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/krArc/krarc.cpp b/krArc/krarc.cpp index 435821e..6ff1ca0 100644 --- a/krArc/krarc.cpp +++ b/krArc/krarc.cpp @@ -86,7 +86,7 @@ kio_krarcProtocol::kio_krarcProtocol(const TQCString &pool_socket, const TQCStri dirDict.setAutoDelete(true); arcTempDir = locateLocal("tmp",TQString()); - TQString dirName = "krArc"+TQDateTime::tqcurrentDateTime().toString(Qt::ISODate); + TQString dirName = "krArc"+TQDateTime::currentDateTime().toString(Qt::ISODate); dirName.replace(TQRegExp(":"),"_"); TQDir(arcTempDir).mkdir(dirName); arcTempDir = arcTempDir+dirName+"/"; @@ -124,7 +124,7 @@ void kio_krarcProtocol::mkdir(const KURL& url,int permissions){ if( putCmd.isEmpty() ){ error(ERR_UNSUPPORTED_ACTION, - i18n("Creating directories is not supported with %1 archives").tqarg(arcType) ); + i18n("Creating directories is not supported with %1 archives").arg(arcType) ); return; } @@ -154,14 +154,14 @@ void kio_krarcProtocol::mkdir(const KURL& url,int permissions){ // pack the directory KrShellProcess proc; proc << putCmd << convertName( arcFile->url().path() ) + " " << convertFileName( tmpDir.mid(arcTempDir.length()) ); - infoMessage(i18n("Creating %1 ...").tqarg( url.fileName() ) ); + infoMessage(i18n("Creating %1 ...").arg( url.fileName() ) ); TQDir::setCurrent(arcTempDir); proc.start(KProcess::Block,KProcess::AllOutput); // delete the temp directory TQDir().rmdir(arcTempDir); - if( !proc.normalExit() || !checktqStatus( proc.exitStatus() ) ) { + if( !proc.normalExit() || !checkStatus( proc.exitStatus() ) ) { error(ERR_COULD_NOT_WRITE,url.path() + "\n\n" + proc.getErrorMsg() ); return; } @@ -184,7 +184,7 @@ void kio_krarcProtocol::put(const KURL& url,int permissions,bool overwrite,bool if( putCmd.isEmpty() ){ error(ERR_UNSUPPORTED_ACTION, - i18n("Writing to %1 archives is not supported").tqarg(arcType) ); + i18n("Writing to %1 archives is not supported").arg(arcType) ); return; } if( !overwrite && findFileEntry(url) ){ @@ -225,13 +225,13 @@ void kio_krarcProtocol::put(const KURL& url,int permissions,bool overwrite,bool // pack the file KrShellProcess proc; proc << putCmd << convertName( arcFile->url().path() )+ " " <<convertFileName( tmpFile.mid(arcTempDir.length()) ); - infoMessage(i18n("Packing %1 ...").tqarg( url.fileName() ) ); + infoMessage(i18n("Packing %1 ...").arg( url.fileName() ) ); TQDir::setCurrent(arcTempDir); proc.start(KProcess::Block,KProcess::AllOutput); // remove the file TQFile::remove(tmpFile); - if( !proc.normalExit() || !checktqStatus( proc.exitStatus() ) ) { + if( !proc.normalExit() || !checkStatus( proc.exitStatus() ) ) { error(ERR_COULD_NOT_WRITE,url.path() + "\n\n" + proc.getErrorMsg() ); return; } @@ -259,7 +259,7 @@ void kio_krarcProtocol::get(const KURL& url, int tries ){ if( getCmd.isEmpty() ){ error(ERR_UNSUPPORTED_ACTION, - i18n("Retrieving data from %1 archives is not supported").tqarg(arcType) ); + i18n("Retrieving data from %1 archives is not supported").arg(arcType) ); return; } UDSEntry* entry = findFileEntry(url); @@ -317,13 +317,13 @@ void kio_krarcProtocol::get(const KURL& url, int tries ){ connect(&proc,TQT_SIGNAL(receivedStdout(KProcess*,char*,int)), this,TQT_SLOT(receivedData(KProcess*,char*,int)) ); } - infoMessage(i18n("Unpacking %1 ...").tqarg( url.fileName() ) ); + infoMessage(i18n("Unpacking %1 ...").arg( url.fileName() ) ); // change the working directory to our arcTempDir TQDir::setCurrent(arcTempDir); proc.start(KProcess::Block,KProcess::AllOutput); if( !extArcReady && !decompressToFile ) { - if( !proc.normalExit() || !checktqStatus( proc.exitStatus() ) || ( arcType != "bzip2" && expectedSize != decompressedLen ) ) { + if( !proc.normalExit() || !checkStatus( proc.exitStatus() ) || ( arcType != "bzip2" && expectedSize != decompressedLen ) ) { if( encrypted && tries ) { invalidatePassword(); get( url, tries - 1 ); @@ -334,7 +334,7 @@ void kio_krarcProtocol::get(const KURL& url, int tries ){ } } else{ - if( !proc.normalExit() || !checktqStatus( proc.exitStatus() ) || !TQFileInfo( arcTempDir+file ).exists() ) { + if( !proc.normalExit() || !checkStatus( proc.exitStatus() ) || !TQFileInfo( arcTempDir+file ).exists() ) { if( decompressToFile ) TQFile(arcTempDir+file).remove(); if( encrypted && tries ) { @@ -439,7 +439,7 @@ void kio_krarcProtocol::del(KURL const & url, bool isFile){ if( delCmd.isEmpty() ){ error(ERR_UNSUPPORTED_ACTION, - i18n("Deleting files from %1 archives is not supported").tqarg(arcType) ); + i18n("Deleting files from %1 archives is not supported").arg(arcType) ); return; } if( !findFileEntry(url) ){ @@ -455,9 +455,9 @@ void kio_krarcProtocol::del(KURL const & url, bool isFile){ } KrShellProcess proc; proc << delCmd << convertName( arcFile->url().path() )+" " << convertFileName( file ); - infoMessage(i18n("Deleting %1 ...").tqarg( url.fileName() ) ); + infoMessage(i18n("Deleting %1 ...").arg( url.fileName() ) ); proc.start(KProcess::Block, KProcess::AllOutput); - if( !proc.normalExit() || !checktqStatus( proc.exitStatus() ) ) { + if( !proc.normalExit() || !checkStatus( proc.exitStatus() ) ) { error(ERR_COULD_NOT_WRITE,url.path() + "\n\n" + proc.getErrorMsg() ); return; } @@ -479,7 +479,7 @@ void kio_krarcProtocol::stat( const KURL & url ){ if( listCmd.isEmpty() ){ error(ERR_UNSUPPORTED_ACTION, - i18n("Accessing files is not supported with the %1 archives").tqarg(arcType) ); + i18n("Accessing files is not supported with the %1 archives").arg(arcType) ); return; } TQString path = url.path(-1); @@ -551,9 +551,9 @@ void kio_krarcProtocol::copy (const KURL &url, const KURL &dest, int, bool overw if( arcType == "ace" && TQFile( "/dev/ptmx" ).exists() ) // Don't remove, unace crashes if missing!!! proc << "<" << "/dev/ptmx"; - infoMessage(i18n("Unpacking %1 ...").tqarg( url.fileName() ) ); + infoMessage(i18n("Unpacking %1 ...").arg( url.fileName() ) ); proc.start(KProcess::Block, KProcess::AllOutput); - if( !proc.normalExit() || !checktqStatus( proc.exitStatus() ) ) { + if( !proc.normalExit() || !checkStatus( proc.exitStatus() ) ) { error(KIO::ERR_COULD_NOT_WRITE, dest.path(-1) + "\n\n" + proc.getErrorMsg() ); return; } @@ -579,7 +579,7 @@ void kio_krarcProtocol::listDir(const KURL& url){ } if( listCmd.isEmpty() ){ error(ERR_UNSUPPORTED_ACTION, - i18n("Listing directories is not supported for %1 archives").tqarg(arcType) ); + i18n("Listing directories is not supported for %1 archives").arg(arcType) ); return; } TQString path = url.path(); @@ -712,7 +712,7 @@ bool kio_krarcProtocol::initDirDict(const KURL&url, bool forced){ if( arcType == "ace" && TQFile( "/dev/ptmx" ).exists() ) // Don't remove, unace crashes if missing!!! proc << "<" << "/dev/ptmx"; proc.start(KProcess::Block,KProcess::AllOutput); - if( !proc.normalExit() || !checktqStatus( proc.exitStatus() ) ) return false; + if( !proc.normalExit() || !checkStatus( proc.exitStatus() ) ) return false; } // clear the dir dictionary dirDict.clear(); @@ -983,13 +983,13 @@ void kio_krarcProtocol::parseLine(int lineNo, TQString line, TQFile*) { if( perm.length() == 7 ) // windows rar permission format { - bool isDir = ( perm.tqat(1).lower() == 'd' ); - bool isReadOnly = ( perm.tqat(2).lower() == 'r' ); + bool isDir = ( perm.at(1).lower() == 'd' ); + bool isReadOnly = ( perm.at(2).lower() == 'r' ); perm = isDir ? "drwxr-xr-x" : "-rw-r--r--"; if( isReadOnly ) - perm.tqat( 2 ) = '-'; + perm.at( 2 ) = '-'; } if(perm.length() != 10) perm = (perm.at(0)=='d')? "drwxr-xr-x" : "-rw-r--r--" ; @@ -1073,7 +1073,7 @@ void kio_krarcProtocol::parseLine(int lineNo, TQString line, TQFile*) { // date & time int month = (TQStringList::split(',', "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec")).findIndex( nextWord(line) ) + 1; int day = nextWord(line).toInt(); - int year = TQDate::tqcurrentDate().year(); + int year = TQDate::currentDate().year(); TQString third = nextWord(line); TQTime qtime; @@ -1141,11 +1141,11 @@ void kio_krarcProtocol::parseLine(int lineNo, TQString line, TQFile*) { // permissions perm = nextWord(line); - bool isDir = ( perm.tqat(0).lower() == 'd' ); - bool isReadOnly = ( perm.tqat(1).lower() == 'r' ); + bool isDir = ( perm.at(0).lower() == 'd' ); + bool isReadOnly = ( perm.at(1).lower() == 'r' ); perm = isDir ? "drwxr-xr-x" : "-rw-r--r--"; if( isReadOnly ) - perm.tqat( 2 ) = '-'; + perm.at( 2 ) = '-'; mode = parsePermString(perm); @@ -1369,14 +1369,14 @@ bool kio_krarcProtocol::initArcParameters() { if( KStandardDirs::findExe(cmd).isEmpty() ){ error( KIO::ERR_CANNOT_LAUNCH_PROCESS, cmd+ - i18n("\nMake sure that the %1 binary are installed properly on your system.").tqarg(cmd)); + i18n("\nMake sure that the %1 binary are installed properly on your system.").arg(cmd)); KRDEBUG("Failed to find cmd: " << cmd); return false; } return true; } -bool kio_krarcProtocol::checktqStatus( int exitCode ) { +bool kio_krarcProtocol::checkStatus( int exitCode ) { KRDEBUG( exitCode ); if( arcType == "zip" || arcType == "rar" || arcType == "7z" ) |