diff options
Diffstat (limited to 'src/arkollon/rcparser.cpp')
-rw-r--r-- | src/arkollon/rcparser.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/arkollon/rcparser.cpp b/src/arkollon/rcparser.cpp index 147be1b..10124ac 100644 --- a/src/arkollon/rcparser.cpp +++ b/src/arkollon/rcparser.cpp @@ -19,9 +19,9 @@ ***************************************************************************/ #include "rcparser.h" -#include <qregexp.h> -#include <qfile.h> -#include <qtextstream.h> +#include <tqregexp.h> +#include <tqfile.h> +#include <tqtextstream.h> RcParser::RcParser() { @@ -32,18 +32,18 @@ RcParser::~RcParser() { } -void RcParser::addSearchDir(QString dir) +void RcParser::addSearchDir(TQString dir) { dirs.append(dir); } -bool RcParser::openFile(QString name) +bool RcParser::openFile(TQString name) { // Check if it exists fileName = ""; - for ( QStringList::Iterator it = dirs.begin(); it != dirs.end(); ++it ) + for ( TQStringList::Iterator it = dirs.begin(); it != dirs.end(); ++it ) { - if (QFile::exists((*it) + "/" + name)) + if (TQFile::exists((*it) + "/" + name)) { fileName = (*it) + "/" + name; break; @@ -57,17 +57,17 @@ bool RcParser::openFile(QString name) sections.clear(); // Read the file's contents - QFile file(fileName); + TQFile file(fileName); file.open(IO_ReadOnly); - QTextStream stream(&file); + TQTextStream stream(&file); - QRegExp sectionRegExp("^\\[([^\\]]*)\\]$"); - QRegExp pairRegExp("^([^=\\s]*)([=\\s]*)(.*)$"); + TQRegExp sectionRegExp("^\\[([^\\]]*)\\]$"); + TQRegExp pairRegExp("^([^=\\s]*)([=\\s]*)(.*)$"); currentSection = "RcParserDefaultSection"; while (!stream.atEnd()) { - QString line = stream.readLine(); + TQString line = stream.readLine(); if (line.left(1) == "#") // Comment continue; @@ -81,8 +81,8 @@ bool RcParser::openFile(QString name) } if (pairRegExp.search(line) != -1) { - QString key = pairRegExp.cap(1); - QString value = pairRegExp.cap(3); + TQString key = pairRegExp.cap(1); + TQString value = pairRegExp.cap(3); sections[currentSection][key] = value; //printf("Found pair \"%s\" = \"%s\"\n", key.latin1(), value.latin1()); continue; @@ -95,25 +95,25 @@ bool RcParser::openFile(QString name) return true; } -void RcParser::setSection(QString section) +void RcParser::setSection(TQString section) { currentSection = section; } -QStringList RcParser::sectionList() +TQStringList RcParser::sectionList() { return sections.keys(); } -QString RcParser::readString(QString key, QString def) +TQString RcParser::readString(TQString key, TQString def) { - QString ret = sections[currentSection][key]; + TQString ret = sections[currentSection][key]; if (ret.isEmpty()) return def; return ret; } -int RcParser::readInt(QString key, int def) +int RcParser::readInt(TQString key, int def) { bool ok; int ret = sections[currentSection][key].toInt(&ok); @@ -122,7 +122,7 @@ int RcParser::readInt(QString key, int def) return ret; } -bool RcParser::readBool(QString key, bool def) +bool RcParser::readBool(TQString key, bool def) { bool ret = def; if (sections[currentSection][key].lower() == "true") @@ -136,9 +136,9 @@ bool RcParser::readBool(QString key, bool def) return ret; } -QStringList RcParser::readList(QString key) +TQStringList RcParser::readList(TQString key) { - return QStringList::split(",", sections[currentSection][key]); + return TQStringList::split(",", sections[currentSection][key]); } |