diff options
Diffstat (limited to 'filesharing/advanced/nfs/nfsfile.cpp')
-rw-r--r-- | filesharing/advanced/nfs/nfsfile.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/filesharing/advanced/nfs/nfsfile.cpp b/filesharing/advanced/nfs/nfsfile.cpp index 79fc732e..c61a393c 100644 --- a/filesharing/advanced/nfs/nfsfile.cpp +++ b/filesharing/advanced/nfs/nfsfile.cpp @@ -21,10 +21,10 @@ #include <time.h> #include <unistd.h> -#include <qfileinfo.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qstringlist.h> +#include <tqfileinfo.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqstringlist.h> #include <kdebug.h> #include <kmessagebox.h> @@ -65,9 +65,9 @@ bool NFSFile::hasEntry(NFSEntry *entry) } -NFSEntry* NFSFile::getEntryByPath(const QString & path) +NFSEntry* NFSFile::getEntryByPath(const TQString & path) { - QString testPath = path.stripWhiteSpace(); + TQString testPath = path.stripWhiteSpace(); if ( testPath[testPath.length()-1] != '/' ) testPath += '/'; @@ -80,7 +80,7 @@ NFSEntry* NFSFile::getEntryByPath(const QString & path) return 0L; } -bool NFSFile::removeEntryByPath(const QString & path) { +bool NFSFile::removeEntryByPath(const TQString & path) { NFSEntry* entry = getEntryByPath(path); if (!entry) return false; @@ -99,7 +99,7 @@ EntryIterator NFSFile::getEntries() bool NFSFile::load() { - QFile f(_url.path()); + TQFile f(_url.path()); if ( !f.open(IO_ReadOnly) ) { kdError() << "NFSFile::load: Could not open " << _url.path() << endl; @@ -109,14 +109,14 @@ bool NFSFile::load() _entries.clear(); _lines.clear(); - QTextStream s( &f ); + TQTextStream s( &f ); bool continuedLine = false; // is true if the line before ended with a backslash - QString completeLine; + TQString completeLine; while ( !s.eof() ) { - QString currentLine = s.readLine().stripWhiteSpace(); + TQString currentLine = s.readLine().stripWhiteSpace(); if (continuedLine) { completeLine += currentLine; @@ -146,8 +146,8 @@ bool NFSFile::load() continue; } - QString path; - QString hosts; + TQString path; + TQString hosts; // Handle quotation marks if ( completeLine[0] == '"' ) { @@ -179,13 +179,13 @@ bool NFSFile::load() kdDebug(5009) << "KNFSShare: Found path: '" << path << "'" << endl; NFSEntry *entry = new NFSEntry(path); - QStringList hostList = QStringList::split(' ', hosts); + TQStringList hostList = TQStringList::split(' ', hosts); if (hostList.isEmpty()) { NFSHost* host = new NFSHost("*"); entry->addHost(host); } else { - QStringList::iterator it; + TQStringList::iterator it; for ( it = hostList.begin(); it != hostList.end(); ++it ) { NFSHost* host = new NFSHost((*it).stripWhiteSpace()); entry->addHost(host); @@ -205,8 +205,8 @@ bool NFSFile::load() } -void NFSFile::saveTo(QTextStream * stream) { - QPtrListIterator<NFSLine> it(_lines); +void NFSFile::saveTo(TQTextStream * stream) { + TQPtrListIterator<NFSLine> it(_lines); NFSLine *line; while ( (line = it.current()) != 0 ) { @@ -215,12 +215,12 @@ void NFSFile::saveTo(QTextStream * stream) { } } -bool NFSFile::saveTo(const QString& fileName) { - QFile file(fileName); +bool NFSFile::saveTo(const TQString& fileName) { + TQFile file(fileName); if (!file.open(IO_WriteOnly)) return false; - QTextStream stream(&file); + TQTextStream stream(&file); saveTo(&stream); file.close(); return true; @@ -228,7 +228,7 @@ bool NFSFile::saveTo(const QString& fileName) { bool NFSFile::save() { - if (QFileInfo(_url.path()).isWritable() ) { + if (TQFileInfo(_url.path()).isWritable() ) { saveTo(_url.path()); } else { @@ -240,14 +240,14 @@ bool NFSFile::save() KProcIO proc; - QString command = QString("cp %1 %2") + TQString command = TQString("cp %1 %2") .arg(KProcess::quote( tempFile.name() )) .arg(KProcess::quote( _url.path() )); if (restartNFSServer) command +=";exportfs -ra"; - if (!QFileInfo(_url.path()).isWritable() ) + if (!TQFileInfo(_url.path()).isWritable() ) proc<<"kdesu" << "-d" << "-c"<<command; if (!proc.start(KProcess::Block, true)) { |