diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:25:18 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:25:18 +0000 |
commit | aa3a1ca934bc541bddd3fa136a85f106f7da266e (patch) | |
tree | 9ad0b795aed8fa4ac30c2fe0fd1aacb8175714c0 /ksysv/IOCore.cpp | |
parent | b10cf7066791a2f362495890cd50c984e8025412 (diff) | |
download | tdeadmin-aa3a1ca934bc541bddd3fa136a85f106f7da266e.tar.gz tdeadmin-aa3a1ca934bc541bddd3fa136a85f106f7da266e.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeadmin@1157635 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksysv/IOCore.cpp')
-rw-r--r-- | ksysv/IOCore.cpp | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/ksysv/IOCore.cpp b/ksysv/IOCore.cpp index c61dec6..434d051 100644 --- a/ksysv/IOCore.cpp +++ b/ksysv/IOCore.cpp @@ -18,10 +18,10 @@ #include <errno.h> #include <unistd.h> -#include <qfileinfo.h> -#include <qptrlist.h> -#include <qvaluelist.h> -#include <qstringlist.h> +#include <tqfileinfo.h> +#include <tqptrlist.h> +#include <tqvaluelist.h> +#include <tqstringlist.h> #include <kdebug.h> #include <kapplication.h> @@ -36,15 +36,15 @@ #include "ksv_core.h" #include "ksv_conf.h" -QString ksv::IO::relToAbs (const QString& dir, const QString& rel) +TQString ksv::IO::relToAbs (const TQString& dir, const TQString& rel) { if (rel.left(1) != "/") - return QDir::cleanDirPath (dir + "/" + rel); + return TQDir::cleanDirPath (dir + "/" + rel); else - return QDir::cleanDirPath (rel); + return TQDir::cleanDirPath (rel); } -void ksv::IO::removeFile (const QFileInfo& info, QDir& dir, QString& rich, QString& plain) +void ksv::IO::removeFile (const TQFileInfo& info, TQDir& dir, TQString& rich, TQString& plain) { if (!dir.remove(info.fileName(), FALSE)) { @@ -69,26 +69,26 @@ void ksv::IO::removeFile (const QFileInfo& info, QDir& dir, QString& rich, QStri } } -void ksv::IO::dissectFilename (const QString& file, QString& base, int& nr) +void ksv::IO::dissectFilename (const TQString& file, TQString& base, int& nr) { - QString tmp = file.mid(1, file.length()); + TQString tmp = file.mid(1, file.length()); nr = tmp.left(2).toInt(); base = tmp.mid(2, tmp.length()); } void ksv::IO::makeSymlink (const KSVData& data, int runlevel, bool start, - QString& rich, QString& plain) + TQString& rich, TQString& plain) { - const QString symName = QString("%1%2%3").arg(start ? "S" : "K").arg(data.numberString()).arg(data.label()); - const QString symPath = QString("%1/rc%2.d/").arg(KSVConfig::self()->runlevelPath()).arg(runlevel); + const TQString symName = TQString("%1%2%3").arg(start ? "S" : "K").arg(data.numberString()).arg(data.label()); + const TQString symPath = TQString("%1/rc%2.d/").arg(KSVConfig::self()->runlevelPath()).arg(runlevel); - const QString symbol = symPath + symName; - QString target = data.filename(); + const TQString symbol = symPath + symName; + TQString target = data.filename(); - if (QDir::isRelativePath(target)) - target = ksv::IO::makeRelativePath(QDir::cleanDirPath(symPath), - QDir::cleanDirPath(data.path())) + data.filename(); + if (TQDir::isRelativePath(target)) + target = ksv::IO::makeRelativePath(TQDir::cleanDirPath(symPath), + TQDir::cleanDirPath(data.path())) + data.filename(); if (symlink(target.local8Bit(), symbol.local8Bit()) == 0) { @@ -109,15 +109,15 @@ void ksv::IO::makeSymlink (const KSVData& data, int runlevel, bool start, } } -QString ksv::IO::makeRelativePath (const QString& from, const QString& to) +TQString ksv::IO::makeRelativePath (const TQString& from, const TQString& to) { - if (QDir::isRelativePath(from) || QDir::isRelativePath(to)) - return QString::null; + if (TQDir::isRelativePath(from) || TQDir::isRelativePath(to)) + return TQString::null; int pos = 0; const int f_length = from.length(); - QStringList from_list; + TQStringList from_list; while (pos > -1) { const int old = pos + 1; @@ -137,7 +137,7 @@ QString ksv::IO::makeRelativePath (const QString& from, const QString& to) const int t_length = to.length(); - QStringList to_list; + TQStringList to_list; pos = 0; while (pos > -1) @@ -165,7 +165,7 @@ QString ksv::IO::makeRelativePath (const QString& from, const QString& to) && *from_list.at(lcp) == *to_list.at(lcp)) lcp++; - QString result; + TQString result; for (int i = f_c - lcp; i > 0; --i) result += "../"; @@ -175,11 +175,11 @@ QString ksv::IO::makeRelativePath (const QString& from, const QString& to) return result; } -bool ksv::IO::loadSavedConfiguration (QDataStream& s, - QValueList<KSVData>* start, - QValueList<KSVData>* stop) +bool ksv::IO::loadSavedConfiguration (TQDataStream& s, + TQValueList<KSVData>* start, + TQValueList<KSVData>* stop) { - QCString magic; + TQCString magic; s >> magic; if (magic != "KSysV") return false; @@ -190,18 +190,18 @@ bool ksv::IO::loadSavedConfiguration (QDataStream& s, if (version != 3) return false; // too old - QDateTime saveTime; + TQDateTime saveTime; s >> saveTime; for (int i = 0; i < ksv::runlevelNumber; ++i) { - QString rlMagic; - QString section; + TQString rlMagic; + TQString section; s >> rlMagic; s >> section; - if (rlMagic != QString::fromLatin1("RUNLEVEL %1").arg(i)) + if (rlMagic != TQString::fromLatin1("RUNLEVEL %1").arg(i)) return false; if (section != "START") @@ -232,25 +232,25 @@ bool ksv::IO::loadSavedConfiguration (QDataStream& s, return true; } -bool ksv::IO::saveConfiguration (QDataStream& s, +bool ksv::IO::saveConfiguration (TQDataStream& s, KSVDragList** start, KSVDragList** stop) { Q_INT32 version = 3; - s << QCString("KSysV") + s << TQCString("KSysV") << version - << QDateTime::currentDateTime(); // save date + << TQDateTime::currentDateTime(); // save date for (int i = 0; i < ksv::runlevelNumber; ++i) { Q_INT32 numberOfItems = start[i]->childCount(); - s << QString::fromLatin1 ("RUNLEVEL %1").arg (i) - << QString::fromLatin1 ("START") + s << TQString::fromLatin1 ("RUNLEVEL %1").arg (i) + << TQString::fromLatin1 ("START") << numberOfItems; - for (QListViewItemIterator it (start[i]); + for (TQListViewItemIterator it (start[i]); it.current(); ++it) { @@ -259,10 +259,10 @@ bool ksv::IO::saveConfiguration (QDataStream& s, numberOfItems = stop[i]->childCount(); - s << QString::fromLatin1 ("STOP") + s << TQString::fromLatin1 ("STOP") << numberOfItems; - for (QListViewItemIterator it (stop[i]); + for (TQListViewItemIterator it (stop[i]); it.current(); ++it) { @@ -273,19 +273,19 @@ bool ksv::IO::saveConfiguration (QDataStream& s, return true; } -KTrader::OfferList ksv::IO::servicesForFile (const QString& filename) +KTrader::OfferList ksv::IO::servicesForFile (const TQString& filename) { static KTrader* trader = KTrader::self(); static KMimeMagic* magic = KMimeMagic::self(); - const QString mimetype = magic->findFileType(filename)->mimeType(); + const TQString mimetype = magic->findFileType(filename)->mimeType(); return trader->query (mimetype, "Type == 'Application'"); } -KService::Ptr ksv::IO::preferredServiceForFile (const QString& filename) +KService::Ptr ksv::IO::preferredServiceForFile (const TQString& filename) { static KMimeMagic* magic = KMimeMagic::self(); - const QString mimetype = magic->findFileType(filename)->mimeType(); + const TQString mimetype = magic->findFileType(filename)->mimeType(); return KServiceTypeProfile::preferredService (mimetype, "Application"); } |