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 | |
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')
-rw-r--r-- | kab/addressbook.cc | 170 | ||||
-rw-r--r-- | kab/addressbook.h | 134 | ||||
-rw-r--r-- | kab/kabapi.cc | 18 | ||||
-rw-r--r-- | kab/kabapi.h | 14 | ||||
-rw-r--r-- | kab/qconfigDB.cc | 344 | ||||
-rw-r--r-- | kab/qconfigDB.h | 172 |
6 files changed, 426 insertions, 426 deletions
diff --git a/kab/addressbook.cc b/kab/addressbook.cc index 8db8fdb26..d5813237c 100644 --- a/kab/addressbook.cc +++ b/kab/addressbook.cc @@ -18,8 +18,8 @@ #include "addressbook.h" #include "qconfigDB.h" -#include <qfileinfo.h> -#include <qstringlist.h> +#include <tqfileinfo.h> +#include <tqstringlist.h> #include <kapplication.h> #include <kglobal.h> @@ -100,23 +100,23 @@ const int AddressBook::Entry::NoOfFields =sizeof(AddressBook::Entry::Fields)/sizeof(AddressBook::Entry::Fields[0]); struct QStringLess - : public binary_function<const QString&, const QString&, bool> + : public binary_function<const TQString&, const TQString&, bool> { /** The function operator, inline. */ - bool operator()(const QString& x, const QString& y) const + bool operator()(const TQString& x, const TQString& y) const { return x < y; // make one Qt operator fit exactly } }; // ----- the derived map class: -class StringKabKeyMap : public map<QString, KabKey, QStringLess> +class StringKabKeyMap : public map<TQString, KabKey, QStringLess> { /* Same as map, but a class for compilation reasons. This way we do not need * to include the QStringLess class into the addressbook header file. */ }; // ----- another derived map class: -class KeyNameMap : public map<const char*, QString, less<const char*> > +class KeyNameMap : public map<const char*, TQString, less<const char*> > { // same thing }; @@ -132,7 +132,7 @@ KabKey::operator == (const KabKey& key) const } void -KabKey::setKey(const QCString& text) +KabKey::setKey(const TQCString& text) { // ########################################################################### key=text; @@ -153,7 +153,7 @@ AddressBook::Entry::Address::Address() { } -bool AddressBook::Entry::Address::nameOfField(const char* key, QString& value) +bool AddressBook::Entry::Address::nameOfField(const char* key, TQString& value) { KeyNameMap::iterator pos; // ----- @@ -164,47 +164,47 @@ bool AddressBook::Entry::Address::nameOfField(const char* key, QString& value) fields=new KeyNameMap; Q_CHECK_PTR(fields); if(!fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Headline"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Position"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Organization"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Department"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Sub-Department"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Delivery Label"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("street/postal","Address"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Zipcode"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("City"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Country"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("As in addresses", "State"))).second) { kdDebug(KAB_KDEBUG_AREA) @@ -217,7 +217,7 @@ bool AddressBook::Entry::Address::nameOfField(const char* key, QString& value) << "inserted field names." << endl; } #if ! defined NDEBUG - QString name; + TQString name; kdDebug(KAB_KDEBUG_AREA) << "AddressBook::Entry::Address::nameOfField:" << endl << "Created key-fieldname-map. Defined fields are:" @@ -248,7 +248,7 @@ bool AddressBook::Entry::Address::nameOfField(const char* key, QString& value) } } -bool AddressBook::Entry::nameOfField(const char* key, QString& value) +bool AddressBook::Entry::nameOfField(const char* key, TQString& value) { KeyNameMap::iterator pos; // ----- @@ -259,83 +259,83 @@ bool AddressBook::Entry::nameOfField(const char* key, QString& value) fields=new KeyNameMap; Q_CHECK_PTR(fields); if(!fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("person","Title"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Rank"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Formatted Name"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Name Prefix"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("First Name"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Middle Name"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Last Name"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Birthday"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Comment"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Talk Addresses"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Email Addresses"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Keywords"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Telephone Number"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("URLs"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("User Field 1"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("User Field 2"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("User Field 3"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("User Field 4"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Custom"))).second || !fields->insert - (map<const char*, QString, less<const char*> >::value_type + (map<const char*, TQString, less<const char*> >::value_type (Fields[counter++], i18n("Categories"))).second) { kdDebug(KAB_KDEBUG_AREA) @@ -347,7 +347,7 @@ bool AddressBook::Entry::nameOfField(const char* key, QString& value) << "inserted field names." << endl; } #if ! defined NDEBUG - QString name; + TQString name; kdDebug(KAB_KDEBUG_AREA) << "AddressBook::Entry::nameOfField:" << endl << "Created key-fieldname-map. Defined fields are:" << endl; @@ -400,8 +400,8 @@ int AddressBook::Entry::noOfAddresses() const return addresses.size(); } -AddressBook::AddressBook(QWidget* parent, const char* name, bool loadit) - : QFrame(parent, name), +AddressBook::AddressBook(TQWidget* parent, const char* name, bool loadit) + : TQFrame(parent, name), config(new QConfigDB(this)), data(new QConfigDB(this)), entries(new StringKabKeyMap), @@ -409,7 +409,7 @@ AddressBook::AddressBook(QWidget* parent, const char* name, bool loadit) { register bool GUARD; GUARD=true; // ########################################################################### - QString dir, filename; + TQString dir, filename; bool createBackup=true; KeyValueMap *keys; // ----- do memory checks (do not rely on exception handling): @@ -420,10 +420,10 @@ AddressBook::AddressBook(QWidget* parent, const char* name, bool loadit) i18n("Out of Memory")); kapp->quit(); // It is critical, but will possibly never happen. } - connect(data, SIGNAL(fileChanged()), SLOT(dataFileChanged())); - connect(data, SIGNAL(changed(QConfigDB*)), - SLOT(reloaded(QConfigDB*))); - connect(config, SIGNAL(fileChanged()), SLOT(configFileChanged())); + connect(data, TQT_SIGNAL(fileChanged()), TQT_SLOT(dataFileChanged())); + connect(data, TQT_SIGNAL(changed(QConfigDB*)), + TQT_SLOT(reloaded(QConfigDB*))); + connect(config, TQT_SIGNAL(fileChanged()), TQT_SLOT(configFileChanged())); // ----- set style: filename = locate( "data", STD_CONFIGFILENAME); @@ -482,7 +482,7 @@ AddressBook::AddressBook(QWidget* parent, const char* name, bool loadit) if(createBackup) { // ----- create the backup file: - QString temp=data->fileName(); + TQString temp=data->fileName(); if(data->setFileName(temp+".backup", false, false)) { if(!data->save()) @@ -543,14 +543,14 @@ AddressBook::ErrorCode AddressBook::getState() // ########################################################################### } -AddressBook::ErrorCode AddressBook::load(const QString& filename) +AddressBook::ErrorCode AddressBook::load(const TQString& filename) { // ----- Remark: Close the file if it could not be loaded! // ########################################################################### ErrorCode rc=NoError; - QFileInfo newfile, oldfile; + TQFileInfo newfile, oldfile; // ----- - QString fname = (filename.isEmpty()) ? data->fileName() : filename ; + TQString fname = (filename.isEmpty()) ? data->fileName() : filename ; if(fname.isEmpty()) // there was never a filename set: { state=NoFile; @@ -645,13 +645,13 @@ AddressBook::ErrorCode AddressBook::load(const QString& filename) } AddressBook::ErrorCode -AddressBook::getListOfNames(QStringList* strings, bool reverse, bool initials) +AddressBook::getListOfNames(TQStringList* strings, bool reverse, bool initials) { register bool GUARD; GUARD=false; // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << "AddressBook::getListOfNames: called.\n"; StringKabKeyMap::iterator pos; - QString desc; + TQString desc; ErrorCode rc=NoError; ErrorCode temp; // ----- erase the list contents: @@ -683,7 +683,7 @@ AddressBook::getListOfNames(QStringList* strings, bool reverse, bool initials) } AddressBook::ErrorCode -AddressBook::literalName(const KabKey& key, QString& text, bool rev, bool init) +AddressBook::literalName(const KabKey& key, TQString& text, bool rev, bool init) { // ########################################################################### Entry entry; @@ -700,12 +700,12 @@ AddressBook::literalName(const KabKey& key, QString& text, bool rev, bool init) } AddressBook::ErrorCode -AddressBook::literalName(const Entry& entry, QString& text, bool rev, bool init) +AddressBook::literalName(const Entry& entry, TQString& text, bool rev, bool init) { register bool GUARD; GUARD=false; // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << "AddressBook::literalName: called.\n"; - QString firstname, middlename, lastname, nameprefix; + TQString firstname, middlename, lastname, nameprefix; // ----- is the formatted name set? if(!entry.fn.isEmpty()) { @@ -848,7 +848,7 @@ AddressBook::reloaded(QConfigDB* db) } AddressBook::ErrorCode -AddressBook::save(const QString& filename, bool force) +AddressBook::save(const TQString& filename, bool force) { // ########################################################################### if(filename.isEmpty()) @@ -878,10 +878,10 @@ AddressBook::save(const QString& filename, bool force) } bool -AddressBook::isSameFile(const QString& a, const QString& b) +AddressBook::isSameFile(const TQString& a, const TQString& b) { // ########################################################################### - QFileInfo filea(a), fileb(b); + TQFileInfo filea(a), fileb(b); // ----- return filea.absFilePath()==fileb.absFilePath(); // ########################################################################### @@ -945,7 +945,7 @@ AddressBook::getEntry(const KabKey& key, Section*& section) "AddressBook::getEntry: no such entry.\n"; return NoSuchEntry; } else { - if(data->get((QCString)ENTRY_SECTION+'/'+key.getKey(), section)) + if(data->get((TQCString)ENTRY_SECTION+'/'+key.getKey(), section)) { kdDebug(GUARD, KAB_KDEBUG_AREA) << "AddressBook::getEntry: done." << endl; @@ -1251,7 +1251,7 @@ AddressBook::nextAvailEntryKey() Section::StringSectionMap::iterator pos; Section *section=entrySection(); KabKey key; - QCString dummy; + TQCString dummy; bool good=true; // ----- if(section!=0) @@ -1287,7 +1287,7 @@ AddressBook::updateMirrorMap() // ########################################################################### kdDebug(GUARD, KAB_KDEBUG_AREA) << "AddressBook::updateMirrorMap: updating mirror map.\n"; - QString key; + TQString key; Entry entry; ErrorCode ec; KabKey kk; @@ -1337,7 +1337,7 @@ AddressBook::makeEntryFromSection(Section* section, Entry& entry) Entry::Address addressDummy; int count; // ----- create the aggregats: - const QCString StringKeys[]= { + const TQCString StringKeys[]= { "title", "rank", "fn", @@ -1351,7 +1351,7 @@ AddressBook::makeEntryFromSection(Section* section, Entry& entry) "user3", "user4" }; - QString* StringValues[]= { + TQString* StringValues[]= { &temp.title, &temp.rank, &temp.fn, @@ -1366,7 +1366,7 @@ AddressBook::makeEntryFromSection(Section* section, Entry& entry) &temp.user4 }; const int StringKeySize=sizeof(StringKeys)/sizeof(StringKeys[0]); - const QCString StringListKeys[]= { + const TQCString StringListKeys[]= { "talk", "emails", "keywords", @@ -1375,7 +1375,7 @@ AddressBook::makeEntryFromSection(Section* section, Entry& entry) "custom", "categories" }; - QStringList* StringListValues[]= { + TQStringList* StringListValues[]= { &temp.talk, &temp.emails, &temp.keywords, @@ -1446,7 +1446,7 @@ AddressBook::ErrorCode AddressBook::makeAddressFromMap(KeyValueMap* keys, Entry::Address& address) { // ########################################################################### - const QCString Keys[]= { + const TQCString Keys[]= { "headline", "position", "org", @@ -1460,7 +1460,7 @@ AddressBook::makeAddressFromMap(KeyValueMap* keys, Entry::Address& address) "country", "state" }; - QString* strings[]= { + TQString* strings[]= { &address.headline, &address.position, &address.org, @@ -1492,7 +1492,7 @@ AddressBook::makeSectionFromEntry(const Entry& entry, Section& section) list<Entry::Address>::const_iterator addPos; Section *addresses=0; Section *address=0; - QCString key; // used for creating address subsection keys + TQCString key; // used for creating address subsection keys int count=0; // counts the addresses KeyValueMap *keys; // ----- prepare the section object: @@ -1583,10 +1583,10 @@ AddressBook::makeSectionFromEntry(const Entry& entry, Section& section) } AddressBook::ErrorCode -AddressBook::createNew(const QString& filename) +AddressBook::createNew(const TQString& filename) { // ########################################################################### - const QString KabTemplateFile=locate("data", "kab/template.kab"); + const TQString KabTemplateFile=locate("data", "kab/template.kab"); kdDebug(KAB_KDEBUG_AREA) << "AddressBook::createNew: template file is \"" << (const char*)KabTemplateFile.utf8() << "\"." << endl; @@ -1637,11 +1637,11 @@ AddressBook::ErrorCode AddressBook::createConfigFile() { // ########################################################################### - const QString ConfigTemplateFile=locate("data", "kab/template.config"); + const TQString ConfigTemplateFile=locate("data", "kab/template.config"); kdDebug(KAB_KDEBUG_AREA) << "AddressBook::createConfigFile: config template file is \"" << (const char*)ConfigTemplateFile.utf8() << "\"." << endl; - const QString filename= locateLocal( "data", STD_CONFIGFILENAME); + const TQString filename= locateLocal( "data", STD_CONFIGFILENAME); QConfigDB db; // ----- if(ConfigTemplateFile.isEmpty() @@ -1689,7 +1689,7 @@ AddressBook::ErrorCode AddressBook::loadConfigFile() { // ########################################################################### - QString file = locateLocal( "data", STD_CONFIGFILENAME); + TQString file = locateLocal( "data", STD_CONFIGFILENAME); if(config->setFileName(file, true, true)) { if(config->load()) @@ -1714,7 +1714,7 @@ AddressBook::loadConfigFile() } AddressBook::ErrorCode -AddressBook::makeVCardFromEntry(const Entry&, const QString&) +AddressBook::makeVCardFromEntry(const Entry&, const TQString&) { // ########################################################################### return NotImplemented; @@ -1722,7 +1722,7 @@ AddressBook::makeVCardFromEntry(const Entry&, const QString&) } AddressBook::ErrorCode -AddressBook::makeEntryFromVCard(const QString&, Entry&) +AddressBook::makeEntryFromVCard(const TQString&, Entry&) { // ########################################################################### return NotImplemented; @@ -1737,7 +1737,7 @@ AddressBook::getStandardFileName() // ########################################################################### } -QString AddressBook::phoneType(AddressBook::Telephone phone) +TQString AddressBook::phoneType(AddressBook::Telephone phone) { switch(phone) { @@ -1770,7 +1770,7 @@ Section* AddressBook::configurationSection() } } -AddressBook::ErrorCode AddressBook::Entry::get(const char* fieldname, QVariant& field) +AddressBook::ErrorCode AddressBook::Entry::get(const char* fieldname, TQVariant& field) { // "title", "rank", "fn", "nameprefix", "firstname", "middlename", "lastname", // "birthday", "comment", "talk", "emails", "keywords", "telephone", @@ -1877,7 +1877,7 @@ AddressBook::ErrorCode AddressBook::Entry::get(const char* fieldname, QVariant& } AddressBook::ErrorCode AddressBook::Entry::Address::get(const char* fieldname, - QVariant& field) + TQVariant& field) { // "headline", "position", // "org", "orgunit", "orgsubunit", @@ -1945,7 +1945,7 @@ AddressBook::ErrorCode AddressBook::Entry::Address::get(const char* fieldname, Section* AddressBook::categoriesSection() { - const QString Predefines[]= { + const TQString Predefines[]= { i18n("Business"), i18n("Private"), i18n("Dates") }; @@ -1975,9 +1975,9 @@ Section* AddressBook::categoriesSection() keys=categories->getKeys(); for(size_t count=0; count<Size; ++count) { - QStringList values; + TQStringList values; values.append(Predefines[count]); - keys->insert(QCString().setNum(count), values); + keys->insert(TQCString().setNum(count), values); } section->add(KAB_CATEGORY_KEY, categories); keys=section->getKeys(); @@ -1999,7 +1999,7 @@ AddressBook::ErrorCode AddressBook::categories(CategoriesMap& cat) KeyValueMap* keys; int key; bool rc; - QStringList values; + TQStringList values; StringStringMap::iterator pos; // ----- query categories section: section=categoriesSection(); diff --git a/kab/addressbook.h b/kab/addressbook.h index ccd2d1bc4..21766a95a 100644 --- a/kab/addressbook.h +++ b/kab/addressbook.h @@ -28,12 +28,12 @@ class QStringList; class KeyNameMap; #include <list> -#include <qframe.h> -#include <qdatetime.h> -#include <qstring.h> -#include <qsize.h> -#include <qvariant.h> -#include <qmap.h> +#include <tqframe.h> +#include <tqdatetime.h> +#include <tqstring.h> +#include <tqsize.h> +#include <tqvariant.h> +#include <tqmap.h> /** * The class KabKey is used to select entries out of the database file. @@ -49,22 +49,22 @@ public: /** * Get the key as a QCString */ - QCString getKey() const; + TQCString getKey() const; /** * Set this key */ - void setKey(const QCString&); + void setKey(const TQCString&); protected: /** * The key of the in this database */ - QCString key; + TQCString key; class KabKeyPrivate; KabKeyPrivate *d; }; -class CategoriesMap : public QMap<int, QString> +class CategoriesMap : public TQMap<int, TQString> { }; @@ -167,7 +167,7 @@ class CategoriesMap : public QMap<int, QString> * mirror map nedds to be changed. * * \par The view - * If you display an AddressBook object (that is a derived QFrame), + * If you display an AddressBook object (that is a derived TQFrame), * it may show an entry * of the database that you might select. The entry you hand over to the method * ::displayEntry does not need to be contained in the currently loaded file. @@ -275,7 +275,7 @@ public: * <DT>firstname<DT><DD>The first name. </DD> * <DT>middlename<DT><DD>The middle name. </DD> * <DT>lastname<DT><DD>The last name. </DD> - * <DT>birthday<DT><DD>The birthday (a QDate). </DD> + * <DT>birthday<DT><DD>The birthday (a TQDate). </DD> * <DT>comment<DT><DD>A free form comment. </DD> * <DT>talk<DT><DD>The talk addresses (a string list). </DD> * <DT>emails<DT><DD>The email addresses (a string list). </DD> @@ -344,34 +344,34 @@ public: /** Query the literal, translated name of the field given by its key. @return false if key is not defined */ - static bool nameOfField(const char* key, QString& value); + static bool nameOfField(const char* key, TQString& value); /** Get a field by its field name. Field names are defined in @see Fields. Since there are different file types a field - may be represented with, a QVariant is returned. */ - ErrorCode get(const char* key, QVariant&); + may be represented with, a TQVariant is returned. */ + ErrorCode get(const char* key, TQVariant&); // ----- the following members represent the fields: /** The headline for this address. */ - QString headline; + TQString headline; /** The position of the person at this address. */ - QString position; + TQString position; /** The organization of the person at this address. */ - QString org; + TQString org; /** The org unit of the person at this address. */ - QString orgUnit; + TQString orgUnit; /** The org subunit of the person at this address. */ - QString orgSubUnit; + TQString orgSubUnit; /** The description for delivering. */ - QString deliveryLabel; + TQString deliveryLabel; /** Street, with house number. */ - QString address; + TQString address; /** Zip or postal code. */ - QString zip; + TQString zip; /** The town. */ - QString town; + TQString town; /** The country for federal states. */ - QString country; + TQString country; /** The state for federal states. */ - QString state; + TQString state; protected: static KeyNameMap *fields; }; @@ -396,38 +396,38 @@ public: /** Query the literal, translated name of the field given by its key. @return false if key is not defined */ - static bool nameOfField(const char* key, QString& value); + static bool nameOfField(const char* key, TQString& value); /** Get a field by its field name. Field names are defined in @see Fields. Since there are different file types a field - may be represented with, a QVariant is returned. */ - ErrorCode get(const char* key, QVariant&); + may be represented with, a TQVariant is returned. */ + ErrorCode get(const char* key, TQVariant&); // members: // this parts are assumed to be unique for every entry: - QString title; /**< The title of the person. */ - QString rank; /**< The rank of the person. */ - QString fn; /**< The formatted name of the person. */ - QString nameprefix; /**< A possibly name prefix for that person. */ - QString firstname; /**< The first name of the person. */ - QString middlename; /**< The middle name of the person. */ - QString lastname; /**< The last name of the person. */ - QDate birthday; /**< The birthday of this person. */ - QString comment; /**< The comment. */ - QStringList talk; /**< The talk addresses. */ - QStringList emails; /**< The email addresses. */ - QStringList keywords; /**< The user defined keywords for searching. */ + TQString title; /**< The title of the person. */ + TQString rank; /**< The rank of the person. */ + TQString fn; /**< The formatted name of the person. */ + TQString nameprefix; /**< A possibly name prefix for that person. */ + TQString firstname; /**< The first name of the person. */ + TQString middlename; /**< The middle name of the person. */ + TQString lastname; /**< The last name of the person. */ + TQDate birthday; /**< The birthday of this person. */ + TQString comment; /**< The comment. */ + TQStringList talk; /**< The talk addresses. */ + TQStringList emails; /**< The email addresses. */ + TQStringList keywords; /**< The user defined keywords for searching. */ /** * Telephon numbers and types. This list contains combinations of telephone * numbers and the types of the phones, in this order. See enum * Telephone above. */ - QStringList telephone; - QStringList URLs; /**< The home or related web pages of this person. */ - QString user1; /**< The first user-declared field. */ - QString user2; /**< The second user-declared field. */ - QString user3; /**< The third user-declared field. */ - QString user4; /**< The fourth user-declared field. */ - QStringList custom; - QStringList categories; /**< The categories this entry is assigned to. */ + TQStringList telephone; + TQStringList URLs; /**< The home or related web pages of this person. */ + TQString user1; /**< The first user-declared field. */ + TQString user2; /**< The second user-declared field. */ + TQString user3; /**< The third user-declared field. */ + TQString user4; /**< The fourth user-declared field. */ + TQStringList custom; + TQStringList categories; /**< The categories this entry is assigned to. */ protected: static KeyNameMap *fields; }; @@ -435,7 +435,7 @@ public: * The constructor. If \e load is true, the user standard file will * automatically be loaded into the object. */ - AddressBook(QWidget* parent=0, const char* name=0, bool load=true); + AddressBook(TQWidget* parent=0, const char* name=0, bool load=true); ~AddressBook(); /**< The destructor. */ /** * Get the internal state of the object. @@ -448,14 +448,14 @@ public: * Load the file with the given path. An empty file name reloads the * currently opened file. */ - ErrorCode load(const QString& filename=QString::null); + ErrorCode load(const TQString& filename=TQString::null); /** * Save the file to the given path and file name. An empty file name saves * to the file where the database has been read from. * If force is true, the method will switch to r/w mode for saving and * back. */ - ErrorCode save(const QString& filename=QString::null, bool force=false); + ErrorCode save(const TQString& filename=TQString::null, bool force=false); /** * Close this file. * ::closeFile assures sure that the ::data object is reset no matter of the @@ -511,12 +511,12 @@ public: * name, f. a. [with reverse==true]. * If there is no entry with this key, the method returns ::NoSuchEntry. */ - ErrorCode literalName(const KabKey& key, QString& text, + ErrorCode literalName(const KabKey& key, TQString& text, bool reverse=false, bool initials=false); /** * This is an overloaded method that differs only in the arguments it takes. */ - ErrorCode literalName(const Entry& entry, QString& text, + ErrorCode literalName(const Entry& entry, TQString& text, bool reverse=false, bool initials=false); /** * Get the key of the item in the selector with the given index. @@ -533,7 +533,7 @@ public: * call this method when receiving the signal ::changed and display the list * in the combo. */ - ErrorCode getListOfNames(QStringList*, bool reverse=true, bool initials=true); + ErrorCode getListOfNames(TQStringList*, bool reverse=true, bool initials=true); /** * Hand over the configuration database. Careful! */ @@ -560,7 +560,7 @@ public: * empty, it creates the users standard data file. The method does not load * the new database. */ - ErrorCode createNew(const QString& filename=QString::null); + ErrorCode createNew(const TQString& filename=TQString::null); /** * Creates the local configuration file. The filename is fixed to * \c kab.config, it will be created in the local kab directory @@ -572,25 +572,25 @@ public: ErrorCode createConfigFile(); ErrorCode loadConfigFile(); /**< Load the local configuration file. */ // ErrorCode configureKab(); /**< Open the configuration dialog for the KabAPI. */ - // QSize sizeHint(); /**< The preferred (minimal) size of the view. */ // ni + // TQSize sizeHint(); /**< The preferred (minimal) size of the view. */ // ni /** * This method parses a vCard and creates an Entry object from it. */ - ErrorCode makeEntryFromVCard(const QString& card, Entry&); + ErrorCode makeEntryFromVCard(const TQString& card, Entry&); /** * This method creates a vCard string from an entry. */ - ErrorCode makeVCardFromEntry(const Entry& entry, const QString& card); + ErrorCode makeVCardFromEntry(const Entry& entry, const TQString& card); /** * Returns the complete path to the user standard file. An empty path * indicates an error, but this should not happen. It is NOT ensured * that the file exists. */ - QString getStandardFileName(); + TQString getStandardFileName(); /** * Call this to get a telephone type translated to the locale. */ - static QString phoneType(AddressBook::Telephone); + static TQString phoneType(AddressBook::Telephone); /** * Query the entry categories defined for this address * book. Categories may differ between addressbooks. @@ -604,7 +604,7 @@ public: /** * Query the real name of a category by its index. */ - ErrorCode category(int index, QString&); + ErrorCode category(int index, TQString&); /** * Query the category section. This is the "raw" storage of the defined * categories. It is always defined (or will be created if you have an old @@ -617,7 +617,7 @@ public: #ifdef KDE_NO_COMPAT private: #endif - QString getStandardFilename() { return getStandardFileName(); }; + TQString getStandardFilename() { return getStandardFileName(); }; protected: QConfigDB *config; /**< The configuration database. */ @@ -632,7 +632,7 @@ protected: * Returns true if both pathes point to the same file. * The method resolves relative file names to find this out. */ - bool isSameFile(const QString& a, const QString& b); + bool isSameFile(const TQString& a, const TQString& b); /** * Parse the section and copy its contents into \a entry. * The method expects a subsection called \e addresses that contains a @@ -681,7 +681,7 @@ protected: * Set the background image. Kab will store a deep copy of the image. * If the image is a null image nothing will be displayed. */ - // void setBackground(const QImage&); + // void setBackground(const TQImage&); /** * Enable or disable the background image. */ @@ -721,8 +721,8 @@ public slots: // ---------------------------------------------------------------------------- signals: void changed(); /**< The entries have changed, update the selector. */ - void setStatus(const QString&); /**< This is kab radio with the news... */ - void newFile(const QString&); /**< Notifies changes of the file name. */ + void setStatus(const TQString&); /**< This is kab radio with the news... */ + void newFile(const TQString&); /**< Notifies changes of the file name. */ // ############################################################################ private: diff --git a/kab/kabapi.cc b/kab/kabapi.cc index 0f5d76222..0cf97905c 100644 --- a/kab/kabapi.cc +++ b/kab/kabapi.cc @@ -33,7 +33,7 @@ using namespace std; -KabAPI::KabAPI(QWidget* parent, const char* name) +KabAPI::KabAPI(TQWidget* parent, const char* name) : KDialogBase(parent, name), book(0), listbox(new KListBox(this)), @@ -43,19 +43,19 @@ KabAPI::KabAPI(QWidget* parent, const char* name) setMainWidget(listbox); showButtonApply(false); enableButtonSeparator(true); - connect(listbox, SIGNAL(highlighted(int)), SLOT(entrySelected(int))); - connect(listbox, SIGNAL(doubleClicked ( QListBoxItem * )),SLOT(slotDoubleClicked ( QListBoxItem * ))); + connect(listbox, TQT_SIGNAL(highlighted(int)), TQT_SLOT(entrySelected(int))); + connect(listbox, TQT_SIGNAL(doubleClicked ( TQListBoxItem * )),TQT_SLOT(slotDoubleClicked ( TQListBoxItem * ))); } -void KabAPI::slotDoubleClicked ( QListBoxItem * ) +void KabAPI::slotDoubleClicked ( TQListBoxItem * ) { accept(); } int KabAPI::exec() { - QStringList names; + TQStringList names; // ----- if(book==0) { @@ -90,8 +90,8 @@ AddressBook::ErrorCode KabAPI::init() book=new AddressBook(0, "KABAPI::book", true); //change parent from "this" to "0" //dsweet if(book->getState()==AddressBook::NoError) { - connect(book, SIGNAL(setStatus(const QString&)), - SLOT(setStatusSlot(const QString&))); + connect(book, TQT_SIGNAL(setStatus(const TQString&)), + TQT_SLOT(setStatusSlot(const TQString&))); return AddressBook::NoError; } else { return AddressBook::InternError; @@ -152,7 +152,7 @@ AddressBook::ErrorCode KabAPI::remove(const KabKey& key) // ############################################################################ } -AddressBook::ErrorCode KabAPI::getEntryByName(const QString&, +AddressBook::ErrorCode KabAPI::getEntryByName(const TQString&, list<AddressBook::Entry>&, const int) { // ############################################################################ @@ -214,7 +214,7 @@ void KabAPI::entrySelected(int index) selection=index; } -void KabAPI::setStatusSlot(const QString& text) +void KabAPI::setStatusSlot(const TQString& text) { emit(setStatus(text)); } diff --git a/kab/kabapi.h b/kab/kabapi.h index 2c790ab1a..08971be77 100644 --- a/kab/kabapi.h +++ b/kab/kabapi.h @@ -76,10 +76,10 @@ public: * database itselfes, as you could not query if this could be done * without failures. Thus you have to call init before you can * use the database. - * @param parent The QWidget pointer to the parent widget. + * @param parent The TQWidget pointer to the parent widget. * @param name The widgets name (used for debugging) */ - KabAPI(QWidget* parent=0, const char* name=0); + KabAPI(TQWidget* parent=0, const char* name=0); /** * You must call init before accessing the database. init opens the * database file (usually $HOME/.kde/share/apps/kab/addressbook.database) @@ -158,7 +158,7 @@ public: * @param max Maximum number of returned entries. * @return NoError if an entry is found or NoEntry. */ - AddressBook::ErrorCode getEntryByName(const QString& name, + AddressBook::ErrorCode getEntryByName(const TQString& name, std::list<AddressBook::Entry>& entries, const int max=5); /** @@ -176,7 +176,7 @@ public: std::list<AddressBook::Entry>& entries, const int max=5); /** - * Execute this dialog. This overloads QDialog::exec to fill the list box + * Execute this dialog. This overloads TQDialog::exec to fill the list box * before showing. */ int exec(); @@ -203,13 +203,13 @@ protected slots: /** * Capture status messages from book. */ - void setStatusSlot(const QString&); - void slotDoubleClicked ( QListBoxItem * ); + void setStatusSlot(const TQString&); + void slotDoubleClicked ( TQListBoxItem * ); signals: /** * Send status messages. */ - void setStatus(const QString&); + void setStatus(const TQString&); // ############################################################################ private: class KAbAPIPrivate; 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); diff --git a/kab/qconfigDB.h b/kab/qconfigDB.h index 7a71d901e..20698ce36 100644 --- a/kab/qconfigDB.h +++ b/kab/qconfigDB.h @@ -22,9 +22,9 @@ using namespace std; #include <list> #include <map> -#include <qwidget.h> -#include <qcstring.h> -#include <qstrlist.h> +#include <tqwidget.h> +#include <tqcstring.h> +#include <tqstrlist.h> class QTimer; class QDate; @@ -44,18 +44,18 @@ class QTextStream; * it is called with. */ struct QCStringLess - : public binary_function<const QCString&, const QCString&, bool> + : public binary_function<const TQCString&, const TQCString&, bool> { /** * The function operator, inline. */ - bool operator()(const QCString& x, const QCString& y) const + bool operator()(const TQCString& x, const TQCString& y) const { return x < (const char*)y; // make one Qt operator fit exactly } }; -typedef map<QCString, QCString, QCStringLess> StringStringMap; +typedef map<TQCString, TQCString, QCStringLess> StringStringMap; /** * The class KeyValueMap is used for managing key-value-pairs @@ -63,7 +63,7 @@ typedef map<QCString, QCString, QCStringLess> StringStringMap; * used as they are or in conjunction with the configuration * database class. * While the first version used the string class, this second - * uses the QCString class. + * uses the TQCString class. * The class uses pairs of methods for each datatype, they are * called ::get and ::insert. Every overloaded version of this * methods get the key of the settings and a reference to the @@ -98,9 +98,9 @@ typedef map<QCString, QCString, QCStringLess> StringStringMap; * guarantees anything, don't you?) that every value that * has been stored by one of the member functions of the * class like <BR> - * <TT> insert(const QCString& key, [value&]); </TT> <BR> + * <TT> insert(const TQCString& key, [value&]); </TT> <BR> * can also be retrieved using <BR> - * <TT> get(const QCString& key, [value&]);</TT> <BR> + * <TT> get(const TQCString& key, [value&]);</TT> <BR> * without being modified. <BR> * (Please report anything that does not do so!) </LI> </OL> * The class is used to implement the #QConfigDB class. @@ -127,23 +127,23 @@ protected: * Returns true if there where no errors while parsing. * @see makeComplexString */ - bool parseComplexString(const QCString& orig, int index, - QCString& result, int& noOfChars) const; + bool parseComplexString(const TQCString& orig, int index, + TQCString& result, int& noOfChars) const; /** * Codes a normal string into a complex string. * @see parseComplexString */ - QCString makeComplexString(const QCString& orig); + TQCString makeComplexString(const TQCString& orig); /** * Inserts a complex string into the map. * The string must be coded already, no tests are performed. * \a if force is false, an existing value will not be overridden. */ - bool insertRaw(const QCString& key, const QCString& value, bool force=false); + bool insertRaw(const TQCString& key, const TQCString& value, bool force=false); /** * Retrieves the undecoded value (a complex string) of the given key. */ - bool getRaw(const QCString& key, QCString& value) const; + bool getRaw(const TQCString& key, TQCString& value) const; // ---------------------------------------------------------------------------- public: /** @@ -184,181 +184,181 @@ public: * already declared in the database and are declared again in the file. * If \a relax is true, the value of a string may be empty. */ - bool fill(const QString&, bool force=false, bool relax=false); + bool fill(const TQString&, bool force=false, bool relax=false); /** * Saves the database to a file. * Only overrides existing files if force is true. */ - bool save(const QString&, bool force=false); + bool save(const TQString&, bool force=false); /** * Saves contents to an already open text stream. * \a count spaces are inserted before each line. This method is * called when save hierarchical databases. * @see ::QConfigDB */ - bool save(QTextStream& file, int count); + bool save(TQTextStream& file, int count); /** * Get the value for the key as a string. * \a key is the key to search for, \a value is a reference to the object * the value for the key is assigned to. */ - bool get(const QCString& key, QCString& value) const; + bool get(const TQCString& key, TQCString& value) const; /** * Insert a string value for the given key. * If force is true, an existing value for this key will be overridden. * The method returns false if the key exists and \a force is false. */ - bool insert(const QCString& key, const QCString& value, bool force=false); + bool insert(const TQCString& key, const TQCString& value, bool force=false); /** * Insert a character pointer for the given key. * pgcc treats character pointers as boolean objects, not as strings. * If force is true, an existing value for this key will be overridden. * The method returns false if the key exists and \a force is false. */ - inline bool insert(const QCString& key, const char* value, bool force=false); + inline bool insert(const TQCString& key, const char* value, bool force=false); /** * Insert a line like "key_a="Hallo!" into the map as a key-value-pair. * If force is true existing keys will be overridden. * If relax is true the value may be empty an empty string. * If encode is false, the string will not be coded (do not use!). */ - bool insertLine(QCString, bool force=false, bool relax=false, bool encode=true); + bool insertLine(TQCString, bool force=false, bool relax=false, bool encode=true); // --------------- /** * Get the value for the key as a long integer. * \a key is the key to search for, \a value is a reference to the object * the value for the key is assigned to. */ - bool get(const QCString&, long&) const; + bool get(const TQCString&, long&) const; /** * Insert a long integer value for the given key. * If force is true, an existing value for this key will be overridden. * The method returns false if the key exists and \a force is false. */ - bool insert(const QCString&, const long&, bool force=false); + bool insert(const TQCString&, const long&, bool force=false); // --------------- /** * For insertion of UNICODE strings, a special method pair is created. The - * data will be translated to utf8 and inserted in the map as a QCString. + * data will be translated to utf8 and inserted in the map as a TQCString. * This will probably be not fast, but this methods are not suited to save * large amounts of data. For saving anything else than UNICODE strings, * no such conversion is needed. * \a key is the key to search for, \a value is a reference to the object * the value for the key is assigned to. */ - bool get(const QCString&, QString&) const; + bool get(const TQCString&, TQString&) const; /** * Insert a UNICODE string value for the given key. * If force is true, an existing value for this key will be overridden. * The method returns false if the key exists and \a force is false. */ - bool insert(const QCString&, const QString&, bool force=false); + bool insert(const TQCString&, const TQString&, bool force=false); // --------------- /** * Get the value for the key as a double. * \a key is the key to search for, \a value is a reference to the object * the value for the key is assigned to. */ - bool get(const QCString&, double&) const; + bool get(const TQCString&, double&) const; /** * Insert a double value for the given key. * If force is true, an existing value for this key will be overridden. * The method returns false if the key exists and \a force is false. */ - bool insert(const QCString&, const double&, bool force=false); + bool insert(const TQCString&, const double&, bool force=false); // --------------- /** * Get the value for the key as a boolean value. * \a key is the key to search for, \a value is a reference to the object * the value for the key is assigned to. */ - bool get(const QCString&, bool&) const; + bool get(const TQCString&, bool&) const; /** * Insert a boolean value for the given key. * If force is true, an existing value for this key will be overridden. * The method returns false if the key exists and \a force is false. */ - bool insert(const QCString&, const bool&, bool force=false); + bool insert(const TQCString&, const bool&, bool force=false); // --------------- /** * Get the value for the key as a list of strings. * \a key is the key to search for, \a value is a reference to the object * the value for the key is assigned to. */ - bool get(const QCString&, list<QCString>&) const; + bool get(const TQCString&, list<TQCString>&) const; /** * Insert a list of strings for the given key. * If force is true, an existing value for this key will be overridden. * The method returns false if the key exists and \a force is false. */ - bool insert(const QCString&, const list<QCString>&, bool force=false); + bool insert(const TQCString&, const list<TQCString>&, bool force=false); // -------------- /** - * Get the value for the key as a QStrList. + * Get the value for the key as a TQStrList. * \a key is the key to search for, \a value is a reference to the object * the value for the key is assigned to. */ - bool get(const QCString&, QStrList&) const; + bool get(const TQCString&, TQStrList&) const; /** - * Insert a QStrList for the given key. + * Insert a TQStrList for the given key. * If force is true, an existing value for this key will be overridden. * The method returns false if the key exists and \a force is false. */ - bool insert(const QCString&, const QStrList&, bool force=false); + bool insert(const TQCString&, const TQStrList&, bool force=false); // -------------- /** - * Get the value for the key as a QStringList. Beware of the difference - - * a QStringList is a list of QString objects, while QStrList handles + * Get the value for the key as a TQStringList. Beware of the difference - + * a TQStringList is a list of TQString objects, while TQStrList handles * char* like objects. * \a key is the key to search for, \a value is a reference to the object * the value for the key is assigned to. */ - bool get(const QCString&, QStringList&) const; + bool get(const TQCString&, TQStringList&) const; /** - * Insert a QStringList for the given key. + * Insert a TQStringList for the given key. * If force is true, an existing value for this key will be overridden. * The method returns false if the key exists and \a force is false. */ - bool insert(const QCString&, const QStringList&, bool force=false); + bool insert(const TQCString&, const TQStringList&, bool force=false); // -------------- /** * Get the value for the key as a list of long integers. * \a key is the key to search for, \a value is a reference to the object * the value for the key is assigned to. */ - bool get(const QCString&, list<long>&) const; + bool get(const TQCString&, list<long>&) const; /** * Insert a list of long integers for the given key. * If force is true, an existing value for this key will be overridden. * The method returns false if the key exists and \a force is false. */ - bool insert(const QCString&, const list<long>&, bool force=false); + bool insert(const TQCString&, const list<long>&, bool force=false); // -------------- /** * Get the value for the key as a list of integers. * \a key is the key to search for, \a value is a reference to the object * the value for the key is assigned to. */ - bool get(const QCString&, list<int>&) const; + bool get(const TQCString&, list<int>&) const; /** * Insert a list of integers for the given key. * If force is true, an existing value for this key will be overridden. * The method returns false if the key exists and \a force is false. */ - bool insert(const QCString&, const list<int>&, bool force=false); + bool insert(const TQCString&, const list<int>&, bool force=false); // -------------- some Qt high-level data types: /** - * Get the value for the key as a QDate. + * Get the value for the key as a TQDate. * The value will be parsed to a integer list that must be a \e valid - * date (see QDate documentation). \c false will be returned if the value + * date (see TQDate documentation). \c false will be returned if the value * is not valid or a null date. This situation might only happen in * manually created files, since the insert-method for QDates rejects to * insert inalid dates, it inserts null dates instead. - * @see get(const QCString&, QDate &) + * @see get(const TQCString&, TQDate &) */ - bool get(const QCString&, QDate &) const; + bool get(const TQCString&, TQDate &) const; /** - * Insert a QDate for the given key. + * Insert a TQDate for the given key. * If force is true, an existing value for this key will be overridden. * The method returns false if the key exists and \a force is false. * \e Attention: If you insert an invalid date a null date will be used. @@ -366,20 +366,20 @@ public: * You will not be able to store an invalid date and retrieve it using * ::get! */ - bool insert(const QCString&, const QDate&, bool force=false); + bool insert(const TQCString&, const TQDate&, bool force=false); // -------------- /** * Get the value for the key as a list of doubles. * \a key is the key to search for, \a value is a reference to the object * the value for the key is assigned to. */ - bool get(const QCString&, list<double>&) const; + bool get(const TQCString&, list<double>&) const; /** * Insert a list of doubles for the given key. * If force is true, an existing value for this key will be overridden. * The method returns false if the key exists and \a force is false. */ - bool insert(const QCString&, const list<double>&, bool force=false); + bool insert(const TQCString&, const list<double>&, bool force=false); // -------------- // end of corresponding get-insert-pairs /** @@ -389,7 +389,7 @@ public: /** * Erases all key-value-pairs in the map. */ - bool erase(const QCString& key); + bool erase(const TQCString& key); // ############################################################################ }; @@ -409,7 +409,7 @@ public: /** * The StringSectionMap type is defined to make the code more readable. */ - typedef map<QCString, Section*, QCStringLess> StringSectionMap; + typedef map<TQCString, Section*, QCStringLess> StringSectionMap; // ---------------------------------------------------------------------------- protected: /** @@ -427,23 +427,23 @@ protected: /** * Insert the spaces for indention the lines of this section when saving. */ - void insertIndentSpace(QTextStream& file, int level); + void insertIndentSpace(TQTextStream& file, int level); /** * Check whether the string (one line of the file currently read) marks the * beginning of a new subsection (usually [sectionname]). */ - bool isBeginOfSection(QCString); + bool isBeginOfSection(TQCString); /** * Check whether the string (one line of the file currently read) marks the * end of a new subsection (usually [END]). */ - bool isEndOfSection(QCString); + bool isEndOfSection(TQCString); /** * Extract the name of the section from the string. * The string must contain the line that starts the section. * @see ::isBeginOfSection */ - QCString nameOfSection(const QCString&); + TQCString nameOfSection(const TQCString&); // ---------------------------------------------------------------------------- public: /** @@ -458,23 +458,23 @@ public: /** * Add an empty new section. */ - bool add(const QCString&); + bool add(const TQCString&); /** * Add the section. */ - bool add(const QCString&, Section*); + bool add(const TQCString&, Section*); /** * Search for the section, returning an iterator to it. */ - bool find(const QCString&, StringSectionMap::iterator&); + bool find(const TQCString&, StringSectionMap::iterator&); /** * Search for the section, returning a pointer to the section object. */ - bool find(const QCString&, Section*&); + bool find(const TQCString&, Section*&); /** * Remove this subsection. */ - bool remove(const QCString&); + bool remove(const TQCString&); /** * Return the key-value-pairs of this (!) section. */ @@ -484,14 +484,14 @@ public: * Level is the position in section tree depth (the hierarchy level). * It is used for indenting. */ - bool save(QTextStream& stream, int level=0); + bool save(TQTextStream& stream, int level=0); /** * Read one section from the given input stream. * The method does not expect the line that marks the begin of the * section. If finish is false, the code does also not except the * section to be ended with a line like [END]. */ - bool readSection(QTextStream& file, bool finish=true); + bool readSection(TQTextStream& file, bool finish=true); /** * Clears both subsections and keys. */ @@ -520,7 +520,7 @@ public: /** * The class QConfigDB is used to manage text-based data files * with hierarchical structure. <BR> - * It is derived from ::QWidget, so it may be derived to display + * It is derived from ::TQWidget, so it may be derived to display * its contents. The basic implementation here does not display * anything to make it a lean class. <BR> * Some notes about the philosophy of the configuration @@ -561,13 +561,13 @@ protected: /** * A timer pointer for watching the file. */ - QTimer *timer; + TQTimer *timer; // ---------------------------------------------------------------------------- public: /** * The Qt standard constructor. */ - QConfigDB(QWidget* parent=0, const char* name=0); + QConfigDB(TQWidget* parent=0, const char* name=0); /** * The virtual destructor. */ @@ -575,21 +575,21 @@ public: /** * Get the key-value-map for the section referenced by \a key. */ - bool get(const QCString& key, KeyValueMap*& map); + bool get(const TQCString& key, KeyValueMap*& map); /** * Get the key-value-map for the section referenced by \a key as key list. */ - bool get(const list<QCString>& key, KeyValueMap*& map); + bool get(const list<TQCString>& key, KeyValueMap*& map); /** * Get the address of the specified Section object by its path. * Never delete the section returned to you. */ - bool get(const QCString& key, Section*&); + bool get(const TQCString& key, Section*&); /** * Get the address of the specified Section object by a path list. * Never delete the section returned to you. */ - bool get(const list<QCString>& key, Section*&); + bool get(const list<TQCString>& key, Section*&); /** * Get the keys of the toplevel section. */ @@ -598,12 +598,12 @@ public: * Create the section with this path. * All elements of the path that do not exist are created. */ - bool createSection(const QCString& key); + bool createSection(const TQCString& key); /** * Create the section with a path like the path list. * All elements of the path that do not exist are created. */ - bool createSection(const list<QCString>& key); + bool createSection(const list<TQCString>& key); /** * Load the file. * @see ::setFileName @@ -630,7 +630,7 @@ public: * altered. Subsequent calls may be used to check if a file already * exists. */ - bool setFileName(const QString& name, bool mustexist=true, bool ro=false); + bool setFileName(const TQString& name, bool mustexist=true, bool ro=false); /** * Store the modification time of the file for later check of changes. */ @@ -638,7 +638,7 @@ public: /** * Give the current filename. */ - QString fileName(); + TQString fileName(); /** * Returns if the current file name is set for read only access. */ @@ -661,7 +661,7 @@ public: * locking the file, a number < zero reports an error and indicates * that the file is locked. */ - static int IsLocked(const QString& fn); + static int IsLocked(const TQString& fn); /** * Check an existing lock file for its validity. * \a fn is the name of the DATA file that is locked. @@ -677,7 +677,7 @@ public: * Returns false if the lockfile exists and is definitely stale or there * is none, returns true if the lockfile seems to be really valid. */ - static bool CheckLockFile(const QString& filename); + static bool CheckLockFile(const TQString& filename); /** * The static method CleanLockFiles removes all files in the list * ::LockFiles when called. @@ -709,11 +709,11 @@ protected: * Transform a given path into a list of strings. * All internal path handling is done with lists. */ - list<QCString> stringToKeylist(const QCString&); + list<TQCString> stringToKeylist(const TQCString&); /** * The current filename. */ - QString filename; + TQString filename; /** * The current file opening mode. */ @@ -729,11 +729,11 @@ protected: * does not exist by now. * @see ::storeFileAge */ - QDateTime *mtime; + TQDateTime *mtime; /** * Lock the file. */ - bool lock(const QString& file); + bool lock(const TQString& file); /** * Debugging aid, called from REQUIRE and ENSURE macros when the Nana library * is used. @@ -743,7 +743,7 @@ protected: * All created lockfiles are notified in this list. * The list contains the names of the lockfiles, not of the files itselfes. */ - static list<QString> LockFiles; + static list<TQString> LockFiles; // ---------------------------------------------------------------------------- public slots: /** @@ -770,9 +770,9 @@ signals: }; // ----- inline functions: -bool KeyValueMap::insert(const QCString& key, const char* value, bool force) +bool KeyValueMap::insert(const TQCString& key, const char* value, bool force) { - return insert(key, (QCString)value, force); + return insert(key, (TQCString)value, force); } // ----- |