diff options
Diffstat (limited to 'kdbg/typetable.cpp')
-rw-r--r-- | kdbg/typetable.cpp | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/kdbg/typetable.cpp b/kdbg/typetable.cpp index 3136a61..e2d96a5 100644 --- a/kdbg/typetable.cpp +++ b/kdbg/typetable.cpp @@ -4,8 +4,8 @@ * See the file COPYING in the toplevel directory of the source directory. */ -#include <qdir.h> -#include <qptrlist.h> +#include <ntqdir.h> +#include <ntqptrlist.h> #include <kglobal.h> #include <kstandarddirs.h> #include <ksimpleconfig.h> @@ -40,7 +40,7 @@ void TypeTable::loadTypeTables() { typeTablesInited = true; - const QStringList files = KGlobal::dirs()->findAllResources("types", "*.kdbgtt", + const TQStringList files = KGlobal::dirs()->findAllResources("types", "*.kdbgtt", false, true); if (files.isEmpty()) { @@ -48,7 +48,7 @@ void TypeTable::loadTypeTables() return; } - for (QValueListConstIterator<QString> p = files.begin(); p != files.end(); ++p) { + for (TQValueListConstIterator<TQString> p = files.begin(); p != files.end(); ++p) { typeTables.push_back(TypeTable()); typeTables.back().loadFromFile(*p); } @@ -56,7 +56,7 @@ void TypeTable::loadTypeTables() TypeTable::TypeTable() : - m_printQStringDataCmd(0) + m_printTQStringDataCmd(0) { m_typeDict.setAutoDelete(true); // aliasDict keeps only pointers to items into typeDict @@ -65,7 +65,7 @@ TypeTable::TypeTable() : TypeTable::~TypeTable() { - delete[] m_printQStringDataCmd; + delete[] m_printTQStringDataCmd; while (!m_templates.empty()) { delete m_templates.begin()->second; m_templates.erase(m_templates.begin()); @@ -77,7 +77,7 @@ static const char TypeTableGroup[] = "Type Table"; static const char LibDisplayName[] = "LibDisplayName"; static const char ShlibRE[] = "ShlibRE"; static const char EnableBuiltin[] = "EnableBuiltin"; -static const char PrintQStringCmd[] = "PrintQStringCmd"; +static const char PrintTQStringCmd[] = "PrintTQStringCmd"; static const char TypesEntryFmt[] = "Types%d"; static const char DisplayEntry[] = "Display"; static const char AliasEntry[] = "Alias"; @@ -86,7 +86,7 @@ static const char ExprEntryFmt[] = "Expr%d"; static const char FunctionGuardEntryFmt[] = "FunctionGuard%d"; -void TypeTable::loadFromFile(const QString& fileName) +void TypeTable::loadFromFile(const TQString& fileName) { TRACE("reading file " + fileName); KSimpleConfig cf(fileName, true); /* read-only */ @@ -98,26 +98,26 @@ void TypeTable::loadFromFile(const QString& fileName) m_displayName = cf.readEntry(LibDisplayName); if (m_displayName.isEmpty()) { // use file name instead - QFileInfo fi(fileName); + TQFileInfo fi(fileName); m_displayName = fi.baseName(true); } - m_shlibNameRE = QRegExp(cf.readEntry(ShlibRE)); + m_shlibNameRE = TQRegExp(cf.readEntry(ShlibRE)); m_enabledBuiltins = cf.readListEntry(EnableBuiltin); - QString printQString = cf.readEntry(PrintQStringCmd); - const char* ascii = printQString.ascii(); + TQString printTQString = cf.readEntry(PrintTQStringCmd); + const char* ascii = printTQString.ascii(); if (ascii == 0) ascii = ""; - m_printQStringDataCmd = new char[strlen(ascii)+1]; - strcpy(m_printQStringDataCmd, ascii); + m_printTQStringDataCmd = new char[strlen(ascii)+1]; + strcpy(m_printTQStringDataCmd, ascii); /* * Get the types. We search for entries of kind Types1, Types2, etc. * because a single entry Types could get rather long for large * libraries. */ - QString typesEntry; + TQString typesEntry; for (int i = 1; ; i++) { // next bunch of types cf.setGroup(TypeTableGroup); @@ -125,11 +125,11 @@ void TypeTable::loadFromFile(const QString& fileName) if (!cf.hasKey(typesEntry)) break; - QStringList typeNames = cf.readListEntry(typesEntry, ','); + TQStringList typeNames = cf.readListEntry(typesEntry, ','); // now read them - QString alias; - for (QStringList::iterator it = typeNames.begin(); it != typeNames.end(); ++it) + TQString alias; + for (TQStringList::iterator it = typeNames.begin(); it != typeNames.end(); ++it) { cf.setGroup(*it); // check if this is an alias @@ -150,10 +150,10 @@ void TypeTable::loadFromFile(const QString& fileName) } // for all Types%d } -void TypeTable::readType(KConfigBase& cf, const QString& type) +void TypeTable::readType(KConfigBase& cf, const TQString& type) { // the display string - QString expr = cf.readEntry(DisplayEntry); + TQString expr = cf.readEntry(DisplayEntry); TypeInfo* info = new TypeInfo(expr); if (info->m_numExprs == 0) { @@ -165,8 +165,8 @@ void TypeTable::readType(KConfigBase& cf, const QString& type) info->m_templatePattern = cf.readEntry(TemplateEntry); // Expr1, Expr2, etc... - QString exprEntry; - QString funcGuardEntry; + TQString exprEntry; + TQString funcGuardEntry; for (int j = 0; j < info->m_numExprs; j++) { exprEntry.sprintf(ExprEntryFmt, j+1); expr = cf.readEntry(exprEntry); @@ -182,25 +182,25 @@ void TypeTable::readType(KConfigBase& cf, const QString& type) m_typeDict.insert(type, info); else m_templates[type] = info; - TRACE(type + QString().sprintf(": %d exprs", info->m_numExprs)); + TRACE(type + TQString().sprintf(": %d exprs", info->m_numExprs)); } -void TypeTable::copyTypes(QDict<TypeInfo>& dict) +void TypeTable::copyTypes(TQDict<TypeInfo>& dict) { - for (QDictIterator<TypeInfo> it = m_typeDict; it != 0; ++it) { + for (TQDictIterator<TypeInfo> it = m_typeDict; it != 0; ++it) { dict.insert(it.currentKey(), it); } - for (QDictIterator<TypeInfo> it = m_aliasDict; it != 0; ++it) { + for (TQDictIterator<TypeInfo> it = m_aliasDict; it != 0; ++it) { dict.insert(it.currentKey(), it); } } -bool TypeTable::isEnabledBuiltin(const QString& feature) const +bool TypeTable::isEnabledBuiltin(const TQString& feature) const { return m_enabledBuiltins.find(feature) != m_enabledBuiltins.end(); } -TypeInfo::TypeInfo(const QString& displayString) +TypeInfo::TypeInfo(const TQString& displayString) { // decompose the input into the parts int i = 0; @@ -227,9 +227,9 @@ TypeInfo::~TypeInfo() ProgramTypeTable::ProgramTypeTable() : - m_parseQt2QStrings(false), + m_parseTQt2TQStrings(false), m_QCharIsShort(false), - m_printQStringDataCmd(0) + m_printTQStringDataCmd(0) { m_types.setAutoDelete(false); /* paranoia */ m_aliasDict.setAutoDelete(false); /* paranoia */ @@ -249,22 +249,22 @@ void ProgramTypeTable::loadTypeTable(TypeTable* table) std::inserter(m_templates, m_templates.begin()), std::ptr_fun(template2Info)); - // check whether to enable builtin QString support - if (!m_parseQt2QStrings) { - m_parseQt2QStrings = table->isEnabledBuiltin("QString::Data"); + // check whether to enable builtin TQString support + if (!m_parseTQt2TQStrings) { + m_parseTQt2TQStrings = table->isEnabledBuiltin("TQString::Data"); } if (!m_QCharIsShort) { - m_QCharIsShort = table->isEnabledBuiltin("QCharIsShort"); + m_QCharIsShort = table->isEnabledBuiltin("TQCharIsShort"); } - if (!m_printQStringDataCmd && *table->printQStringDataCmd()) { - m_printQStringDataCmd = table->printQStringDataCmd(); + if (!m_printTQStringDataCmd && *table->printTQStringDataCmd()) { + m_printTQStringDataCmd = table->printTQStringDataCmd(); } } ProgramTypeTable::TemplateMap::value_type ProgramTypeTable::template2Info(const TypeTable::TypeMap::value_type& tt) { - QStringList args = splitTemplateArgs(tt.second->m_templatePattern); + TQStringList args = splitTemplateArgs(tt.second->m_templatePattern); TemplateMap::value_type result(args.front(), TemplateInfo()); result.second.type = tt.second; @@ -278,9 +278,9 @@ ProgramTypeTable::TemplateMap::value_type * The first entry of the returned list is the template name, the remaining * entries are the arguments. */ -QStringList ProgramTypeTable::splitTemplateArgs(const QString& t) +TQStringList ProgramTypeTable::splitTemplateArgs(const TQString& t) { - QStringList result; + TQStringList result; result.push_back(t); int i = t.find('<'); @@ -302,14 +302,14 @@ QStringList ProgramTypeTable::splitTemplateArgs(const QString& t) nest--; else if (nest == 0 && t[i] == ',') { // found end of argument - QString arg = t.mid(start, i-start); + TQString arg = t.mid(start, i-start); result.push_back(arg); start = i+1; // skip ',' } } // accept the template only if the closing '>' is the last character if (nest < 0 && unsigned(i) == t.length()) { - QString arg = t.mid(start, i-start-1); + TQString arg = t.mid(start, i-start-1); result.push_back(arg); } else { result.clear(); @@ -318,7 +318,7 @@ QStringList ProgramTypeTable::splitTemplateArgs(const QString& t) return result; } -TypeInfo* ProgramTypeTable::lookup(QString type) +TypeInfo* ProgramTypeTable::lookup(TQString type) { /* * Registered aliases contain the complete template parameter list. @@ -337,7 +337,7 @@ TypeInfo* ProgramTypeTable::lookup(QString type) /* * The hard part: Look up a template. */ - QStringList parts = splitTemplateArgs(type); + TQStringList parts = splitTemplateArgs(type); if (parts.size() == 1) return 0; // not a template @@ -351,7 +351,7 @@ TypeInfo* ProgramTypeTable::lookup(QString type) for (TemplateMap::const_iterator i = range.first; i != range.second; ++i) { - const QStringList& pat = i->second.templateArgs; + const TQStringList& pat = i->second.templateArgs; if (parts.size() < pat.size()) continue; // too few arguments @@ -360,8 +360,8 @@ TypeInfo* ProgramTypeTable::lookup(QString type) if (parts.size() > pat.size() && pat.back() != "*") continue; // too many arguments and no wildcard - QStringList::const_iterator t = parts.begin(); - QStringList::const_iterator p = pat.begin(); + TQStringList::const_iterator t = parts.begin(); + TQStringList::const_iterator p = pat.begin(); unsigned accumPenalty = 0; bool equal = true; unsigned penalty = ~(~0U>>1); // 1 in the leading bit @@ -386,15 +386,15 @@ TypeInfo* ProgramTypeTable::lookup(QString type) return result; } -void ProgramTypeTable::registerAlias(const QString& name, TypeInfo* type) +void ProgramTypeTable::registerAlias(const TQString& name, TypeInfo* type) { ASSERT(lookup(name) == 0 || lookup(name) == type); m_aliasDict.insert(name, type); } -void ProgramTypeTable::loadLibTypes(const QStringList& libs) +void ProgramTypeTable::loadLibTypes(const TQStringList& libs) { - for (QStringList::const_iterator it = libs.begin(); it != libs.end(); ++it) + for (TQStringList::const_iterator it = libs.begin(); it != libs.end(); ++it) { // look up the library for (std::list<TypeTable>::iterator t = typeTables.begin(); t != typeTables.end(); ++t) |