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 +++++++++++++++++++++++------------------------ kioslave/nfs/kio_nfs.h | 38 ++++++------ 2 files changed, 93 insertions(+), 93 deletions(-) (limited to 'kioslave/nfs') 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 <<"-"< #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #define PORTMAP //this seems to be required to compile on Solaris #include @@ -55,24 +55,24 @@ class NFSFileHandle //ostream& operator<<(ostream&, const NFSFileHandle&); -typedef QMap NFSFileHandleMap; +typedef TQMap NFSFileHandleMap; class NFSProtocol : public KIO::SlaveBase { public: - NFSProtocol (const QCString &pool, const QCString &app ); + NFSProtocol (const TQCString &pool, const TQCString &app ); virtual ~NFSProtocol(); virtual void openConnection(); virtual void closeConnection(); - virtual void setHost( const QString& host, int port, const QString& user, const QString& pass ); + virtual void setHost( const TQString& host, int port, const TQString& user, const TQString& pass ); virtual void put( const KURL& url, int _mode,bool _overwrite, bool _resume ); virtual void get( const KURL& url ); virtual void listDir( const KURL& url); - virtual void symlink( const QString &target, const KURL &dest, bool ); + virtual void symlink( const TQString &target, const KURL &dest, bool ); virtual void stat( const KURL & url); virtual void mkdir( const KURL& url, int permissions ); virtual void del( const KURL& url, bool isfile); @@ -81,22 +81,22 @@ class NFSProtocol : public KIO::SlaveBase virtual void copy( const KURL& src, const KURL &dest, int mode, bool overwrite ); protected: // void createVirtualDirEntry(KIO::UDSEntry & entry); - bool checkForError(int clientStat, int nfsStat, const QString& text); - bool isExportedDir(const QString& path); + bool checkForError(int clientStat, int nfsStat, const TQString& text); + bool isExportedDir(const TQString& path); void completeUDSEntry(KIO::UDSEntry& entry, fattr& attributes); void completeBadLinkUDSEntry(KIO::UDSEntry& entry, fattr& attributes); - void completeAbsoluteLinkUDSEntry(KIO::UDSEntry& entry, const QCString& path); - bool isValidLink(const QString& parentDir, const QString& linkDest); -// bool isAbsoluteLink(const QString& path); + void completeAbsoluteLinkUDSEntry(KIO::UDSEntry& entry, const TQCString& path); + bool isValidLink(const TQString& parentDir, const TQString& linkDest); +// bool isAbsoluteLink(const TQString& path); - NFSFileHandle getFileHandle(QString path); + NFSFileHandle getFileHandle(TQString path); NFSFileHandleMap m_handleCache; - QIntDict m_usercache; // maps long ==> QString * - QIntDict m_groupcache; + TQIntDict m_usercache; // maps long ==> TQString * + TQIntDict m_groupcache; - QStringList m_exportedDirs; - QString m_currentHost; + TQStringList m_exportedDirs; + TQString m_currentHost; CLIENT *m_client; CLIENT *m_nfsClient; timeval total_timeout; -- cgit v1.2.1