diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
commit | ffe8a83e053396df448e9413828527613ca3bd46 (patch) | |
tree | a73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kab/qconfigDB.cc | |
parent | 682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff) | |
download | tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kab/qconfigDB.cc')
-rw-r--r-- | kab/qconfigDB.cc | 344 |
1 files changed, 172 insertions, 172 deletions
diff --git a/kab/qconfigDB.cc b/kab/qconfigDB.cc index d6a92261f..a49388ff9 100644 --- a/kab/qconfigDB.cc +++ b/kab/qconfigDB.cc @@ -24,12 +24,12 @@ extern "C" { #include <ctype.h> } -// #include <qstring.h> -#include <qtextstream.h> -#include <qfile.h> -#include <qtimer.h> -#include <qdatetime.h> -#include <qfileinfo.h> +// #include <tqstring.h> +#include <tqtextstream.h> +#include <tqfile.h> +#include <tqtimer.h> +#include <tqdatetime.h> +#include <tqfileinfo.h> #include "qconfigDB.moc" #include <kdebug.h> @@ -40,7 +40,7 @@ extern "C" { #define KAB_KDEBUG_AREA 800 -static bool isComment(QCString line) +static bool isComment(TQCString line) { // ############################################################################ line=line.stripWhiteSpace(); @@ -53,13 +53,13 @@ static bool isComment(QCString line) // ############################################################################ } -static void tokenize(list<QCString>& res, const QCString& text, char tr, bool strict=false) +static void tokenize(list<TQCString>& res, const TQCString& text, char tr, bool strict=false) { register bool GUARD; GUARD=false; // ############################################################################ kdDebug(GUARD, KAB_KDEBUG_AREA) << "tokenize: called." << endl; int eins=0, zwei=0; - QCString teil; + TQCString teil; // ----- kdDebug(GUARD, KAB_KDEBUG_AREA) << "tokenize: partening -->%" << text.data() << "<--." << endl; res.erase(res.begin(), res.end()); @@ -95,14 +95,14 @@ static void tokenize(list<QCString>& res, const QCString& text, char tr, bool st // ############################################################################ } -// QCString AuthorEmailAddress; // assign your email address to this string +// TQCString AuthorEmailAddress; // assign your email address to this string -static QCString ReadLineFromStream(QTextStream& stream) +static TQCString ReadLineFromStream(TQTextStream& stream) { register bool GUARD; GUARD=false; // ############################################################################ kdDebug(GUARD, KAB_KDEBUG_AREA) << "ReadLineFromStream:: reading line." << endl; - QCString line; + TQCString line; // ----- while(!stream.eof()) { @@ -125,7 +125,7 @@ static QCString ReadLineFromStream(QTextStream& stream) // class implementations: -list<QString> QConfigDB::LockFiles; // the lockfiles created by this session +list<TQString> QConfigDB::LockFiles; // the lockfiles created by this session KeyValueMap::KeyValueMap() : data(new StringStringMap) @@ -189,19 +189,19 @@ KeyValueMap::clear() } bool -KeyValueMap::fill(const QString& filename, bool force, bool relax) +KeyValueMap::fill(const TQString& filename, bool force, bool relax) { register bool GUARD; GUARD=false; // ########################################################################### - QFile file(filename); - QCString line; + TQFile file(filename); + TQCString line; // ----- if(file.open(IO_ReadOnly)) { - QTextStream stream(&file); - // We read/write utf8 strings, so we don't want that QTextStream uses local8bit - // Latin1 means : no conversion, when giving char*s to a QTextStream. (DF) - stream.setEncoding(QTextStream::Latin1); + TQTextStream stream(&file); + // We read/write utf8 strings, so we don't want that TQTextStream uses local8bit + // Latin1 means : no conversion, when giving char*s to a TQTextStream. (DF) + stream.setEncoding(TQTextStream::Latin1); // ----- while(!stream.eof()) { @@ -229,7 +229,7 @@ KeyValueMap::fill(const QString& filename, bool force, bool relax) } bool -KeyValueMap::save(const QString& filename, bool force) +KeyValueMap::save(const TQString& filename, bool force) { register bool GUARD; GUARD=false; // ########################################################################### @@ -237,7 +237,7 @@ KeyValueMap::save(const QString& filename, bool force) "KeyValueMap::save: saving data to -->" << filename << "<--.\n"; StringStringMap::iterator pos; - QFile file(filename); + TQFile file(filename); // ----- open file, regarding existence: if(!force) { @@ -250,8 +250,8 @@ KeyValueMap::save(const QString& filename, bool force) } if(file.open(IO_WriteOnly)) { - QTextStream stream(&file); - stream.setEncoding(QTextStream::Latin1); // no conversion + TQTextStream stream(&file); + stream.setEncoding(TQTextStream::Latin1); // no conversion stream << "# saved by KeyValueMap object ($Revision$)" << endl; for(pos=data->begin(); pos!=data->end(); ++pos) { // values do not get coded here @@ -269,7 +269,7 @@ KeyValueMap::save(const QString& filename, bool force) } bool -KeyValueMap::save(QTextStream& file, int count) +KeyValueMap::save(TQTextStream& file, int count) { register bool GUARD; GUARD=false; // ########################################################################### @@ -293,7 +293,7 @@ KeyValueMap::save(QTextStream& file, int count) bool -KeyValueMap::erase(const QCString& key) +KeyValueMap::erase(const TQCString& key) { // ########################################################################### bool rc=(data->erase(key)>0); @@ -312,17 +312,17 @@ KeyValueMap::empty() bool KeyValueMap::parseComplexString -(const QCString& orig, +(const TQCString& orig, int index, // first char to parse - QCString& result, // string without leading and trailing ".." + TQCString& result, // string without leading and trailing ".." int& noOfChars) // no of chars that represented the const // complex string in the original { register bool GUARD; GUARD=false; // ########################################################################### int first; - QCString temp(2*orig.length()); - QCString mod; + TQCString temp(2*orig.length()); + TQCString mod; int count=1; kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::parseComplexString: parsing the string -->" @@ -413,7 +413,7 @@ KeyValueMap::parseComplexString } QCString -KeyValueMap::makeComplexString(const QCString& orig) +KeyValueMap::makeComplexString(const TQCString& orig) { register bool GUARD; GUARD=false; // ########################################################################### @@ -421,7 +421,7 @@ KeyValueMap::makeComplexString(const QCString& orig) "KeyValueMap::makeComplexString: coding the string\n -->" << orig << "<--\n into a complex string.\n"; - QCString temp(2*orig.length()); + TQCString temp(2*orig.length()); unsigned int count; // ----- temp+='"'; // opening bracket @@ -466,7 +466,7 @@ KeyValueMap::makeComplexString(const QCString& orig) } bool -KeyValueMap::getRaw(const QCString& key, QCString& value) const +KeyValueMap::getRaw(const TQCString& key, TQCString& value) const { register bool GUARD; GUARD=false; // ########################################################################### @@ -488,7 +488,7 @@ KeyValueMap::getRaw(const QCString& key, QCString& value) const } bool -KeyValueMap::insertRaw(const QCString& key, const QCString& value, bool force) +KeyValueMap::insertRaw(const TQCString& key, const TQCString& value, bool force) { register bool GUARD; GUARD=false; // ########################################################################### @@ -533,7 +533,7 @@ KeyValueMap::insertRaw(const QCString& key, const QCString& value, bool force) // ascii strings: bool -KeyValueMap::insert(const QCString& key, const QCString& value, bool force) +KeyValueMap::insert(const TQCString& key, const TQCString& value, bool force) { register bool GUARD; GUARD=false; // ########################################################################### @@ -554,15 +554,15 @@ KeyValueMap::insert(const QCString& key, const QCString& value, bool force) */ bool -KeyValueMap::insertLine(QCString line, bool force, bool relax, bool encode) +KeyValueMap::insertLine(TQCString line, bool force, bool relax, bool encode) { register bool GUARD; GUARD=false; // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::insertLine: inserting line -->"<<line<<"<--.\n"; int index; - QCString key; - QCString value; + TQCString key; + TQCString value; // ----- is the line empty or does it contain only whitespaces? uint len = line.length(); for(index=0; isspace(line[index]) && (unsigned)index<len; ++index); @@ -609,14 +609,14 @@ KeyValueMap::insertLine(QCString line, bool force, bool relax, bool encode) } bool -KeyValueMap::get(const QCString& key, QCString& value) const +KeyValueMap::get(const TQCString& key, TQCString& value) const { register bool GUARD; GUARD=false; // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::get[string]: " "trying to get value for key \"" << key << "\" ... " << endl; - QCString raw; - QCString temp; + TQCString raw; + TQCString temp; // ----- if(!getRaw(key, raw)) { @@ -649,11 +649,11 @@ KeyValueMap::get(const QCString& key, QCString& value) const // UNICODE strings: bool -KeyValueMap::insert(const QCString& key, const QString& value, bool force) +KeyValueMap::insert(const TQCString& key, const TQString& value, bool force) { register bool GUARD; GUARD=false; // ########################################################################### - QCString v; + TQCString v; // ----- v=value.utf8(); kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::insert[QString]: trying to " @@ -666,13 +666,13 @@ KeyValueMap::insert(const QCString& key, const QString& value, bool force) } bool -KeyValueMap::get(const QCString& key, QString& value) const +KeyValueMap::get(const TQCString& key, TQString& value) const { register bool GUARD; GUARD=false; // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::get[QString]: trying to get " - "a QString value for key " << key << endl; - QCString v; + "a TQString value for key " << key << endl; + TQCString v; // ----- get string representation: if(!get(key, v)) { @@ -681,7 +681,7 @@ KeyValueMap::get(const QCString& key, QString& value) const return false; } // ----- find its state: - value=QString::fromUtf8(v); // is there a better way? + value=TQString::fromUtf8(v); // is there a better way? kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::get[QString]: success, value" " (in UTF8) is " << v << endl; return true; @@ -692,7 +692,7 @@ KeyValueMap::get(const QCString& key, QString& value) const // bool: bool -KeyValueMap::insert(const QCString& key, const bool& value, bool force) +KeyValueMap::insert(const TQCString& key, const bool& value, bool force) { register bool GUARD; GUARD=false; // ########################################################################### @@ -707,13 +707,13 @@ KeyValueMap::insert(const QCString& key, const bool& value, bool force) bool -KeyValueMap::get(const QCString& key, bool& value) const +KeyValueMap::get(const TQCString& key, bool& value) const { register bool GUARD; GUARD=false; // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::get[bool]: trying to get " "BOOL value for key " << key << endl; - QCString v; + TQCString v; // ----- get string representation: if(!get(key, v)) { @@ -748,13 +748,13 @@ KeyValueMap::get(const QCString& key, bool& value) const // long: bool -KeyValueMap::insert(const QCString& key, const long& value, bool force) +KeyValueMap::insert(const TQCString& key, const long& value, bool force) { register bool GUARD; GUARD=false; // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::insert[int]: trying to " "insert value \""<<value << "\" for key\n -->"<<key<<"<--.\n"; - QCString temp; + TQCString temp; // ----- temp.setNum(value); return insert(key, temp, force); @@ -762,13 +762,13 @@ KeyValueMap::insert(const QCString& key, const long& value, bool force) } bool -KeyValueMap::get(const QCString& key, long& value) const +KeyValueMap::get(const TQCString& key, long& value) const { register bool GUARD; GUARD=false; // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::get[int]: trying to get " "INTEGER value for key " << key << endl; - QCString v; + TQCString v; bool ok; long temp; // ----- @@ -794,14 +794,14 @@ KeyValueMap::get(const QCString& key, long& value) const // long int lists: bool -KeyValueMap::insert(const QCString& key, const list<long>& values, bool force) +KeyValueMap::insert(const TQCString& key, const list<long>& values, bool force) { register bool GUARD; GUARD=false; // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::insert[long int list]: " "trying to insert long int list into map." << endl; - QCString temp; - QCString value; + TQCString temp; + TQCString value; list<long>::const_iterator pos; // ----- for(pos=values.begin(); pos!=values.end(); ++pos) @@ -821,7 +821,7 @@ KeyValueMap::insert(const QCString& key, const list<long>& values, bool force) } bool -KeyValueMap::get(const QCString& key, list<long>& values) const +KeyValueMap::get(const TQCString& key, list<long>& values) const { register bool GUARD; GUARD=false; // ########################################################################### @@ -829,9 +829,9 @@ KeyValueMap::get(const QCString& key, list<long>& values) const "to decode int list for key " << key << endl; kdDebug(!values.empty(), KAB_KDEBUG_AREA) << "KeyValueMap::get[long int list]" ": attention - list should be empty but is not.\n"; - QCString value; - list<QCString> tokens; - list<QCString>::iterator pos; + TQCString value; + list<TQCString> tokens; + list<TQCString>::iterator pos; long temp; bool ok; // ----- @@ -869,14 +869,14 @@ KeyValueMap::get(const QCString& key, list<long>& values) const // int lists: bool -KeyValueMap::insert(const QCString& key, const list<int>& values, bool force) +KeyValueMap::insert(const TQCString& key, const list<int>& values, bool force) { register bool GUARD; GUARD=false; // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::insert[int list]: trying to " "insert int list into map." << endl; - QCString temp; - QCString value; + TQCString temp; + TQCString value; list<int>::const_iterator pos; // ----- for(pos=values.begin(); pos!=values.end(); ++pos) @@ -896,7 +896,7 @@ KeyValueMap::insert(const QCString& key, const list<int>& values, bool force) } bool -KeyValueMap::get(const QCString& key, list<int>& values) const +KeyValueMap::get(const TQCString& key, list<int>& values) const { register bool GUARD; GUARD=false; // ########################################################################### @@ -904,9 +904,9 @@ KeyValueMap::get(const QCString& key, list<int>& values) const "decode int list for key " << key << endl; kdDebug(!values.empty(), KAB_KDEBUG_AREA) << "KeyValueMap::get[int list]: " "attention - list should be empty but is not.\n"; - QCString value; - list<QCString> tokens; - list<QCString>::iterator pos; + TQCString value; + list<TQCString> tokens; + list<TQCString>::iterator pos; int temp; bool ok; // ----- @@ -944,13 +944,13 @@ KeyValueMap::get(const QCString& key, list<int>& values) const // doubles: bool -KeyValueMap::insert(const QCString& key, const double& value, bool force) +KeyValueMap::insert(const TQCString& key, const double& value, bool force) { register bool GUARD; GUARD=false; // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA).form("KeyValueMap::insert[double]: trying to " "insert value \"%f\" for key\n -->", value) << key << "<--.\n"; - QCString temp; + TQCString temp; // ----- temp.setNum(value); return insert(key, temp, force); @@ -958,13 +958,13 @@ KeyValueMap::insert(const QCString& key, const double& value, bool force) } bool -KeyValueMap::get(const QCString& key, double& value) const +KeyValueMap::get(const TQCString& key, double& value) const { register bool GUARD; GUARD=false; // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::get[double]: trying to get " "FLOAT value for key " << key << endl; - QCString v; + TQCString v; bool ok; double temp; // ----- @@ -991,7 +991,7 @@ KeyValueMap::get(const QCString& key, double& value) const // lists of strings: bool -KeyValueMap::get(const QCString& key, list<QCString>& values) const +KeyValueMap::get(const TQCString& key, list<TQCString>& values) const { register bool GUARD; GUARD=false; kdDebug(!values.empty(), KAB_KDEBUG_AREA) << "KeyValueMap::get[string list]: " @@ -1000,7 +1000,7 @@ KeyValueMap::get(const QCString& key, list<QCString>& values) const // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::get[string list]: trying to " "decode string list for key " << key << endl; - QCString raw, part, value; + TQCString raw, part, value; int first=1, second=1, i; // ----- get the string value as a whole: if(!getRaw(key, raw)) @@ -1068,15 +1068,15 @@ KeyValueMap::get(const QCString& key, list<QCString>& values) const } bool -KeyValueMap::insert(const QCString& key, const list<QCString>& values, bool force) +KeyValueMap::insert(const TQCString& key, const list<TQCString>& values, bool force) { register bool GUARD; GUARD=false; // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::insert[string list]: " "coding string list." << endl; - QCString value="\""; - QCString temp; - list<QCString>::const_iterator pos; + TQCString value="\""; + TQCString temp; + list<TQCString>::const_iterator pos; // ----- create coded string list: for(pos=values.begin(); pos!=values.end(); @@ -1100,7 +1100,7 @@ KeyValueMap::insert(const QCString& key, const list<QCString>& values, bool forc // QStrList-s: bool -KeyValueMap::get(const QCString& key, QStrList& values) const +KeyValueMap::get(const TQCString& key, TQStrList& values) const { register bool GUARD; GUARD=false; kdDebug(!values.isEmpty(), KAB_KDEBUG_AREA) << "KeyValueMap::get[QStrList]: " @@ -1109,7 +1109,7 @@ KeyValueMap::get(const QCString& key, QStrList& values) const // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::get[QStrList]: trying to " "decode string list for key " << key << endl; - QCString raw, part, value; + TQCString raw, part, value; int first=1, second=1, i; // ----- get the string value as a whole: if(!getRaw(key, raw)) @@ -1176,19 +1176,19 @@ KeyValueMap::get(const QCString& key, QStrList& values) const } bool -KeyValueMap::insert(const QCString& key, const QStrList& values, bool force) +KeyValueMap::insert(const TQCString& key, const TQStrList& values, bool force) { register bool GUARD; GUARD=false; // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::insert[QStrList]: coding string list." << endl; - QCString value="\""; - QCString temp; + TQCString value="\""; + TQCString temp; unsigned int count; // ----- create coded string list: for(count=0; count<values.count(); ++count) { // create strings like "abc\efgh\eijk": - temp=makeComplexString(((QStrList)values).at(count)); + temp=makeComplexString(((TQStrList)values).at(count)); temp.remove(0, 1); // remove the leading "\"" temp.remove(temp.length()-1, 1); // the trailing "\"" value+=temp; @@ -1207,7 +1207,7 @@ KeyValueMap::insert(const QCString& key, const QStrList& values, bool force) // QStringList-s: bool -KeyValueMap::get(const QCString& key, QStringList& values) const +KeyValueMap::get(const TQCString& key, TQStringList& values) const { register bool GUARD; GUARD=false; kdDebug(!values.isEmpty(), KAB_KDEBUG_AREA) << "KeyValueMap::get" @@ -1217,8 +1217,8 @@ KeyValueMap::get(const QCString& key, QStringList& values) const /* The values are stored in a utf8-coded set of QCStrings. This list is retrieved and converted back to Unicode strings. */ kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::get[QStringList]: trying to " - "decode QStringList for key " << key << endl; - QStrList temp; + "decode TQStringList for key " << key << endl; + TQStrList temp; unsigned int count; // ----- get the plain C strings: if(!get(key, temp)) @@ -1231,7 +1231,7 @@ KeyValueMap::get(const QCString& key, QStringList& values) const // ----- do the conversion: for(count=0; count<temp.count(); ++count) { - values.append(QString::fromUtf8(temp.at(count))); + values.append(TQString::fromUtf8(temp.at(count))); } // ----- kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::get[QStringList]: done." << endl; @@ -1240,16 +1240,16 @@ KeyValueMap::get(const QCString& key, QStringList& values) const } bool -KeyValueMap::insert(const QCString& key, const QStringList& values, bool force) +KeyValueMap::insert(const TQCString& key, const TQStringList& values, bool force) { register bool GUARD; GUARD=false; // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << - "KeyValueMap::insert[QStringList]: coding QStringList." << endl; + "KeyValueMap::insert[QStringList]: coding TQStringList." << endl; // The method simply creates a list of utf8-coded strings and inserts it. - QStrList utf8strings; + TQStrList utf8strings; unsigned int count; - // ----- create QCString list: + // ----- create TQCString list: for(count=0; count<values.count(); ++count) { utf8strings.append((*values.at(count)).utf8()); @@ -1263,15 +1263,15 @@ KeyValueMap::insert(const QCString& key, const QStringList& values, bool force) // lists of doubles: bool -KeyValueMap::insert(const QCString& key, const list<double>& values, bool force) +KeyValueMap::insert(const TQCString& key, const list<double>& values, bool force) { register bool GUARD; GUARD=false; // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::insert[double list]: trying " "to insert double list into map." << endl; - QCString buffer; - // QCString value(30*values.size()); // not usable with Qt 2 - QCString value; // WORK_TO_DO: how to reserve enough space to avoid growing? + TQCString buffer; + // TQCString value(30*values.size()); // not usable with Qt 2 + TQCString value; // WORK_TO_DO: how to reserve enough space to avoid growing? list<double>::const_iterator pos; // ----- for(pos=values.begin(); pos!=values.end(); ++pos) @@ -1291,7 +1291,7 @@ KeyValueMap::insert(const QCString& key, const list<double>& values, bool force) } bool -KeyValueMap::get(const QCString& key, list<double>& values) const +KeyValueMap::get(const TQCString& key, list<double>& values) const { register bool GUARD; GUARD=false; // ########################################################################### @@ -1299,9 +1299,9 @@ KeyValueMap::get(const QCString& key, list<double>& values) const "decode double list for key " << key << endl; kdDebug(!values.empty(), KAB_KDEBUG_AREA) << "KeyValueMap::get[double list]: " "attention - list should be empty but is not." << endl; - QCString value; - list<QCString> tokens; - list<QCString>::iterator pos; + TQCString value; + list<TQCString> tokens; + list<TQCString>::iterator pos; double temp; bool ok; // ----- @@ -1334,12 +1334,12 @@ KeyValueMap::get(const QCString& key, list<double>& values) const // QDates: bool -KeyValueMap::insert(const QCString& key, const QDate& value, bool force) +KeyValueMap::insert(const TQCString& key, const TQDate& value, bool force) { register bool GUARD; GUARD=false; // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::insert[QDate]: trying to " - "insert QDate into map." << endl; + "insert TQDate into map." << endl; list<long> values; // ----- if(!value.isValid()) @@ -1358,15 +1358,15 @@ KeyValueMap::insert(const QCString& key, const QDate& value, bool force) } bool -KeyValueMap::get(const QCString& key, QDate& date) const +KeyValueMap::get(const TQCString& key, TQDate& date) const { register bool GUARD; GUARD=false; // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << "KeyValueMap::get[QDate]: trying to decode" - " QDate for key " << key << endl; + " TQDate for key " << key << endl; list<long> values; long y, m, d; - QDate temp; + TQDate temp; // ----- if(!get(key, values)) { @@ -1384,7 +1384,7 @@ KeyValueMap::get(const QCString& key, QDate& date) const m=values.front(); values.pop_front(); d=values.front(); // ----- - if(y!=0 || m!=0 || d!=0) temp.setYMD(y, m, d); // avoid QDate messages + if(y!=0 || m!=0 || d!=0) temp.setYMD(y, m, d); // avoid TQDate messages if(!temp.isValid() && !temp.isNull()) { kdDebug(GUARD, KAB_KDEBUG_AREA) << @@ -1418,7 +1418,7 @@ Section::Section(const KeyValueMap& contents) } bool -Section::add(const QCString& name) +Section::add(const TQCString& name) { register bool GUARD; GUARD=false; // ########################################################################### @@ -1453,7 +1453,7 @@ Section::add(const QCString& name) } bool -Section::add(const QCString& name, Section* section) +Section::add(const TQCString& name, Section* section) { register bool GUARD; GUARD=false; // ########################################################################### @@ -1471,7 +1471,7 @@ Section::add(const QCString& name, Section* section) } bool -Section::find(const QCString& name, StringSectionMap::iterator& result) +Section::find(const TQCString& name, StringSectionMap::iterator& result) { register bool GUARD; GUARD=false; // ########################################################################### @@ -1493,7 +1493,7 @@ Section::find(const QCString& name, StringSectionMap::iterator& result) } bool -Section::remove(const QCString& name) +Section::remove(const TQCString& name) { // ########################################################################### StringSectionMap::iterator pos; @@ -1509,7 +1509,7 @@ Section::remove(const QCString& name) } bool -Section::find(const QCString& name, Section*& section) +Section::find(const TQCString& name, Section*& section) { // ########################################################################### StringSectionMap::iterator pos; @@ -1533,7 +1533,7 @@ Section::getKeys() } void -Section::insertIndentSpace(QTextStream& file, int level) +Section::insertIndentSpace(TQTextStream& file, int level) { // ########################################################################### int i, j; @@ -1547,7 +1547,7 @@ Section::insertIndentSpace(QTextStream& file, int level) } bool -Section::save(QTextStream& stream, int level) +Section::save(TQTextStream& stream, int level) { register bool GUARD; GUARD=false; // ########################################################################### @@ -1590,13 +1590,13 @@ Section::save(QTextStream& stream, int level) } bool -Section::readSection(QTextStream& file, bool finish) +Section::readSection(TQTextStream& file, bool finish) { register bool GUARD; GUARD=false; // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << "Section::readSection: reading section." << endl; - QCString line; - QCString name; + TQCString line; + TQCString name; Section* temp; // ----- for(;;) @@ -1659,7 +1659,7 @@ Section::readSection(QTextStream& file, bool finish) } bool -Section::isBeginOfSection(QCString line) +Section::isBeginOfSection(TQCString line) { register bool GUARD; GUARD=false; // ########################################################################### @@ -1685,7 +1685,7 @@ Section::isBeginOfSection(QCString line) } bool -Section::isEndOfSection(QCString line) +Section::isEndOfSection(TQCString line) { register bool GUARD; GUARD=false; // ########################################################################### @@ -1693,7 +1693,7 @@ Section::isEndOfSection(QCString line) << line <<" the end of" " a section?" << endl; int first=1, second; - QCString temp; + TQCString temp; // ----- line=line.simplifyWhiteSpace(); if(line.isEmpty() || line.length()<2) @@ -1726,12 +1726,12 @@ Section::isEndOfSection(QCString line) } QCString -Section::nameOfSection(const QCString& line) +Section::nameOfSection(const TQCString& line) { register bool GUARD; GUARD=false; // ########################################################################### int first=1, second; - QCString temp; + TQCString temp; // ----- temp=line.simplifyWhiteSpace(); if(temp.isEmpty() || temp.length()<=2) @@ -1808,12 +1808,12 @@ Section::noOfSections() // ########################################################################### } -QConfigDB::QConfigDB(QWidget* parent, const char* name) - : QWidget(parent, name), +QConfigDB::QConfigDB(TQWidget* parent, const char* name) + : TQWidget(parent, name), timer(0), readonly(true), locked(false), - mtime(new QDateTime) + mtime(new TQDateTime) { // ########################################################################### hide(); @@ -1847,13 +1847,13 @@ bool QConfigDB::invariant() } bool -QConfigDB::get(const list<QCString>& key, KeyValueMap*& map) +QConfigDB::get(const list<TQCString>& key, KeyValueMap*& map) { register bool GUARD; GUARD=false; // ############################################################################ kdDebug(GUARD, KAB_KDEBUG_AREA) << "QConfigDB::get: trying to get keys ... " << endl; Section* section=⊤ - list<QCString>::const_iterator pos; + list<TQCString>::const_iterator pos; // ----- if(key.empty()) { @@ -1890,12 +1890,12 @@ QConfigDB::get() } bool -QConfigDB::createSection(const list<QCString>& key) +QConfigDB::createSection(const list<TQCString>& key) { // ############################################################################ Section* section=⊤ unsigned int index; - list<QCString>::const_iterator pos; + list<TQCString>::const_iterator pos; Section* thenewone; bool rc; // ----- @@ -1942,7 +1942,7 @@ QConfigDB::empty() } bool -QConfigDB::createSection(const QCString& desc) +QConfigDB::createSection(const TQCString& desc) { // ############################################################################ return createSection(stringToKeylist(desc)); @@ -1950,22 +1950,22 @@ QConfigDB::createSection(const QCString& desc) } bool -QConfigDB::get(const QCString& key, KeyValueMap*& map) +QConfigDB::get(const TQCString& key, KeyValueMap*& map) { // ############################################################################ return get(stringToKeylist(key), map); // ############################################################################ } -list<QCString> -QConfigDB::stringToKeylist(const QCString& desc) +list<TQCString> +QConfigDB::stringToKeylist(const TQCString& desc) { register bool GUARD; GUARD=false; kdDebug(GUARD, KAB_KDEBUG_AREA) << "QConfigDB::stringToKeylist: parsing path " << desc << endl; // ############################################################################ - list<QCString> key; + list<TQCString> key; int first=0, second; - QCString temp; + TQCString temp; // ----- if(desc.isEmpty()) { @@ -2002,7 +2002,7 @@ QConfigDB::stringToKeylist(const QCString& desc) bool -QConfigDB::get(const QCString& key, Section*& section) +QConfigDB::get(const TQCString& key, Section*& section) { // ############################################################################ return get(stringToKeylist(key), section); @@ -2010,13 +2010,13 @@ QConfigDB::get(const QCString& key, Section*& section) } bool -QConfigDB::get(const list<QCString>& key, Section*& section) +QConfigDB::get(const list<TQCString>& key, Section*& section) { register bool GUARD; GUARD=false; // ############################################################################ kdDebug(GUARD, KAB_KDEBUG_AREA) << "QConfigDB::get: searching section ... " << endl; Section* temp=⊤ - list<QCString>::const_iterator pos; + list<TQCString>::const_iterator pos; // ----- for(pos=key.begin(); pos!=key.end(); ++pos) { @@ -2042,24 +2042,24 @@ QConfigDB::isRO() } int -QConfigDB::IsLocked(const QString& file) +QConfigDB::IsLocked(const TQString& file) { register bool GUARD; GUARD=false; // ############################################################################ - QString lockfile=file+".lock"; + TQString lockfile=file+".lock"; int pid=-1; // ----- - if(access(QFile::encodeName(lockfile), F_OK)==0) + if(access(TQFile::encodeName(lockfile), F_OK)==0) { - QFile f(lockfile); + TQFile f(lockfile); // ----- kdDebug(GUARD, KAB_KDEBUG_AREA) << "QConfigDB::IsLocked: the file\n" << file << "\nhas a lockfile.\n"; if(f.open(IO_ReadOnly)) { - QTextStream stream(&f); - stream.setEncoding(QTextStream::Latin1); // no conversion + TQTextStream stream(&f); + stream.setEncoding(TQTextStream::Latin1); // no conversion // ----- stream >> pid; if(pid==-1) @@ -2106,16 +2106,16 @@ QConfigDB::lock() } bool -QConfigDB::lock(const QString& file) +QConfigDB::lock(const TQString& file) { register bool GUARD; GUARD=false; // ############################################################################ kdDebug(GUARD, KAB_KDEBUG_AREA) << "QConfigDB::lock: locking the file " << file << endl; - QString lockfile=file+".lock"; - QFile f(lockfile); + TQString lockfile=file+".lock"; + TQFile f(lockfile); // ----- - if(access(QFile::encodeName(lockfile), F_OK)==0) + if(access(TQFile::encodeName(lockfile), F_OK)==0) { kdDebug(GUARD, KAB_KDEBUG_AREA) << "QConfigDB::lock: the file is locked by" " another process." << endl; @@ -2123,8 +2123,8 @@ QConfigDB::lock(const QString& file) } else { if(f.open(IO_WriteOnly)) { - QTextStream stream(&f); - stream.setEncoding(QTextStream::Latin1); // no conversion + TQTextStream stream(&f); + stream.setEncoding(TQTextStream::Latin1); // no conversion // ----- stream << getpid() << endl; f.close(); @@ -2147,8 +2147,8 @@ QConfigDB::unlock() // ############################################################################ kdDebug(GUARD, KAB_KDEBUG_AREA) << "QConfigDB::unlock: unlocking the file " << filename << endl; - QString lockfile=filename+".lock"; - list<QString>::iterator pos; + TQString lockfile=filename+".lock"; + list<TQString>::iterator pos; // ----- if(!locked) { @@ -2156,9 +2156,9 @@ QConfigDB::unlock() "lock the file!" << endl; return false; } - if(access(QFile::encodeName(lockfile), F_OK | W_OK)==0) + if(access(TQFile::encodeName(lockfile), F_OK | W_OK)==0) { - if(::remove(QFile::encodeName(lockfile))==0) + if(::remove(TQFile::encodeName(lockfile))==0) { kdDebug(GUARD, KAB_KDEBUG_AREA) << "QConfigDB::unlock: lockfile deleted." << endl; @@ -2192,13 +2192,13 @@ QConfigDB::CleanLockFiles(int) { register bool GUARD; GUARD=false; // ############################################################################ - list<QString>::iterator pos; + list<TQString>::iterator pos; // ----- kdDebug(GUARD, KAB_KDEBUG_AREA).form("QConfigDB::CleanLockFiles: removing %i " "remaining lockfiles.", LockFiles.size()) << endl; for(pos=LockFiles.begin(); pos!=LockFiles.end(); ++pos) { - if(::remove(QFile::encodeName(*pos))==0) + if(::remove(TQFile::encodeName(*pos))==0) { kdDebug(GUARD, KAB_KDEBUG_AREA) << " " << *pos << " removed.\n"; @@ -2220,8 +2220,8 @@ QConfigDB::watch(bool state) { // start timer if(timer==0) { - timer=new QTimer(this); - connect(timer, SIGNAL(timeout()), SLOT(checkFileChanged())); + timer=new TQTimer(this); + connect(timer, TQT_SIGNAL(timeout()), TQT_SLOT(checkFileChanged())); } timer->start(1000); } else { // stop timer @@ -2234,7 +2234,7 @@ QConfigDB::watch(bool state) } bool -QConfigDB::CheckLockFile(const QString& file) +QConfigDB::CheckLockFile(const TQString& file) { register bool GUARD; GUARD=false; // ############################################################################ @@ -2278,7 +2278,7 @@ QConfigDB::checkFileChanged() kdDebug(GUARD, KAB_KDEBUG_AREA) << "QConfigDB::checkFileChanged: no filename." << endl; return false; } - QFileInfo file(filename); + TQFileInfo file(filename); // ----- if(file.exists()) { @@ -2311,7 +2311,7 @@ QConfigDB::storeFileAge() register bool GUARD; GUARD=false; // ############################################################################ kdDebug(GUARD, KAB_KDEBUG_AREA) << "QConfigDB::storeFileAge: called." << endl; - QFileInfo file(filename); + TQFileInfo file(filename); // ----- if(file.exists()) { @@ -2319,7 +2319,7 @@ QConfigDB::storeFileAge() return true; } else { kdDebug(GUARD, KAB_KDEBUG_AREA) << "QConfigDB::save: could not stat file." << endl; - *mtime=QDateTime(); // a null date + *mtime=TQDateTime(); // a null date return false; } // ############################################################################ @@ -2327,7 +2327,7 @@ QConfigDB::storeFileAge() bool -QConfigDB::setFileName(const QString& filename_, bool mustexist, bool readonly_) +QConfigDB::setFileName(const TQString& filename_, bool mustexist, bool readonly_) { register bool GUARD; GUARD=false; // ############################################################################ @@ -2347,7 +2347,7 @@ QConfigDB::setFileName(const QString& filename_, bool mustexist, bool readonly_) // ----- remove possible stale lockfile: if(IsLocked(filename_)!=0 && !CheckLockFile(filename_)) { // ----- it is stale: - if(::remove(QFile::encodeName(filename_+".lock"))==0) + if(::remove(TQFile::encodeName(filename_+".lock"))==0) { kdDebug(GUARD, KAB_KDEBUG_AREA) << "QConfigDB::setFileName: removed stale lockfile." << endl; @@ -2360,7 +2360,7 @@ QConfigDB::setFileName(const QString& filename_, bool mustexist, bool readonly_) // ----- if(mustexist) { - if(access(QFile::encodeName(filename_), readonly_==true ? R_OK : W_OK | R_OK)==0) + if(access(TQFile::encodeName(filename_), readonly_==true ? R_OK : W_OK | R_OK)==0) { kdDebug(GUARD, KAB_KDEBUG_AREA) << "QConfigDB::setFileName: permission granted." << endl; @@ -2384,10 +2384,10 @@ QConfigDB::setFileName(const QString& filename_, bool mustexist, bool readonly_) return false; } } else { - if(access(QFile::encodeName(filename_), F_OK)==0) + if(access(TQFile::encodeName(filename_), F_OK)==0) { kdDebug(GUARD, KAB_KDEBUG_AREA) << "QConfigDB::setFileName: file exists." << endl; - if(access(QFile::encodeName(filename_), W_OK | R_OK)==0) + if(access(TQFile::encodeName(filename_), W_OK | R_OK)==0) { kdDebug(GUARD, KAB_KDEBUG_AREA) << "QConfigDB::setFileName: permission granted." << endl; @@ -2472,11 +2472,11 @@ QConfigDB::save(const char* header, bool force) // ----- now save it: if(!isRO()) { - QFile file(filename); + TQFile file(filename); if(file.open(IO_WriteOnly)) { - QTextStream stream(&file); - stream.setEncoding(QTextStream::Latin1); // no conversion + TQTextStream stream(&file); + stream.setEncoding(TQTextStream::Latin1); // no conversion // ----- if(header!=0) { @@ -2524,13 +2524,13 @@ QConfigDB::load() { register bool GUARD; GUARD=false ; // ############################################################################ - QFile file(filename); + TQFile file(filename); // ----- if(file.open(IO_ReadOnly)) { kdDebug(GUARD, KAB_KDEBUG_AREA) << "QConfigDB::load: file access OK." << endl; - QTextStream stream(&file); - stream.setEncoding(QTextStream::Latin1); // no conversion + TQTextStream stream(&file); + stream.setEncoding(TQTextStream::Latin1); // no conversion // ----- clear(); bool rc=top.readSection(stream, false); |