From c663b6440964f6ac48027143ac9e63298991f9d0 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:33:34 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kioslave/nfs/kio_nfs.cpp | 148 +++++++++++++++++++++++------------------------ 1 file changed, 74 insertions(+), 74 deletions(-) (limited to 'kioslave/nfs/kio_nfs.cpp') diff --git a/kioslave/nfs/kio_nfs.cpp b/kioslave/nfs/kio_nfs.cpp index b35489c8d..debe19d3d 100644 --- a/kioslave/nfs/kio_nfs.cpp +++ b/kioslave/nfs/kio_nfs.cpp @@ -45,8 +45,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -127,12 +127,12 @@ int kdemain( int argc, char **argv ) return 0; } -static bool isRoot(const QString& path) +static bool isRoot(const TQString& path) { return (path.isEmpty() || (path=="/")); } -static bool isAbsoluteLink(const QString& path) +static bool isAbsoluteLink(const TQString& path) { //hmm, don't know if (path.isEmpty()) return TRUE; @@ -166,23 +166,23 @@ static void createVirtualDirEntry(UDSEntry & entry) } -static void stripTrailingSlash(QString& path) +static void stripTrailingSlash(TQString& path) { //if (path=="/") return; if (path=="/") path=""; else if (path[path.length()-1]=='/') path.truncate(path.length()-1); } -static void getLastPart(const QString& path, QString& lastPart, QString& rest) +static void getLastPart(const TQString& path, TQString& lastPart, TQString& rest) { int slashPos=path.findRev("/"); lastPart=path.mid(slashPos+1); rest=path.left(slashPos+1); } -static QString removeFirstPart(const QString& path) +static TQString removeFirstPart(const TQString& path) { - QString result(""); + TQString result(""); if (path.isEmpty()) return result; result=path.mid(1); int slashPos=result.find("/"); @@ -235,7 +235,7 @@ NFSFileHandle& NFSFileHandle::operator= (const char* src) }*/ -NFSProtocol::NFSProtocol (const QCString &pool, const QCString &app ) +NFSProtocol::NFSProtocol (const TQCString &pool, const TQCString &app ) :SlaveBase( "nfs", pool, app ) ,m_client(0) ,m_sock(-1) @@ -291,7 +291,7 @@ void NFSProtocol::closeConnection() m_client=0; } -bool NFSProtocol::isExportedDir(const QString& path) +bool NFSProtocol::isExportedDir(const TQString& path) { return (m_exportedDirs.find(path.mid(1))!=m_exportedDirs.end()); } @@ -301,7 +301,7 @@ bool NFSProtocol::isExportedDir(const QString& path) If this doesn't succeed, it needs to do a nfs rpc call in order to obtain one. */ -NFSFileHandle NFSProtocol::getFileHandle(QString path) +NFSFileHandle NFSProtocol::getFileHandle(TQString path) { if (m_client==0) openConnection(); @@ -326,7 +326,7 @@ NFSFileHandle NFSProtocol::getFileHandle(QString path) kdDebug(7121)<<"path is in the cache, returning the FH -"<ex_dir[0] == '/' ) fname = KIO::encodeFileName(exportlist->ex_dir + 1); else fname = KIO::encodeFileName(exportlist->ex_dir); - m_handleCache.insert(QString("/")+fname,fh); + m_handleCache.insert(TQString("/")+fname,fh); m_exportedDirs.append(fname); // kdDebug() <<"appending file -"<nextentry) { - if ((QString(".")!=dirEntry->name) && (QString("..")!=dirEntry->name)) + if ((TQString(".")!=dirEntry->name) && (TQString("..")!=dirEntry->name)) filesToList.append(dirEntry->name); } } while (!listres.readdirres_u.reply.eof); @@ -577,13 +577,13 @@ void NFSProtocol::listDir( const KURL& _url) UDSEntry entry; //stat all files in filesToList - for (QStringList::Iterator it=filesToList.begin(); it!=filesToList.end(); it++) + for (TQStringList::Iterator it=filesToList.begin(); it!=filesToList.end(); it++) { UDSAtom atom; diropargs dirargs; diropres dirres; memcpy(dirargs.dir.data,fh,NFS_FHSIZE); - QCString tmpStr=QFile::encodeName(*it); + TQCString tmpStr=TQFile::encodeName(*it); dirargs.name=tmpStr.data(); kdDebug(7121)<<"calling rpc: FH: -"<1) && (tmpPath[0]=='/')) tmpPath=tmpPath.mid(1); // We can't stat root, but we know it's a dir if (isRoot(path) || isExportedDir(path)) @@ -696,7 +696,7 @@ void NFSProtocol::stat( const KURL & url) diropargs dirargs; attrstat attrAndStat; memcpy(dirargs.dir.data,fh,NFS_FHSIZE); - QCString tmpStr=QFile::encodeName(path); + TQCString tmpStr=TQFile::encodeName(path); dirargs.name=tmpStr.data(); kdDebug(7121)<<"calling rpc: FH: -"<pw_name)) ); + m_usercache.insert( uid, new TQString(TQString::fromLatin1(user->pw_name)) ); atom.m_str = user->pw_name; } else @@ -825,7 +825,7 @@ void NFSProtocol::completeAbsoluteLinkUDSEntry(UDSEntry& entry, const QCString& struct group *grp = getgrgid( gid ); if ( grp ) { - m_groupcache.insert( gid, new QString(QString::fromLatin1(grp->gr_name)) ); + m_groupcache.insert( gid, new TQString(TQString::fromLatin1(grp->gr_name)) ); atom.m_str = grp->gr_name; } else @@ -893,13 +893,13 @@ void NFSProtocol::completeUDSEntry(UDSEntry& entry, fattr& attributes) atom.m_uds = KIO::UDS_USER; uid_t uid = attributes.uid; - QString *temp = m_usercache.find( uid ); + TQString *temp = m_usercache.find( uid ); if ( !temp ) { struct passwd *user = getpwuid( uid ); if ( user ) { - m_usercache.insert( uid, new QString(user->pw_name) ); + m_usercache.insert( uid, new TQString(user->pw_name) ); atom.m_str = user->pw_name; } else @@ -917,7 +917,7 @@ void NFSProtocol::completeUDSEntry(UDSEntry& entry, fattr& attributes) struct group *grp = getgrgid( gid ); if ( grp ) { - m_groupcache.insert( gid, new QString(grp->gr_name) ); + m_groupcache.insert( gid, new TQString(grp->gr_name) ); atom.m_str = grp->gr_name; } else @@ -959,7 +959,7 @@ void NFSProtocol::completeUDSEntry(UDSEntry& entry, fattr& attributes) }*/ } -void NFSProtocol::setHost(const QString& host, int /*port*/, const QString& /*user*/, const QString& /*pass*/) +void NFSProtocol::setHost(const TQString& host, int /*port*/, const TQString& /*user*/, const TQString& /*pass*/) { kdDebug(7121)<<"setHost: -"<0); - data( QByteArray() ); + data( TQByteArray() ); finished(); } //TODO the partial putting thing is not yet implemented void NFSProtocol::put( const KURL& url, int _mode, bool _overwrite, bool /*_resume*/ ) { - QString destPath( QFile::encodeName(url.path())); + TQString destPath( TQFile::encodeName(url.path())); kdDebug( 7121 ) << "Put -" << destPath <<"-"<