diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-03 02:49:54 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-03 02:49:54 +0000 |
commit | 6ffad5a006df848f5e9a80ca31e5faec8ed65e62 (patch) | |
tree | 3757770dc3586efff30fdfe30f7e36b64ab883f1 /krusader/VFS | |
parent | 1359f43e963c10d08c6c78f4806da291ca216bfe (diff) | |
download | krusader-6ffad5a0.tar.gz krusader-6ffad5a0.zip |
TQt4 port krusader
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/krusader@1239136 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'krusader/VFS')
28 files changed, 951 insertions, 938 deletions
diff --git a/krusader/VFS/arc_vfs.cpp b/krusader/VFS/arc_vfs.cpp index 97e32df..80a2df4 100755 --- a/krusader/VFS/arc_vfs.cpp +++ b/krusader/VFS/arc_vfs.cpp @@ -34,16 +34,16 @@ #include <dirent.h> #include <time.h> // QT includes -#include <qregexp.h> -#include <qdir.h> -#include <qdatetime.h> -#include <qfileinfo.h> +#include <tqregexp.h> +#include <tqdir.h> +#include <tqdatetime.h> +#include <tqfileinfo.h> // KDE includes #include <kmessagebox.h> #include <klocale.h> #include <kprocess.h> #include <kio/jobclasses.h> -#include <qprogressdialog.h> +#include <tqprogressdialog.h> #include <kglobalsettings.h> #include <kmimetype.h> #include <kcursor.h> @@ -60,7 +60,7 @@ #define MAX_FILES 500 //constructor -arc_vfs::arc_vfs(QString origin,QString type,QObject* panel,bool write): +arc_vfs::arc_vfs(TQString origin,TQString type,TQObject* panel,bool write): vfs(panel),arcFile(origin),changed(false),prefix(""),ignoreLines(0){ if ( type == "tarz" ) type = "-tgz"; @@ -81,7 +81,7 @@ arc_vfs::arc_vfs(QString origin,QString type,QObject* panel,bool write): return; } - QString password = QString::null; + TQString password = TQString(); krConfig->setGroup("Archives"); // fill the command options if( type == "gzip" ){ @@ -129,7 +129,7 @@ arc_vfs::arc_vfs(QString origin,QString type,QObject* panel,bool write): password = KRarcHandler::getPassword(arcFile,type); cmd = KrServices::fullPathName( "unzip" ); listCmd = "-ZTs "; - QString zipcmd = KrServices::fullPathName( "zip" ); + TQString zipcmd = KrServices::fullPathName( "zip" ); delCmd = zipcmd+" -d"; addCmd = zipcmd+" -ry"; getCmd = " -o"; @@ -143,8 +143,8 @@ arc_vfs::arc_vfs(QString origin,QString type,QObject* panel,bool write): } // "-rpm" is used only to list the rpm - to extract files use "+rpm" if(type == "-rpm"){ - //rpm can't handle files with " " in them so replace " " with "\ " - arcFile.replace(QRegExp(" "),"\\ "); + //rpm can't handle files with " " in them so tqreplace " " with "\ " + arcFile.tqreplace(TQRegExp(" "),"\\ "); cmd = KrServices::fullPathName( "rpm" ); listCmd = " --dump -lpq "; @@ -173,7 +173,7 @@ arc_vfs::arc_vfs(QString origin,QString type,QObject* panel,bool write): cmd = KrServices::fullPathName( "unrar" ); listCmd = " -c- v "; delCmd = ""; - addCmd = (doRar ? QString(KrServices::fullPathName( "rar" ) + " -r a ") : QString("")) ; + addCmd = (doRar ? TQString(KrServices::fullPathName( "rar" ) + " -r a ") : TQString("")) ; getCmd = " x -y "; ignoreLines = 8; isWritable = (doRar && isWritable ); @@ -185,11 +185,11 @@ arc_vfs::arc_vfs(QString origin,QString type,QObject* panel,bool write): } // return the working dir -QString arc_vfs::vfs_workingDir(){ +TQString arc_vfs::vfs_workingDir(){ // get the path inside the archive - QString path = vfs_origin.right((vfs_origin.length()-vfs_origin.findRev('\\'))-1); + TQString path = vfs_origin.right((vfs_origin.length()-vfs_origin.tqfindRev('\\'))-1); if(path.left(1) != "/") path = "/"+path; - QDir().mkdir(tmpDir+path); + TQDir().mkdir(tmpDir+path); return tmpDir+path; } @@ -215,7 +215,7 @@ bool arc_vfs::getDirs(){ proc.start(KProcess::Block); if( !proc.normalExit() || !proc.exitStatus() == 0 ){ if (!quietMode) KMessageBox::error(krApp, i18n("<qt>Can't read <b>%1</b>. Archive " - "might be corrupted!</qt>").arg(arcFile.mid(arcFile.findRev('/')+1))); + "might be corrupted!</qt>").tqarg(arcFile.mid(arcFile.tqfindRev('/')+1))); error = true; return false; } @@ -229,24 +229,24 @@ bool arc_vfs::getDirs(){ dirList.append(tempdir); // parse the temp file - QFile temp(tmpDir+"/tempfilelist"); + TQFile temp(tmpDir+"/tempfilelist"); temp.open(IO_ReadOnly); char buf[1000]; - QString line; + TQString line; if(vfs_type == "gzip" || vfs_type == "-zip" ) temp.readLine(line,10000); // skip the first line - it's garbage if( vfs_type == "-rar" ){ while(temp.readLine(line,10000) != -1) - if ( line.contains("----------") ) break; + if ( line.tqcontains("----------") ) break; } while(temp.readLine(buf,1000) != -1){ - line = QString::fromLocal8Bit(buf); - if ( line.contains("----------") ) break; + line = TQString::fromLocal8Bit(buf); + if ( line.tqcontains("----------") ) break; parseLine(line.stripWhiteSpace(),&temp); } temp.close(); - QDir().remove(tmpDir+"/tempfilelist"); + TQDir().remove(tmpDir+"/tempfilelist"); } else { // bzip2 // clear the dir list @@ -264,18 +264,18 @@ bool arc_vfs::getDirs(){ // copy a file to the vfs (physical) -void arc_vfs::vfs_addFiles(KURL::List *fileUrls,KIO::CopyJob::CopyMode mode,QObject* toNotify,QString dir, PreserveMode /*pmode*/ ){ +void arc_vfs::vfs_addFiles(KURL::List *fileUrls,KIO::CopyJob::CopyMode mode,TQObject* toNotify,TQString dir, PreserveMode /*pmode*/ ){ if ( addCmd.isEmpty() ) return; // get the path inside the archive - QString path = vfs_origin.right((vfs_origin.length()-vfs_origin.findRev('\\'))-1); + TQString path = vfs_origin.right((vfs_origin.length()-vfs_origin.tqfindRev('\\'))-1); path = path+"/"; if(dir != "" ) dir = "/"+dir; if(path.left(1) != "/") path = "/"+path; // make sure the destination exist - for( int i=0; i >= 0 ; i= QString(tmpDir+path+dir).find('/',i+1) ){ - QDir().mkdir(QString(tmpDir+path+dir).left(i)); + for( int i=0; i >= 0 ; i= TQString(tmpDir+path+dir).tqfind('/',i+1) ){ + TQDir().mkdir(TQString(tmpDir+path+dir).left(i)); } changed = true; //rescan the archive @@ -284,14 +284,14 @@ void arc_vfs::vfs_addFiles(KURL::List *fileUrls,KIO::CopyJob::CopyMode mode,QObj dest.setPath(tmpDir+path+dir); KIO::Job* job = new KIO::CopyJob(*fileUrls,dest,mode,false,true); - connect(job,SIGNAL(result(KIO::Job*)),this,SLOT(vfs_refresh(KIO::Job*)) ); + connect(job,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(vfs_refresh(KIO::Job*)) ); if(mode == KIO::CopyJob::Move) // notify the other panel - connect(job,SIGNAL(result(KIO::Job*)),toNotify,SLOT(vfs_refresh(KIO::Job*)) ); + connect(job,TQT_SIGNAL(result(KIO::Job*)),toNotify,TQT_SLOT(vfs_refresh(KIO::Job*)) ); } // remove a file from the vfs (physical) -void arc_vfs::vfs_delFiles(QStringList *fileNames){ +void arc_vfs::vfs_delFiles(TQStringList *fileNames){ if ( delCmd.isEmpty() ) return; // if we move to trash - just extract files and move them to trash - // the repack() will delete them for us @@ -301,27 +301,27 @@ void arc_vfs::vfs_delFiles(QStringList *fileNames){ changed = true; KIO::Job *job = new KIO::CopyJob(*filesUrls,KGlobalSettings::trashPath(),KIO::CopyJob::Move,false,true ); - connect(job,SIGNAL(result(KIO::Job*)),this,SLOT(vfs_refresh(KIO::Job*))); + connect(job,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(vfs_refresh(KIO::Job*))); } // else we have to delete the files from both the archive and the temp dir else { // change dir to the temp dir - QString save = getcwd(0,0); + TQString save = getcwd(0,0); chdir(tmpDir.local8Bit()); - QStringList files; + TQStringList files; KIO::filesize_t totalSizeVal = 0; unsigned long totalFilesVal = 0; // names -> urls - for(QStringList::Iterator name = fileNames->begin(); name != fileNames->end(); ++name ) + for(TQStringList::Iterator name = fileNames->begin(); name != fileNames->end(); ++name ) processName(*name,&files,&totalSizeVal,&totalFilesVal); KShellProcess proc1 , proc2; krApp->startWaiting(i18n("Deleting Files..."),files.count()+ignoreLines); - connect(&proc1,SIGNAL(receivedStdout(KProcess*,char*,int)), - krApp, SLOT(incProgress(KProcess*,char*,int)) ); + connect(&proc1,TQT_SIGNAL(receivedStdout(KProcess*,char*,int)), + krApp, TQT_SLOT(incProgress(KProcess*,char*,int)) ); proc1 << delCmd << "\""+arcFile+"\""; proc2 << "rm -rf"; @@ -332,7 +332,7 @@ void arc_vfs::vfs_delFiles(QStringList *fileNames){ if ( i%MAX_FILES==0 || i==files.count() ){ proc1.start(KProcess::NotifyOnExit,KProcess::AllOutput); proc2.start(); - while( proc1.isRunning() || proc2.isRunning() ) qApp->processEvents(); // busy wait - need to find something better... + while( proc1.isRunning() || proc2.isRunning() ) tqApp->processEvents(); // busy wait - need to find something better... proc1.clearArguments() ; proc2.clearArguments(); proc1 << delCmd << "\""+arcFile+"\""; proc2 << "rm -rf"; @@ -347,47 +347,47 @@ void arc_vfs::vfs_delFiles(QStringList *fileNames){ } // return a path to the file -QString arc_vfs::vfs_getFile(QString name){ +TQString arc_vfs::vfs_getFile(TQString name){ // get the current file path - QString path = vfs_origin.right((vfs_origin.length()-vfs_origin.findRev('\\'))-1); + TQString path = vfs_origin.right((vfs_origin.length()-vfs_origin.tqfindRev('\\'))-1); if(path.left(1)=="/") path.remove(0,1); if(path != "") path = path+"/"; - QStringList temp(name); + TQStringList temp(name); vfs_getFiles(&temp); return tmpDir+"/"+path+name; } -KURL::List* arc_vfs::vfs_getFiles(QStringList* names){ +KURL::List* arc_vfs::vfs_getFiles(TQStringList* names){ KURL url; KURL::List* urls = new KURL::List(); // get the current file path - QString path = vfs_origin.right((vfs_origin.length()-vfs_origin.findRev('\\'))-1); + TQString path = vfs_origin.right((vfs_origin.length()-vfs_origin.tqfindRev('\\'))-1); if(path.left(1)=="/") path.remove(0,1); if(path != "") path = path+"/"; // change dir to the temp dir - QString save = getcwd(0,0); + TQString save = getcwd(0,0); chdir(tmpDir.local8Bit()); // names -> urls - QStringList files; + TQStringList files; KIO::filesize_t totalSize = 0; unsigned long totalFiles = 0; - for(QStringList::Iterator name = names->begin(); name != names->end(); ++name ){ + for(TQStringList::Iterator name = names->begin(); name != names->end(); ++name ){ processName(*name,&files,&totalSize,&totalFiles); url.setPath(tmpDir+"/"+path+(*name)); urls->append(url); } // check the urls for unpacked files and directories - for(QStringList::Iterator file = files.begin(); file != files.end(); ++file ){ + for(TQStringList::Iterator file = files.begin(); file != files.end(); ++file ){ if ( (*file).right(1)=="/" ){ - QDir(tmpDir).mkdir(*file); + TQDir(tmpDir).mkdir(*file); if( vfs_type == "-rar" ) file = files.remove(file--); } // don't unpack the same file twice - else if( extFiles.contains(*file) ){ + else if( extFiles.tqcontains(*file) ){ file = files.remove(file--); } } @@ -395,8 +395,8 @@ KURL::List* arc_vfs::vfs_getFiles(QStringList* names){ if ( files.count() > 0 ){ krApp->startWaiting(i18n("Unpacking Files"),files.count()+ignoreLines); KShellProcess proc; - connect(&proc,SIGNAL(receivedStdout(KProcess*,char*,int)), - krApp, SLOT(incProgress(KProcess*,char*,int)) ); + connect(&proc,TQT_SIGNAL(receivedStdout(KProcess*,char*,int)), + krApp, TQT_SLOT(incProgress(KProcess*,char*,int)) ); proc << cmd << getCmd << "\""+arcFile+"\""; if( vfs_type == "gzip" || vfs_type == "zip2" ) proc << ">"; @@ -404,7 +404,7 @@ KURL::List* arc_vfs::vfs_getFiles(QStringList* names){ proc << (prefix+*files.at(i++)); if ( i%MAX_FILES==0 || i==files.count() ){ proc.start(KProcess::NotifyOnExit,KProcess::AllOutput); - while( proc.isRunning() ) qApp->processEvents(); + while( proc.isRunning() ) tqApp->processEvents(); proc.clearArguments(); proc << cmd << getCmd << "\""+arcFile+"\""; } @@ -419,35 +419,35 @@ KURL::List* arc_vfs::vfs_getFiles(QStringList* names){ } // make dir -void arc_vfs::vfs_mkdir(QString name){ - QString path = vfs_origin.right((vfs_origin.length()-vfs_origin.findRev('\\'))-1); +void arc_vfs::vfs_mkdir(TQString name){ + TQString path = vfs_origin.right((vfs_origin.length()-vfs_origin.tqfindRev('\\'))-1); if(path.left(1)=="/") path.remove(0,1); if(path != "") path = path+"/"; - QDir(tmpDir).mkdir(path+name); + TQDir(tmpDir).mkdir(path+name); changed = true; //rescan the archive vfs_refresh(vfs_origin); } // rename file -void arc_vfs::vfs_rename(QString fileName,QString newName){ +void arc_vfs::vfs_rename(TQString fileName,TQString newName){ KURL::List temp; temp.append(vfs_getFile(fileName)); - QString path = vfs_origin.right((vfs_origin.length()-vfs_origin.findRev('\\'))-1); + TQString path = vfs_origin.right((vfs_origin.length()-vfs_origin.tqfindRev('\\'))-1); if(path.left(1)=="/") path.remove(0,1); if(path != "") path = path+"/"; - QDir(tmpDir).mkdir(path); + TQDir(tmpDir).mkdir(path); changed = true; //rescan the archive KURL dest; dest.setPath(tmpDir+path+"/"+newName); KIO::Job* job = new KIO::CopyJob(temp,dest,KIO::CopyJob::Move,false,false); - connect(job,SIGNAL(result(KIO::Job*)),this,SLOT(vfs_refresh(KIO::Job*)) ); + connect(job,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(vfs_refresh(KIO::Job*)) ); } -bool arc_vfs::vfs_refresh(QString origin){ +bool arc_vfs::vfs_refresh(TQString origin){ if ( error ) return false; if ( changed || origin == vfs_origin ){ @@ -461,7 +461,7 @@ bool arc_vfs::vfs_refresh(QString origin){ vfs_origin = origin; // get the directory... - QString path = origin.right((origin.length()-origin.findRev('\\'))-1); + TQString path = origin.right((origin.length()-origin.tqfindRev('\\'))-1); if(path.left(1) =="/") path.remove(0,1); vfs_filesP = findDir(path); @@ -471,15 +471,15 @@ bool arc_vfs::vfs_refresh(QString origin){ } // service functions -QString arc_vfs::nextWord(QString &s,char d) { +TQString arc_vfs::nextWord(TQString &s,char d) { s=s.stripWhiteSpace(); - int j=s.find(d,0); - QString temp=s.left(j); // find the leftmost word. + int j=s.tqfind(d,0); + TQString temp=s.left(j); // find the leftmost word. s.remove(0,j); return temp; } -void arc_vfs::getFilesToPack(QStringList* filesToPack,QString dir_name){ +void arc_vfs::getFilesToPack(TQStringList* filesToPack,TQString dir_name){ bool newDir = false; vfileDict *vfs_filesP_backup = vfs_filesP; // save vfs_filesP @@ -492,7 +492,7 @@ void arc_vfs::getFilesToPack(QStringList* filesToPack,QString dir_name){ if(!dir) return ; register struct dirent* dirEnt; - QString name; + TQString name; KDE_struct_stat stat_p; while( (dirEnt=readdir(dir)) != NULL ){ name = dirEnt->d_name; @@ -503,7 +503,7 @@ void arc_vfs::getFilesToPack(QStringList* filesToPack,QString dir_name){ if( S_ISDIR(stat_p.st_mode) ){ // recurse on all sub dirs if( !findDir(dir_name+name) ){ // add to the list only new && empty dirs - if( newDir && QDir(dir_name+name).entryList(QDir::All | QDir::AccessMask).count() <= 2 ) + if( newDir && TQDir(dir_name+name).entryList(TQDir::All | TQDir::AccessMask).count() <= 2 ) filesToPack->append( dir_name+name); } getFilesToPack(filesToPack,dir_name+name); @@ -511,11 +511,11 @@ void arc_vfs::getFilesToPack(QStringList* filesToPack,QString dir_name){ } // if the file don't exist add it to the archive and to the extFiles - if( newDir || !extFiles.contains( dir_name+name ) ){ + if( newDir || !extFiles.tqcontains( dir_name+name ) ){ filesToPack->append( dir_name+name ); extFiles.append( temp ); } // else if the file exist but was modified - repack it; - else if( !extFiles.contains( temp ) ){ + else if( !extFiles.tqcontains( temp ) ){ filesToPack->append( dir_name+name ); extFiles.remove( dir_name+name ); extFiles.append( temp ); @@ -524,9 +524,9 @@ void arc_vfs::getFilesToPack(QStringList* filesToPack,QString dir_name){ vfs_filesP = vfs_filesP_backup; // restore vfs_filesP } -void arc_vfs::getFilesToDelete(QStringList* filesToDelete,QString){ +void arc_vfs::getFilesToDelete(TQStringList* filesToDelete,TQString){ // sync the extFiles - and find out which files were deleted - QString file; + TQString file; for(unsigned int i=0 ; i<extFiles.count(); ){ file = tmpDir+"/"+(*extFiles.at(i)).url; if( !KRpermHandler::fileExist(file) ){ @@ -537,7 +537,7 @@ void arc_vfs::getFilesToDelete(QStringList* filesToDelete,QString){ } } -void arc_vfs::getExtFiles(QString dir_name){ +void arc_vfs::getExtFiles(TQString dir_name){ register DIR* dir = opendir(tmpDir.local8Bit()+"/"+dir_name.local8Bit()); if(!dir){ kdWarning() << "faild to opendir(): " << tmpDir.local8Bit()+"/"+dir_name.local8Bit() << endl; @@ -547,7 +547,7 @@ void arc_vfs::getExtFiles(QString dir_name){ if( dir_name != "") dir_name = dir_name+"/"; register struct dirent* dirEnt; - QString name; + TQString name; KDE_struct_stat stat_p; while( (dirEnt=readdir(dir)) != NULL ){ name = dirEnt->d_name; @@ -560,32 +560,32 @@ void arc_vfs::getExtFiles(QString dir_name){ } // if the file is not in extFiles - it is newly extracted. // note: getFilesToPack() updates time + size ! - else if( !extFiles.contains( dir_name+name ) ){ + else if( !extFiles.tqcontains( dir_name+name ) ){ extFiles.append( temp ); } } } void arc_vfs::repack(){ - QString save = getcwd(0,0); + TQString save = getcwd(0,0); chdir(tmpDir.local8Bit()); // delete from the archive files that were unpacked and deleted if( vfs_isWritable() ){ - QStringList filesToDelete; + TQStringList filesToDelete; getFilesToDelete(&filesToDelete); if( !filesToDelete.isEmpty() ){ KShellProcess delProc; krApp->startWaiting(i18n("Deleting Files..."),filesToDelete.count()+ignoreLines); - connect(&delProc,SIGNAL(receivedStdout(KProcess*,char*,int)), - krApp, SLOT(incProgress(KProcess*,char*,int)) ); + connect(&delProc,TQT_SIGNAL(receivedStdout(KProcess*,char*,int)), + krApp, TQT_SLOT(incProgress(KProcess*,char*,int)) ); delProc << delCmd << "\""+arcFile+"\""; for( unsigned int i=0 ; i < filesToDelete.count() ;){ delProc << (*filesToDelete.at(i++)); if( i%MAX_FILES==0 || i==filesToDelete.count() ){ delProc.start(KProcess::NotifyOnExit,KProcess::AllOutput); - while( delProc.isRunning() ) qApp->processEvents(); + while( delProc.isRunning() ) tqApp->processEvents(); delProc.clearArguments(); delProc << delCmd << "\""+arcFile+"\""; } @@ -596,18 +596,18 @@ void arc_vfs::repack(){ // finaly repack tmpDir if( vfs_isWritable() || vfs_type=="gzip" || vfs_type=="zip2" ){ - QStringList filesToPack; + TQStringList filesToPack; getFilesToPack(&filesToPack); if( !filesToPack.isEmpty() ){ KShellProcess addProc; krApp->startWaiting(i18n("Repacking..."),filesToPack.count()+ignoreLines); - connect(&addProc,SIGNAL(receivedStdout(KProcess*,char*,int)), - krApp, SLOT(incProgress(KProcess*,char*,int)) ); + connect(&addProc,TQT_SIGNAL(receivedStdout(KProcess*,char*,int)), + krApp, TQT_SLOT(incProgress(KProcess*,char*,int)) ); if( vfs_type=="gzip" || vfs_type=="zip2" ){ addProc << addCmd << *filesToPack.at(0)<< ">" << "\""+arcFile+"\""; addProc.start(KProcess::NotifyOnExit); - while( addProc.isRunning() ) qApp->processEvents(); + while( addProc.isRunning() ) tqApp->processEvents(); } else { addProc << addCmd << "\""+arcFile+"\""; @@ -615,7 +615,7 @@ void arc_vfs::repack(){ addProc << "\""+prefix+(*filesToPack.at(i++))+"\""; if( i%MAX_FILES==0 || i==filesToPack.count() ){ addProc.start(KProcess::NotifyOnExit,KProcess::AllOutput); - while( addProc.isRunning() ) qApp->processEvents(); // busy wait - need to find something better... + while( addProc.isRunning() ) tqApp->processEvents(); // busy wait - need to find something better... addProc.clearArguments(); addProc << addCmd << "\""+arcFile+"\""; } @@ -627,40 +627,40 @@ void arc_vfs::repack(){ chdir(save.local8Bit()); } -vfileDict* arc_vfs::findDir(QString name){ +vfileDict* arc_vfs::findDir(TQString name){ for(arc_dir* temp = dirList.first();temp != 0 ; temp = dirList.next()){ if(temp->name == name) return &(temp->entries); } return 0; } -arc_vfs::arc_dir* arc_vfs::findArcDir(QString name){ +arc_vfs::arc_dir* arc_vfs::findArcDir(TQString name){ for(arc_dir* temp = dirList.first();temp != 0 ; temp = dirList.next()){ if(temp->name == name) return temp; } return 0; } -QString arc_vfs::changeDir(QString name){ +TQString arc_vfs::changeDir(TQString name){ if(name.left(2) == "./") { prefix = "./"; name.remove(0,2); } - if(!name.contains('/')){ + if(!name.tqcontains('/')){ vfs_filesP = findDir(""); return name; } // seperate the path from the name - QString path = name.left(name.findRev('/')); - name = name.mid(name.findRev('/')+1); + TQString path = name.left(name.tqfindRev('/')); + name = name.mid(name.tqfindRev('/')+1); // see if the path exists if ((vfs_filesP=findDir(path)) == 0){ //create a new dir entry - QString Pname = path.mid(path.findRev('/')+1); + TQString Pname = path.mid(path.tqfindRev('/')+1); if(Pname.isEmpty()) return name; - QString tempName = arcFile; - QFileInfo qfi(tempName.replace(QRegExp("\\"),"")); + TQString tempName = arcFile; + TQFileInfo qfi(tempName.tqreplace(TQRegExp("\\"),"")); vfile* vf=new vfile(Pname,0,"drwxr-xr-x",qfi.lastModified().toTime_t(),false, qfi.owner(),qfi.group(),"inode/directory","",0 ); // add dirs if needed @@ -678,12 +678,12 @@ QString arc_vfs::changeDir(QString name){ } // calculate space -void arc_vfs::vfs_calcSpace(QString name ,KIO::filesize_t *totalSize,unsigned long *totalFiles,unsigned long *totalDirs,bool* stop){ +void arc_vfs::vfs_calcSpace(TQString name ,KIO::filesize_t *totalSize,unsigned long *totalFiles,unsigned long *totalDirs,bool* stop){ if ( *stop ) return; vfile* vf = vfs_search(name); // get the path inside the archive - QString path = vfs_origin.right((vfs_origin.length()-vfs_origin.findRev('\\'))-1); + TQString path = vfs_origin.right((vfs_origin.length()-vfs_origin.tqfindRev('\\'))-1); path = path+"/"; if(path.left(1) == "/") path.remove(0,1); @@ -694,7 +694,7 @@ void arc_vfs::vfs_calcSpace(QString name ,KIO::filesize_t *totalSize,unsigned lo else { // handle directories : ( ++(*totalDirs); - QString origin_backup = vfs_origin; // backup the vfs origin + TQString origin_backup = vfs_origin; // backup the vfs origin vfs_origin = vfs_origin+"/"+name; vfileDict* vfs_filesP_backup = vfs_filesP; // backup the vfs_filesP vfs_filesP = findDir(path+name); @@ -710,12 +710,12 @@ void arc_vfs::vfs_calcSpace(QString name ,KIO::filesize_t *totalSize,unsigned lo } } -void arc_vfs::processName(const QString& name, QStringList *urls,KIO::filesize_t *totalSize,unsigned long *totalFiles ){ +void arc_vfs::processName(const TQString& name, TQStringList *urls,KIO::filesize_t *totalSize,unsigned long *totalFiles ){ vfile* vf = vfs_search(name); if ( vf == 0 ) return; // get the path inside the archive - QString path = vfs_origin.right((vfs_origin.length()-vfs_origin.findRev('\\'))-1); + TQString path = vfs_origin.right((vfs_origin.length()-vfs_origin.tqfindRev('\\'))-1); path = path+"/"; if(path.left(1) == "/") path.remove(0,1); @@ -725,7 +725,7 @@ void arc_vfs::processName(const QString& name, QStringList *urls,KIO::filesize_t urls->append(path+name); } else { // handle directories : ( urls->append(path+name+"/"); - QString origin_backup = vfs_origin; // backup the vfs origin + TQString origin_backup = vfs_origin; // backup the vfs origin vfs_origin = vfs_origin+"/"+name; vfileDict* vfs_filesP_backup = vfs_filesP; // backup the vfs_filesP vfs_filesP = findDir(path+name); @@ -739,16 +739,16 @@ void arc_vfs::processName(const QString& name, QStringList *urls,KIO::filesize_t } } -void arc_vfs::parseLine(QString line, QFile* temp){ - QString name; +void arc_vfs::parseLine(TQString line, TQFile* temp){ + TQString name; KIO::filesize_t size = 0; - QString perm; - QFileInfo qfi(arcFile); + TQString perm; + TQFileInfo qfi(arcFile); time_t mtime = qfi.lastModified().toTime_t(); bool link = false; uid_t owner = getuid(); gid_t group = getgid(); - QString dest = ""; + TQString dest = ""; mode_t mode = 0; @@ -761,8 +761,8 @@ void arc_vfs::parseLine(QString line, QFile* temp){ size = nextWord(line).toLong(); nextWord(line); name = nextWord(line,'\n'); - if(name.contains('/')) name = name.mid(name.findRev('/')+1,name.length()); - perm = KRpermHandler::mode2QString(stat_p.st_mode) ; + if(name.tqcontains('/')) name = name.mid(name.tqfindRev('/')+1,name.length()); + perm = KRpermHandler::mode2TQString(stat_p.st_mode) ; owner = KRpermHandler::user2uid(qfi.owner()); group = KRpermHandler::group2gid(qfi.group()); mode = stat_p.st_mode; @@ -774,9 +774,9 @@ void arc_vfs::parseLine(QString line, QFile* temp){ KDE_stat(arcFile.local8Bit(),&stat_p); name = qfi.fileName(); - name = name.left(name.findRev('.')); + name = name.left(name.tqfindRev('.')); //long size = qfi.size(); - perm = KRpermHandler::mode2QString(stat_p.st_mode) ; + perm = KRpermHandler::mode2TQString(stat_p.st_mode) ; owner = KRpermHandler::user2uid(qfi.owner()); group = KRpermHandler::group2gid(qfi.group()); mode = stat_p.st_mode; @@ -785,18 +785,18 @@ void arc_vfs::parseLine(QString line, QFile* temp){ // parse tar files if(vfs_type == "-tar" || vfs_type == "-tbz" || vfs_type == "-tgz" ){ perm = nextWord(line); - QString temp = nextWord(line); - owner = temp.left(temp.findRev('/')).toInt(); - group = temp.mid(temp.find('/')+1,temp.length()).toInt(); + TQString temp = nextWord(line); + owner = temp.left(temp.tqfindRev('/')).toInt(); + group = temp.mid(temp.tqfind('/')+1,temp.length()).toInt(); size = nextWord(line).toLong(); temp = nextWord(line); name = nextWord(line,'\n'); if (name.startsWith("/")) // fix full-paths problem in tar (thanks to Heiner!) name.remove(0, 1); - if( name.contains(" -> ") ){ + if( name.tqcontains(" -> ") ){ link = true; - dest = name.mid(name.find(" -> ")+4); - name = name.left(name.find(" -> ")); + dest = name.mid(name.tqfind(" -> ")+4); + name = name.left(name.tqfind(" -> ")); } } @@ -805,11 +805,11 @@ void arc_vfs::parseLine(QString line, QFile* temp){ perm = nextWord(line); if(perm.length() != 10) perm = (perm.at(0)=='d')? "drwxr-xr-x" : "-rw-r--r--" ; - if (nextWord(line).contains("file")) return; + if (nextWord(line).tqcontains("file")) return; nextWord(line); size = nextWord(line).toLong(); nextWord(line);nextWord(line); - QString temp = nextWord(line); + TQString temp = nextWord(line); name = nextWord(line,'\n'); } @@ -819,14 +819,14 @@ void arc_vfs::parseLine(QString line, QFile* temp){ nextWord(line);nextWord(line);nextWord(line); size = nextWord(line).toLong(); nextWord(line);nextWord(line);nextWord(line); - QString tempName = arcFile; - QFileInfo qfi(tempName.replace(QRegExp("\\"),"")); + TQString tempName = arcFile; + TQFileInfo qfi(tempName.tqreplace(TQRegExp("\\"),"")); name = nextWord(line,'\n'); if ( name.left(1) == "/" ) name.remove(0,1); - if( name.contains(" -> ") ){ + if( name.tqcontains(" -> ") ){ link = true; - dest = name.mid(name.find(" -> ")+4); - name = name.left(name.find(" -> ")); + dest = name.mid(name.tqfind(" -> ")+4); + name = name.left(name.tqfind(" -> ")); } } // parse rared files @@ -847,7 +847,7 @@ void arc_vfs::parseLine(QString line, QFile* temp){ size = nextWord(line).toLong(); mtime = nextWord(line).toLong(); nextWord(line); - perm = KRpermHandler::mode2QString(nextWord(line).toLong()); + perm = KRpermHandler::mode2TQString(nextWord(line).toLong()); perm = (perm.at(0)=='d')? "drwxr-xr-x" : "-rw-r--r--" ; } @@ -856,7 +856,7 @@ void arc_vfs::parseLine(QString line, QFile* temp){ if(name.length() < 1) return; - QString mime = KMimeType::findByURL( "/"+name,0,true,true)->name(); + TQString mime = KMimeType::findByURL( "/"+name,0,true,true)->name(); vfile* vf=new vfile(name,size,perm,mtime,link,owner,group,mime,dest,mode); vfile* vf2 = vfs_search(name); if(vf2 != 0) vfs_removeFromList(vf2); diff --git a/krusader/VFS/arc_vfs.h b/krusader/VFS/arc_vfs.h index b4adf9b..ccc1ef5 100644 --- a/krusader/VFS/arc_vfs.h +++ b/krusader/VFS/arc_vfs.h @@ -33,65 +33,66 @@ #include <sys/types.h> #include "vfs.h" -#include <qvaluestack.h> +#include <tqvaluestack.h> #include <kprocess.h> -#include <qfile.h> -#include <qprogressdialog.h> +#include <tqfile.h> +#include <tqprogressdialog.h> class arc_vfs : public vfs { Q_OBJECT + TQ_OBJECT class arc_dir; class extFile; public: - arc_vfs(QString origin,QString type,QObject* panel,bool write); + arc_vfs(TQString origin,TQString type,TQObject* panel,bool write); ~arc_vfs(); // copy a file to the vfs (physical) - void vfs_addFiles(KURL::List *fileUrls,KIO::CopyJob::CopyMode mode,QObject* toNotify=0,QString dir = "", PreserveMode pmode = PM_DEFAULT ); + void vfs_addFiles(KURL::List *fileUrls,KIO::CopyJob::CopyMode mode,TQObject* toNotify=0,TQString dir = "", PreserveMode pmode = PM_DEFAULT ); // remove a file from the vfs (physical) - void vfs_delFiles(QStringList *fileNames); + void vfs_delFiles(TQStringList *fileNames); // return a path to the file - QString vfs_getFile(QString name); - KURL::List* vfs_getFiles(QStringList* names); + TQString vfs_getFile(TQString name); + KURL::List* vfs_getFiles(TQStringList* names); // make dir - void vfs_mkdir(QString name); + void vfs_mkdir(TQString name); // rename file - void vfs_rename(QString fileName,QString newName); + void vfs_rename(TQString fileName,TQString newName); // calculate space - void vfs_calcSpace(QString name ,KIO::filesize_t *totalSize,unsigned long *totalFiles,unsigned long *totalDirs, bool* stop); + void vfs_calcSpace(TQString name ,KIO::filesize_t *totalSize,unsigned long *totalFiles,unsigned long *totalDirs, bool* stop); // return the working dir - QString vfs_workingDir(); + TQString vfs_workingDir(); public slots: // actually reads files and stats - bool vfs_refresh(QString origin); + bool vfs_refresh(TQString origin); void repack(); protected: - QString tmpDir; // the temp directory tha archive is using - QString arcFile; // the archive file URL + TQString tmpDir; // the temp directory tha archive is using + TQString arcFile; // the archive file URL bool changed; // true if repack changed the archive - QList<arc_dir> dirList; - QValueList<extFile> extFiles; // the name, time & size of files unpacked from this archive + TQList<arc_dir> dirList; + TQValueList<extFile> extFiles; // the name, time & size of files unpacked from this archive - void processName(const QString& name,QStringList *urls,KIO::filesize_t *totalSize,unsigned long *totalFiles ); + void processName(const TQString& name,TQStringList *urls,KIO::filesize_t *totalSize,unsigned long *totalFiles ); bool getDirs(); // fill the dir list - vfileDict* findDir(QString name); - arc_dir* findArcDir(QString name); - void getFilesToPack (QStringList* filesToPack,QString dir_name = ""); - void getFilesToDelete(QStringList* filesToDelete,QString dir_name = ""); - void getExtFiles( QString dir_name="" ); - QString nextWord( QString &s, char d=' ' ); - QString changeDir(QString name); - - void parseLine(QString line,QFile* temp); - - QString prefix; - QString cmd; // the archiver main command - QString listCmd; // the file listing option - QString delCmd; // the delete option - QString addCmd; // the add files option - QString getCmd; // the extract files option + vfileDict* findDir(TQString name); + arc_dir* findArcDir(TQString name); + void getFilesToPack (TQStringList* filesToPack,TQString dir_name = ""); + void getFilesToDelete(TQStringList* filesToDelete,TQString dir_name = ""); + void getExtFiles( TQString dir_name="" ); + TQString nextWord( TQString &s, char d=' ' ); + TQString changeDir(TQString name); + + void parseLine(TQString line,TQFile* temp); + + TQString prefix; + TQString cmd; // the archiver main command + TQString listCmd; // the file listing option + TQString delCmd; // the delete option + TQString addCmd; // the add files option + TQString getCmd; // the extract files option // the interl progress bar variale int ignoreLines; // no of lines to ignore on stdout @@ -99,26 +100,26 @@ protected: private: class arc_dir{ public: - arc_dir(QString _name){ + arc_dir(TQString _name){ name = _name; entries.setAutoDelete(true); } - QString name; // the name of the dir + TQString name; // the name of the dir vfileDict entries; // the file and dir in this dir }; class extFile{ public: extFile(): url(""),time(0),size(0){} - extFile(QString u): url(u),time(0),size(0){} - extFile(QString u,time_t t,off_t s): url(u),time(t),size(s){} + extFile(TQString u): url(u),time(0),size(0){} + extFile(TQString u,time_t t,off_t s): url(u),time(t),size(s){} bool operator==(const extFile& ef) const{ if( url != ef.url ) return false; if( size*ef.size && size!=ef.size )return false; if( time*ef.time && time!=ef.time )return false; return true; } - QString url; + TQString url; time_t time; off_t size; }; diff --git a/krusader/VFS/ftp_vfs.cpp b/krusader/VFS/ftp_vfs.cpp index 1cfb394..90684b7 100644 --- a/krusader/VFS/ftp_vfs.cpp +++ b/krusader/VFS/ftp_vfs.cpp @@ -36,10 +36,10 @@ #include <sys/types.h> #endif // QT includes -#include <qdir.h> -#include <qregexp.h> -#include <qtimer.h> -#include <qeventloop.h> +#include <tqdir.h> +#include <tqregexp.h> +#include <tqtimer.h> +#include <tqeventloop.h> // KDE includes #include <kio/jobclasses.h> #include <klocale.h> @@ -56,7 +56,7 @@ #include "../defaults.h" #include "../resources.h" -ftp_vfs::ftp_vfs( QObject* panel ) : vfs( panel ), busy( false ) { +ftp_vfs::ftp_vfs( TQObject* panel ) : vfs( panel ), busy( false ) { // set the writable attribute isWritable = true; vfs_type = FTP; @@ -69,7 +69,7 @@ ftp_vfs::~ftp_vfs() { void ftp_vfs::slotAddFiles( KIO::Job *, const KIO::UDSEntryList& entries ) { int rwx = -1; - QString prot = vfs_origin.protocol(); + TQString prot = vfs_origin.protocol(); if( prot == "krarc" || prot == "tar" || prot == "zip" ) rwx = PERM_ALL; @@ -82,7 +82,7 @@ void ftp_vfs::slotAddFiles( KIO::Job *, const KIO::UDSEntryList& entries ) { vfile *temp; // get file statistics - QString name = kfi.text(); + TQString name = kfi.text(); // ignore un-needed entries if ( name.isEmpty() || name == "." || name == ".." ) continue; @@ -90,10 +90,10 @@ void ftp_vfs::slotAddFiles( KIO::Job *, const KIO::UDSEntryList& entries ) { time_t mtime = kfi.time( KIO::UDS_MODIFICATION_TIME ); bool symLink = kfi.isLink(); mode_t mode = kfi.mode() | kfi.permissions(); - QString perm = KRpermHandler::mode2QString( mode ); + TQString perm = KRpermHandler::mode2TQString( mode ); // set the mimetype - QString mime = kfi.mimetype(); - QString symDest = ""; + TQString mime = kfi.mimetype(); + TQString symDest = ""; if ( symLink ) { symDest = kfi.linkDest(); if ( kfi.isDir() ) perm[ 0 ] = 'd'; @@ -103,14 +103,14 @@ void ftp_vfs::slotAddFiles( KIO::Job *, const KIO::UDSEntryList& entries ) { if ( kfi.user().isEmpty() ) temp = new vfile( name, size, perm, mtime, symLink, getuid(), getgid(), mime, symDest, mode, rwx ); else { - QString currentUser = vfs_origin.user(); - if ( currentUser.contains( "@" ) ) /* remove the FTP proxy tags from the username */ - currentUser.truncate( currentUser.find( '@' ) ); + TQString currentUser = vfs_origin.user(); + if ( currentUser.tqcontains( "@" ) ) /* remove the FTP proxy tags from the username */ + currentUser.truncate( currentUser.tqfind( '@' ) ); if ( currentUser.isEmpty() ) { if( vfs_origin.host().isEmpty() ) currentUser = KRpermHandler::uid2user( getuid() ); else { - currentUser = ""; // empty, but not QString::null + currentUser = ""; // empty, but not TQString() } } #if KDE_IS_VERSION(3,5,0) @@ -159,14 +159,14 @@ void ftp_vfs::slotListResult( KIO::Job *job ) { } bool ftp_vfs::populateVfsList( const KURL& origin, bool showHidden ) { - QString errorMsg = QString::null; + TQString errorMsg = TQString(); if ( !origin.isValid() ) - errorMsg = i18n( "Malformed URL:\n%1" ).arg( origin.url() ); + errorMsg = i18n( "Malformed URL:\n%1" ).tqarg( origin.url() ); if ( !KProtocolInfo::supportsListing( origin ) ) { if( origin.protocol() == "ftp" && KProtocolInfo::supportsReading( origin ) ) errorMsg = i18n( "Krusader doesn't support FTP access via HTTP.\nIf it is not the case, please check and change the Proxy settings in kcontrol." ); else - errorMsg = i18n( "Protocol not supported by Krusader:\n%1" ).arg( origin.url() ); + errorMsg = i18n( "Protocol not supported by Krusader:\n%1" ).tqarg( origin.url() ); } if ( !errorMsg.isEmpty() ) { @@ -179,21 +179,21 @@ bool ftp_vfs::populateVfsList( const KURL& origin, bool showHidden ) { vfs_origin = origin; vfs_origin.adjustPath(-1); - //QTimer::singleShot( 0,this,SLOT(startLister()) ); + //TQTimer::singleShot( 0,this,TQT_SLOT(startLister()) ); listError = false; // Open the directory marked by origin krConfig->setGroup( "Look&Feel" ); //vfs_origin.adjustPath(+1); KIO::Job *job = KIO::listDir( vfs_origin, false, showHidden ); - connect( job, SIGNAL( entries( KIO::Job*, const KIO::UDSEntryList& ) ), - this, SLOT( slotAddFiles( KIO::Job*, const KIO::UDSEntryList& ) ) ); - connect( job, SIGNAL( redirection( KIO::Job*, const KURL& ) ), - this, SLOT( slotRedirection( KIO::Job*, const KURL& ) ) ); - connect( job, SIGNAL( permanentRedirection( KIO::Job*, const KURL&, const KURL& ) ), - this, SLOT( slotPermanentRedirection( KIO::Job*, const KURL&, const KURL& ) ) ); + connect( job, TQT_SIGNAL( entries( KIO::Job*, const KIO::UDSEntryList& ) ), + this, TQT_SLOT( slotAddFiles( KIO::Job*, const KIO::UDSEntryList& ) ) ); + connect( job, TQT_SIGNAL( redirection( KIO::Job*, const KURL& ) ), + this, TQT_SLOT( slotRedirection( KIO::Job*, const KURL& ) ) ); + connect( job, TQT_SIGNAL( permanentRedirection( KIO::Job*, const KURL&, const KURL& ) ), + this, TQT_SLOT( slotPermanentRedirection( KIO::Job*, const KURL&, const KURL& ) ) ); - connect( job, SIGNAL( result( KIO::Job* ) ), - this, SLOT( slotListResult( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), + this, TQT_SLOT( slotListResult( KIO::Job* ) ) ); job->setWindow( krApp ); @@ -211,7 +211,7 @@ bool ftp_vfs::populateVfsList( const KURL& origin, bool showHidden ) { // copy a file to the vfs (physical) -void ftp_vfs::vfs_addFiles( KURL::List *fileUrls, KIO::CopyJob::CopyMode mode, QObject* toNotify, QString dir, PreserveMode /*pmode*/ ) { +void ftp_vfs::vfs_addFiles( KURL::List *fileUrls, KIO::CopyJob::CopyMode mode, TQObject* toNotify, TQString dir, PreserveMode /*pmode*/ ) { KURL destUrl = vfs_origin; if ( dir != "" ) { @@ -219,38 +219,38 @@ void ftp_vfs::vfs_addFiles( KURL::List *fileUrls, KIO::CopyJob::CopyMode mode, Q destUrl.cleanPath(); // removes the '..', '.' and extra slashes from the URL. if ( destUrl.protocol() == "tar" || destUrl.protocol() == "zip" || destUrl.protocol() == "krarc" ) { - if ( QDir( destUrl.path( -1 ) ).exists() ) + if ( TQDir( destUrl.path( -1 ) ).exists() ) destUrl.setProtocol( "file" ); // if we get out from the archive change the protocol } } KIO::Job* job = new KIO::CopyJob( *fileUrls, destUrl, mode, false, true ); - connect( job, SIGNAL( result( KIO::Job* ) ), this, SLOT( vfs_refresh( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), this, TQT_SLOT( vfs_refresh( KIO::Job* ) ) ); if ( mode == KIO::CopyJob::Move ) // notify the other panel - connect( job, SIGNAL( result( KIO::Job* ) ), toNotify, SLOT( vfs_refresh( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), toNotify, TQT_SLOT( vfs_refresh( KIO::Job* ) ) ); } // remove a file from the vfs (physical) -void ftp_vfs::vfs_delFiles( QStringList *fileNames ) { +void ftp_vfs::vfs_delFiles( TQStringList *fileNames ) { KURL::List filesUrls; KURL url; // names -> urls for ( uint i = 0 ; i < fileNames->count(); ++i ) { - QString filename = ( *fileNames ) [ i ]; + TQString filename = ( *fileNames ) [ i ]; url = vfs_origin; url.addPath( filename ); filesUrls.append( url ); } KIO::Job *job = new KIO::DeleteJob( filesUrls, false, true ); - connect( job, SIGNAL( result( KIO::Job* ) ), this, SLOT( vfs_refresh( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), this, TQT_SLOT( vfs_refresh( KIO::Job* ) ) ); } -KURL::List* ftp_vfs::vfs_getFiles( QStringList* names ) { +KURL::List* ftp_vfs::vfs_getFiles( TQStringList* names ) { KURL url; KURL::List* urls = new KURL::List(); - for ( QStringList::Iterator name = names->begin(); name != names->end(); ++name ) { + for ( TQStringList::Iterator name = names->begin(); name != names->end(); ++name ) { url = vfs_getFile( *name ); urls->append( url ); } @@ -259,7 +259,7 @@ KURL::List* ftp_vfs::vfs_getFiles( QStringList* names ) { // return a path to the file -KURL ftp_vfs::vfs_getFile( const QString& name ) { +KURL ftp_vfs::vfs_getFile( const TQString& name ) { vfile * vf = vfs_search( name ); if ( !vf ) return KURL(); // empty @@ -268,15 +268,15 @@ KURL ftp_vfs::vfs_getFile( const QString& name ) { return url; } -void ftp_vfs::vfs_mkdir( const QString& name ) { +void ftp_vfs::vfs_mkdir( const TQString& name ) { KURL url = vfs_origin; url.addPath( name ); KIO::SimpleJob* job = KIO::mkdir( url ); - connect( job, SIGNAL( result( KIO::Job* ) ), this, SLOT( vfs_refresh( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), this, TQT_SLOT( vfs_refresh( KIO::Job* ) ) ); } -void ftp_vfs::vfs_rename( const QString& fileName, const QString& newName ) { +void ftp_vfs::vfs_rename( const TQString& fileName, const TQString& newName ) { KURL::List fileUrls; KURL oldUrl = vfs_origin; oldUrl.addPath( fileName ) ; @@ -287,10 +287,10 @@ void ftp_vfs::vfs_rename( const QString& fileName, const QString& newName ) { newUrl.addPath( newName ); KIO::Job *job = new KIO::CopyJob( fileUrls, newUrl, KIO::CopyJob::Move, true, true ); - connect( job, SIGNAL( result( KIO::Job* ) ), this, SLOT( vfs_refresh( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), this, TQT_SLOT( vfs_refresh( KIO::Job* ) ) ); } -QString ftp_vfs::vfs_workingDir() { +TQString ftp_vfs::vfs_workingDir() { return vfs_origin.url( -1 ); } diff --git a/krusader/VFS/ftp_vfs.h b/krusader/VFS/ftp_vfs.h index 14387a8..f165ee4 100644 --- a/krusader/VFS/ftp_vfs.h +++ b/krusader/VFS/ftp_vfs.h @@ -39,25 +39,26 @@ class ftp_vfs : public vfs{ Q_OBJECT + TQ_OBJECT public: // the constructor simply uses the inherited constructor - ftp_vfs(QObject* panel); + ftp_vfs(TQObject* panel); ~ftp_vfs(); /// Copy a file to the vfs (physical). - virtual void vfs_addFiles(KURL::List *fileUrls,KIO::CopyJob::CopyMode mode,QObject* toNotify,QString dir = "", PreserveMode pmode = PM_DEFAULT ); + virtual void vfs_addFiles(KURL::List *fileUrls,KIO::CopyJob::CopyMode mode,TQObject* toNotify,TQString dir = "", PreserveMode pmode = PM_DEFAULT ); /// Remove a file from the vfs (physical) - virtual void vfs_delFiles(QStringList *fileNames); + virtual void vfs_delFiles(TQStringList *fileNames); /// Return a list of URLs for multiple files - virtual KURL::List* vfs_getFiles(QStringList* names); + virtual KURL::List* vfs_getFiles(TQStringList* names); /// Return a URL to a single file - virtual KURL vfs_getFile(const QString& name); + virtual KURL vfs_getFile(const TQString& name); /// Create a new directory - virtual void vfs_mkdir(const QString& name); + virtual void vfs_mkdir(const TQString& name); /// Rename file - virtual void vfs_rename(const QString& fileName,const QString& newName); + virtual void vfs_rename(const TQString& fileName,const TQString& newName); /// Return the VFS working dir - QString vfs_workingDir(); + TQString vfs_workingDir(); public slots: /// Handles new files from the dir lister diff --git a/krusader/VFS/krarchandler.cpp b/krusader/VFS/krarchandler.cpp index 2d4f0b6..2b1a3ab 100644 --- a/krusader/VFS/krarchandler.cpp +++ b/krusader/VFS/krarchandler.cpp @@ -28,14 +28,14 @@ * * ***************************************************************************/ // QT includes -#include <qtextstream.h> +#include <tqtextstream.h> // KDE includes #include <kprocess.h> #include <ktempfile.h> #include <klocale.h> #include <kmessagebox.h> #include <kio/passdlg.h> -#include <qfile.h> +#include <tqfile.h> #include <kstandarddirs.h> #include <ktar.h> #include <kio/global.h> @@ -46,12 +46,12 @@ #include "../krservices.h" #include "../Dialogs/krpleasewait.h" -static QStringList arcProtocols = QStringList::split(";", "tar;bzip;bzip2;gzip;krarc;zip"); +static TQStringList arcProtocols = TQStringList::split(";", "tar;bzip;bzip2;gzip;krarc;zip"); KWallet::Wallet * KRarcHandler::wallet = 0; -QStringList KRarcHandler::supportedPackers() { - QStringList packers; +TQStringList KRarcHandler::supportedPackers() { + TQStringList packers; // we will simply try to find the packers here.. if ( KrServices::cmdExist( "tar" ) ) packers.append( "tar" ); @@ -70,53 +70,53 @@ QStringList KRarcHandler::supportedPackers() { if ( KrServices::cmdExist( "7z" ) || KrServices::cmdExist( "7za" ) ) packers.append( "7z" ); if ( KrServices::cmdExist( "rpm" ) && KrServices::cmdExist( "rpm2cpio" ) ) packers.append( "rpm" ); // kdDebug() << "Supported Packers:" << endl; - //QStringList::Iterator it; + //TQStringList::Iterator it; //for( it = packers.begin(); it != packers.end(); ++it ) // kdDebug() << *it << endl; return packers; } -bool KRarcHandler::arcSupported( QString type ) { +bool KRarcHandler::arcSupported( TQString type ) { // lst will contain the supported unpacker list... krConfig->setGroup( "Archives" ); - QStringList lst = krConfig->readListEntry( "Supported Packers" ); + TQStringList lst = krConfig->readListEntry( "Supported Packers" ); - if ( type == "-zip" && lst.contains( "unzip" ) ) + if ( type == "-zip" && lst.tqcontains( "unzip" ) ) return true; - else if ( type == "-tar" && lst.contains( "tar" ) ) + else if ( type == "-tar" && lst.tqcontains( "tar" ) ) return true; - else if ( type == "-tbz" && lst.contains( "tar" ) ) + else if ( type == "-tbz" && lst.tqcontains( "tar" ) ) return true; - else if ( type == "-tgz" && lst.contains( "tar" ) ) + else if ( type == "-tgz" && lst.tqcontains( "tar" ) ) return true; - else if ( type == "tarz" && lst.contains( "tar" ) ) + else if ( type == "tarz" && lst.tqcontains( "tar" ) ) return true; - else if ( type == "gzip" && lst.contains( "gzip" ) ) + else if ( type == "gzip" && lst.tqcontains( "gzip" ) ) return true; - else if ( type == "zip2" && lst.contains( "bzip2" ) ) + else if ( type == "zip2" && lst.tqcontains( "bzip2" ) ) return true; - else if ( type == "-lha" && lst.contains( "lha" ) ) + else if ( type == "-lha" && lst.tqcontains( "lha" ) ) return true; - else if ( type == "-ace" && lst.contains( "unace" ) ) + else if ( type == "-ace" && lst.tqcontains( "unace" ) ) return true; - else if ( type == "-rpm" && lst.contains( "cpio" ) ) + else if ( type == "-rpm" && lst.tqcontains( "cpio" ) ) return true; - else if ( type == "cpio" && lst.contains( "cpio" ) ) + else if ( type == "cpio" && lst.tqcontains( "cpio" ) ) return true; - else if ( type == "-rar" && ( lst.contains( "unrar" ) || lst.contains( "rar" ) ) ) + else if ( type == "-rar" && ( lst.tqcontains( "unrar" ) || lst.tqcontains( "rar" ) ) ) return true; - else if ( type == "-arj" && ( lst.contains( "unarj" ) || lst.contains( "arj" ) ) ) + else if ( type == "-arj" && ( lst.tqcontains( "unarj" ) || lst.tqcontains( "arj" ) ) ) return true; - else if ( type == "-deb" && ( lst.contains( "dpkg" ) && lst.contains( "tar" ) ) ) + else if ( type == "-deb" && ( lst.tqcontains( "dpkg" ) && lst.tqcontains( "tar" ) ) ) return true; - else if ( type == "-7z" && lst.contains( "7z" ) ) + else if ( type == "-7z" && lst.tqcontains( "7z" ) ) return true; // not supported : ( return false; } -bool KRarcHandler::arcHandled( QString type ) { +bool KRarcHandler::arcHandled( TQString type ) { // first check if supported if ( !arcSupported( type ) ) return false; @@ -142,7 +142,7 @@ bool KRarcHandler::arcHandled( QString type ) { } -long KRarcHandler::arcFileCount( QString archive, QString type, QString password ) { +long KRarcHandler::arcFileCount( TQString archive, TQString type, TQString password ) { int divideWith = 1; // first check if supported @@ -152,7 +152,7 @@ long KRarcHandler::arcFileCount( QString archive, QString type, QString password if ( type == "zip2" || type == "gzip" ) return 1L; // set the right lister to do the job - QString lister; + TQString lister; if ( type == "-zip" ) lister = KrServices::fullPathName( "unzip" ) + " -ZTs"; else if ( type == "-tar" ) lister = KrServices::fullPathName( "tar" ) + " -tvf"; @@ -185,15 +185,15 @@ long KRarcHandler::arcFileCount( QString archive, QString type, QString password // count the number of files in the archive long count = 1; - KTempFile tmpFile( /*"tmp"*/ QString::null, "krusader-unpack" ); // commented out as it created files in the current dir! + KTempFile tmpFile( /*"tmp"*/ TQString(), "krusader-unpack" ); // commented out as it created files in the current dir! KrShellProcess list; list << lister << KrServices::quote( archive ) << ">" << tmpFile.name() ; - if( type == "-ace" && QFile( "/dev/ptmx" ).exists() ) // Don't remove, unace crashes if missing!!! + if( type == "-ace" && TQFile( "/dev/ptmx" ).exists() ) // Don't remove, unace crashes if missing!!! list<< "<" << "/dev/ptmx"; list.start( KProcess::NotifyOnExit, KProcess::AllOutput ); while ( list.isRunning() ) { usleep( 1000 ); - qApp->processEvents(); + tqApp->processEvents(); if( krApp->wasWaitingCancelled() ) list.kill(); } @@ -201,14 +201,14 @@ long KRarcHandler::arcFileCount( QString archive, QString type, QString password krApp->stopWait(); - if( !list.normalExit() || !checkStatus( type, list.exitStatus() ) ) { - KMessageBox::detailedError (krApp, i18n( "Failed to list the content of the archive (%1)!" ).arg( archive ), + if( !list.normalExit() || !checktqStatus( type, list.exitStatus() ) ) { + KMessageBox::detailedError (krApp, i18n( "Failed to list the content of the archive (%1)!" ).tqarg( archive ), list.getErrorMsg(), i18n("Error" ) ); return 0; } - QTextStream *stream = tmpFile.textStream(); - while ( stream && stream->readLine() != QString::null ) ++count; + TQTextStream *stream = tmpFile.textStream(); + while ( stream && stream->readLine() != TQString() ) ++count; tmpFile.unlink(); //make sure you call stopWait after this function return... @@ -217,7 +217,7 @@ long KRarcHandler::arcFileCount( QString archive, QString type, QString password return count / divideWith; } -bool KRarcHandler::unpack( QString archive, QString type, QString password, QString dest ) { +bool KRarcHandler::unpack( TQString archive, TQString type, TQString password, TQString dest ) { krConfig->setGroup( "Archives" ); if ( krConfig->readBoolEntry( "Test Before Unpack", _TestBeforeUnpack ) ) { // test first - or be sorry later... @@ -233,7 +233,7 @@ bool KRarcHandler::unpack( QString archive, QString type, QString password, QStr if ( count == 1 ) count = 0 ; // choose the right packer for the job - QString packer, cpioName = QString::null; + TQString packer, cpioName = TQString(); // set the right packer to do the job if ( type == "-zip" ) packer = KrServices::fullPathName( "unzip" ) + " -o" ; @@ -251,15 +251,15 @@ bool KRarcHandler::unpack( QString archive, QString type, QString password, QStr KrServices::fullPathName( "unarj" ) + " x"; else if ( type == "-7z" ) packer = KrServices::fullPathName( "7z" ) + " -y x"; else if ( type == "-rpm" ) { - QString tempDir = locateLocal("tmp",QString::null); + TQString tempDir = locateLocal("tmp",TQString()); cpioName = tempDir+"/contents.cpio"; KrShellProcess cpio; cpio << KrServices::fullPathName( "rpm2cpio" ) << " " + KrServices::quote( archive ) << " > " << cpioName; cpio.start(KProcess::Block, KProcess::AllOutput ); - if( !cpio.normalExit() || !checkStatus( "cpio", cpio.exitStatus() ) ) { - KMessageBox::detailedError (krApp, i18n( "Failed to convert rpm (%1) to cpio!" ).arg( archive ), + if( !cpio.normalExit() || !checktqStatus( "cpio", cpio.exitStatus() ) ) { + KMessageBox::detailedError (krApp, i18n( "Failed to convert rpm (%1) to cpio!" ).tqarg( archive ), cpio.getErrorMsg(), i18n("Error" ) ); return 0; } @@ -268,15 +268,15 @@ bool KRarcHandler::unpack( QString archive, QString type, QString password, QStr packer = KrServices::fullPathName( "cpio" ) + " --force-local --no-absolute-filenames -iuvdF"; } else if ( type == "-deb" ) { - QString tempDir = locateLocal("tmp",QString::null); + TQString tempDir = locateLocal("tmp",TQString()); cpioName = tempDir+"/contents.tar"; KrShellProcess dpkg; dpkg << KrServices::fullPathName( "dpkg" ) << " --fsys-tarfile " + KrServices::quote( archive ) << " > " << cpioName; dpkg.start(KProcess::Block, KProcess::AllOutput ); - if( !dpkg.normalExit() || !checkStatus( "-deb", dpkg.exitStatus() ) ) { - KMessageBox::detailedError (krApp, i18n( "Failed to convert deb (%1) to tar!" ).arg( archive ), + if( !dpkg.normalExit() || !checktqStatus( "-deb", dpkg.exitStatus() ) ) { + KMessageBox::detailedError (krApp, i18n( "Failed to convert deb (%1) to tar!" ).tqarg( archive ), dpkg.getErrorMsg(), i18n("Error" ) ); return 0; } @@ -299,31 +299,31 @@ bool KRarcHandler::unpack( QString archive, QString type, QString password, QStr KrShellProcess proc; proc << packer << " " + KrServices::quote( archive ); if( type == "zip2" || type=="gzip" ){ - QString arcname = archive.mid(archive.findRev("/")+1); - if( arcname.contains(".") ) arcname = arcname.left(arcname.findRev(".")); + TQString arcname = archive.mid(archive.tqfindRev("/")+1); + if( arcname.tqcontains(".") ) arcname = arcname.left(arcname.tqfindRev(".")); proc << ">" << KrServices::quote( dest+"/"+arcname ); } - if( type == "-ace" && QFile( "/dev/ptmx" ).exists() ) // Don't remove, unace crashes if missing!!! + if( type == "-ace" && TQFile( "/dev/ptmx" ).exists() ) // Don't remove, unace crashes if missing!!! proc << "<" << "/dev/ptmx"; - QString save = getcwd( 0, 0 ); + TQString save = getcwd( 0, 0 ); chdir( dest.local8Bit() ); // tell the user to wait krApp->startWaiting( i18n( "Unpacking File(s)" ), count, true ); if ( count != 0 ) { - connect( &proc, SIGNAL( receivedStdout( KProcess*, char*, int ) ), - krApp, SLOT( incProgress( KProcess*, char*, int ) ) ); + connect( &proc, TQT_SIGNAL( receivedStdout( KProcess*, char*, int ) ), + krApp, TQT_SLOT( incProgress( KProcess*, char*, int ) ) ); if( type == "-rpm" ) - connect( &proc, SIGNAL( receivedStderr( KProcess*, char*, int ) ), - krApp, SLOT( incProgress( KProcess*, char*, int ) ) ); + connect( &proc, TQT_SIGNAL( receivedStderr( KProcess*, char*, int ) ), + krApp, TQT_SLOT( incProgress( KProcess*, char*, int ) ) ); } // start the unpacking process proc.start( KProcess::NotifyOnExit, KProcess::AllOutput ); while ( proc.isRunning() ) { usleep( 1000 ); - qApp->processEvents(); + tqApp->processEvents(); if( krApp->wasWaitingCancelled() ) proc.kill(); } @@ -332,11 +332,11 @@ bool KRarcHandler::unpack( QString archive, QString type, QString password, QStr chdir( save.local8Bit() ); if( !cpioName.isEmpty() ) - QFile( cpioName ).remove(); /* remove the cpio file */ + TQFile( cpioName ).remove(); /* remove the cpio file */ // check the return value - if ( !proc.normalExit() || !checkStatus( type, proc.exitStatus() ) ) { - KMessageBox::detailedError (krApp, i18n( "Failed to unpack %1!" ).arg( archive ), + if ( !proc.normalExit() || !checktqStatus( type, proc.exitStatus() ) ) { + KMessageBox::detailedError (krApp, i18n( "Failed to unpack %1!" ).tqarg( archive ), krApp->wasWaitingCancelled() ? i18n( "User cancelled." ) : proc.getErrorMsg(), i18n("Error" ) ); return false; @@ -344,9 +344,9 @@ bool KRarcHandler::unpack( QString archive, QString type, QString password, QStr return true; // SUCCESS } -bool KRarcHandler::test( QString archive, QString type, QString password, long count ) { +bool KRarcHandler::test( TQString archive, TQString type, TQString password, long count ) { // choose the right packer for the job - QString packer; + TQString packer; // set the right packer to do the job if ( type == "-zip" ) packer = KrServices::fullPathName( "unzip" ) + " -t"; @@ -377,19 +377,19 @@ bool KRarcHandler::test( QString archive, QString type, QString password, long c KrShellProcess proc; proc << packer << KrServices::quote( archive ); - if( type == "-ace" && QFile( "/dev/ptmx" ).exists() ) // Don't remove, unace crashes if missing!!! + if( type == "-ace" && TQFile( "/dev/ptmx" ).exists() ) // Don't remove, unace crashes if missing!!! proc << "<" << "/dev/ptmx"; // tell the user to wait krApp->startWaiting( i18n( "Testing Archive" ), count, true ); - if ( count != 0 ) connect( &proc, SIGNAL( receivedStdout( KProcess*, char*, int ) ), - krApp, SLOT( incProgress( KProcess*, char*, int ) ) ); + if ( count != 0 ) connect( &proc, TQT_SIGNAL( receivedStdout( KProcess*, char*, int ) ), + krApp, TQT_SLOT( incProgress( KProcess*, char*, int ) ) ); // start the unpacking process proc.start( KProcess::NotifyOnExit, KProcess::AllOutput ); while ( proc.isRunning() ) { usleep( 1000 ); - qApp->processEvents(); + tqApp->processEvents(); if( krApp->wasWaitingCancelled() ) proc.kill(); } @@ -397,15 +397,15 @@ bool KRarcHandler::test( QString archive, QString type, QString password, long c krApp->stopWait(); // check the return value - if ( !proc.normalExit() || !checkStatus( type, proc.exitStatus() ) ) + if ( !proc.normalExit() || !checktqStatus( type, proc.exitStatus() ) ) return false; return true; // SUCCESS } -bool KRarcHandler::pack( QStringList fileNames, QString type, QString dest, long count, QMap<QString,QString> extraProps ) { +bool KRarcHandler::pack( TQStringList fileNames, TQString type, TQString dest, long count, TQMap<TQString,TQString> extraProps ) { // set the right packer to do the job - QString packer; + TQString packer; if ( type == "zip" ) { packer = KrServices::fullPathName( "zip" ) + " -ry"; type = "-zip"; } else if ( type == "tar" ) { packer = KrServices::fullPathName( "tar" ) + " -cvf"; type = "-tar"; } @@ -417,7 +417,7 @@ bool KRarcHandler::pack( QStringList fileNames, QString type, QString dest, long else if ( type == "7z" ) { packer = KrServices::fullPathName( "7z" ) + " -y a"; type = "-7z"; } else return false; - QString password = QString::null; + TQString password = TQString(); if( extraProps.count( "Password" ) > 0 ) { password = extraProps[ "Password" ]; @@ -436,17 +436,17 @@ bool KRarcHandler::pack( QStringList fileNames, QString type, QString dest, long packer += " -p'" + password + "'"; } else - password = QString::null; + password = TQString(); } } if( extraProps.count( "VolumeSize" ) > 0 ) { - QString sizeStr = extraProps[ "VolumeSize" ]; + TQString sizeStr = extraProps[ "VolumeSize" ]; KIO::filesize_t size = sizeStr.toLongLong(); if( size >= 10000 ) { if( type == "-arj" || type == "-rar" ) - packer += QString( " -v%1b" ).arg( sizeStr ); + packer += TQString( " -v%1b" ).tqarg( sizeStr ); } } @@ -459,44 +459,44 @@ bool KRarcHandler::pack( QStringList fileNames, QString type, QString dest, long if( type == "-rar" ) { static const int rarLevels[] = { 0, 1, 2, 2, 3, 3, 4, 4, 5 }; - packer += QString( " -m%1" ).arg( rarLevels[ level ] ); + packer += TQString( " -m%1" ).tqarg( rarLevels[ level ] ); } else if( type == "-arj" ) { static const int arjLevels[] = { 0, 4, 4, 3, 3, 2, 2, 1, 1 }; - packer += QString( " -m%1" ).arg( arjLevels[ level ] ); + packer += TQString( " -m%1" ).tqarg( arjLevels[ level ] ); } else if( type == "-zip" ) { static const int zipLevels[] = { 0, 1, 2, 4, 5, 6, 7, 8, 9 }; - packer += QString( " -%1" ).arg( zipLevels[ level ] ); + packer += TQString( " -%1" ).tqarg( zipLevels[ level ] ); } else if( type == "-7z" ) { static const int sevenZipLevels[] = { 0, 1, 2, 4, 5, 6, 7, 8, 9 }; - packer += QString( " -mx%1" ).arg( sevenZipLevels[ level ] ); + packer += TQString( " -mx%1" ).tqarg( sevenZipLevels[ level ] ); } } if( extraProps.count( "CommandLineSwitches" ) > 0 ) - packer += QString( " %1" ).arg( extraProps[ "CommandLineSwitches" ] ); + packer += TQString( " %1" ).tqarg( extraProps[ "CommandLineSwitches" ] ); // prepare to pack KrShellProcess proc; proc << packer << KrServices::quote( dest ); - for ( QStringList::Iterator file = fileNames.begin(); file != fileNames.end(); ++file ) { + for ( TQStringList::Iterator file = fileNames.begin(); file != fileNames.end(); ++file ) { proc << KrServices::quote( *file ); } // tell the user to wait krApp->startWaiting( i18n( "Packing File(s)" ), count, true ); if ( count != 0 ) - connect( &proc, SIGNAL( receivedStdout( KProcess*, char*, int ) ), - krApp, SLOT( incProgress( KProcess*, char*, int ) ) ); + connect( &proc, TQT_SIGNAL( receivedStdout( KProcess*, char*, int ) ), + krApp, TQT_SLOT( incProgress( KProcess*, char*, int ) ) ); // start the packing process proc.start( KProcess::NotifyOnExit, KProcess::AllOutput ); while ( proc.isRunning() ) { usleep( 1000 ); - qApp->processEvents(); + tqApp->processEvents(); if( krApp->wasWaitingCancelled() ) proc.kill(); } @@ -504,8 +504,8 @@ bool KRarcHandler::pack( QStringList fileNames, QString type, QString dest, long krApp->stopWait(); // check the return value - if ( !proc.normalExit() || !checkStatus( type, proc.exitStatus() ) ) { - KMessageBox::detailedError (krApp, i18n( "Failed to pack %1!" ).arg( dest ), + if ( !proc.normalExit() || !checktqStatus( type, proc.exitStatus() ) ) { + KMessageBox::detailedError (krApp, i18n( "Failed to pack %1!" ).tqarg( dest ), krApp->wasWaitingCancelled() ? i18n( "User cancelled." ) : proc.getErrorMsg(), i18n("Error" ) ); return false; @@ -520,10 +520,10 @@ bool KRarcHandler::pack( QStringList fileNames, QString type, QString dest, long return true; // SUCCESS } -QString KRarcHandler::getPassword( QString path ) { - QString password; +TQString KRarcHandler::getPassword( TQString path ) { + TQString password; - QString key = "krarc-" + path; + TQString key = "krarc-" + path; if( !KWallet::Wallet::keyDoesNotExist(KWallet::Wallet::NetworkWallet(), KWallet::Wallet::PasswordFolder(), key ) ) { if( !KWallet::Wallet::isOpen( KWallet::Wallet::NetworkWallet() ) && wallet != 0 ) { @@ -534,9 +534,9 @@ QString KRarcHandler::getPassword( QString path ) { wallet = KWallet::Wallet::openWallet( KWallet::Wallet::NetworkWallet() ); if ( wallet && wallet->hasFolder( KWallet::Wallet::PasswordFolder() ) ) { wallet->setFolder( KWallet::Wallet::PasswordFolder() ); - QMap<QString,QString> map; + TQMap<TQString,TQString> map; if ( wallet->readMap( key, map ) == 0 ) { - QMap<QString, QString>::ConstIterator it = map.find( "password" ); + TQMap<TQString, TQString>::ConstIterator it = map.tqfind( "password" ); if ( it != map.end() ) password = it.data(); } @@ -544,7 +544,7 @@ QString KRarcHandler::getPassword( QString path ) { } bool keep = true; - QString user = "archive"; + TQString user = "archive"; KIO::PasswordDialog passDlg( i18n("This archive is encrypted, please supply the password:"), user, true ); passDlg.setPassword( password ); @@ -563,7 +563,7 @@ QString KRarcHandler::getPassword( QString path ) { ok = wallet->createFolder( KWallet::Wallet::PasswordFolder() ); if ( ok ) { wallet->setFolder( KWallet::Wallet::PasswordFolder() ); - QMap<QString,QString> map; + TQMap<TQString,TQString> map; map.insert( "login", "archive" ); map.insert( "password", password ); wallet->writeMap( key, map ); @@ -577,14 +577,14 @@ QString KRarcHandler::getPassword( QString path ) { } bool KRarcHandler::isArchive(const KURL& url) { - QString protocol = url.protocol(); - if (arcProtocols.find(protocol) != arcProtocols.end()) + TQString protocol = url.protocol(); + if (arcProtocols.tqfind(protocol) != arcProtocols.end()) return true; else return false; } -QString KRarcHandler::getType( bool &encrypted, QString fileName, QString mime, bool checkEncrypted ) { - QString result = detectArchive( encrypted, fileName, checkEncrypted ); +TQString KRarcHandler::getType( bool &encrypted, TQString fileName, TQString mime, bool checkEncrypted ) { + TQString result = detectArchive( encrypted, fileName, checkEncrypted ); if( result.isNull() ) result = mime; else @@ -597,7 +597,7 @@ QString KRarcHandler::getType( bool &encrypted, QString fileName, QString mime, } -bool KRarcHandler::checkStatus( QString type, int exitCode ) { +bool KRarcHandler::checktqStatus( TQString type, int exitCode ) { if( type == "-zip" || type == "-rar" || type == "-7z" ) return exitCode == 0 || exitCode == 1; else if( type == "-ace" || type == "zip2" || type == "-lha" || type == "-rpm" || type == "cpio" || @@ -611,12 +611,12 @@ bool KRarcHandler::checkStatus( QString type, int exitCode ) { } struct AutoDetectParams { - QString type; + TQString type; int location; - QString detectionString; + TQString detectionString; }; -QString KRarcHandler::detectArchive( bool &encrypted, QString fileName, bool checkEncrypted ) { +TQString KRarcHandler::detectArchive( bool &encrypted, TQString fileName, bool checkEncrypted ) { static AutoDetectParams autoDetectParams[] = {{"zip", 0, "PK\x03\x04"}, {"rar", 0, "Rar!\x1a" }, {"arj", 0, "\x60\xea" }, @@ -630,14 +630,14 @@ QString KRarcHandler::detectArchive( bool &encrypted, QString fileName, bool che encrypted = false; - QFile arcFile( fileName ); + TQFile arcFile( fileName ); if ( arcFile.open( IO_ReadOnly ) ) { char buffer[ 1024 ]; long sizeMax = arcFile.readBlock( buffer, sizeof( buffer ) ); arcFile.close(); for( int i=0; i < autoDetectElems; i++ ) { - QString detectionString = autoDetectParams[ i ].detectionString; + TQString detectionString = autoDetectParams[ i ].detectionString; int location = autoDetectParams[ i ].location; int endPtr = detectionString.length() + location; @@ -653,7 +653,7 @@ QString KRarcHandler::detectArchive( bool &encrypted, QString fileName, bool che } if( j == detectionString.length() ) { - QString type = autoDetectParams[ i ].type; + TQString type = autoDetectParams[ i ].type; if( type == "bzip2" || type == "gzip" ) { KTar tapeArchive( fileName ); if( tapeArchive.open( IO_ReadOnly ) ) { @@ -749,7 +749,7 @@ QString KRarcHandler::detectArchive( bool &encrypted, QString fileName, bool che } } } - return QString::null; + return TQString(); } #include "krarchandler.moc" diff --git a/krusader/VFS/krarchandler.h b/krusader/VFS/krarchandler.h index 3d3606d..1ed9301 100644 --- a/krusader/VFS/krarchandler.h +++ b/krusader/VFS/krarchandler.h @@ -30,55 +30,57 @@ #ifndef KRARCHANDLER_H #define KRARCHANDLER_H -#include <qstringlist.h> -#include <qobject.h> +#include <tqstringlist.h> +#include <tqobject.h> #include <kprocess.h> #include <kurl.h> #include <kwallet.h> -class KRarcHandler: public QObject { +class KRarcHandler: public TQObject { Q_OBJECT + TQ_OBJECT public: // return the number of files in the archive - static long arcFileCount(QString archive, QString type, QString password); + static long arcFileCount(TQString archive, TQString type, TQString password); // unpack an archive to destination directory - static bool unpack(QString archive, QString type, QString password, QString dest ); + static bool unpack(TQString archive, TQString type, TQString password, TQString dest ); // pack an archive to destination directory - static bool pack(QStringList fileNames, QString type, QString dest, long count, QMap<QString,QString> extraProps ); + static bool pack(TQStringList fileNames, TQString type, TQString dest, long count, TQMap<TQString,TQString> extraProps ); // test an archive - static bool test(QString archive, QString type, QString password, long count = 0L ); + static bool test(TQString archive, TQString type, TQString password, long count = 0L ); // true - if the right unpacker exist in the system - static bool arcSupported(QString type); + static bool arcSupported(TQString type); // true - if supported and the user want us to handle this kind of archive - static bool arcHandled(QString type); + static bool arcHandled(TQString type); // return the a list of supported packers - static QStringList supportedPackers(); + static TQStringList supportedPackers(); // true - if the url is an archive (ie: tar:/home/test/file.tar.bz2) static bool isArchive(const KURL& url); // used to determine the type of the archive - static QString getType( bool &encrypted, QString fileName, QString mime, bool checkEncrypted = true ); + static TQString getType( bool &encrypted, TQString fileName, TQString mime, bool checkEncrypted = true ); // queries the password from the user - static QString getPassword( QString path ); + static TQString getPassword( TQString path ); // detects the archive type - static QString detectArchive( bool &encrypted, QString fileName, bool checkEncrypted = true ); + static TQString detectArchive( bool &encrypted, TQString fileName, bool checkEncrypted = true ); private: // checks if the returned status is correct - static bool checkStatus( QString type, int exitCode ); + static bool checktqStatus( TQString type, int exitCode ); static KWallet::Wallet * wallet; }; class KrShellProcess : public KShellProcess { Q_OBJECT + TQ_OBJECT public: - KrShellProcess() : KShellProcess(), errorMsg( QString::null ), outputMsg( QString::null ) { - connect(this,SIGNAL(receivedStderr(KProcess*,char*,int)), - this,SLOT(receivedErrorMsg(KProcess*,char*,int)) ); - connect(this,SIGNAL(receivedStdout(KProcess*,char*,int)), - this,SLOT(receivedOutputMsg(KProcess*,char*,int)) ); + KrShellProcess() : KShellProcess(), errorMsg( TQString() ), outputMsg( TQString() ) { + connect(this,TQT_SIGNAL(receivedStderr(KProcess*,char*,int)), + this,TQT_SLOT(receivedErrorMsg(KProcess*,char*,int)) ); + connect(this,TQT_SIGNAL(receivedStdout(KProcess*,char*,int)), + this,TQT_SLOT(receivedOutputMsg(KProcess*,char*,int)) ); } - QString getErrorMsg() { + TQString getErrorMsg() { if( errorMsg.stripWhiteSpace().isEmpty() ) return outputMsg.right( 500 ); else @@ -87,52 +89,53 @@ public: public slots: void receivedErrorMsg(KProcess*, char *buf, int len) { - errorMsg += QString::fromLocal8Bit( buf, len ); + errorMsg += TQString::fromLocal8Bit( buf, len ); if( errorMsg.length() > 500 ) errorMsg = errorMsg.right( 500 ); receivedOutputMsg( 0, buf, len ); } void receivedOutputMsg(KProcess*, char *buf, int len) { - outputMsg += QString::fromLocal8Bit( buf, len ); + outputMsg += TQString::fromLocal8Bit( buf, len ); if( outputMsg.length() > 500 ) outputMsg = outputMsg.right( 500 ); } private: - QString errorMsg; - QString outputMsg; + TQString errorMsg; + TQString outputMsg; }; class Kr7zEncryptionChecker : public KrShellProcess { Q_OBJECT + TQ_OBJECT public: Kr7zEncryptionChecker() : KrShellProcess(), encrypted( false ), lastData() { - connect(this,SIGNAL(receivedStdout(KProcess*,char*,int)), - this,SLOT(processStdout(KProcess*,char*,int)) ); + connect(this,TQT_SIGNAL(receivedStdout(KProcess*,char*,int)), + this,TQT_SLOT(processStdout(KProcess*,char*,int)) ); } public slots: void processStdout( KProcess *proc,char *buf,int len ) { - QByteArray d(len); + TQByteArray d(len); d.setRawData(buf,len); - QString data = QString( d ); + TQString data = TQString( d ); d.resetRawData(buf,len); - QString checkable = lastData + data; + TQString checkable = lastData + data; - QStringList lines = QStringList::split( '\n', checkable ); + TQStringList lines = TQStringList::split( '\n', checkable ); lastData = lines[ lines.count() - 1 ]; for( unsigned i=0; i != lines.count(); i++ ) { - QString line = lines[ i ].stripWhiteSpace().lower(); - int ndx = line.find( "testing" ); + TQString line = lines[ i ].stripWhiteSpace().lower(); + int ndx = line.tqfind( "testing" ); if( ndx >=0 ) line.truncate( ndx ); if( line.isEmpty() ) continue; - if( line.contains( "password" ) && line.contains( "enter" ) ) { + if( line.tqcontains( "password" ) && line.tqcontains( "enter" ) ) { encrypted = true; proc->kill(); } @@ -142,7 +145,7 @@ public slots: bool isEncrypted() { return encrypted; } private: bool encrypted; - QString lastData; + TQString lastData; }; #endif diff --git a/krusader/VFS/krdirwatch.cpp b/krusader/VFS/krdirwatch.cpp index 96ec185..4f5c93d 100644 --- a/krusader/VFS/krdirwatch.cpp +++ b/krusader/VFS/krdirwatch.cpp @@ -32,14 +32,14 @@ #include <sys/types.h> #include <kdebug.h> #include "krpermhandler.h" -#include "qstringlist.h" -#include <qdir.h> +#include "tqstringlist.h" +#include <tqdir.h> KRdirWatch::KRdirWatch(int msec,bool dirOnly): delay(msec),t(this), changed(false) { - if(dirOnly) dir.setFilter( QDir::Dirs | QDir::Hidden | QDir::NoSymLinks ); + if(dirOnly) dir.setFilter( TQDir::Dirs | TQDir::Hidden | TQDir::NoSymLinks ); watched.setAutoDelete(true); - connect(&t,SIGNAL(timeout()),this, SLOT(checkDirs())); + connect(&t,TQT_SIGNAL(timeout()),this, TQT_SLOT(checkDirs())); startScan(); } @@ -48,7 +48,7 @@ KRdirWatch::~KRdirWatch(){ stopScan(); } -void KRdirWatch::removeDir(QString path){ +void KRdirWatch::removeDir(TQString path){ t.stop(); for ( it = watched.first(); it != 0; ) if (it->path == path) watched.remove(); @@ -56,7 +56,7 @@ void KRdirWatch::removeDir(QString path){ if (!stopped) startScan(); } -void KRdirWatch::addDir(QString path, bool checkPermissions){ +void KRdirWatch::addDir(TQString path, bool checkPermissions){ t.stop(); krDirEntry* temp = new krDirEntry; @@ -78,7 +78,7 @@ void KRdirWatch::addDir(QString path, bool checkPermissions){ qfi.setFile(path); temp->path = dir.path(); - temp->count = dir.entryList(QDir::All | QDir::AccessMask).count(); + temp->count = dir.entryList(TQDir::All | TQDir::AccessMask).count(); temp->lastModified = qfi.lastModified(); watched.append(temp); @@ -89,9 +89,9 @@ void KRdirWatch::addDir(QString path, bool checkPermissions){ void KRdirWatch::checkDirs(){ t.stop(); - QString path; + TQString path; unsigned long count; - QDateTime dt; + TQDateTime dt; for ( it = watched.first(); it != 0; it = watched.next() ){ path = it->path; @@ -102,7 +102,7 @@ void KRdirWatch::checkDirs(){ return; } dt = qfi.lastModified(); - count = dir.entryList(QDir::All | QDir::AccessMask).count(); + count = dir.entryList(TQDir::All | TQDir::AccessMask).count(); // check for changes if(it->lastModified!=dt || it->count!=count){ changed = true; diff --git a/krusader/VFS/krdirwatch.h b/krusader/VFS/krdirwatch.h index e897eeb..dff9532 100644 --- a/krusader/VFS/krdirwatch.h +++ b/krusader/VFS/krdirwatch.h @@ -33,27 +33,28 @@ #ifndef KRDIRWATCH_H #define KRDIRWATCH_H -#include <qobject.h> -#include <qstring.h> -#include <qptrlist.h> -#include <qtimer.h> -#include <qdatetime.h> -#include <qdir.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqptrlist.h> +#include <tqtimer.h> +#include <tqdatetime.h> +#include <tqdir.h> typedef struct krDirEntry_s{ - QString path; + TQString path; unsigned long count; // number of files - QDateTime lastModified; + TQDateTime lastModified; } krDirEntry ; -class KRdirWatch : public QObject { +class KRdirWatch : public TQObject { Q_OBJECT + TQ_OBJECT public: KRdirWatch(int msec = 250 , bool dirOnly = false ); ~KRdirWatch(); - void addDir(QString path,bool checkPermissions = true ); - void removeDir(QString path); + void addDir(TQString path,bool checkPermissions = true ); + void removeDir(TQString path); inline void clearList(){watched.clear();} inline void startScan(){t.start(delay);stopped=false;} @@ -67,10 +68,10 @@ signals: protected: int delay; // time in msec between updates - QList<krDirEntry> watched; - QTimer t; - QDir dir; - QFileInfo qfi; + TQList<krDirEntry> watched; + TQTimer t; + TQDir dir; + TQFileInfo qfi; krDirEntry* it; bool changed; // true if something happend to the watched dirs bool stopped; // true if the watcher is stopped diff --git a/krusader/VFS/krpermhandler.cpp b/krusader/VFS/krpermhandler.cpp index fd8e52c..3ef93c3 100644 --- a/krusader/VFS/krpermhandler.cpp +++ b/krusader/VFS/krpermhandler.cpp @@ -41,21 +41,21 @@ #include <klocale.h> #include <kglobal.h> #include <klargefile.h> -// Qt includes -#include <qdatetime.h> -#include <qdir.h> +// TQt includes +#include <tqdatetime.h> +#include <tqdir.h> // krusader includes #include <kdeversion.h> #include "krpermhandler.h" #include "../resources.h" -QDict<uid_t> *KRpermHandler::passwdCache = 0L; -QDict<gid_t> *KRpermHandler::groupCache = 0L; -QIntDict<char> *KRpermHandler::currentGroups = 0L; -QIntDict<QString> *KRpermHandler::uidCache = 0L; -QIntDict<QString> *KRpermHandler::gidCache = 0L; +TQDict<uid_t> *KRpermHandler::passwdCache = 0L; +TQDict<gid_t> *KRpermHandler::groupCache = 0L; +TQIntDict<char> *KRpermHandler::currentGroups = 0L; +TQIntDict<TQString> *KRpermHandler::uidCache = 0L; +TQIntDict<TQString> *KRpermHandler::gidCache = 0L; -char KRpermHandler::writeable( QString perm, gid_t gid, uid_t uid, int rwx ) { +char KRpermHandler::writeable( TQString perm, gid_t gid, uid_t uid, int rwx ) { if( rwx != -1 ) return ( rwx & W_OK ) ? ALLOWED_PERM : NO_PERM; // root override @@ -64,7 +64,7 @@ char KRpermHandler::writeable( QString perm, gid_t gid, uid_t uid, int rwx ) { // first check other permissions. if ( perm[ 8 ] != '-' ) return ALLOWED_PERM; // now check group permission - if ( ( perm[ 5 ] != '-' ) && ( currentGroups->find( gid ) ) ) + if ( ( perm[ 5 ] != '-' ) && ( currentGroups->tqfind( gid ) ) ) return ALLOWED_PERM; // the last chance - user permissions if ( ( perm[ 2 ] != '-' ) && ( uid == getuid() ) ) @@ -73,7 +73,7 @@ char KRpermHandler::writeable( QString perm, gid_t gid, uid_t uid, int rwx ) { return NO_PERM; } -char KRpermHandler::readable( QString perm, gid_t gid, uid_t uid, int rwx ) { +char KRpermHandler::readable( TQString perm, gid_t gid, uid_t uid, int rwx ) { if( rwx != -1 ) return ( rwx & R_OK ) ? ALLOWED_PERM : NO_PERM; // root override @@ -82,7 +82,7 @@ char KRpermHandler::readable( QString perm, gid_t gid, uid_t uid, int rwx ) { // first check other permissions. if ( perm[ 7 ] != '-' ) return ALLOWED_PERM; // now check group permission - if ( ( perm[ 4 ] != '-' ) && ( currentGroups->find( gid ) ) ) + if ( ( perm[ 4 ] != '-' ) && ( currentGroups->tqfind( gid ) ) ) return ALLOWED_PERM; // the last chance - user permissions if ( ( perm[ 1 ] != '-' ) && ( uid == getuid() ) ) @@ -91,13 +91,13 @@ char KRpermHandler::readable( QString perm, gid_t gid, uid_t uid, int rwx ) { return NO_PERM; } -char KRpermHandler::executable( QString perm, gid_t gid, uid_t uid, int rwx ) { +char KRpermHandler::executable( TQString perm, gid_t gid, uid_t uid, int rwx ) { if( rwx != -1 ) return ( rwx & X_OK ) ? ALLOWED_PERM : NO_PERM; // first check other permissions. if ( perm[ 9 ] != '-' ) return ALLOWED_PERM; // now check group permission - if ( ( perm[ 6 ] != '-' ) && ( currentGroups->find( gid ) ) ) + if ( ( perm[ 6 ] != '-' ) && ( currentGroups->tqfind( gid ) ) ) return ALLOWED_PERM; // the last chance - user permissions if ( ( perm[ 3 ] != '-' ) && ( uid == getuid() ) ) @@ -106,31 +106,31 @@ char KRpermHandler::executable( QString perm, gid_t gid, uid_t uid, int rwx ) { return NO_PERM; } -bool KRpermHandler::fileWriteable( QString localFile ) { +bool KRpermHandler::fileWriteable( TQString localFile ) { KDE_struct_stat stat_p; if ( KDE_stat( localFile.local8Bit(), &stat_p ) == -1 ) return false; mode_t m = stat_p.st_mode; - QString perm = mode2QString( m ); + TQString perm = mode2TQString( m ); return writeable( perm, stat_p.st_gid, stat_p.st_uid ); } -bool KRpermHandler::fileReadable( QString localFile ) { +bool KRpermHandler::fileReadable( TQString localFile ) { KDE_struct_stat stat_p; if ( KDE_stat( localFile.local8Bit(), &stat_p ) == -1 ) return false; mode_t m = stat_p.st_mode; - QString perm = mode2QString( m ); + TQString perm = mode2TQString( m ); return readable( perm, stat_p.st_gid, stat_p.st_uid ); } -bool KRpermHandler::fileExecutable( QString localFile ) { +bool KRpermHandler::fileExecutable( TQString localFile ) { KDE_struct_stat stat_p; if ( KDE_stat( localFile.local8Bit(), &stat_p ) == -1 ) return false; mode_t m = stat_p.st_mode; - QString perm = mode2QString( m ); + TQString perm = mode2TQString( m ); return executable( perm, stat_p.st_gid, stat_p.st_uid ); } -QString KRpermHandler::mode2QString( mode_t m ) { +TQString KRpermHandler::mode2TQString( mode_t m ) { char perm[ 11 ]; for( int i=0; i != 10; i++ ) perm[ i ] = '-'; @@ -155,7 +155,7 @@ QString KRpermHandler::mode2QString( mode_t m ) { if ( m & 0001 ) perm[ 9 ] = 'x'; if ( m & 01000 ) perm[ 9 ] = 't'; - return QString( perm ); + return TQString( perm ); } void KRpermHandler::init() { @@ -167,11 +167,11 @@ void KRpermHandler::init() { int groupNo = getgroups( 50, groupList ); // init the groups and user caches - passwdCache = new QDict<uid_t>( 317 ); - groupCache = new QDict<gid_t>( 317 ); - currentGroups = new QIntDict<char>( 317 ); - uidCache = new QIntDict<QString>( 317 ); - gidCache = new QIntDict<QString>( 317 ); + passwdCache = new TQDict<uid_t>( 317 ); + groupCache = new TQDict<gid_t>( 317 ); + currentGroups = new TQIntDict<char>( 317 ); + uidCache = new TQIntDict<TQString>( 317 ); + gidCache = new TQIntDict<TQString>( 317 ); passwdCache->setAutoDelete( true ); @@ -186,7 +186,7 @@ void KRpermHandler::init() { while ( ( pass = getpwent() ) != 0L ) { uid_temp = new uid_t( pass->pw_uid ); passwdCache->insert( pass->pw_name, uid_temp ); - uidCache->insert( pass->pw_uid, new QString( pass->pw_name ) ); + uidCache->insert( pass->pw_uid, new TQString( pass->pw_name ) ); } delete pass; endpwent(); @@ -197,7 +197,7 @@ void KRpermHandler::init() { while ( ( gr = getgrent() ) != 0L ) { gid_temp = new gid_t( gr->gr_gid ); groupCache->insert( gr->gr_name, gid_temp ); - gidCache->insert( gr->gr_gid, new QString( gr->gr_name ) ); + gidCache->insert( gr->gr_gid, new TQString( gr->gr_name ) ); } delete gr; endgrent(); @@ -211,7 +211,7 @@ void KRpermHandler::init() { currentGroups->insert( getegid(), t ); } -char KRpermHandler::ftpWriteable ( QString fileOwner, QString userName, QString perm ) { +char KRpermHandler::ftpWriteable ( TQString fileOwner, TQString userName, TQString perm ) { // first check other permissions. if ( perm[ 8 ] != '-' ) return ALLOWED_PERM; // can't check group permission ! @@ -224,7 +224,7 @@ char KRpermHandler::ftpWriteable ( QString fileOwner, QString userName, QString return NO_PERM; } -char KRpermHandler::ftpReadable ( QString fileOwner, QString userName, QString perm ) { +char KRpermHandler::ftpReadable ( TQString fileOwner, TQString userName, TQString perm ) { // first check other permissions. if ( perm[ 7 ] != '-' ) return ALLOWED_PERM; // can't check group permission ! @@ -237,7 +237,7 @@ char KRpermHandler::ftpReadable ( QString fileOwner, QString userName, QString p return NO_PERM; } -char KRpermHandler::ftpExecutable( QString fileOwner, QString userName, QString perm ) { +char KRpermHandler::ftpExecutable( TQString fileOwner, TQString userName, TQString perm ) { // first check other permissions. if ( perm[ 9 ] != '-' ) return ALLOWED_PERM; // can't check group permission ! @@ -250,22 +250,22 @@ char KRpermHandler::ftpExecutable( QString fileOwner, QString userName, QString return NO_PERM; } -bool KRpermHandler::dirExist( QString path ) { +bool KRpermHandler::dirExist( TQString path ) { DIR * dir = opendir( path.local8Bit() ); if ( !dir ) return false; closedir( dir ); // bug fix Karai Csaba (ckarai) return true; } -bool KRpermHandler::fileExist( QString fullPath ) { +bool KRpermHandler::fileExist( TQString fullPath ) { if ( fullPath.right( 1 ) == "/" ) fullPath = fullPath.left( fullPath.length() - 1 ) ; if ( fullPath.left( 1 ) != "/" ) return fileExist( "/", fullPath ); - return fileExist( fullPath.left( fullPath.findRev( "/" ) ) , - fullPath.mid( fullPath.findRev( "/" ) + 1 ) ); + return fileExist( fullPath.left( fullPath.tqfindRev( "/" ) ) , + fullPath.mid( fullPath.tqfindRev( "/" ) + 1 ) ); } -bool KRpermHandler::fileExist( QString path, QString name ) { - if ( QDir( path ).exists( name ) ) return true; +bool KRpermHandler::fileExist( TQString path, TQString name ) { + if ( TQDir( path ).exists( name ) ) return true; DIR* dir = opendir( path.local8Bit() ); if ( !dir ) return false; struct dirent* dirEnt; @@ -279,20 +279,20 @@ bool KRpermHandler::fileExist( QString path, QString name ) { return false; } -QString KRpermHandler::parseSize( KIO::filesize_t val ) { +TQString KRpermHandler::parseSize( KIO::filesize_t val ) { #if (KDE_VERSION_MAJOR >= 3) && (KDE_VERSION_MINOR >= 5) - return KGlobal::locale()->formatNumber(QString::number(val), false, 0); + return KGlobal::locale()->formatNumber(TQString::number(val), false, 0); #else return KGlobal::locale()->formatNumber(val); #endif #if 0 - QString temp; + TQString temp; temp.sprintf( "%llu", val ); if ( temp.length() <= 3 ) return temp; unsigned int i = temp.length() % 3; if ( i == 0 ) i = 3; - QString size = temp.left( i ) + ","; + TQString size = temp.left( i ) + ","; while ( i + 3 < temp.length() ) { size = size + temp.mid( i, 3 ) + ","; i += 3; @@ -303,8 +303,8 @@ QString KRpermHandler::parseSize( KIO::filesize_t val ) { #endif } -QString KRpermHandler::date2qstring( QString date ) { - QString temp; +TQString KRpermHandler::date2qstring( TQString date ) { + TQString temp; int year; year = date[ 6 ].digitValue() * 10 + date[ 7 ].digitValue(); @@ -316,40 +316,40 @@ QString KRpermHandler::date2qstring( QString date ) { return temp; } -time_t KRpermHandler::QString2time( QString date ) { +time_t KRpermHandler::TQString2time( TQString date ) { struct tm t; t.tm_sec = 0; - t.tm_min = ( QString( date[ 12 ] ) + QString( date[ 13 ] ) ).toInt(); - t.tm_hour = ( QString( date[ 9 ] ) + QString( date[ 10 ] ) ).toInt(); - t.tm_mday = ( QString( date[ 0 ] ) + QString( date[ 1 ] ) ).toInt(); - t.tm_mon = ( QString( date[ 3 ] ) + QString( date[ 4 ] ) ).toInt() - 1; - t.tm_year = ( QString( date[ 6 ] ) + QString( date[ 7 ] ) ).toInt(); + t.tm_min = ( TQString( date[ 12 ] ) + TQString( date[ 13 ] ) ).toInt(); + t.tm_hour = ( TQString( date[ 9 ] ) + TQString( date[ 10 ] ) ).toInt(); + t.tm_mday = ( TQString( date[ 0 ] ) + TQString( date[ 1 ] ) ).toInt(); + t.tm_mon = ( TQString( date[ 3 ] ) + TQString( date[ 4 ] ) ).toInt() - 1; + t.tm_year = ( TQString( date[ 6 ] ) + TQString( date[ 7 ] ) ).toInt(); if ( t.tm_year < 70 ) t.tm_year += 100; t.tm_isdst = -1; // daylight saving time information isn't availble return mktime( &t ); } -gid_t KRpermHandler::group2gid( QString group ) { - gid_t * gid = groupCache->find( group ); +gid_t KRpermHandler::group2gid( TQString group ) { + gid_t * gid = groupCache->tqfind( group ); if ( gid ) return * gid; return getgid(); } -uid_t KRpermHandler::user2uid ( QString user ) { - uid_t * uid = passwdCache->find( user ); +uid_t KRpermHandler::user2uid ( TQString user ) { + uid_t * uid = passwdCache->tqfind( user ); if ( uid ) return * uid; return getuid(); } -QString KRpermHandler::gid2group( gid_t groupId ) { - QString * group = gidCache->find( groupId ); +TQString KRpermHandler::gid2group( gid_t groupId ) { + TQString * group = gidCache->tqfind( groupId ); if ( group ) return * group; - return QString( "???" ); + return TQString( "???" ); } -QString KRpermHandler::uid2user ( uid_t userId ) { - QString * user = uidCache->find( userId ); +TQString KRpermHandler::uid2user ( uid_t userId ) { + TQString * user = uidCache->tqfind( userId ); if ( user ) return * user; - return QString( "???" ); + return TQString( "???" ); } diff --git a/krusader/VFS/krpermhandler.h b/krusader/VFS/krpermhandler.h index 8529ca6..ffb9485 100644 --- a/krusader/VFS/krpermhandler.h +++ b/krusader/VFS/krpermhandler.h @@ -32,11 +32,11 @@ #ifndef KRPERMHANDLER_H #define KRPERMHANDLER_H -#include <qstring.h> -#include <qfileinfo.h> +#include <tqstring.h> +#include <tqfileinfo.h> #include <sys/types.h> -#include <qdict.h> -#include <qintdict.h> +#include <tqdict.h> +#include <tqintdict.h> #include <kio/global.h> #define NO_PERM 0 @@ -50,40 +50,40 @@ public: static void init(); - static gid_t group2gid(QString group); - static uid_t user2uid (QString user); + static gid_t group2gid(TQString group); + static uid_t user2uid (TQString user); - static QString gid2group(gid_t groupId); - static QString uid2user (uid_t userId); + static TQString gid2group(gid_t groupId); + static TQString uid2user (uid_t userId); - static char writeable (QString perm, gid_t gid, uid_t uid, int rwx=-1); - static char readable (QString perm, gid_t gid, uid_t uid, int rwx=-1); - static char executable(QString perm, gid_t gid, uid_t uid, int rwx=-1); + static char writeable (TQString perm, gid_t gid, uid_t uid, int rwx=-1); + static char readable (TQString perm, gid_t gid, uid_t uid, int rwx=-1); + static char executable(TQString perm, gid_t gid, uid_t uid, int rwx=-1); - static bool fileWriteable (QString localFile); - static bool fileReadable (QString localFile); - static bool fileExecutable(QString localFile); + static bool fileWriteable (TQString localFile); + static bool fileReadable (TQString localFile); + static bool fileExecutable(TQString localFile); - static char ftpWriteable ( QString fileOwner, QString userName, QString perm ); - static char ftpReadable ( QString fileOwner, QString userName, QString perm ); - static char ftpExecutable( QString fileOwner, QString userName, QString perm ); + static char ftpWriteable ( TQString fileOwner, TQString userName, TQString perm ); + static char ftpReadable ( TQString fileOwner, TQString userName, TQString perm ); + static char ftpExecutable( TQString fileOwner, TQString userName, TQString perm ); - static bool dirExist (QString path); - static bool fileExist(QString fullPath); - static bool fileExist(QString Path, QString name); + static bool dirExist (TQString path); + static bool fileExist(TQString fullPath); + static bool fileExist(TQString Path, TQString name); - static QString mode2QString(mode_t m); - static QString parseSize(KIO::filesize_t val); - static QString date2qstring(QString date); - static time_t QString2time(QString date); + static TQString mode2TQString(mode_t m); + static TQString parseSize(KIO::filesize_t val); + static TQString date2qstring(TQString date); + static time_t TQString2time(TQString date); private: // cache for passwd and group entries - static QDict<uid_t> *passwdCache; - static QDict<gid_t> *groupCache; - static QIntDict<char> *currentGroups; - static QIntDict<QString> *uidCache; - static QIntDict<QString> *gidCache; + static TQDict<uid_t> *passwdCache; + static TQDict<gid_t> *groupCache; + static TQIntDict<char> *currentGroups; + static TQIntDict<TQString> *uidCache; + static TQIntDict<TQString> *gidCache; }; #endif diff --git a/krusader/VFS/krquery.cpp b/krusader/VFS/krquery.cpp index a3a0443..c8a63de 100644 --- a/krusader/VFS/krquery.cpp +++ b/krusader/VFS/krquery.cpp @@ -37,13 +37,13 @@ #include "krarchandler.h" #include "krpermhandler.h" -#include <qtextstream.h> -#include <qtextcodec.h> -#include <qregexp.h> +#include <tqtextstream.h> +#include <tqtextcodec.h> +#include <tqregexp.h> #include <klargefile.h> #include <klocale.h> #include <kmimetype.h> -#include <qfile.h> +#include <tqfile.h> #include <kurlcompletion.h> #include <kio/job.h> #include <kfileitem.h> @@ -52,26 +52,26 @@ #define MAX_LINE_LEN 500 // set the defaults -KRQuery::KRQuery(): QObject(), matchesCaseSensitive(true), bNull( true ), - contain(QString::null),containCaseSensetive(true), +KRQuery::KRQuery(): TQObject(), matchesCaseSensitive(true), bNull( true ), + contain(TQString()),containCaseSensetive(true), containWholeWord(false),containOnRemote(false), minSize(0),maxSize(0),newerThen(0),olderThen(0), - owner(QString::null),group(QString::null),perm(QString::null), - type(QString::null),inArchive(false),recurse(true), + owner(TQString()),group(TQString()),perm(TQString()), + type(TQString()),inArchive(false),recurse(true), followLinksP(true), receivedBuffer( 0 ), processEventsConnected(0) {} // set the defaults -KRQuery::KRQuery( const QString &name, bool matchCase ) : QObject(), - bNull( true ),contain(QString::null),containCaseSensetive(true), +KRQuery::KRQuery( const TQString &name, bool matchCase ) : TQObject(), + bNull( true ),contain(TQString()),containCaseSensetive(true), containWholeWord(false), containOnRemote(false), minSize(0),maxSize(0),newerThen(0),olderThen(0), - owner(QString::null),group(QString::null),perm(QString::null), - type(QString::null),inArchive(false),recurse(true), + owner(TQString()),group(TQString()),perm(TQString()), + type(TQString()),inArchive(false),recurse(true), followLinksP(true), receivedBuffer( 0 ), processEventsConnected(0) { setNameFilter( name, matchCase ); } -KRQuery::KRQuery( const KRQuery & that ) : QObject(), receivedBuffer( 0 ), processEventsConnected(0) { +KRQuery::KRQuery( const KRQuery & that ) : TQObject(), receivedBuffer( 0 ), processEventsConnected(0) { *this = that; } @@ -112,61 +112,61 @@ KRQuery& KRQuery::operator=(const KRQuery &old) { } void KRQuery::connectNotify ( const char * signal ) { - QString signalString = QString( signal ).replace( " ", "" ); - QString processString = QString( SIGNAL( processEvents( bool & ) ) ).replace( " ", "" ); + TQString signalString = TQString( signal ).tqreplace( " ", "" ); + TQString processString = TQString( TQT_SIGNAL( processEvents( bool & ) ) ).tqreplace( " ", "" ); if( signalString == processString ) processEventsConnected++; } void KRQuery::disconnectNotify ( const char * signal ) { - QString signalString = QString( signal ).replace( " ", "" ); - QString processString = QString( SIGNAL( processEvents( bool & ) ) ).replace( " ", "" ); + TQString signalString = TQString( signal ).tqreplace( " ", "" ); + TQString processString = TQString( TQT_SIGNAL( processEvents( bool & ) ) ).tqreplace( " ", "" ); if( signalString == processString ) processEventsConnected--; } -bool KRQuery::checkPerm( QString filePerm ) const +bool KRQuery::checkPerm( TQString filePerm ) const { for ( int i = 0; i < 9; ++i ) if ( perm[ i ] != '?' && perm[ i ] != filePerm[ i + 1 ] ) return false; return true; } -bool KRQuery::checkType( QString mime ) const +bool KRQuery::checkType( TQString mime ) const { if ( type == mime ) return true; if ( type == i18n( "Archives" ) ) return KRarcHandler::arcSupported( mime.right( 4 ) ); - if ( type == i18n( "Directories" ) ) return mime.contains( "directory" ); - if ( type == i18n( "Image Files" ) ) return mime.contains( "image/" ); - if ( type == i18n( "Text Files" ) ) return mime.contains( "text/" ); - if ( type == i18n( "Video Files" ) ) return mime.contains( "video/" ); - if ( type == i18n( "Audio Files" ) ) return mime.contains( "audio/" ); - if ( type == i18n( "Custom" ) ) return customType.contains( mime ); + if ( type == i18n( "Directories" ) ) return mime.tqcontains( "directory" ); + if ( type == i18n( "Image Files" ) ) return mime.tqcontains( "image/" ); + if ( type == i18n( "Text Files" ) ) return mime.tqcontains( "text/" ); + if ( type == i18n( "Video Files" ) ) return mime.tqcontains( "video/" ); + if ( type == i18n( "Audio Files" ) ) return mime.tqcontains( "audio/" ); + if ( type == i18n( "Custom" ) ) return customType.tqcontains( mime ); return false; } -bool KRQuery::match( const QString & name ) const { +bool KRQuery::match( const TQString & name ) const { return matchCommon( name, matches, excludes ); } -bool KRQuery::matchDirName( const QString & name ) const { +bool KRQuery::matchDirName( const TQString & name ) const { return matchCommon( name, includedDirs, excludedDirs ); } -bool KRQuery::matchCommon( const QString &nameIn, const QStringList &matchList, const QStringList &excludeList ) const +bool KRQuery::matchCommon( const TQString &nameIn, const TQStringList &matchList, const TQStringList &excludeList ) const { if( excludeList.count() == 0 && matchList.count() == 0 ) /* true if there's no match condition */ return true; - QString name( nameIn ); - int ndx = nameIn.findRev( '/' ); // virtual filenames may contain '/' + TQString name( nameIn ); + int ndx = nameIn.tqfindRev( '/' ); // virtual filenames may contain '/' if( ndx != -1 ) // but the end of the filename is OK name = nameIn.mid( ndx + 1 ); unsigned int len; for ( unsigned int i = 0; i < excludeList.count(); ++i ) { - QRegExp( *excludeList.at( i ), matchesCaseSensitive, true ).match( name, 0, ( int* ) & len ); + TQRegExp( *excludeList.at( i ), matchesCaseSensitive, true ).match( name, 0, ( int* ) & len ); if ( len == name.length() ) return false; } @@ -175,7 +175,7 @@ bool KRQuery::matchCommon( const QString &nameIn, const QStringList &matchList, for ( unsigned int i = 0; i < matchList.count(); ++i ) { - QRegExp( *matchList.at( i ), matchesCaseSensitive, true ).match( name, 0, ( int* ) & len ); + TQRegExp( *matchList.at( i ), matchesCaseSensitive, true ).match( name, 0, ( int* ) & len ); if ( len == name.length() ) return true; } return false; @@ -233,7 +233,7 @@ bool KRQuery::match( vfile *vf ) const bool KRQuery::match( KFileItem *kfi ) const { mode_t mode = kfi->mode() | kfi->permissions(); - QString perm = KRpermHandler::mode2QString( mode ); + TQString perm = KRpermHandler::mode2TQString( mode ); if ( kfi->isDir() ) perm[ 0 ] = 'd'; @@ -246,22 +246,22 @@ bool KRQuery::match( KFileItem *kfi ) const { // takes the string and adds BOLD to it, so that when it is displayed, // the grepped text will be bold -void fixFoundTextForDisplay(QString& haystack, int start, int length) { - QString before = haystack.left( start ); - QString text = haystack.mid( start, length ); - QString after = haystack.mid( start + length ); +void fixFoundTextForDisplay(TQString& haystack, int start, int length) { + TQString before = haystack.left( start ); + TQString text = haystack.mid( start, length ); + TQString after = haystack.mid( start + length ); - before.replace( '&', "&" ); - before.replace( '<', "<" ); - before.replace( '>', ">" ); + before.tqreplace( '&', "&" ); + before.tqreplace( '<', "<" ); + before.tqreplace( '>', ">" ); - text.replace( '&', "&" ); - text.replace( '<', "<" ); - text.replace( '>', ">" ); + text.tqreplace( '&', "&" ); + text.tqreplace( '<', "<" ); + text.tqreplace( '>', ">" ); - after.replace( '&', "&" ); - after.replace( '<', "<" ); - after.replace( '>', ">" ); + after.tqreplace( '&', "&" ); + after.tqreplace( '<', "<" ); + after.tqreplace( '>', ">" ); haystack = ("<qt>"+before+"<b>"+text+"</b>"+after+"</qt>" ); } @@ -319,7 +319,7 @@ bool KRQuery::checkBuffer( const char *buf, int len ) const { bool KRQuery::checkLines( const char * buf, int len ) const { - QStringList list; + TQStringList list; int start = 0; int k = 0; @@ -329,7 +329,7 @@ bool KRQuery::checkLines( const char * buf, int len ) const { if( k != start ) { - QString line = QTextCodec::codecForLocale()->toUnicode( buf + start, k - start ); + TQString line = TQTextCodec::codecForLocale()->toUnicode( buf + start, k - start ); if( !line.isEmpty() ) list << line; } @@ -339,22 +339,22 @@ bool KRQuery::checkLines( const char * buf, int len ) const } if( start != k ) { - QString line = QTextCodec::codecForLocale()->toUnicode( buf + start, k - start ); + TQString line = TQTextCodec::codecForLocale()->toUnicode( buf + start, k - start ); if( !line.isEmpty() ) list << line; } for( unsigned int i=0; i != list.count(); i++ ) { - QString line = list[ i ]; + TQString line = list[ i ]; int ndx = 0; if ( line.isNull() ) return false; if ( containWholeWord ) { - while ( ( ndx = line.find( contain, ndx, containCaseSensetive ) ) != -1 ) + while ( ( ndx = line.tqfind( contain, ndx, containCaseSensetive ) ) != -1 ) { - QChar before = line.at( ndx - 1 ); - QChar after = line.at( ndx + contain.length() ); + TQChar before = line.at( ndx - 1 ); + TQChar after = line.at( ndx + contain.length() ); if ( !before.isLetterOrNumber() && !after.isLetterOrNumber() && after != '_' && before != '_' ) { @@ -365,7 +365,7 @@ bool KRQuery::checkLines( const char * buf, int len ) const ndx++; } } - else if ( (ndx = line.find( contain, 0, containCaseSensetive )) != -1 ) { + else if ( (ndx = line.tqfind( contain, 0, containCaseSensetive )) != -1 ) { lastSuccessfulGrep = line; fixFoundTextForDisplay(lastSuccessfulGrep, ndx, contain.length()); return true; @@ -374,9 +374,9 @@ bool KRQuery::checkLines( const char * buf, int len ) const return false; } -bool KRQuery::containsContent( QString file ) const +bool KRQuery::containsContent( TQString file ) const { - QFile qf( file ); + TQFile qf( file ); if( !qf.open( IO_ReadOnly ) ) return false; @@ -403,17 +403,17 @@ bool KRQuery::containsContent( QString file ) const if( checkBuffer( buffer, 0 ) ) return true; - lastSuccessfulGrep = QString::null; // nothing was found + lastSuccessfulGrep = TQString(); // nothing was found return false; } bool KRQuery::containsContent( KURL url ) const { KIO::TransferJob *contentReader = KIO::get( url, false, false ); - connect(contentReader, SIGNAL(data(KIO::Job *, const QByteArray &)), - this, SLOT(containsContentData(KIO::Job *, const QByteArray &))); - connect(contentReader, SIGNAL( result( KIO::Job* ) ), - this, SLOT(containsContentFinished( KIO::Job* ) ) ); + connect(contentReader, TQT_SIGNAL(data(KIO::Job *, const TQByteArray &)), + this, TQT_SLOT(containsContentData(KIO::Job *, const TQByteArray &))); + connect(contentReader, TQT_SIGNAL( result( KIO::Job* ) ), + this, TQT_SLOT(containsContentFinished( KIO::Job* ) ) ); busy = true; containsContentResult = false; @@ -432,7 +432,7 @@ bool KRQuery::containsContent( KURL url ) const return containsContentResult; } -void KRQuery::containsContentData(KIO::Job *job, const QByteArray &array) { +void KRQuery::containsContentData(KIO::Job *job, const TQByteArray &array) { receivedBytes += array.size(); if( checkBuffer( array.data(), array.size() ) ) { containsContentResult = true; @@ -450,8 +450,8 @@ void KRQuery::containsContentFinished( KIO::Job * ) { bool KRQuery::checkTimer() const { if( timer.elapsed() >= STATUS_SEND_DELAY ) { int pcnt = (int)(100.*(double)receivedBytes/(double)totalBytes + .5); - QString message = i18n( "Searching content of '%1' (%2%)" ) - .arg( fileName ).arg( pcnt ); + TQString message = i18n( "Searching content of '%1' (%2%)" ) + .tqarg( fileName ).tqarg( pcnt ); timer.start(); emit ((KRQuery *)this)->status( message ); return true; @@ -459,9 +459,9 @@ bool KRQuery::checkTimer() const { return false; } -QStringList KRQuery::split( QString str ) +TQStringList KRQuery::split( TQString str ) { - QStringList list; + TQStringList list; unsigned splitNdx = 0; unsigned startNdx = 0; bool quotation = false; @@ -473,7 +473,7 @@ QStringList KRQuery::split( QString str ) if( !quotation && str[ splitNdx ] == ' ') { - QString section = str.mid( startNdx, splitNdx - startNdx ); + TQString section = str.mid( startNdx, splitNdx - startNdx ); startNdx = splitNdx+1; if( section.startsWith( "\"" ) && section.endsWith( "\"" ) && section.length() >=2 ) section = section.mid( 1, section.length()-2 ); @@ -485,7 +485,7 @@ QStringList KRQuery::split( QString str ) if( startNdx < splitNdx ) { - QString section = str.mid( startNdx, splitNdx - startNdx ); + TQString section = str.mid( startNdx, splitNdx - startNdx ); if( section.startsWith( "\"" ) && section.endsWith( "\"" ) && section.length() >=2 ) section = section.mid( 1, section.length()-2 ); if( !section.isEmpty() ) @@ -495,14 +495,14 @@ QStringList KRQuery::split( QString str ) return list; } -void KRQuery::setNameFilter( const QString &text, bool cs ) +void KRQuery::setNameFilter( const TQString &text, bool cs ) { bNull = false; matchesCaseSensitive = cs; origFilter = text; - QString matchText = text; - QString excludeText; + TQString matchText = text; + TQString excludeText; unsigned excludeNdx = 0; bool quotationMark = 0; @@ -539,7 +539,7 @@ void KRQuery::setNameFilter( const QString &text, bool cs ) continue; } - if( !matches[ i ].contains( "*" ) && !matches[ i ].contains( "?" ) ) + if( !matches[ i ].tqcontains( "*" ) && !matches[ i ].tqcontains( "?" ) ) matches[ i ] = "*" + matches[ i ] + "*"; i++; @@ -555,14 +555,14 @@ void KRQuery::setNameFilter( const QString &text, bool cs ) continue; } - if( !excludes[ i ].contains( "*" ) && !excludes[ i ].contains( "?" ) ) + if( !excludes[ i ].tqcontains( "*" ) && !excludes[ i ].tqcontains( "?" ) ) excludes[ i ] = "*" + excludes[ i ] + "*"; i++; } } -void KRQuery::setContent( const QString &content, bool cs, bool wholeWord, bool remoteSearch ) +void KRQuery::setContent( const TQString &content, bool cs, bool wholeWord, bool remoteSearch ) { bNull = false; contain = content; @@ -571,16 +571,16 @@ void KRQuery::setContent( const QString &content, bool cs, bool wholeWord, bool containOnRemote = remoteSearch; } -void KRQuery::setMinimumFileSize( KIO::filesize_t minimumSize ) +void KRQuery::setMinimumFileSize( KIO::filesize_t tqminimumSize ) { bNull = false; - minSize = minimumSize; + minSize = tqminimumSize; } -void KRQuery::setMaximumFileSize( KIO::filesize_t maximumSize ) +void KRQuery::setMaximumFileSize( KIO::filesize_t tqmaximumSize ) { bNull = false; - maxSize = maximumSize; + maxSize = tqmaximumSize; } void KRQuery::setNewerThan( time_t time ) @@ -595,25 +595,25 @@ void KRQuery::setOlderThan( time_t time ) olderThen = time; } -void KRQuery::setOwner( const QString &ownerIn ) +void KRQuery::setOwner( const TQString &ownerIn ) { bNull = false; owner = ownerIn; } -void KRQuery::setGroup( const QString &groupIn ) +void KRQuery::setGroup( const TQString &groupIn ) { bNull = false; group = groupIn; } -void KRQuery::setPermissions( const QString &permIn ) +void KRQuery::setPermissions( const TQString &permIn ) { bNull = false; perm = permIn; } -void KRQuery::setMimeType( const QString &typeIn, QStringList customList ) +void KRQuery::setMimeType( const TQString &typeIn, TQStringList customList ) { bNull = false; type = typeIn; @@ -635,7 +635,7 @@ bool KRQuery::isExcluded( const KURL &url ) void KRQuery::setSearchInDirs( const KURL::List &urls ) { whereToSearch.clear(); for( unsigned int i = 0; i < urls.count(); ++i ) { - QString url = urls[ i ].url(); + TQString url = urls[ i ].url(); KURL completed = vfs::fromPathOrURL( KURLCompletion::replacedPath( url, true, true ) ); whereToSearch.append( completed ); } @@ -644,7 +644,7 @@ void KRQuery::setSearchInDirs( const KURL::List &urls ) { void KRQuery::setDontSearchInDirs( const KURL::List &urls ) { whereNotToSearch.clear(); for( unsigned int i = 0; i < urls.count(); ++i ) { - QString url = urls[ i ].url(); + TQString url = urls[ i ].url(); KURL completed = vfs::fromPathOrURL( KURLCompletion::replacedPath( url, true, true ) ); whereNotToSearch.append( completed ); } diff --git a/krusader/VFS/krquery.h b/krusader/VFS/krquery.h index 5849d79..e7bb86f 100644 --- a/krusader/VFS/krquery.h +++ b/krusader/VFS/krquery.h @@ -27,11 +27,11 @@ * (at your option) any later version. * * * ***************************************************************************/ -#ifndef KRQUERY_H -#define KRQUERY_H +#ifndef KRTQUERY_H +#define KRTQUERY_H -#include <qstringlist.h> -#include <qdatetime.h> +#include <tqstringlist.h> +#include <tqdatetime.h> #include <time.h> #include <kurl.h> #include <kio/jobclasses.h> @@ -39,14 +39,15 @@ class KFileItem; -class KRQuery : public QObject { +class KRQuery : public TQObject { Q_OBJECT + TQ_OBJECT public: // null query KRQuery(); // query only with name filter - KRQuery( const QString &name, bool matchCase = true ); + KRQuery( const TQString &name, bool matchCase = true ); // copy constructor KRQuery( const KRQuery & ); // let operator @@ -59,14 +60,14 @@ public: // matching a KIO file with the query bool match( KFileItem *file ) const;// checks if the given vfile object matches the conditions // matching a name with the query - bool match( const QString &name ) const;// matching the filename only + bool match( const TQString &name ) const;// matching the filename only // matching the name of the directory - bool matchDirName( const QString &name ) const; + bool matchDirName( const TQString &name ) const; // sets the text for name filtering - void setNameFilter( const QString &text, bool cs=true ); - // returns the current filter mask - const QString& nameFilter() const { return origFilter; } + void setNameFilter( const TQString &text, bool cs=true ); + // returns the current filter tqmask + const TQString& nameFilter() const { return origFilter; } // returns whether the filter is case sensitive bool isCaseSensitive() { return matchesCaseSensitive; } @@ -74,7 +75,7 @@ public: bool isNull() {return bNull;}; // sets the content part of the query - void setContent( const QString &content, bool cs=true, bool wholeWord=false, bool remoteSearch=false ); + void setContent( const TQString &content, bool cs=true, bool wholeWord=false, bool remoteSearch=false ); // sets the minimum file size limit void setMinimumFileSize( KIO::filesize_t ); @@ -87,11 +88,11 @@ public: void setOlderThan( time_t time ); // sets the owner - void setOwner( const QString &ownerIn ); + void setOwner( const TQString &ownerIn ); // sets the group - void setGroup( const QString &groupIn ); + void setGroup( const TQString &groupIn ); // sets the permissions - void setPermissions( const QString &permIn ); + void setPermissions( const TQString &permIn ); // sets the mimetype for the query // type, must be one of the following: @@ -99,8 +100,8 @@ public: // 2. one of: i18n("Archives"), i18n("Directories"), i18n("Image Files") // i18n("Text Files"), i18n("Video Files"), i18n("Audio Files") // 3. i18n("Custom") in which case you must supply a list of valid mime-types - // in the member QStringList customType - void setMimeType( const QString &typeIn, QStringList customList = QStringList() ); + // in the member TQStringList customType + void setMimeType( const TQString &typeIn, TQStringList customList = TQStringList() ); // true if setMimeType was called bool hasMimeType() { return type.isEmpty(); } @@ -130,7 +131,7 @@ public: // gives whether we search for content bool isContentSearched() const { return !contain.isEmpty(); } - const QString& foundText() const { return lastSuccessfulGrep; } + const TQString& foundText() const { return lastSuccessfulGrep; } protected: // important to know whether the event processor is connected @@ -139,15 +140,15 @@ protected: virtual void disconnectNotify ( const char * signal ); protected: - QStringList matches; // what to search - QStringList excludes; // what to exclude - QStringList includedDirs; // what dirs to include - QStringList excludedDirs; // what dirs to exclude + TQStringList matches; // what to search + TQStringList excludes; // what to exclude + TQStringList includedDirs; // what dirs to include + TQStringList excludedDirs; // what dirs to exclude bool matchesCaseSensitive; bool bNull; // flag if the query is null - QString contain; // file must contain this string + TQString contain; // file must contain this string bool containCaseSensetive; bool containWholeWord; bool containOnRemote; @@ -158,12 +159,12 @@ protected: time_t newerThen; time_t olderThen; - QString owner; - QString group; - QString perm; + TQString owner; + TQString group; + TQString perm; - QString type; - QStringList customType; + TQString type; + TQStringList customType; bool inArchive; // if true- search in archive. bool recurse; // if true recurse ob sub-dirs... @@ -173,36 +174,36 @@ protected: KURL::List whereNotToSearch; // directorys NOT to search signals: - void status( const QString &name ); + void status( const TQString &name ); void processEvents( bool & stopped ); private: - bool matchCommon( const QString &, const QStringList &, const QStringList & ) const; - bool checkPerm(QString perm) const; - bool checkType(QString mime) const; - bool containsContent( QString file ) const; + bool matchCommon( const TQString &, const TQStringList &, const TQStringList & ) const; + bool checkPerm(TQString perm) const; + bool checkType(TQString mime) const; + bool containsContent( TQString file ) const; bool containsContent( KURL url ) const; bool checkBuffer( const char *buffer, int len ) const; bool checkLines( const char *buffer, int len ) const; bool checkTimer() const; - QStringList split( QString ); + TQStringList split( TQString ); private slots: - void containsContentData(KIO::Job *, const QByteArray &); + void containsContentData(KIO::Job *, const TQByteArray &); void containsContentFinished(KIO::Job*); private: - QString origFilter; + TQString origFilter; mutable bool busy; mutable bool containsContentResult; mutable char * receivedBuffer; mutable int receivedBufferLen; - mutable QString lastSuccessfulGrep; - mutable QString fileName; + mutable TQString lastSuccessfulGrep; + mutable TQString fileName; mutable KIO::filesize_t receivedBytes; mutable KIO::filesize_t totalBytes; mutable int processEventsConnected; - mutable QTime timer; + mutable TQTime timer; }; #endif diff --git a/krusader/VFS/krvfshandler.cpp b/krusader/VFS/krvfshandler.cpp index 6a116fa..72a436d 100644 --- a/krusader/VFS/krvfshandler.cpp +++ b/krusader/VFS/krvfshandler.cpp @@ -21,7 +21,7 @@ #include "ftp_vfs.h" #include "virt_vfs.h" -#include <qdir.h> +#include <tqdir.h> #include <kdebug.h> @@ -32,10 +32,10 @@ KrVfsHandler::~KrVfsHandler(){ } vfs::VFS_TYPE KrVfsHandler::getVfsType(const KURL& url){ - QString protocol = url.protocol(); + TQString protocol = url.protocol(); if( ( protocol == "krarc" || protocol == "tar" || protocol == "zip" ) && - QDir(url.path(-1)).exists() ) + TQDir(url.path(-1)).exists() ) return vfs::NORMAL; if( url.isLocalFile() ){ @@ -48,7 +48,7 @@ vfs::VFS_TYPE KrVfsHandler::getVfsType(const KURL& url){ return vfs::ERROR; } -vfs* KrVfsHandler::getVfs(const KURL& url,QObject* parent,vfs* oldVfs){ +vfs* KrVfsHandler::getVfs(const KURL& url,TQObject* tqparent,vfs* oldVfs){ vfs::VFS_TYPE newType,oldType = vfs::ERROR; if(oldVfs) oldType = oldVfs->vfs_getType(); @@ -59,10 +59,10 @@ vfs* KrVfsHandler::getVfs(const KURL& url,QObject* parent,vfs* oldVfs){ if( oldType != newType ){ switch( newType ){ - case (vfs::NORMAL) : newVfs = new normal_vfs(parent); break; - case (vfs::FTP ) : newVfs = new ftp_vfs(parent) ; break; - case (vfs::TEMP ) : newVfs = 0/*new temp_vfs(parent)*/ ; break; - case (vfs::VIRT ) : newVfs = new virt_vfs(parent) ; break; + case (vfs::NORMAL) : newVfs = new normal_vfs(tqparent); break; + case (vfs::FTP ) : newVfs = new ftp_vfs(tqparent) ; break; + case (vfs::TEMP ) : newVfs = 0/*new temp_vfs(tqparent)*/ ; break; + case (vfs::VIRT ) : newVfs = new virt_vfs(tqparent) ; break; case (vfs::ERROR ) : newVfs = 0 ; break; } } diff --git a/krusader/VFS/krvfshandler.h b/krusader/VFS/krvfshandler.h index 698a504..900af8a 100644 --- a/krusader/VFS/krvfshandler.h +++ b/krusader/VFS/krvfshandler.h @@ -18,7 +18,7 @@ #ifndef KRVFSHANDLER_H #define KRVFSHANDLER_H -#include <qobject.h> +#include <tqobject.h> #include <kurl.h> @@ -28,13 +28,13 @@ *@author Shie Erlich & Rafi Yanai */ -class KrVfsHandler : public QObject { +class KrVfsHandler : public TQObject { public: KrVfsHandler(); ~KrVfsHandler(); static vfs::VFS_TYPE getVfsType(const KURL& url); - static vfs* getVfs(const KURL& url,QObject* parent=0,vfs* oldVfs=0); + static vfs* getVfs(const KURL& url,TQObject* tqparent=0,vfs* oldVfs=0); }; #endif diff --git a/krusader/VFS/normal_vfs.cpp b/krusader/VFS/normal_vfs.cpp index adbfb34..9db06a7 100644 --- a/krusader/VFS/normal_vfs.cpp +++ b/krusader/VFS/normal_vfs.cpp @@ -33,8 +33,8 @@ #include <unistd.h> #include <dirent.h> // QT includes -#include <qdir.h> -#include <qtimer.h> +#include <tqdir.h> +#include <tqtimer.h> // KDE includes #include <kmessagebox.h> #include <kmimetype.h> @@ -64,12 +64,12 @@ #endif #endif -normal_vfs::normal_vfs(QObject* panel):vfs(panel), watcher(0) { +normal_vfs::normal_vfs(TQObject* panel):vfs(panel), watcher(0) { vfs_type=NORMAL; } bool normal_vfs::populateVfsList(const KURL& origin, bool showHidden){ - QString path = origin.path(-1); + TQString path = origin.path(-1); // set the writable attribute to true, if that's not the case - the KIO job // will give the warnings and errors @@ -85,9 +85,9 @@ bool normal_vfs::populateVfsList(const KURL& origin, bool showHidden){ vfs_origin.cleanPath(-1); // check that the new origin exists - if ( !QDir(path).exists() ) + if ( !TQDir(path).exists() ) { - if( !quietMode ) KMessageBox::error(krApp, i18n("Directory %1 does not exist!").arg( path ), i18n("Error")); + if( !quietMode ) KMessageBox::error(krApp, i18n("Directory %1 does not exist!").tqarg( path ), i18n("Error")); return false; } @@ -97,12 +97,12 @@ bool normal_vfs::populateVfsList(const KURL& origin, bool showHidden){ DIR* dir = opendir(path.local8Bit()); if(!dir) { - if( !quietMode ) KMessageBox::error(krApp, i18n("Can't open the %1 directory!").arg( path ), i18n("Error")); + if( !quietMode ) KMessageBox::error(krApp, i18n("Can't open the %1 directory!").tqarg( path ), i18n("Error")); return false; } // change directory to the new directory - QString save = getcwd( 0, 0 ); + TQString save = getcwd( 0, 0 ); if (chdir(path.local8Bit()) != 0) { if( !quietMode ) KMessageBox::error(krApp, i18n("Access denied to")+path, i18n("Error")); closedir(dir); @@ -110,10 +110,10 @@ bool normal_vfs::populateVfsList(const KURL& origin, bool showHidden){ } struct dirent* dirEnt; - QString name; + TQString name; while( (dirEnt=readdir(dir)) != NULL ){ - name = QString::fromLocal8Bit(dirEnt->d_name); + name = TQString::fromLocal8Bit(dirEnt->d_name); // show hidden files ? if ( !showHidden && name.left(1) == "." ) continue ; @@ -131,9 +131,9 @@ bool normal_vfs::populateVfsList(const KURL& origin, bool showHidden){ { watcher = new KDirWatch(); // connect the watcher - connect(watcher,SIGNAL(dirty(const QString&)),this,SLOT(vfs_slotDirty(const QString&))); - connect(watcher,SIGNAL(created(const QString&)),this, SLOT(vfs_slotCreated(const QString&))); - connect(watcher,SIGNAL(deleted(const QString&)),this, SLOT(vfs_slotDeleted(const QString&))); + connect(watcher,TQT_SIGNAL(dirty(const TQString&)),this,TQT_SLOT(vfs_slotDirty(const TQString&))); + connect(watcher,TQT_SIGNAL(created(const TQString&)),this, TQT_SLOT(vfs_slotCreated(const TQString&))); + connect(watcher,TQT_SIGNAL(deleted(const TQString&)),this, TQT_SLOT(vfs_slotDeleted(const TQString&))); watcher->addDir(vfs_getOrigin().path(-1),true); //start watching the new dir watcher->startScan(true); } @@ -142,7 +142,7 @@ bool normal_vfs::populateVfsList(const KURL& origin, bool showHidden){ } // copy a file to the vfs (physical) -void normal_vfs::vfs_addFiles(KURL::List *fileUrls,KIO::CopyJob::CopyMode mode,QObject* toNotify,QString dir, PreserveMode pmode ){ +void normal_vfs::vfs_addFiles(KURL::List *fileUrls,KIO::CopyJob::CopyMode mode,TQObject* toNotify,TQString dir, PreserveMode pmode ){ //if( watcher ) watcher->stopScan(); // we will refresh manually this time... if( watcher ) { delete watcher; // stopScan is buggy, leaves reference on the directory, that's why we delete the watcher @@ -153,18 +153,18 @@ void normal_vfs::vfs_addFiles(KURL::List *fileUrls,KIO::CopyJob::CopyMode mode,Q dest.setPath(vfs_workingDir()+"/"+dir); KIO::Job* job = PreservingCopyJob::createCopyJob( pmode, *fileUrls,dest,mode,false,true ); - connect(job,SIGNAL(result(KIO::Job*)),this,SLOT(vfs_refresh()) ); + connect(job,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(vfs_refresh()) ); if(mode == KIO::CopyJob::Move) // notify the other panel - connect(job,SIGNAL(result(KIO::Job*)),toNotify,SLOT(vfs_refresh(KIO::Job*)) ); + connect(job,TQT_SIGNAL(result(KIO::Job*)),toNotify,TQT_SLOT(vfs_refresh(KIO::Job*)) ); else job->setAutoErrorHandlingEnabled( true ); } // remove a file from the vfs (physical) -void normal_vfs::vfs_delFiles(QStringList *fileNames){ +void normal_vfs::vfs_delFiles(TQStringList *fileNames){ KURL::List filesUrls; KURL url; - QDir local( vfs_workingDir() ); + TQDir local( vfs_workingDir() ); vfile* vf; // if( watcher ) watcher->stopScan(); // we will refresh manually this time... @@ -175,7 +175,7 @@ void normal_vfs::vfs_delFiles(QStringList *fileNames){ // names -> urls for(uint i=0 ; i<fileNames->count(); ++i){ - QString filename = (*fileNames)[i]; + TQString filename = (*fileNames)[i]; vf = vfs_search(filename); url.setPath( vfs_workingDir()+"/"+filename); filesUrls.append(url); @@ -190,38 +190,38 @@ void normal_vfs::vfs_delFiles(QStringList *fileNames){ #else job = new KIO::CopyJob(filesUrls,KGlobalSettings::trashPath(),KIO::CopyJob::Move,false,true ); #endif - connect(job,SIGNAL(result(KIO::Job*)),SLOTS,SLOT(changeTrashIcon())); + connect(job,TQT_SIGNAL(result(KIO::Job*)),SLOTS,TQT_SLOT(changeTrashIcon())); } else job = new KIO::DeleteJob(filesUrls, false, true); - connect(job,SIGNAL(result(KIO::Job*)),this,SLOT(vfs_refresh(KIO::Job*))); + connect(job,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(vfs_refresh(KIO::Job*))); } // return a path to the file -KURL normal_vfs::vfs_getFile(const QString& name){ - QString url; +KURL normal_vfs::vfs_getFile(const TQString& name){ + TQString url; if ( vfs_workingDir() == "/" ) url = "/"+name; else url = vfs_workingDir()+"/"+name; return vfs::fromPathOrURL(url); } -KURL::List* normal_vfs::vfs_getFiles(QStringList* names){ +KURL::List* normal_vfs::vfs_getFiles(TQStringList* names){ KURL::List* urls = new KURL::List(); - for(QStringList::Iterator name = names->begin(); name != names->end(); ++name){ + for(TQStringList::Iterator name = names->begin(); name != names->end(); ++name){ urls->append( vfs_getFile(*name) ); } return urls; } -void normal_vfs::vfs_mkdir(const QString& name){ - if (!QDir(vfs_workingDir()).mkdir(name)) +void normal_vfs::vfs_mkdir(const TQString& name){ + if (!TQDir(vfs_workingDir()).mkdir(name)) if (!quietMode) KMessageBox::sorry(krApp,i18n("Can't create a directory. Check your permissions.")); vfs::vfs_refresh(); } -void normal_vfs::vfs_rename(const QString& fileName,const QString& newName){ +void normal_vfs::vfs_rename(const TQString& fileName,const TQString& newName){ KURL::List fileUrls; KURL url , dest; @@ -236,22 +236,22 @@ void normal_vfs::vfs_rename(const QString& fileName,const QString& newName){ dest.setPath(vfs_workingDir()+"/"+newName); KIO::Job *job = new KIO::CopyJob(fileUrls,dest,KIO::CopyJob::Move,true,false ); - connect(job,SIGNAL(result(KIO::Job*)),this,SLOT(vfs_refresh(KIO::Job*))); + connect(job,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(vfs_refresh(KIO::Job*))); } -vfile* normal_vfs::vfileFromName(const QString& name){ - QString path = vfs_workingDir()+"/"+name; - QCString fileName = path.local8Bit(); +vfile* normal_vfs::vfileFromName(const TQString& name){ + TQString path = vfs_workingDir()+"/"+name; + TQCString fileName = path.local8Bit(); KDE_struct_stat stat_p; KDE_lstat(fileName.data(),&stat_p); KIO::filesize_t size = stat_p.st_size; - QString perm = KRpermHandler::mode2QString(stat_p.st_mode); + TQString perm = KRpermHandler::mode2TQString(stat_p.st_mode); bool symLink= S_ISLNK(stat_p.st_mode); if( S_ISDIR(stat_p.st_mode) ) perm[0] = 'd'; KURL mimeUrl = fromPathOrURL(path); - QString mime=QString::null; + TQString mime=TQString(); char symDest[256]; bzero(symDest,256); @@ -259,8 +259,8 @@ vfile* normal_vfs::vfileFromName(const QString& name){ int endOfName=0; endOfName=readlink(fileName.data(),symDest,256); if ( endOfName != -1 ){ - if ( QDir(QString::fromLocal8Bit( symDest ) ).exists() ) perm[0] = 'd'; - if ( !QDir(vfs_workingDir()).exists( QString::fromLocal8Bit ( symDest ) ) ) mime = "Broken Link !"; + if ( TQDir(TQString::fromLocal8Bit( symDest ) ).exists() ) perm[0] = 'd'; + if ( !TQDir(vfs_workingDir()).exists( TQString::fromLocal8Bit ( symDest ) ) ) mime = "Broken Link !"; } else krOut << "Failed to read link: "<< path<<endl; } @@ -275,16 +275,16 @@ vfile* normal_vfs::vfileFromName(const QString& name){ // create a new virtual file object vfile* temp=new vfile(name,size,perm,stat_p.st_mtime,symLink,stat_p.st_uid, - stat_p.st_gid,mime,QString::fromLocal8Bit( symDest ),stat_p.st_mode, rwx); + stat_p.st_gid,mime,TQString::fromLocal8Bit( symDest ),stat_p.st_mode, rwx); temp->vfile_setUrl( mimeUrl ); return temp; } -void normal_vfs::getACL( vfile *file, QString &acl, QString &defAcl ) +void normal_vfs::getACL( vfile *file, TQString &acl, TQString &defAcl ) { - acl = defAcl = QString::null; + acl = defAcl = TQString(); #if KDE_IS_VERSION(3,5,0) && defined( HAVE_POSIX_ACL ) - QCString fileName = file->vfile_getUrl().path( -1 ).local8Bit(); + TQCString fileName = file->vfile_getUrl().path( -1 ).local8Bit(); #if HAVE_NON_POSIX_ACL_EXTENSIONS if ( acl_extended_file( fileName.data() ) ) { @@ -298,12 +298,12 @@ void normal_vfs::getACL( vfile *file, QString &acl, QString &defAcl ) #endif } -QString normal_vfs::getACL( const QString & path, int type ) +TQString normal_vfs::getACL( const TQString & path, int type ) { #if KDE_IS_VERSION(3,5,0) && defined( HAVE_POSIX_ACL ) acl_t acl = 0; // do we have an acl for the file, and/or a default acl for the dir, if it is one? - if ( ( acl = acl_get_file( path.data(), type ) ) != 0 ) + if ( ( acl = acl_get_file( path.ascii(), type ) ) != 0 ) { bool aclExtended = false; @@ -334,16 +334,16 @@ QString normal_vfs::getACL( const QString & path, int type ) } if( acl == 0 ) - return QString::null; + return TQString(); char *aclString = acl_to_text( acl, 0 ); - QString ret = QString::fromLatin1( aclString ); + TQString ret = TQString::tqfromLatin1( aclString ); acl_free( (void*)aclString ); acl_free( acl ); return ret; #else - return QString::null; + return TQString(); #endif } @@ -352,26 +352,26 @@ void normal_vfs::vfs_slotRefresh() krConfig->setGroup("Advanced"); int maxRefreshFrequency = krConfig->readNumEntry("Max Refresh Frequency", 1000); vfs_refresh(); - disconnect( &refreshTimer, SIGNAL( timeout() ), this, SLOT( vfs_slotRefresh() ) ); + disconnect( &refreshTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( vfs_slotRefresh() ) ); refreshTimer.start( maxRefreshFrequency, true ); } -bool normal_vfs::burstRefresh(const QString& path ){ +bool normal_vfs::burstRefresh(const TQString& path ){ if( path == vfs_getOrigin().path(-1) ) { if( !refreshTimer.isActive() ) { // the directory itself is dirty - full refresh is needed - QTimer::singleShot(0, this, SLOT( vfs_slotRefresh() ) ); // safety: dirty signal comes from KDirWatch! + TQTimer::singleShot(0, this, TQT_SLOT( vfs_slotRefresh() ) ); // safety: dirty signal comes from KDirWatch! return true; } - disconnect( &refreshTimer, SIGNAL( timeout() ), this, SLOT( vfs_slotRefresh() ) ); - connect( &refreshTimer, SIGNAL( timeout() ), this, SLOT( vfs_slotRefresh() ) ); + disconnect( &refreshTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( vfs_slotRefresh() ) ); + connect( &refreshTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( vfs_slotRefresh() ) ); postponedRefreshURL = fromPathOrURL(path); return true; } return false; } -void normal_vfs::vfs_slotDirty(const QString& path){ +void normal_vfs::vfs_slotDirty(const TQString& path){ if( disableRefresh ){ postponedRefreshURL = fromPathOrURL(path); return; @@ -381,7 +381,7 @@ void normal_vfs::vfs_slotDirty(const QString& path){ return; KURL url = fromPathOrURL(path); - QString name = url.fileName(); + TQString name = url.fileName(); // do we have it already ? if( !vfs_search(name ) ) return vfs_slotCreated(path); @@ -393,7 +393,7 @@ void normal_vfs::vfs_slotDirty(const QString& path){ emit updatedVfile(vf); } -void normal_vfs::vfs_slotCreated(const QString& path){ +void normal_vfs::vfs_slotCreated(const TQString& path){ if( disableRefresh ){ postponedRefreshURL = fromPathOrURL(path); return; @@ -404,7 +404,7 @@ void normal_vfs::vfs_slotCreated(const QString& path){ KURL url = fromPathOrURL(path); - QString name = url.fileName(); + TQString name = url.fileName(); // if it's in the CVS - it's an update not new file if( vfs_search(name) ) return vfs_slotDirty(path); @@ -414,7 +414,7 @@ void normal_vfs::vfs_slotCreated(const QString& path){ emit addedVfile(vf); } -void normal_vfs::vfs_slotDeleted(const QString& path){ +void normal_vfs::vfs_slotDeleted(const TQString& path){ if( disableRefresh ){ postponedRefreshURL = fromPathOrURL(path); return; @@ -425,7 +425,7 @@ void normal_vfs::vfs_slotDeleted(const QString& path){ KURL url = fromPathOrURL(path); - QString name = url.fileName(); + TQString name = url.fileName(); // if it's not in the CVS - do nothing if( vfs_search(name) ){ diff --git a/krusader/VFS/normal_vfs.h b/krusader/VFS/normal_vfs.h index 9c7d067..9fd01e1 100644 --- a/krusader/VFS/normal_vfs.h +++ b/krusader/VFS/normal_vfs.h @@ -32,7 +32,7 @@ #define NORMAL_VFS // QT includes -#include <qstring.h> +#include <tqstring.h> // KDE includes #include <kfileitem.h> #include <kdirwatch.h> @@ -46,47 +46,48 @@ */ class normal_vfs : public vfs{ Q_OBJECT + TQ_OBJECT public: // the constructor simply uses the inherited constructor - normal_vfs(QObject* panel); + normal_vfs(TQObject* panel); ~normal_vfs(){if( watcher ) delete watcher;} /// Copy a file to the vfs (physical). - virtual void vfs_addFiles(KURL::List *fileUrls,KIO::CopyJob::CopyMode mode,QObject* toNotify,QString dir = "", PreserveMode pmode = PM_DEFAULT ); + virtual void vfs_addFiles(KURL::List *fileUrls,KIO::CopyJob::CopyMode mode,TQObject* toNotify,TQString dir = "", PreserveMode pmode = PM_DEFAULT ); /// Remove a file from the vfs (physical) - virtual void vfs_delFiles(QStringList *fileNames); + virtual void vfs_delFiles(TQStringList *fileNames); /// Return a list of URLs for multiple files - virtual KURL::List* vfs_getFiles(QStringList* names); + virtual KURL::List* vfs_getFiles(TQStringList* names); /// Return a URL to a single file - virtual KURL vfs_getFile(const QString& name); + virtual KURL vfs_getFile(const TQString& name); /// Create a new directory - virtual void vfs_mkdir(const QString& name); + virtual void vfs_mkdir(const TQString& name); /// Rename file - virtual void vfs_rename(const QString& fileName,const QString& newName); + virtual void vfs_rename(const TQString& fileName,const TQString& newName); /// return the VFS working dir - virtual QString vfs_workingDir() { return vfs_origin.path(-1); } + virtual TQString vfs_workingDir() { return vfs_origin.path(-1); } /// Get ACL permissions - static void getACL( vfile *file, QString &acl, QString &defAcl ); + static void getACL( vfile *file, TQString &acl, TQString &defAcl ); public slots: void vfs_slotRefresh(); - void vfs_slotDirty(const QString& path); - void vfs_slotCreated(const QString& path); - void vfs_slotDeleted(const QString& path); + void vfs_slotDirty(const TQString& path); + void vfs_slotCreated(const TQString& path); + void vfs_slotDeleted(const TQString& path); protected: /// Re-reads files and stats and fills the vfile list virtual bool populateVfsList(const KURL& origin, bool showHidden); - QTimer refreshTimer; //< Timer to exclude sudden refreshes + TQTimer refreshTimer; //< Timer to exclude sudden refreshes KDirWatch *watcher; //< The internal dir watcher - use to detect changes in directories - vfile* vfileFromName(const QString& name); + vfile* vfileFromName(const TQString& name); private: - bool burstRefresh( const QString &path ); - static QString getACL( const QString & path, int type ); + bool burstRefresh( const TQString &path ); + static TQString getACL( const TQString & path, int type ); }; #endif diff --git a/krusader/VFS/preservingcopyjob.cpp b/krusader/VFS/preservingcopyjob.cpp index bd6d6cf..23d62e1 100644 --- a/krusader/VFS/preservingcopyjob.cpp +++ b/krusader/VFS/preservingcopyjob.cpp @@ -36,7 +36,7 @@ #include <kio/job.h> #include <kio/jobclasses.h> #include <kfileitem.h> -#include <qfile.h> +#include <tqfile.h> #include <pwd.h> #include <grp.h> @@ -54,23 +54,23 @@ Attributes::Attributes() uid = (uid_t)-1; gid = (gid_t)-1; mode = (mode_t)-1; - acl = QString::null; + acl = TQString(); } -Attributes::Attributes( time_t tIn, uid_t uIn, gid_t gIn, mode_t modeIn, const QString & aclIn ) +Attributes::Attributes( time_t tIn, uid_t uIn, gid_t gIn, mode_t modeIn, const TQString & aclIn ) { time = tIn, uid = uIn, gid = gIn, mode = modeIn, acl = aclIn; } -Attributes::Attributes( time_t tIn, QString user, QString group, mode_t modeIn, const QString & aclIn ) +Attributes::Attributes( time_t tIn, TQString user, TQString group, mode_t modeIn, const TQString & aclIn ) { time = tIn; uid = (uid_t)-1; - struct passwd* pw = getpwnam(QFile::encodeName( user )); + struct passwd* pw = getpwnam(TQFile::encodeName( user )); if ( pw != 0L ) uid = pw->pw_uid; gid = (gid_t)-1; - struct group* g = getgrnam(QFile::encodeName( group )); + struct group* g = getgrnam(TQFile::encodeName( group )); if ( g != 0L ) gid = g->gr_gid; mode = modeIn; @@ -82,24 +82,24 @@ PreservingCopyJob::PreservingCopyJob( const KURL::List& src, const KURL& dest, C { if( dest.isLocalFile() ) { - connect( this, SIGNAL( aboutToCreate (KIO::Job *, const QValueList< KIO::CopyInfo > &) ), - this, SLOT( slotAboutToCreate (KIO::Job *, const QValueList< KIO::CopyInfo > &) ) ); - connect( this, SIGNAL( copyingDone( KIO::Job *, const KURL &, const KURL &, bool, bool) ), - this, SLOT( slotCopyingDone( KIO::Job *, const KURL &, const KURL &, bool, bool) ) ); - connect( this, SIGNAL( result( KIO::Job * ) ), - this, SLOT( slotFinished() ) ); + connect( this, TQT_SIGNAL( aboutToCreate (KIO::Job *, const TQValueList< KIO::CopyInfo > &) ), + this, TQT_SLOT( slotAboutToCreate (KIO::Job *, const TQValueList< KIO::CopyInfo > &) ) ); + connect( this, TQT_SIGNAL( copyingDone( KIO::Job *, const KURL &, const KURL &, bool, bool) ), + this, TQT_SLOT( slotCopyingDone( KIO::Job *, const KURL &, const KURL &, bool, bool) ) ); + connect( this, TQT_SIGNAL( result( KIO::Job * ) ), + this, TQT_SLOT( slotFinished() ) ); } } -void PreservingCopyJob::slotAboutToCreate( KIO::Job */*job*/, const QValueList< KIO::CopyInfo > &files ) +void PreservingCopyJob::slotAboutToCreate( KIO::Job */*job*/, const TQValueList< KIO::CopyInfo > &files ) { - for ( QValueList< KIO::CopyInfo >::ConstIterator it = files.begin(); it != files.end(); ++it ) { + for ( TQValueList< KIO::CopyInfo >::ConstIterator it = files.begin(); it != files.end(); ++it ) { if( (*it).uSource.isLocalFile() ) { KDE_struct_stat stat_p; KDE_lstat( (*it).uSource.path(-1).local8Bit(),&stat_p); /* getting the date information */ - QString aclStr; + TQString aclStr; #if KDE_IS_VERSION(3,5,0) && defined( HAVE_POSIX_ACL ) acl_t acl = acl_get_file( (*it).uSource.path(-1).local8Bit(), ACL_TYPE_ACCESS ); @@ -134,7 +134,7 @@ void PreservingCopyJob::slotAboutToCreate( KIO::Job */*job*/, const QValueList< if( acl ) { char *aclString = acl_to_text( acl, 0 ); - aclStr = QString::fromLatin1( aclString ); + aclStr = TQString::tqfromLatin1( aclString ); acl_free( (void*)aclString ); acl_free( acl ); } @@ -164,7 +164,7 @@ void PreservingCopyJob::slotResult( Job *job ) { #if KDE_IS_VERSION(3,5,0) && defined( HAVE_POSIX_ACL ) fileAttributes[ url ] = Attributes( kfi.time( KIO::UDS_MODIFICATION_TIME ), kfi.user(), kfi.group(), kfi.mode(), kfi.ACL().asString() ); #else - fileAttributes[ url ] = Attributes( kfi.time( KIO::UDS_MODIFICATION_TIME ), kfi.user(), kfi.group(), kfi.mode(), QString::null ); + fileAttributes[ url ] = Attributes( kfi.time( KIO::UDS_MODIFICATION_TIME ), kfi.user(), kfi.group(), kfi.mode(), TQString() ); #endif } } @@ -173,10 +173,10 @@ void PreservingCopyJob::slotResult( Job *job ) { for( unsigned j=0; j != subjobs.count(); j++ ) { if( subjobs.at( j )->inherits( "KIO::ListJob" ) ) { - disconnect( subjobs.at( j ), SIGNAL( entries (KIO::Job *, const KIO::UDSEntryList &) ), - this, SLOT( slotListEntries (KIO::Job *, const KIO::UDSEntryList &) ) ); - connect( subjobs.at( j ), SIGNAL( entries (KIO::Job *, const KIO::UDSEntryList &) ), - this, SLOT( slotListEntries (KIO::Job *, const KIO::UDSEntryList &) ) ); + disconnect( subjobs.at( j ), TQT_SIGNAL( entries (KIO::Job *, const KIO::UDSEntryList &) ), + this, TQT_SLOT( slotListEntries (KIO::Job *, const KIO::UDSEntryList &) ) ); + connect( subjobs.at( j ), TQT_SIGNAL( entries (KIO::Job *, const KIO::UDSEntryList &) ), + this, TQT_SLOT( slotListEntries (KIO::Job *, const KIO::UDSEntryList &) ) ); } } } @@ -186,10 +186,10 @@ void PreservingCopyJob::slotListEntries(KIO::Job *job, const KIO::UDSEntryList & KIO::UDSEntryListConstIterator end = list.end(); for (; it != end; ++it) { KURL url = ((KIO::SimpleJob *)job)->url(); - QString relName, user, group; + TQString relName, user, group; time_t mtime = (time_t)-1; mode_t mode = 0755; - QString acl; + TQString acl; KIO::UDSEntry::ConstIterator it2 = (*it).begin(); for( ; it2 != (*it).end(); it2++ ) { @@ -230,9 +230,9 @@ void PreservingCopyJob::slotCopyingDone( KIO::Job *, const KURL &from, const KUR { if( postpone ) { // the directories are stamped at the last step, so if it's a directory, we postpone unsigned i=0; - QString path = to.path( -1 ); + TQString path = to.path( -1 ); - for( ; i != directoriesToStamp.count(); i++ ) // sort the URL-s to avoid parent time stamp modification + for( ; i != directoriesToStamp.count(); i++ ) // sort the URL-s to avoid tqparent time stamp modification if( path >= directoriesToStamp[ i ].path( -1 ) ) break; @@ -301,7 +301,7 @@ KIO::CopyJob * PreservingCopyJob::createCopyJob( PreserveMode pmode, const KURL: return new PreservingCopyJob( src, dest, mode, asMethod, showProgressInfo ); case PM_DEFAULT: { - QString group = krConfig->group(); + TQString group = krConfig->group(); krConfig->setGroup( "Advanced" ); bool preserve = krConfig->readBoolEntry( "PreserveAttributes", _PreserveAttributes ); krConfig->setGroup( group ); diff --git a/krusader/VFS/preservingcopyjob.h b/krusader/VFS/preservingcopyjob.h index 0e48959..9e43131 100644 --- a/krusader/VFS/preservingcopyjob.h +++ b/krusader/VFS/preservingcopyjob.h @@ -34,8 +34,8 @@ #include "config.h" #include <time.h> #include <kio/jobclasses.h> -#include <qmap.h> -#include <qvaluelist.h> +#include <tqmap.h> +#include <tqvaluelist.h> typedef enum { PM_NONE = 0, @@ -47,19 +47,20 @@ typedef enum { class Attributes { public: Attributes(); - Attributes( time_t tIn, uid_t uIn, gid_t gIn, mode_t modeIn, const QString & aclIn ); - Attributes( time_t tIn, QString user, QString group, mode_t modeIn, const QString & aclIn ); + Attributes( time_t tIn, uid_t uIn, gid_t gIn, mode_t modeIn, const TQString & aclIn ); + Attributes( time_t tIn, TQString user, TQString group, mode_t modeIn, const TQString & aclIn ); time_t time; uid_t uid; gid_t gid; mode_t mode; - QString acl; + TQString acl; }; class PreservingCopyJob : public KIO::CopyJob { Q_OBJECT + TQ_OBJECT public: @@ -68,17 +69,17 @@ public: static KIO::CopyJob *createCopyJob( PreserveMode pmode, const KURL::List& src, const KURL& dest, CopyMode mode, bool asMethod, bool showProgressInfo ); public slots: - void slotAboutToCreate (KIO::Job *, const QValueList< KIO::CopyInfo > &); + void slotAboutToCreate (KIO::Job *, const TQValueList< KIO::CopyInfo > &); void slotCopyingDone( KIO::Job *, const KURL &, const KURL &, bool, bool); void slotFinished(); virtual void slotResult( Job *job ); void slotListEntries(KIO::Job *job, const KIO::UDSEntryList &list); private: - QMap<KURL, Attributes> fileAttributes; - QMap<KIO::Job *, KURL> pendingJobs; - QValueList<KURL> directoriesToStamp; - QValueList<KURL> originalDirectories; + TQMap<KURL, Attributes> fileAttributes; + TQMap<KIO::Job *, KURL> pendingJobs; + TQValueList<KURL> directoriesToStamp; + TQValueList<KURL> originalDirectories; }; #endif /* __PRESERVING_COPY_JOB_H__ */ diff --git a/krusader/VFS/temp_vfs.cpp b/krusader/VFS/temp_vfs.cpp index 12a5dad..e7130e0 100644 --- a/krusader/VFS/temp_vfs.cpp +++ b/krusader/VFS/temp_vfs.cpp @@ -27,8 +27,8 @@ * (at your option) any later version. * * * ***************************************************************************/ -// Qt includes -#include <qdir.h> +// TQt includes +#include <tqdir.h> // KDE includes #include <kmessagebox.h> #include <kprocess.h> @@ -40,8 +40,8 @@ #include "../resources.h" #include "../krservices.h" -temp_vfs::temp_vfs( QString origin, QString type, QWidget* panel, bool ): - normal_vfs(panel){ +temp_vfs::temp_vfs( TQString origin, TQString type, TQWidget* panel, bool ): + normal_vfs(TQT_TQOBJECT(panel)){ vfs_type=TEMP; // first we need to create a temp diretory tmpDir = krApp->getTempDir(); @@ -69,12 +69,12 @@ temp_vfs::~temp_vfs(){ } // return the working dir -QString temp_vfs::vfs_workingDir(){ +TQString temp_vfs::vfs_workingDir(){ // get the path inside the archive - QString path = vfs_origin.path(-1); - path = path.mid(path.findRev('\\')+1); + TQString path = vfs_origin.path(-1); + path = path.mid(path.tqfindRev('\\')+1); if(path.left(1) != "/") path = "/"+path; - QDir().mkdir(tmpDir+path); + TQDir().mkdir(tmpDir+path); return tmpDir+path; } @@ -83,7 +83,7 @@ bool temp_vfs::vfs_refresh(const KURL& origin){ vfs_origin = origin; vfs_origin.adjustPath(-1); // get the directory... - QString path = origin.path(-1).mid(origin.path(-1).findRev('\\')+1); + TQString path = origin.path(-1).mid(origin.path(-1).tqfindRev('\\')+1); if(path.left(1) =="/") path.remove(0,1); if ( !normal_vfs::vfs_refresh(tmpDir+"/"+path) ){ vfs_origin = backup; @@ -93,18 +93,18 @@ bool temp_vfs::vfs_refresh(const KURL& origin){ return true; } -void temp_vfs::handleAceArj(QString origin, QString type){ +void temp_vfs::handleAceArj(TQString origin, TQString type){ // for ace and arj we just unpack to the tmpDir if( !KRarcHandler::arcHandled(type) ){ if (!quietMode) KMessageBox::error(krApp,"This archive type is NOT supported"); return; } - else if( !KRarcHandler::unpack(origin,type, QString::null, tmpDir) ){ + else if( !KRarcHandler::unpack(origin,type, TQString(), tmpDir) ){ return; } } -void temp_vfs::handleRpm(QString origin){ +void temp_vfs::handleRpm(TQString origin){ // then extract the cpio archive from the rpm KShellProcess rpm; rpm << "rpm2cpio"<<"\""+origin+"\""+" > "+tmpDir+"/contents.cpio"; @@ -119,7 +119,7 @@ void temp_vfs::handleRpm(QString origin){ rpm.start(KProcess::Block); } -void temp_vfs::handleIso(QString origin){ +void temp_vfs::handleIso(TQString origin){ // mount the ISO image KShellProcess mount; mount << KrServices::fullPathName( "mount" ) << "-o loop" << origin << tmpDir; diff --git a/krusader/VFS/temp_vfs.h b/krusader/VFS/temp_vfs.h index f55eb23..3b94248 100644 --- a/krusader/VFS/temp_vfs.h +++ b/krusader/VFS/temp_vfs.h @@ -37,9 +37,9 @@ class temp_vfs : public normal_vfs { public: - temp_vfs( QString origin, QString type, QWidget* panel, bool writeable); + temp_vfs( TQString origin, TQString type, TQWidget* panel, bool writeable); ~temp_vfs(); - QString vfs_workingDir(); + TQString vfs_workingDir(); bool vfs_isWritable() { return false; } // temp vfs is not writable ! public slots: @@ -47,10 +47,10 @@ public slots: bool vfs_refresh(const KURL& origin); protected: - void handleAceArj(QString origin, QString type); - void handleRpm(QString origin); - void handleIso(QString origin); - QString tmpDir; + void handleAceArj(TQString origin, TQString type); + void handleRpm(TQString origin); + void handleIso(TQString origin); + TQString tmpDir; }; diff --git a/krusader/VFS/vfile.cpp b/krusader/VFS/vfile.cpp index a3e8c6b..3ca3e0f 100644 --- a/krusader/VFS/vfile.cpp +++ b/krusader/VFS/vfile.cpp @@ -33,8 +33,8 @@ #include <grp.h> #include <sys/types.h> #include <sys/stat.h> -// Qt includes -#include <qdatetime.h> +// TQt includes +#include <tqdatetime.h> // KDE includes #include <kmimetype.h> #include <kdeversion.h> @@ -45,25 +45,25 @@ #include <kdebug.h> -vfile::vfile(const QString& name, // useful construtor +vfile::vfile(const TQString& name, // useful construtor const KIO::filesize_t size, - const QString& perm, + const TQString& perm, const time_t mtime, const bool symLink, const uid_t owner, const gid_t group, - const QString& mime, - const QString& symDest, + const TQString& mime, + const TQString& symDest, const mode_t mode, const int rwx) { vfile_name=name; vfile_size=size; - vfile_owner=QString::null; + vfile_owner=TQString(); vfile_ownerId=owner; - vfile_group=QString::null; + vfile_group=TQString(); vfile_groupId=group; - vfile_userName=QString::null; + vfile_userName=TQString(); vfile_perm=perm; vfile_time_t=mtime; vfile_symLink=symLink; @@ -77,20 +77,20 @@ vfile::vfile(const QString& name, // useful construtor vfile_acl_loaded = false; } -vfile::vfile(const QString& name, // useful construtor +vfile::vfile(const TQString& name, // useful construtor const KIO::filesize_t size, - const QString& perm, + const TQString& perm, const time_t mtime, const bool symLink, - const QString& owner, - const QString& group, - const QString& userName, - const QString& mime, - const QString& symDest, + const TQString& owner, + const TQString& group, + const TQString& userName, + const TQString& mime, + const TQString& symDest, const mode_t mode, const int rwx, - const QString& aclString, - const QString& aclDfltString ){ + const TQString& aclString, + const TQString& aclDfltString ){ vfile_name=name; vfile_size=size; vfile_owner=owner; @@ -146,33 +146,33 @@ char vfile::vfile_isExecutable() const { return KRpermHandler::ftpExecutable(vfile_owner, vfile_userName, vfile_perm); } -const QString& vfile::vfile_getMime(bool fast){ - if( vfile_mimeType == QString::null ){ // mimetype == "" is OK so don't check mimetype.empty() ! +const TQString& vfile::vfile_getMime(bool fast){ + if( vfile_mimeType == TQString() ){ // mimetype == "" is OK so don't check mimetype.empty() ! vfile_mimeType = KMimeType::findByURL( vfile_getUrl(),vfile_getMode(),vfile_getUrl().isLocalFile(),fast)->name(); - if( vfile_mimeType.contains("directory") ) vfile_perm[0] = 'd', vfile_isdir = true; + if( vfile_mimeType.tqcontains("directory") ) vfile_perm[0] = 'd', vfile_isdir = true; } return vfile_mimeType; } -const QString& vfile::vfile_getOwner(){ +const TQString& vfile::vfile_getOwner(){ if( vfile_owner.isEmpty() ) vfile_owner=KRpermHandler::uid2user(vfile_getUid()); return vfile_owner; } -const QString& vfile::vfile_getGroup(){ +const TQString& vfile::vfile_getGroup(){ if( vfile_group.isEmpty() ) vfile_group=KRpermHandler::gid2group(vfile_getGid()); return vfile_group; } -const QString& vfile::vfile_getACL(){ +const TQString& vfile::vfile_getACL(){ if( !vfile_acl_loaded ) vfile_loadACL(); return vfile_acl; } -const QString& vfile::vfile_getDefaultACL(){ +const TQString& vfile::vfile_getDefaultACL(){ if( !vfile_acl_loaded ) vfile_loadACL(); return vfile_def_acl; diff --git a/krusader/VFS/vfile.h b/krusader/VFS/vfile.h index 61aa9bc..d2aa284 100644 --- a/krusader/VFS/vfile.h +++ b/krusader/VFS/vfile.h @@ -30,8 +30,8 @@ #define VFILE_H // QT includes -#include <qstring.h> -#include <qobject.h> +#include <tqstring.h> +#include <tqobject.h> // System includes #include <sys/types.h> // KDE includes @@ -46,8 +46,9 @@ * contains the nessecery details about a file and member functions which * allow the object to give out the needed details about the file. */ -class vfile : public QObject{ +class vfile : public TQObject{ Q_OBJECT + TQ_OBJECT public: vfile(){} @@ -56,55 +57,55 @@ public: * Use this constructor when you know the following files properties: \n * file name, file size, file permissions,is the file a link,owner uid & group uid. */ - vfile(const QString& name, + vfile(const TQString& name, const KIO::filesize_t size, - const QString& perm, + const TQString& perm, const time_t mtime, const bool symLink, const uid_t owner, const gid_t group, - const QString& mime, - const QString& symDest, + const TQString& mime, + const TQString& symDest, const mode_t mode, const int rwx = -1 ); - vfile(const QString& name, + vfile(const TQString& name, const KIO::filesize_t size, - const QString& perm, + const TQString& perm, const time_t mtime, const bool symLink, - const QString& owner, - const QString& group, - const QString& userName, - const QString& mime, - const QString& symDest, + const TQString& owner, + const TQString& group, + const TQString& userName, + const TQString& mime, + const TQString& symDest, const mode_t mode, const int rwx = -1, - const QString& aclString = QString::null, - const QString& aclDfltString = QString::null ); + const TQString& aclString = TQString(), + const TQString& aclDfltString = TQString() ); bool operator==(const vfile& vf) const; vfile& operator= (const vfile& vf); inline bool operator!=(const vfile& vf){ return !((*this)==vf); } // following functions give-out file details - inline const QString& vfile_getName() const { return vfile_name; } + inline const TQString& vfile_getName() const { return vfile_name; } inline KIO::filesize_t vfile_getSize() const { return vfile_size; } - inline const QString& vfile_getPerm() const { return vfile_perm; } + inline const TQString& vfile_getPerm() const { return vfile_perm; } inline bool vfile_isDir() const { return vfile_isdir; } inline bool vfile_isSymLink() const { return vfile_symLink; } - inline const QString& vfile_getSymDest() const { return vfile_symDest; } + inline const TQString& vfile_getSymDest() const { return vfile_symDest; } inline mode_t vfile_getMode() const { return vfile_mode; } inline uid_t vfile_getUid() const { return vfile_ownerId; } inline gid_t vfile_getGid() const { return vfile_groupId; } inline time_t vfile_getTime_t() const { return vfile_time_t; } inline const KURL& vfile_getUrl() const { return vfile_url; } - const QString& vfile_getMime(bool fast=false); - const QString& vfile_getOwner(); - const QString& vfile_getGroup(); - const QString& vfile_getACL(); - const QString& vfile_getDefaultACL(); + const TQString& vfile_getMime(bool fast=false); + const TQString& vfile_getOwner(); + const TQString& vfile_getGroup(); + const TQString& vfile_getACL(); + const TQString& vfile_getDefaultACL(); const KIO::UDSEntry vfile_getEntry(); //< return the UDSEntry from the vfile char vfile_isReadable() const; char vfile_isWriteable() const; @@ -117,8 +118,8 @@ public: inline void vfile_setSize(KIO::filesize_t size) {vfile_size = size;} inline void vfile_setUrl(const KURL& url) {vfile_url = url; } - inline void vfile_setIcon(const QString& icn) {vfile_icon = icn; } - inline QString vfile_getIcon(); + inline void vfile_setIcon(const TQString& icn) {vfile_icon = icn; } + inline TQString vfile_getIcon(); virtual ~vfile(){} @@ -127,37 +128,37 @@ private: protected: // the file information list - QString vfile_name; //< file name + TQString vfile_name; //< file name KIO::filesize_t vfile_size; //< file size mode_t vfile_mode; //< file mode uid_t vfile_ownerId; //< file owner id gid_t vfile_groupId; //< file group id - QString vfile_owner; //< file owner name - QString vfile_group; //< file group name - QString vfile_userName; //< the current username - QString vfile_perm; //< file permissions string + TQString vfile_owner; //< file owner name + TQString vfile_group; //< file group name + TQString vfile_userName; //< the current username + TQString vfile_perm; //< file permissions string time_t vfile_time_t; //< file modification in time_t format bool vfile_symLink; //< true if the file is a symlink - QString vfile_mimeType; //< file mimetype - QString vfile_symDest; //< if it's a sym link - its detination + TQString vfile_mimeType; //< file mimetype + TQString vfile_symDest; //< if it's a sym link - its detination KURL vfile_url; //< file URL - empty by default - QString vfile_icon; //< the name of the icon file + TQString vfile_icon; //< the name of the icon file bool vfile_isdir; //< flag, if it's a directory int vfile_rwx; //< flag, showing read, write, execute properties bool vfile_acl_loaded;//<flag, indicates that ACL permissions already loaded bool vfile_has_acl; //< flag, indicates ACL permissions - QString vfile_acl; //< ACL permission string - QString vfile_def_acl; //< ACL default string + TQString vfile_acl; //< ACL permission string + TQString vfile_def_acl; //< ACL default string }; -QString vfile::vfile_getIcon(){ +TQString vfile::vfile_getIcon(){ if( vfile_icon.isEmpty() ){ - QString mime = this->vfile_getMime(); + TQString mime = this->vfile_getMime(); if ( mime == "Broken Link !" ) vfile_icon = "file_broken"; else { - vfile_icon = KMimeType::mimeType( mime ) ->icon( QString::null, true ); + vfile_icon = KMimeType::mimeType( mime ) ->icon( TQString(), true ); } } return vfile_icon; diff --git a/krusader/VFS/vfs.cpp b/krusader/VFS/vfs.cpp index 54efe7e..db49f0b 100644 --- a/krusader/VFS/vfs.cpp +++ b/krusader/VFS/vfs.cpp @@ -33,24 +33,24 @@ #include <unistd.h> #include <time.h> -#include <qeventloop.h> +#include <tqeventloop.h> #include <kapplication.h> #include <klargefile.h> -#include <qdir.h> +#include <tqdir.h> #include "vfs.h" #include "../krusader.h" #include "../defaults.h" -vfs::vfs(QObject* panel, bool quiet): vfs_busy(false), quietMode(quiet),disableRefresh(false),postponedRefreshURL(), - invalidated(true),panelConnected(false),vfs_tempFilesP(0),vfileIterator(0),deletePossible( true ), +vfs::vfs(TQObject* panel, bool quiet): vfs_busy(false), quietMode(quiet),disableRefresh(false),postponedRefreshURL(), + tqinvalidated(true),panelConnected(false),vfs_tempFilesP(0),vfileIterator(0),deletePossible( true ), deleteRequested( false ) { setVfsFilesP( new vfileDict() ); if ( panel ){ panelConnected = true; - connect(this,SIGNAL(startUpdate()),panel,SLOT(slotStartUpdate())); - connect(this,SIGNAL(incrementalRefreshFinished( const KURL& )),panel,SLOT(slotGetStats( const KURL& ))); + connect(this,TQT_SIGNAL(startUpdate()),panel,TQT_SLOT(slotStartUpdate())); + connect(this,TQT_SIGNAL(incrementalRefreshFinished( const KURL& )),panel,TQT_SLOT(slotGetStats( const KURL& ))); } else quietMode = true; } @@ -82,28 +82,28 @@ bool vfs::vfs_refresh(KIO::Job* job){ return vfs_refresh(vfs_origin); } -KURL vfs::fromPathOrURL( const QString &originIn ) +KURL vfs::fromPathOrURL( const TQString &originIn ) { - QString password, loginName, origin = originIn; + TQString password, loginName, origin = originIn; bool bugfix = false; - if ( originIn.contains( ":/" ) && !originIn.startsWith( "/" ) ) + if ( originIn.tqcontains( ":/" ) && !originIn.startsWith( "/" ) ) { // breakdown the url; /* FIXME: untill KDE fixes the bug we have to check for passwords and users with @ in them... */ - bugfix = origin.find("@") != origin.findRev("@"); + bugfix = origin.tqfind("@") != origin.tqfindRev("@"); if(bugfix){ - if(origin.find(":") != origin.findRev(":", origin.findRev("@") )){ - int passStart = origin.find( ":",origin.find(":")+1 )+1; - int passLen = origin.findRev("@")-passStart; + if(origin.tqfind(":") != origin.tqfindRev(":", origin.tqfindRev("@") )){ + int passStart = origin.tqfind( ":",origin.tqfind(":")+1 )+1; + int passLen = origin.tqfindRev("@")-passStart; password = origin.mid(passStart,passLen); origin = origin.remove(passStart-1,passLen+1); } - if(origin.find("@") != origin.findRev("@")){ - int usrStart = origin.find( "/" )+1; + if(origin.tqfind("@") != origin.tqfindRev("@")){ + int usrStart = origin.tqfind( "/" )+1; if(origin.at(usrStart) == '/') ++usrStart; - int usrLen = origin.findRev("@")-usrStart; + int usrLen = origin.tqfindRev("@")-usrStart; loginName = origin.mid(usrStart,usrLen); origin = origin.remove(usrStart,usrLen+1); } @@ -120,7 +120,7 @@ KURL vfs::fromPathOrURL( const QString &originIn ) return url; } -QString vfs::pathOrURL( const KURL &originIn, int trailingSlash ) +TQString vfs::pathOrURL( const KURL &originIn, int trailingSlash ) { if( originIn.isLocalFile() ) return originIn.path( trailingSlash ); @@ -133,14 +133,14 @@ void vfs::setVfsFilesP(vfileDict* dict){ vfs_tempFilesP->setAutoDelete( true ); dict->setAutoDelete(true); if( vfileIterator ) delete vfileIterator; - vfileIterator = new QDictIterator<vfile>(*dict); + vfileIterator = new TQDictIterator<vfile>(*dict); } bool vfs::vfs_refresh(){ if( vfs_busy ) return false; - if( invalidated ) // invalidated fs requires total refresh + if( tqinvalidated ) // tqinvalidated fs requires total refresh return vfs_refresh( vfs_getOrigin() ); if( disableRefresh ) @@ -157,7 +157,7 @@ bool vfs::vfs_refresh(){ bool showHidden = krConfig->readBoolEntry("Show Hidden",_ShowHidden); bool res = populateVfsList(vfs_getOrigin(),showHidden); - QString name; + TQString name; if( res ){ // check if the maximum incremental refresh number is achieved int diff = vfs_filesP->count() - vfs_tempFilesP->count(); @@ -196,7 +196,7 @@ bool vfs::vfs_refresh(){ vfs_tempFilesP->remove(name); } // everything thats left is a new file - QDictIterator<vfile> it(*vfs_tempFilesP); + TQDictIterator<vfile> it(*vfs_tempFilesP); for(vfile* vf=it.toFirst(); vf; vf=(++it)){ // sanity checking if( !vf || (*vfs_filesP)[vf->vfile_getName()] ) continue; @@ -227,7 +227,7 @@ bool vfs::vfs_refresh(const KURL& origin){ return true; } - if( !invalidated && origin.equals(vfs_getOrigin(),true) ) return vfs_refresh(); + if( !tqinvalidated && origin.equals(vfs_getOrigin(),true) ) return vfs_refresh(); vfs_busy = true; @@ -249,7 +249,7 @@ bool vfs::vfs_refresh(const KURL& origin){ emit startUpdate(); - invalidated = false; + tqinvalidated = false; return true; } @@ -271,7 +271,7 @@ bool vfs::vfs_processEvents() { if( deleteRequested ) return false; deletePossible = false; - qApp->eventLoop() ->processEvents( QEventLoop::AllEvents | QEventLoop::WaitForMore ); + tqApp->eventLoop() ->processEvents( TQEventLoop::AllEvents | TQEventLoop::WaitForMore ); deletePossible = true; if( deleteRequested ) { emit deleteAllowed(); @@ -299,7 +299,7 @@ void vfs::slotKdsResult( KIO::Job* job){ *kds_busy = true; } -void vfs::vfs_calcSpace( QString name , KIO::filesize_t* totalSize, unsigned long* totalFiles, unsigned long* totalDirs, bool* stop ) { +void vfs::vfs_calcSpace( TQString name , KIO::filesize_t* totalSize, unsigned long* totalFiles, unsigned long* totalDirs, bool* stop ) { calculateURLSize( vfs_getFile( name ), totalSize, totalFiles, totalDirs, stop ); } @@ -316,7 +316,7 @@ void vfs::calculateURLSize( KURL url, KIO::filesize_t* totalSize, unsigned long } else { stat_busy = true; KIO::StatJob* statJob = KIO::stat( url, false ); - connect( statJob, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotStatResultArrived( KIO::Job* ) ) ); + connect( statJob, TQT_SIGNAL( result( KIO::Job* ) ), this, TQT_SLOT( slotStatResultArrived( KIO::Job* ) ) ); while ( !(*stop) && stat_busy ) {usleep(1000);} if( entry.isEmpty() ) return; // statJob failed KFileItem kfi(entry, url, true ); @@ -328,19 +328,19 @@ void vfs::calculateURLSize( KURL url, KIO::filesize_t* totalSize, unsigned long } KDirSize* kds = KDirSize::dirSizeJob( url ); - connect( kds, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotKdsResult( KIO::Job* ) ) ); + connect( kds, TQT_SIGNAL( result( KIO::Job* ) ), this, TQT_SLOT( slotKdsResult( KIO::Job* ) ) ); while ( !(*stop) ){ // we are in a sepetate thread - so sleeping is OK usleep(1000); } } -void vfs::vfs_calcSpaceLocal(QString name ,KIO::filesize_t *totalSize,unsigned long *totalFiles,unsigned long *totalDirs, bool* stop){ +void vfs::vfs_calcSpaceLocal(TQString name ,KIO::filesize_t *totalSize,unsigned long *totalFiles,unsigned long *totalDirs, bool* stop){ if ( *stop ) return; - if (!name.contains("/")) name = vfs_workingDir()+"/"+name; + if (!name.tqcontains("/")) name = vfs_workingDir()+"/"+name; if (name == "/proc") return; - KDE_struct_stat stat_p; // KDE lstat is necessary as QFileInfo and KFileItem + KDE_struct_stat stat_p; // KDE lstat is necessary as TQFileInfo and KFileItem KDE_lstat(name.local8Bit(),&stat_p); // reports wrong size for a symbolic link if( S_ISLNK(stat_p.st_mode) || !S_ISDIR(stat_p.st_mode) ) { // single files are easy : ) @@ -353,16 +353,16 @@ void vfs::vfs_calcSpaceLocal(QString name ,KIO::filesize_t *totalSize,unsigned l if( !readable ) return; - QDir dir(name); + TQDir dir(name); if ( !dir.exists() ) return; ++(*totalDirs); - dir.setFilter(QDir::All | QDir::System | QDir::Hidden); - dir.setSorting(QDir::Name | QDir::DirsFirst); + dir.setFilter(TQDir::All | TQDir::System | TQDir::Hidden); + dir.setSorting(TQDir::Name | TQDir::DirsFirst); // recurse on all the files in the directory - QFileInfoList* fileList = const_cast<QFileInfoList*>(dir.entryInfoList()); - for (QFileInfo* qfiP = fileList->first(); qfiP != 0; qfiP = fileList->next()){ + TQFileInfoList* fileList = const_cast<TQFileInfoList*>(dir.entryInfoList()); + for (TQFileInfo* qfiP = fileList->first(); qfiP != 0; qfiP = fileList->next()){ if ( *stop ) return; if (qfiP->fileName() != "." && qfiP->fileName() != "..") vfs_calcSpaceLocal(name+"/"+qfiP->fileName(),totalSize,totalFiles,totalDirs,stop); @@ -379,11 +379,11 @@ void vfs::slotStatResultArrived( KIO::Job* job ) { #else void vfs::slotKdsResult(KIO::Job *job){/* empty */} -void vfs::vfs_calcSpace( QString /*name*/ , KIO::filesize_t* /*totalSize*/, unsigned long* /*totalFiles*/, unsigned long* /*totalDirs*/, bool* /*stop*/ ) {/* empty*/} +void vfs::vfs_calcSpace( TQString /*name*/ , KIO::filesize_t* /*totalSize*/, unsigned long* /*totalFiles*/, unsigned long* /*totalDirs*/, bool* /*stop*/ ) {/* empty*/} #endif -QValueList<vfile*> vfs::vfs_search(const KRQuery& filter) { - QValueList<vfile*> result; +TQValueList<vfile*> vfs::vfs_search(const KRQuery& filter) { + TQValueList<vfile*> result; for ( vfile *vf = vfs_getFirstFile(); vf != 0 ; vf = vfs_getNextFile() ) if (filter.match(vf)) result.append(vf); diff --git a/krusader/VFS/vfs.h b/krusader/VFS/vfs.h index a20645d..bc5dcf1 100644 --- a/krusader/VFS/vfs.h +++ b/krusader/VFS/vfs.h @@ -31,10 +31,10 @@ #define VFS_H // QT includes -#include <qstring.h> -#include <qvaluelist.h> -#include <qobject.h> -#include <qdict.h> +#include <tqstring.h> +#include <tqvaluelist.h> +#include <tqobject.h> +#include <tqdict.h> // KDE includes #include <kurl.h> #include <kio/jobclasses.h> @@ -48,10 +48,11 @@ * nothing. other VFSs like the normal_vfs inherits from this class and * make it possible to use a consistent API for all types of VFSs. */ -class vfs: public QObject{ +class vfs: public TQObject{ Q_OBJECT + TQ_OBJECT public: - typedef QDict<vfile> vfileDict; + typedef TQDict<vfile> vfileDict; enum VFS_TYPE{ERROR=0,NORMAL,FTP,TEMP,VIRT}; /** @@ -59,34 +60,34 @@ public: * @param panel the panel father. the VFS will connect it's signals to this object. * @param quiet if true, the VFS will not display error messages */ - vfs(QObject* panel, bool quiet=false); + vfs(TQObject* panel, bool quiet=false); virtual ~vfs(); /// Copy a file to the vfs (physical). - virtual void vfs_addFiles(KURL::List *fileUrls,KIO::CopyJob::CopyMode mode,QObject* toNotify,QString dir = "", PreserveMode pmode = PM_DEFAULT)=0; + virtual void vfs_addFiles(KURL::List *fileUrls,KIO::CopyJob::CopyMode mode,TQObject* toNotify,TQString dir = "", PreserveMode pmode = PM_DEFAULT)=0; /// Remove a file from the vfs (physical) - virtual void vfs_delFiles(QStringList *fileNames)=0; + virtual void vfs_delFiles(TQStringList *fileNames)=0; /// Return a list of URLs for multiple files - virtual KURL::List* vfs_getFiles(QStringList* names)=0; + virtual KURL::List* vfs_getFiles(TQStringList* names)=0; /// Return a URL to a single file - virtual KURL vfs_getFile(const QString& name)=0; + virtual KURL vfs_getFile(const TQString& name)=0; /// Create a new directory - virtual void vfs_mkdir(const QString& name)=0; + virtual void vfs_mkdir(const TQString& name)=0; /// Rename file - virtual void vfs_rename(const QString& fileName,const QString& newName)=0; + virtual void vfs_rename(const TQString& fileName,const TQString& newName)=0; /// Calculate the amount of space occupied by a file or directory (recursive). - virtual void vfs_calcSpace(QString name ,KIO::filesize_t *totalSize,unsigned long *totalFiles,unsigned long *totalDirs, bool * stop); + virtual void vfs_calcSpace(TQString name ,KIO::filesize_t *totalSize,unsigned long *totalFiles,unsigned long *totalDirs, bool * stop); /// Calculate the amount of space occupied by a local file or directory (recursive). - virtual void vfs_calcSpaceLocal(QString name ,KIO::filesize_t *totalSize,unsigned long *totalFiles,unsigned long *totalDirs, bool * stop); + virtual void vfs_calcSpaceLocal(TQString name ,KIO::filesize_t *totalSize,unsigned long *totalFiles,unsigned long *totalDirs, bool * stop); /// Return the VFS working dir - virtual QString vfs_workingDir()=0; + virtual TQString vfs_workingDir()=0; /// Return true if the VFS url is writable virtual bool vfs_isWritable() { return isWritable; } /// Return vfile* or 0 if not found - inline vfile* vfs_search(const QString& name){ return (*vfs_filesP)[name]; } + inline vfile* vfs_search(const TQString& name){ return (*vfs_filesP)[name]; } /// Return an empty vfile* list if not found - QValueList<vfile*> vfs_search(const KRQuery& filter); + TQValueList<vfile*> vfs_search(const KRQuery& filter); /// The total size of all the files in the VFS, KIO::filesize_t vfs_totalSize(); /// The number of files in the VFS @@ -110,8 +111,8 @@ public: /// process the application events virtual bool vfs_isDeleting() { return deleteRequested; } // KDE FTP proxy bug correction - static KURL fromPathOrURL( const QString &originIn ); - static QString pathOrURL( const KURL &originIn, int trailingSlash = 0 ); + static KURL fromPathOrURL( const TQString &originIn ); + static TQString pathOrURL( const KURL &originIn, int trailingSlash = 0 ); public slots: @@ -123,14 +124,14 @@ public slots: bool vfs_refresh(); void vfs_setQuiet(bool beQuiet){ quietMode=beQuiet; } void vfs_enableRefresh(bool enable); - void vfs_invalidate() { invalidated = true; } + void vfs_tqinvalidate() { tqinvalidated = true; } signals: void startUpdate(); //< emitted when the VFS starts to refresh its list of vfiles. void startJob(KIO::Job* job); void incrementalRefreshFinished( const KURL& ); //< emitted when the incremental refresh was finished void addedVfile(vfile* vf); - void deletedVfile(const QString& name); + void deletedVfile(const TQString& name); void updatedVfile(vfile* vf); void cleared(); void deleteAllowed(); @@ -147,7 +148,7 @@ protected: /// Add a new vfile to the list. inline void addToList(vfile *data){ vfs_filesP->insert(data->vfile_getName(),data); } /// Deletes a vfile from the list. - inline void removeFromList(QString name){ vfs_filesP->remove(name); } + inline void removeFromList(TQString name){ vfs_filesP->remove(name); } /// Deletes a vfile from the list. void calculateURLSize(KURL url,KIO::filesize_t *totalSize,unsigned long *totalFiles,unsigned long *totalDirs, bool * stop); @@ -159,7 +160,7 @@ protected: bool disableRefresh; //< true if refresh is disabled bool isWritable; //< true if it's writable KURL postponedRefreshURL; //< true if vfs_refresh() was called when refresh is disabled. - bool invalidated; //< the content of the cache is invalidated + bool tqinvalidated; //< the content of the cache is tqinvalidated bool panelConnected; //< indicates that there's a panel connected. Important for disabling the dir watcher protected slots: @@ -170,7 +171,7 @@ protected slots: private: vfileDict* vfs_filesP; //< Point to a lists of virtual files (vfile). vfileDict* vfs_tempFilesP;//< Temporary files are stored here - QDictIterator<vfile>* vfileIterator; //< Point to a dictionary of virtual files (vfile). + TQDictIterator<vfile>* vfileIterator; //< Point to a dictionary of virtual files (vfile). // used in the calcSpace function bool* kds_busy; diff --git a/krusader/VFS/virt_vfs.cpp b/krusader/VFS/virt_vfs.cpp index 360e0f7..038edf4 100644 --- a/krusader/VFS/virt_vfs.cpp +++ b/krusader/VFS/virt_vfs.cpp @@ -33,10 +33,10 @@ #define VIRT_VFS_DB "virt_vfs.db" -QDict<KURL::List> virt_vfs::virtVfsDict; +TQDict<KURL::List> virt_vfs::virtVfsDict; KConfig* virt_vfs::virt_vfs_db=0; -virt_vfs::virt_vfs( QObject* panel, bool quiet ) : vfs( panel, quiet ) { +virt_vfs::virt_vfs( TQObject* panel, bool quiet ) : vfs( panel, quiet ) { // set the writable attribute isWritable = true; @@ -81,7 +81,7 @@ bool virt_vfs::populateVfsList( const KURL& origin, bool /*showHidden*/ ) { return true; } -void virt_vfs::vfs_addFiles( KURL::List *fileUrls, KIO::CopyJob::CopyMode /*mode*/, QObject* /*toNotify*/, QString /*dir*/, PreserveMode /*pmode*/ ) { +void virt_vfs::vfs_addFiles( KURL::List *fileUrls, KIO::CopyJob::CopyMode /*mode*/, TQObject* /*toNotify*/, TQString /*dir*/, PreserveMode /*pmode*/ ) { if ( path == "/" ) { if ( !quietMode ) KMessageBox::error( krApp, i18n( "You can't copy files directly to the 'virt:/' directory.\nYou can create a sub directory and copy your files into it." ), i18n( "Error" ) ); @@ -90,18 +90,18 @@ void virt_vfs::vfs_addFiles( KURL::List *fileUrls, KIO::CopyJob::CopyMode /*mode KURL::List* urlList = virtVfsDict[ path ]; for( unsigned i=0; i != fileUrls->count(); i++ ) { - if( !urlList->contains( (*fileUrls)[ i ] ) ) + if( !urlList->tqcontains( (*fileUrls)[ i ] ) ) urlList->push_back( (*fileUrls)[ i ] ); } vfs_refresh(); } -void virt_vfs::vfs_delFiles( QStringList *fileNames ) { +void virt_vfs::vfs_delFiles( TQStringList *fileNames ) { if ( path == "/" ) { for ( uint i = 0 ; i < fileNames->count(); ++i ) { - QString filename = ( *fileNames ) [ i ]; - virtVfsDict[ "/" ] ->remove( QString("virt:/")+filename ); + TQString filename = ( *fileNames ) [ i ]; + virtVfsDict[ "/" ] ->remove( TQString("virt:/")+filename ); virtVfsDict.remove( filename ); } vfs_refresh(); @@ -113,7 +113,7 @@ void virt_vfs::vfs_delFiles( QStringList *fileNames ) { // names -> urls for ( uint i = 0 ; i < fileNames->count(); ++i ) { - QString filename = ( *fileNames ) [ i ]; + TQString filename = ( *fileNames ) [ i ]; filesUrls.append( vfs_getFile( filename ) ); } KIO::Job *job; @@ -126,15 +126,15 @@ void virt_vfs::vfs_delFiles( QStringList *fileNames ) { #else job = new KIO::CopyJob( filesUrls, KGlobalSettings::trashPath(), KIO::CopyJob::Move, false, true ); #endif - connect( job, SIGNAL( result( KIO::Job* ) ), krApp, SLOT( changeTrashIcon() ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), krApp, TQT_SLOT( changeTrashIcon() ) ); } else job = new KIO::DeleteJob( filesUrls, false, true ); // refresh will remove the deleted files... - connect( job, SIGNAL( result( KIO::Job* ) ), this, SLOT( vfs_refresh( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), this, TQT_SLOT( vfs_refresh( KIO::Job* ) ) ); } -void virt_vfs::vfs_removeFiles( QStringList *fileNames ) { +void virt_vfs::vfs_removeFiles( TQStringList *fileNames ) { if ( path == "/" ) return; @@ -148,17 +148,17 @@ void virt_vfs::vfs_removeFiles( QStringList *fileNames ) { vfs_refresh(); } -KURL::List* virt_vfs::vfs_getFiles( QStringList* names ) { +KURL::List* virt_vfs::vfs_getFiles( TQStringList* names ) { KURL url; KURL::List* urls = new KURL::List(); - for ( QStringList::Iterator name = names->begin(); name != names->end(); ++name ) { + for ( TQStringList::Iterator name = names->begin(); name != names->end(); ++name ) { url = vfs_getFile( *name ); urls->append( url ); } return urls; } -KURL virt_vfs::vfs_getFile( const QString& name ) { +KURL virt_vfs::vfs_getFile( const TQString& name ) { vfile * vf = vfs_search( name ); if ( !vf ) return KURL(); // empty @@ -167,7 +167,7 @@ KURL virt_vfs::vfs_getFile( const QString& name ) { return url; } -void virt_vfs::vfs_mkdir( const QString& name ) { +void virt_vfs::vfs_mkdir( const TQString& name ) { if ( path != "/" ) { if ( !quietMode ) KMessageBox::error( krApp, i18n( "Creating new directories is allowed only in the 'virt:/' directory." ), i18n( "Error" ) ); @@ -175,12 +175,12 @@ void virt_vfs::vfs_mkdir( const QString& name ) { } KURL::List* temp = new KURL::List(); virtVfsDict.insert( name, temp ); - virtVfsDict[ "/" ] ->append( QString( "virt:/" )+name ); + virtVfsDict[ "/" ] ->append( TQString( "virt:/" )+name ); vfs_refresh(); } -void virt_vfs::vfs_rename( const QString& fileName, const QString& newName ) { +void virt_vfs::vfs_rename( const TQString& fileName, const TQString& newName ) { KURL::List fileUrls; KURL url , dest; @@ -188,8 +188,8 @@ void virt_vfs::vfs_rename( const QString& fileName, const QString& newName ) { if ( !vf ) return ; // not found if ( path == "/" ) { - virtVfsDict[ "/" ] ->append( QString( "virt:/" ) + newName ); - virtVfsDict[ "/" ] ->remove( QString( "virt:/" ) + fileName ); + virtVfsDict[ "/" ] ->append( TQString( "virt:/" ) + newName ); + virtVfsDict[ "/" ] ->remove( TQString( "virt:/" ) + fileName ); virtVfsDict.insert( newName, virtVfsDict.take( fileName ) ); vfs_refresh(); return ; @@ -205,7 +205,7 @@ void virt_vfs::vfs_rename( const QString& fileName, const QString& newName ) { virtVfsDict[ path ] ->append( dest ); KIO::Job *job = new KIO::CopyJob( fileUrls, dest, KIO::CopyJob::Move, true, false ); - connect( job, SIGNAL( result( KIO::Job* ) ), this, SLOT( vfs_refresh( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), this, TQT_SLOT( vfs_refresh( KIO::Job* ) ) ); } void virt_vfs::slotStatResult( KIO::Job* job ) { @@ -216,7 +216,7 @@ void virt_vfs::slotStatResult( KIO::Job* job ) { vfile* virt_vfs::stat( const KURL& url ) { if( url.protocol() == "virt" ){ - QString path = url.path().mid(1); + TQString path = url.path().mid(1); if( path.isEmpty() ) path = "/"; vfile * temp = new vfile( path, 0, "drwxr-xr-x", time( 0 ), false, getuid(), getgid(), "inode/directory", "", 0 ); temp->vfile_setUrl( url ); @@ -229,7 +229,7 @@ vfile* virt_vfs::stat( const KURL& url ) { else { busy = true; KIO::StatJob* statJob = KIO::stat( url, false ); - connect( statJob, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotStatResult( KIO::Job* ) ) ); + connect( statJob, TQT_SIGNAL( result( KIO::Job* ) ), this, TQT_SLOT( slotStatResult( KIO::Job* ) ) ); while ( busy && vfs_processEvents() ); if( entry.isEmpty() ) return 0; // statJob failed @@ -244,7 +244,7 @@ vfile* virt_vfs::stat( const KURL& url ) { vfile *temp; // get file statistics - QString name; + TQString name; if( url.isLocalFile() ) name = url.path(); else @@ -254,10 +254,10 @@ vfile* virt_vfs::stat( const KURL& url ) { time_t mtime = kfi->time( KIO::UDS_MODIFICATION_TIME ); bool symLink = kfi->isLink(); mode_t mode = kfi->mode() | kfi->permissions(); - QString perm = KRpermHandler::mode2QString( mode ); + TQString perm = KRpermHandler::mode2TQString( mode ); // set the mimetype - QString mime = QString::null; - QString symDest = ""; + TQString mime = TQString(); + TQString symDest = ""; if ( symLink ) { symDest = kfi->linkDest(); if ( kfi->isDir() ) perm[ 0 ] = 'd'; @@ -267,9 +267,9 @@ vfile* virt_vfs::stat( const KURL& url ) { if ( kfi->user().isEmpty() ) temp = new vfile( name, size, perm, mtime, symLink, getuid(), getgid(), mime, symDest, mode ); else { - QString currentUser = url.user(); - if ( currentUser.contains( "@" ) ) /* remove the FTP proxy tags from the username */ - currentUser.truncate( currentUser.find( '@' ) ); + TQString currentUser = url.user(); + if ( currentUser.tqcontains( "@" ) ) /* remove the FTP proxy tags from the username */ + currentUser.truncate( currentUser.tqfind( '@' ) ); if ( currentUser.isEmpty() ) currentUser = KRpermHandler::uid2user( getuid() ); temp = new vfile( name, size, perm, mtime, symLink, kfi->user(), kfi->group(), currentUser, mime, symDest, mode ); @@ -291,10 +291,10 @@ bool virt_vfs::save(){ KConfig* db = getVirtDB(); db->setGroup("virt_db"); - QDictIterator<KURL::List> it( virtVfsDict ); // See QDictIterator + TQDictIterator<KURL::List> it( virtVfsDict ); // See TQDictIterator for( ; it.current(); ++it ){ KURL::List::iterator url; - QStringList entry; + TQStringList entry; for ( url = it.current()->begin() ; url != it.current()->end() ; ++url ) { entry.append( (*url).prettyURL() ); } @@ -310,8 +310,8 @@ bool virt_vfs::restore(){ KConfig* db = getVirtDB(); db->setGroup("virt_db"); - QMap<QString, QString> map = db->entryMap("virt_db"); - QMap<QString, QString>::Iterator it; + TQMap<TQString, TQString> map = db->entryMap("virt_db"); + TQMap<TQString, TQString>::Iterator it; KURL::List* urlList; for ( it = map.begin(); it != map.end(); ++it ) { urlList = new KURL::List( db->readListEntry(it.key()) ); @@ -326,7 +326,7 @@ bool virt_vfs::restore(){ return true; } -void virt_vfs::vfs_calcSpace( QString name , KIO::filesize_t* totalSize, unsigned long* totalFiles, unsigned long* totalDirs, bool* stop ) { +void virt_vfs::vfs_calcSpace( TQString name , KIO::filesize_t* totalSize, unsigned long* totalFiles, unsigned long* totalDirs, bool* stop ) { if ( stop && *stop ) return ; if( path == "/" ) { KURL::List* urlList = virtVfsDict[ name ]; diff --git a/krusader/VFS/virt_vfs.h b/krusader/VFS/virt_vfs.h index 2cf880f..d16b1f1 100644 --- a/krusader/VFS/virt_vfs.h +++ b/krusader/VFS/virt_vfs.h @@ -28,29 +28,30 @@ class virt_vfs : public vfs { Q_OBJECT + TQ_OBJECT public: - virt_vfs(QObject* panel, bool quiet=false); + virt_vfs(TQObject* panel, bool quiet=false); ~virt_vfs(); /// Copy a file to the vfs (physical). - void vfs_addFiles(KURL::List *fileUrls,KIO::CopyJob::CopyMode mode,QObject* toNotify,QString dir = "", PreserveMode pmode = PM_DEFAULT ); + void vfs_addFiles(KURL::List *fileUrls,KIO::CopyJob::CopyMode mode,TQObject* toNotify,TQString dir = "", PreserveMode pmode = PM_DEFAULT ); /// Remove a file from the vfs (physical) - void vfs_delFiles(QStringList *fileNames); + void vfs_delFiles(TQStringList *fileNames); /// Remove a file from the collection (only its link, not the file) - void vfs_removeFiles(QStringList *fileNames); + void vfs_removeFiles(TQStringList *fileNames); /// Return a list of URLs for multiple files - KURL::List* vfs_getFiles(QStringList* names); + KURL::List* vfs_getFiles(TQStringList* names); /// Return a URL to a single file - KURL vfs_getFile(const QString& name); + KURL vfs_getFile(const TQString& name); /// Create a new directory - void vfs_mkdir(const QString& name); + void vfs_mkdir(const TQString& name); /// Rename file - void vfs_rename(const QString& fileName,const QString& newName); + void vfs_rename(const TQString& fileName,const TQString& newName); /// Calculate the amount of space occupied by a file or directory (recursive). - virtual void vfs_calcSpace(QString name ,KIO::filesize_t *totalSize,unsigned long *totalFiles,unsigned long *totalDirs, bool * stop); + virtual void vfs_calcSpace(TQString name ,KIO::filesize_t *totalSize,unsigned long *totalFiles,unsigned long *totalDirs, bool * stop); /// Return the VFS working dir - QString vfs_workingDir(){ return QString::null; } + TQString vfs_workingDir(){ return TQString(); } protected slots: void slotStatResult(KIO::Job *job); @@ -66,10 +67,10 @@ protected: bool populateVfsList(const KURL& origin, bool showHidden); vfile* stat(const KURL& url); - static QDict<KURL::List> virtVfsDict; + static TQDict<KURL::List> virtVfsDict; static KConfig* virt_vfs_db; bool busy; - QString path; + TQString path; KIO::UDSEntry entry; }; diff --git a/krusader/VFS/virtualcopyjob.cpp b/krusader/VFS/virtualcopyjob.cpp index 7b11c77..8525e11 100644 --- a/krusader/VFS/virtualcopyjob.cpp +++ b/krusader/VFS/virtualcopyjob.cpp @@ -39,7 +39,7 @@ #define REPORT_TIMEOUT 200 -VirtualCopyJob::VirtualCopyJob( const QStringList *names, vfs * vfs, const KURL& dest, const KURL& baseURL, +VirtualCopyJob::VirtualCopyJob( const TQStringList *names, vfs * vfs, const KURL& dest, const KURL& baseURL, PreserveMode pmode, KIO::CopyJob::CopyMode mode, bool asMethod, bool showProgressInfo ) : KIO::Job( showProgressInfo ), m_totalSize( 0 ), m_totalFiles( 0 ), m_totalSubdirs( 0 ), m_processedSize( 0 ), m_processedFiles( 0 ), m_processedSubdirs( 0 ), m_tempSize( 0 ), m_tempFiles( 0 ), @@ -52,10 +52,10 @@ VirtualCopyJob::VirtualCopyJob( const QStringList *names, vfs * vfs, const KURL& vfile * file = vfs->vfs_getFirstFile(); while( file ) { - if( names->contains( file->vfile_getName() ) ) { - QString relativeDir = KURL::relativeURL( baseURL, file->vfile_getUrl().upURL() ); + if( names->tqcontains( file->vfile_getName() ) ) { + TQString relativeDir = KURL::relativeURL( baseURL, file->vfile_getUrl().upURL() ); - KURL::List *list = m_filesToCopy.find( relativeDir ); + KURL::List *list = m_filesToCopy.tqfind( relativeDir ); if( list == 0 ) { list = new KURL::List(); m_filesToCopy.insert( relativeDir, list ); @@ -65,7 +65,7 @@ VirtualCopyJob::VirtualCopyJob( const QStringList *names, vfs * vfs, const KURL& m_subdirs[ relativeDir ] = 0; } - if( !list->contains( file->vfile_getUrl() ) ) { + if( !list->tqcontains( file->vfile_getUrl() ) ) { if( file->vfile_isDir() ) { m_dirsToGetSize.append( file->vfile_getUrl() ); m_totalSubdirs++; @@ -83,19 +83,19 @@ VirtualCopyJob::VirtualCopyJob( const QStringList *names, vfs * vfs, const KURL& } if ( showProgressInfo ) { - connect( this, SIGNAL( totalFiles( KIO::Job*, unsigned long ) ), - Observer::self(), SLOT( slotTotalFiles( KIO::Job*, unsigned long ) ) ); - connect( this, SIGNAL( totalDirs( KIO::Job*, unsigned long ) ), - Observer::self(), SLOT( slotTotalDirs( KIO::Job*, unsigned long ) ) ); - connect( this, SIGNAL( processedFiles( KIO::Job*, unsigned long ) ), - Observer::self(), SLOT( slotProcessedFiles( KIO::Job*, unsigned long ) ) ); - connect( this, SIGNAL( processedDirs( KIO::Job*, unsigned long ) ), - Observer::self(), SLOT( slotProcessedDirs( KIO::Job*, unsigned long ) ) ); - connect( this, SIGNAL( percent( KIO::Job*, unsigned long ) ), - Observer::self(), SLOT( slotPercent( KIO::Job*, unsigned long ) ) ); + connect( this, TQT_SIGNAL( totalFiles( KIO::Job*, unsigned long ) ), + Observer::self(), TQT_SLOT( slotTotalFiles( KIO::Job*, unsigned long ) ) ); + connect( this, TQT_SIGNAL( totalDirs( KIO::Job*, unsigned long ) ), + Observer::self(), TQT_SLOT( slotTotalDirs( KIO::Job*, unsigned long ) ) ); + connect( this, TQT_SIGNAL( processedFiles( KIO::Job*, unsigned long ) ), + Observer::self(), TQT_SLOT( slotProcessedFiles( KIO::Job*, unsigned long ) ) ); + connect( this, TQT_SIGNAL( processedDirs( KIO::Job*, unsigned long ) ), + Observer::self(), TQT_SLOT( slotProcessedDirs( KIO::Job*, unsigned long ) ) ); + connect( this, TQT_SIGNAL( percent( KIO::Job*, unsigned long ) ), + Observer::self(), TQT_SLOT( slotPercent( KIO::Job*, unsigned long ) ) ); } - QTimer::singleShot( 0, this, SLOT( slotStart() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( slotStart() ) ); } void VirtualCopyJob::slotStart() { @@ -106,7 +106,7 @@ void VirtualCopyJob::slotStart() { Observer::self()->slotCopying( this, m_baseURL, m_dest ); } - connect(&m_reportTimer,SIGNAL(timeout()),this,SLOT(slotReport())); + connect(&m_reportTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(slotReport())); m_reportTimer.start(REPORT_TIMEOUT,false); statNextDir(); @@ -158,7 +158,7 @@ void VirtualCopyJob::statNextDir() { m_currentDir = KURL::relativeURL( m_baseURL, dirToCheck.upURL() ); KDirSize* kds = KDirSize::dirSizeJob( dirToCheck ); - connect( kds, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotKdsResult( KIO::Job* ) ) ); + connect( kds, TQT_SIGNAL( result( KIO::Job* ) ), this, TQT_SLOT( slotKdsResult( KIO::Job* ) ) ); } void VirtualCopyJob::slotKdsResult( KIO::Job * job ) { @@ -181,7 +181,7 @@ void VirtualCopyJob::createNextDir() { return; } - QDictIterator<KURL::List> diter( m_filesToCopy ); + TQDictIterator<KURL::List> diter( m_filesToCopy ); m_currentDir = diter.currentKey(); m_current = m_dest; @@ -189,7 +189,7 @@ void VirtualCopyJob::createNextDir() { m_current.addPath( m_currentDir ); KIO::Job *job = KIO::stat( m_current ); - connect( job, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotStatResult( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), this, TQT_SLOT( slotStatResult( KIO::Job* ) ) ); } void VirtualCopyJob::slotStatResult( KIO::Job *job ) { @@ -199,7 +199,7 @@ void VirtualCopyJob::slotStatResult( KIO::Job *job ) { if( job->error() == KIO::ERR_DOES_NOT_EXIST && !url.equals( url.upURL(),true ) ) { m_dirStack.push_back( url.fileName() ); KIO::Job *job = KIO::stat( url.upURL() ); - connect( job, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotStatResult( KIO::Job* ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job* ) ), this, TQT_SLOT( slotStatResult( KIO::Job* ) ) ); return; } job->showErrorDialog( krApp ); @@ -214,7 +214,7 @@ void VirtualCopyJob::slotStatResult( KIO::Job *job ) { m_dirStack.pop_back(); KIO::Job *mkdir_job = KIO::mkdir( url ); - connect( mkdir_job, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotMkdirResult( KIO::Job* ) ) ); + connect( mkdir_job, TQT_SIGNAL( result( KIO::Job* ) ), this, TQT_SLOT( slotMkdirResult( KIO::Job* ) ) ); } else copyCurrentDir(); @@ -236,7 +236,7 @@ void VirtualCopyJob::slotMkdirResult( KIO::Job *job ) { m_dirStack.pop_back(); KIO::Job *mkdir_job = KIO::mkdir( url ); - connect( mkdir_job, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotMkdirResult( KIO::Job* ) ) ); + connect( mkdir_job, TQT_SIGNAL( result( KIO::Job* ) ), this, TQT_SLOT( slotMkdirResult( KIO::Job* ) ) ); } else copyCurrentDir(); @@ -248,19 +248,19 @@ void VirtualCopyJob::copyCurrentDir() { KIO::CopyJob * copy_job = PreservingCopyJob::createCopyJob( m_pmode, *m_filesToCopy[ m_currentDir ], m_current, m_mode, m_asMethod, false ); - connect( copy_job, SIGNAL( copying(KIO::Job *, const KURL &, const KURL &) ), - this, SLOT( slotCopying(KIO::Job *, const KURL &, const KURL &) ) ); - connect( copy_job, SIGNAL( moving(KIO::Job *, const KURL &, const KURL &) ), - this, SLOT( slotMoving(KIO::Job *, const KURL &, const KURL &) ) ); - connect( copy_job, SIGNAL( creatingDir(KIO::Job *, const KURL &) ), - this, SLOT( slotCreatingDir(KIO::Job *, const KURL &) ) ); - connect( copy_job, SIGNAL( processedFiles (KIO::Job *, unsigned long) ), - this, SLOT( slotProcessedFiles (KIO::Job *, unsigned long) ) ); - connect( copy_job, SIGNAL( processedDirs (KIO::Job *, unsigned long) ), - this, SLOT( slotProcessedDirs (KIO::Job *, unsigned long) ) ); - connect( copy_job, SIGNAL( processedSize (KIO::Job *, KIO::filesize_t) ), - this, SLOT( slotProcessedSize (KIO::Job *, KIO::filesize_t) ) ); - connect( copy_job, SIGNAL( result( KIO::Job* ) ), this, SLOT( slotCopyResult( KIO::Job* ) ) ); + connect( copy_job, TQT_SIGNAL( copying(KIO::Job *, const KURL &, const KURL &) ), + this, TQT_SLOT( slotCopying(KIO::Job *, const KURL &, const KURL &) ) ); + connect( copy_job, TQT_SIGNAL( moving(KIO::Job *, const KURL &, const KURL &) ), + this, TQT_SLOT( slotMoving(KIO::Job *, const KURL &, const KURL &) ) ); + connect( copy_job, TQT_SIGNAL( creatingDir(KIO::Job *, const KURL &) ), + this, TQT_SLOT( slotCreatingDir(KIO::Job *, const KURL &) ) ); + connect( copy_job, TQT_SIGNAL( processedFiles (KIO::Job *, unsigned long) ), + this, TQT_SLOT( slotProcessedFiles (KIO::Job *, unsigned long) ) ); + connect( copy_job, TQT_SIGNAL( processedDirs (KIO::Job *, unsigned long) ), + this, TQT_SLOT( slotProcessedDirs (KIO::Job *, unsigned long) ) ); + connect( copy_job, TQT_SIGNAL( processedSize (KIO::Job *, KIO::filesize_t) ), + this, TQT_SLOT( slotProcessedSize (KIO::Job *, KIO::filesize_t) ) ); + connect( copy_job, TQT_SIGNAL( result( KIO::Job* ) ), this, TQT_SLOT( slotCopyResult( KIO::Job* ) ) ); } void VirtualCopyJob::slotCopyResult( KIO::Job *job ) { @@ -272,7 +272,7 @@ void VirtualCopyJob::slotCopyResult( KIO::Job *job ) { createNextDir(); } -void VirtualCopyJob::directoryFinished( const QString &name ) { +void VirtualCopyJob::directoryFinished( const TQString &name ) { m_filesToCopy.remove( name ); m_processedSize += m_size[ name ]; diff --git a/krusader/VFS/virtualcopyjob.h b/krusader/VFS/virtualcopyjob.h index 6505a97..98bd479 100644 --- a/krusader/VFS/virtualcopyjob.h +++ b/krusader/VFS/virtualcopyjob.h @@ -33,10 +33,10 @@ #include <kio/job.h> #include "preservingcopyjob.h" -#include <qvaluelist.h> -#include <qtimer.h> -#include <qdict.h> -#include <qmap.h> +#include <tqvaluelist.h> +#include <tqtimer.h> +#include <tqdict.h> +#include <tqmap.h> class vfs; @@ -50,16 +50,17 @@ typedef enum { class VirtualCopyJob : public KIO::Job { Q_OBJECT + TQ_OBJECT public: - VirtualCopyJob( const QStringList *names, vfs * vfs, const KURL& dest, const KURL& baseURL, + VirtualCopyJob( const TQStringList *names, vfs * vfs, const KURL& dest, const KURL& baseURL, PreserveMode pmode, KIO::CopyJob::CopyMode mode, bool asMethod, bool showProgressInfo ); protected: void statNextDir(); void createNextDir(); void copyCurrentDir(); - void directoryFinished( const QString & ); + void directoryFinished( const TQString & ); protected slots: void slotStart(); @@ -97,13 +98,13 @@ private: unsigned long m_tempFiles; unsigned long m_tempSubdirs; - QValueList<KURL> m_dirsToGetSize; + TQValueList<KURL> m_dirsToGetSize; - QDict<KURL::List> m_filesToCopy; + TQDict<KURL::List> m_filesToCopy; - QMap<QString,int> m_size; - QMap<QString,int> m_filenum; - QMap<QString,int> m_subdirs; + TQMap<TQString,int> m_size; + TQMap<TQString,int> m_filenum; + TQMap<TQString,int> m_subdirs; KURL m_baseURL; KURL m_dest; @@ -114,12 +115,12 @@ private: State m_state; - QTimer m_reportTimer; + TQTimer m_reportTimer; KURL m_current; - QString m_currentDir; + TQString m_currentDir; - QStringList m_dirStack; + TQStringList m_dirStack; }; #endif /* __VIRTUAL_COPY_JOB_H__ */ |