From 4ae0c208b66e0f7954e194384464fe2d0a2c56dd Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:51:49 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1157652 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- umbrello/umbrello/codeimport/adaimport.cpp | 108 +++++++-------- umbrello/umbrello/codeimport/adaimport.h | 14 +- umbrello/umbrello/codeimport/classimport.cpp | 12 +- umbrello/umbrello/codeimport/classimport.h | 8 +- umbrello/umbrello/codeimport/cppimport.cpp | 22 ++-- umbrello/umbrello/codeimport/cppimport.h | 8 +- umbrello/umbrello/codeimport/idlimport.cpp | 86 ++++++------ umbrello/umbrello/codeimport/idlimport.h | 8 +- umbrello/umbrello/codeimport/import_utils.cpp | 102 +++++++------- umbrello/umbrello/codeimport/import_utils.h | 42 +++--- umbrello/umbrello/codeimport/javaimport.cpp | 106 +++++++-------- umbrello/umbrello/codeimport/javaimport.h | 18 +-- umbrello/umbrello/codeimport/kdevcppparser/ast.cpp | 66 +++++----- umbrello/umbrello/codeimport/kdevcppparser/ast.h | 104 +++++++-------- .../codeimport/kdevcppparser/ast_utils.cpp | 50 +++---- .../umbrello/codeimport/kdevcppparser/ast_utils.h | 8 +- .../codeimport/kdevcppparser/cpptree2uml.cpp | 146 ++++++++++----------- .../codeimport/kdevcppparser/cpptree2uml.h | 18 +-- .../umbrello/codeimport/kdevcppparser/driver.cpp | 104 +++++++-------- .../umbrello/codeimport/kdevcppparser/driver.h | 104 +++++++-------- .../umbrello/codeimport/kdevcppparser/errors.h | 6 +- .../umbrello/codeimport/kdevcppparser/lexer.cpp | 92 ++++++------- umbrello/umbrello/codeimport/kdevcppparser/lexer.h | 68 +++++----- .../umbrello/codeimport/kdevcppparser/lookup.cpp | 12 +- .../umbrello/codeimport/kdevcppparser/lookup.h | 14 +- .../umbrello/codeimport/kdevcppparser/parser.cpp | 70 +++++----- .../umbrello/codeimport/kdevcppparser/parser.h | 16 +-- .../codeimport/kdevcppparser/tree_parser.cpp | 12 +- .../umbrello/codeimport/kdevcppparser/urlutil.cpp | 98 +++++++------- .../umbrello/codeimport/kdevcppparser/urlutil.h | 44 +++---- umbrello/umbrello/codeimport/nativeimportbase.cpp | 104 +++++++-------- umbrello/umbrello/codeimport/nativeimportbase.h | 46 +++---- umbrello/umbrello/codeimport/pascalimport.cpp | 54 ++++---- umbrello/umbrello/codeimport/pascalimport.h | 2 +- umbrello/umbrello/codeimport/pythonimport.cpp | 40 +++--- umbrello/umbrello/codeimport/pythonimport.h | 4 +- 36 files changed, 908 insertions(+), 908 deletions(-) (limited to 'umbrello/umbrello/codeimport') diff --git a/umbrello/umbrello/codeimport/adaimport.cpp b/umbrello/umbrello/codeimport/adaimport.cpp index 54ac3907..0cbd8d1c 100644 --- a/umbrello/umbrello/codeimport/adaimport.cpp +++ b/umbrello/umbrello/codeimport/adaimport.cpp @@ -14,7 +14,7 @@ #include // qt/kde includes -#include +#include #include // app includes #include "import_utils.h" @@ -43,15 +43,15 @@ void AdaImport::initVars() { /// Split the line so that a string is returned as a single element of the list, /// when not in a string then split at white space. -QStringList AdaImport::split(const QString& lin) { - QStringList list; - QString listElement; +TQStringList AdaImport::split(const TQString& lin) { + TQStringList list; + TQString listElement; bool inString = false; bool seenSpace = false; - QString line = lin.stripWhiteSpace(); + TQString line = lin.stripWhiteSpace(); uint len = line.length(); for (uint i = 0; i < len; i++) { - const QChar& c = line[i]; + const TQChar& c = line[i]; if (inString) { listElement += c; if (c == '"') { @@ -60,14 +60,14 @@ QStringList AdaImport::split(const QString& lin) { continue; } list.append(listElement); - listElement = QString(); + listElement = TQString(); inString = false; } } else if (c == '"') { inString = true; if (!listElement.isEmpty()) list.append(listElement); - listElement = QString(c); + listElement = TQString(c); seenSpace = false; } else if (c == '\'') { if (i < len - 2 && line[i + 2] == '\'') { @@ -77,7 +77,7 @@ QStringList AdaImport::split(const QString& lin) { listElement = line.mid(i, 3); i += 2; list.append(listElement); - listElement = QString(); + listElement = TQString(); continue; } listElement += c; @@ -88,7 +88,7 @@ QStringList AdaImport::split(const QString& lin) { seenSpace = true; if (!listElement.isEmpty()) { list.append(listElement); - listElement = QString(); + listElement = TQString(); } } else { listElement += c; @@ -100,23 +100,23 @@ QStringList AdaImport::split(const QString& lin) { return list; } -void AdaImport::fillSource(const QString& word) { - QString lexeme; +void AdaImport::fillSource(const TQString& word) { + TQString lexeme; const uint len = word.length(); for (uint i = 0; i < len; i++) { - QChar c = word[i]; + TQChar c = word[i]; if (c.isLetterOrNumber() || c == '_' || c == '.' || c == '#') { lexeme += c; } else { if (!lexeme.isEmpty()) { m_source.append(lexeme); - lexeme = QString(); + lexeme = TQString(); } if (c == ':' && word[i + 1] == '=') { m_source.append(":="); i++; } else { - m_source.append(QString(c)); + m_source.append(TQString(c)); } } } @@ -124,14 +124,14 @@ void AdaImport::fillSource(const QString& word) { m_source.append(lexeme); } -QString AdaImport::expand(const QString& name) { - QRegExp pfxRegExp("^(\\w+)\\."); +TQString AdaImport::expand(const TQString& name) { + TQRegExp pfxRegExp("^(\\w+)\\."); pfxRegExp.setCaseSensitive(false); int pos = pfxRegExp.search(name); if (pos == -1) return name; - QString result = name; - QString pfx = pfxRegExp.cap(1); + TQString result = name; + TQString pfx = pfxRegExp.cap(1); if (m_renaming.contains(pfx)) { result.remove(pfxRegExp); result.prepend(m_renaming[pfx] + '.'); @@ -139,16 +139,16 @@ QString AdaImport::expand(const QString& name) { return result; } -void AdaImport::parseStems(const QStringList& stems) { +void AdaImport::parseStems(const TQStringList& stems) { if (stems.isEmpty()) return; - QString base = stems.first(); + TQString base = stems.first(); uint i = 0; while (1) { - QString filename = base + ".ads"; + TQString filename = base + ".ads"; if (! m_parsedFiles.contains(filename)) { // Save current m_source and m_srcIndex. - QStringList source(m_source); + TQStringList source(m_source); uint srcIndex = m_srcIndex; m_source.clear(); parseFile(filename); @@ -167,7 +167,7 @@ void AdaImport::parseStems(const QStringList& stems) { bool AdaImport::parseStmt() { const uint srcLength = m_source.count(); - QString keyword = m_source[m_srcIndex]; + TQString keyword = m_source[m_srcIndex]; UMLDoc *umldoc = UMLApp::app()->getDocument(); //kDebug() << '"' << keyword << '"' << endl; if (keyword == "with") { @@ -176,8 +176,8 @@ bool AdaImport::parseStmt() { return false; } while (++m_srcIndex < srcLength && m_source[m_srcIndex] != ";") { - QStringList components = QStringList::split(".", m_source[m_srcIndex].lower()); - const QString& prefix = components.first(); + TQStringList components = TQStringList::split(".", m_source[m_srcIndex].lower()); + const TQString& prefix = components.first(); if (prefix == "system" || prefix == "ada" || prefix == "gnat" || prefix == "interfaces" || prefix == "text_io" || prefix == "unchecked_conversion" || @@ -197,8 +197,8 @@ bool AdaImport::parseStmt() { return true; } if (keyword == "package") { - const QString& name = advance(); - QStringList parentPkgs = QStringList::split(".", name.lower()); + const TQString& name = advance(); + TQStringList parentPkgs = TQStringList::split(".", name.lower()); parentPkgs.pop_back(); // exclude the current package parseStems(parentPkgs); UMLObject *ns = NULL; @@ -207,7 +207,7 @@ bool AdaImport::parseStmt() { m_scope[m_scopeIndex], m_comment); if (m_source[m_srcIndex + 1] == "new") { m_srcIndex++; - QString pkgName = advance(); + TQString pkgName = advance(); UMLObject *gp = Import_Utils::createUMLObject(Uml::ot_Package, pkgName, m_scope[m_scopeIndex]); gp->setStereotype("generic"); @@ -237,9 +237,9 @@ bool AdaImport::parseStmt() { if (m_inGenericFormalPart) return false; // skip generic formal parameter (not yet implemented) if (keyword == "subtype") { - QString name = advance(); + TQString name = advance(); advance(); // "is" - QString base = expand(advance()); + TQString base = expand(advance()); base.remove("Standard.", false); UMLObject *type = umldoc->findUMLObject(base, Uml::ot_UMLObject, m_scope[m_scopeIndex]); if (type == NULL) { @@ -257,8 +257,8 @@ bool AdaImport::parseStmt() { return true; } if (keyword == "type") { - QString name = advance(); - QString next = advance(); + TQString name = advance(); + TQString next = advance(); if (next == "(") { kDebug() << "AdaImport::parseStmt(" << name << "): " << "discriminant handling is not yet implemented" << endl; @@ -290,7 +290,7 @@ bool AdaImport::parseStmt() { UMLEnum *enumType = static_cast(ns); while ((next = advance()) != ")") { Import_Utils::addEnumLiteral(enumType, next, m_comment); - m_comment = QString(); + m_comment = TQString(); if (advance() != ",") break; } @@ -322,7 +322,7 @@ bool AdaImport::parseStmt() { if (t == Uml::ot_Interface) { while ((next = advance()) == "and") { UMLClassifier *klass = static_cast(ns); - QString base = expand(advance()); + TQString base = expand(advance()); UMLObject *p = Import_Utils::createUMLObject(Uml::ot_Interface, base, m_scope[m_scopeIndex]); UMLClassifier *parent = static_cast(p); Import_Utils::createGeneralization(klass, parent); @@ -344,8 +344,8 @@ bool AdaImport::parseStmt() { return true; } if (next == "new") { - QString base = expand(advance()); - QStringList baseInterfaces; + TQString base = expand(advance()); + TQStringList baseInterfaces; while ((next = advance()) == "and") { baseInterfaces.append(expand(advance())); } @@ -372,8 +372,8 @@ bool AdaImport::parseStmt() { } if (baseInterfaces.count()) { t = Uml::ot_Interface; - QStringList::Iterator end(baseInterfaces.end()); - for (QStringList::Iterator bi(baseInterfaces.begin()); bi != end; ++bi) { + TQStringList::Iterator end(baseInterfaces.end()); + for (TQStringList::Iterator bi(baseInterfaces.begin()); bi != end; ++bi) { ns = Import_Utils::createUMLObject(t, *bi, m_scope[m_scopeIndex]); parent = static_cast(ns); Import_Utils::createGeneralization(klass, parent); @@ -400,7 +400,7 @@ bool AdaImport::parseStmt() { m_klass = NULL; } else if (m_scopeIndex) { if (advance() != ";") { - QString scopeName = m_scope[m_scopeIndex]->getFullyQualifiedName(); + TQString scopeName = m_scope[m_scopeIndex]->getFullyQualifiedName(); if (scopeName.lower() != m_source[m_srcIndex].lower()) kError() << "end: expecting " << scopeName << ", found " << m_source[m_srcIndex] << endl; @@ -419,8 +419,8 @@ bool AdaImport::parseStmt() { if (keyword == "overriding") keyword = advance(); if (keyword == "function" || keyword == "procedure") { - const QString& name = advance(); - QString returnType; + const TQString& name = advance(); + TQString returnType; if (advance() != "(") { // Unlike an Ada package, a UML package does not support // subprograms. @@ -434,7 +434,7 @@ bool AdaImport::parseStmt() { UMLOperation *op = NULL; const uint MAX_PARNAMES = 16; while (m_srcIndex < srcLength && m_source[m_srcIndex] != ")") { - QString parName[MAX_PARNAMES]; + TQString parName[MAX_PARNAMES]; uint parNameCount = 0; do { if (parNameCount >= MAX_PARNAMES) { @@ -448,8 +448,8 @@ bool AdaImport::parseStmt() { skipStmt(); break; } - const QString &direction = advance(); - QString typeName; + const TQString &direction = advance(); + TQString typeName; Uml::Parameter_Direction dir = Uml::pd_In; if (direction == "access") { // Oops, we have to improvise here because there @@ -521,12 +521,12 @@ bool AdaImport::parseStmt() { if (keyword == "task" || keyword == "protected") { // Can task and protected objects/types be mapped to UML? bool isType = false; - QString name = advance(); + TQString name = advance(); if (name == "type") { isType = true; name = advance(); } - QString next = advance(); + TQString next = advance(); if (next == "(") { skipStmt(")"); // skip discriminant next = advance(); @@ -537,8 +537,8 @@ bool AdaImport::parseStmt() { return true; } if (keyword == "for") { // rep spec - QString typeName = advance(); - QString next = advance(); + TQString typeName = advance(); + TQString next = advance(); if (next == "'") { advance(); // skip qualifier next = advance(); @@ -558,21 +558,21 @@ bool AdaImport::parseStmt() { skipStmt(); return true; } - const QString& name = keyword; + const TQString& name = keyword; if (advance() != ":") { kError() << "adaImport: expecting \":\" at " << name << " " << m_source[m_srcIndex] << endl; skipStmt(); return true; } - QString nextToken = advance(); + TQString nextToken = advance(); if (nextToken == "aliased") nextToken = advance(); - QString typeName = expand(nextToken); - QString initialValue; + TQString typeName = expand(nextToken); + TQString initialValue; if (advance() == ":=") { initialValue = advance(); - QString token; + TQString token; while ((token = advance()) != ";") { initialValue.append(' ' + token); } diff --git a/umbrello/umbrello/codeimport/adaimport.h b/umbrello/umbrello/codeimport/adaimport.h index 14e41926..b7f3d3de 100644 --- a/umbrello/umbrello/codeimport/adaimport.h +++ b/umbrello/umbrello/codeimport/adaimport.h @@ -12,8 +12,8 @@ #ifndef ADAIMPORT_H #define ADAIMPORT_H -#include -#include +#include +#include #include "nativeimportbase.h" #include "../umlobjectlist.h" @@ -46,24 +46,24 @@ protected: * Ada's tic which is liable to be confused with the beginning of a character * constant. */ - QStringList split(const QString& line); + TQStringList split(const TQString& line); /** * Implement abstract operation from NativeImportBase. */ - void fillSource(const QString& word); + void fillSource(const TQString& word); /** * Apply package renamings to the given name. * * @return expanded name */ - QString expand(const QString& name); + TQString expand(const TQString& name); /** * Parse all files that can be formed by concatenation of the given stems. */ - void parseStems(const QStringList& stems); + void parseStems(const TQStringList& stems); bool m_inGenericFormalPart; ///< auxiliary variable @@ -74,7 +74,7 @@ protected: */ UMLObjectList m_classesDefinedInThisScope; - typedef QMap StringMap; + typedef TQMap StringMap; /** * Map of package renamings. diff --git a/umbrello/umbrello/codeimport/classimport.cpp b/umbrello/umbrello/codeimport/classimport.cpp index ed675bda..e32758dd 100644 --- a/umbrello/umbrello/codeimport/classimport.cpp +++ b/umbrello/umbrello/codeimport/classimport.cpp @@ -12,7 +12,7 @@ // own header #include "classimport.h" // qt/kde includes -#include +#include #include // app includes #include "../umldoc.h" @@ -24,13 +24,13 @@ #include "pascalimport.h" #include "cppimport.h" -void ClassImport::importFiles(const QStringList &fileList) { +void ClassImport::importFiles(const TQStringList &fileList) { initialize(); UMLDoc *umldoc = UMLApp::app()->getDocument(); uint processedFilesCount = 0; - for (QStringList::const_iterator fileIT = fileList.begin(); + for (TQStringList::const_iterator fileIT = fileList.begin(); fileIT != fileList.end(); ++fileIT) { - QString fileName = (*fileIT); + TQString fileName = (*fileIT); umldoc->writeToStatusBar(i18n("Importing file: %1 Progress: %2/%3"). arg(fileName).arg(processedFilesCount).arg(fileList.size())); parseFile(fileName); @@ -39,7 +39,7 @@ void ClassImport::importFiles(const QStringList &fileList) { umldoc->writeToStatusBar(i18n("Ready.")); } -ClassImport *ClassImport::createImporterByFileExt(const QString &filename) { +ClassImport *ClassImport::createImporterByFileExt(const TQString &filename) { ClassImport *classImporter; if (filename.endsWith(".idl")) classImporter = new IDLImport(); @@ -47,7 +47,7 @@ ClassImport *ClassImport::createImporterByFileExt(const QString &filename) { classImporter = new PythonImport(); else if (filename.endsWith(".java")) classImporter = new JavaImport(); - else if (filename.contains( QRegExp("\\.ad[sba]$") )) + else if (filename.contains( TQRegExp("\\.ad[sba]$") )) classImporter = new AdaImport(); else if (filename.endsWith(".pas")) classImporter = new PascalImport(); diff --git a/umbrello/umbrello/codeimport/classimport.h b/umbrello/umbrello/codeimport/classimport.h index 351ddec5..e9820aa1 100644 --- a/umbrello/umbrello/codeimport/classimport.h +++ b/umbrello/umbrello/codeimport/classimport.h @@ -12,7 +12,7 @@ #ifndef CLASSIMPORT_H #define CLASSIMPORT_H -#include +#include /** * Interfaces classparser library to uml models @@ -32,12 +32,12 @@ public: * * @param files List of files to import. */ - void importFiles(const QStringList &files); + void importFiles(const TQStringList &files); /** * Factory method. */ - static ClassImport *createImporterByFileExt(const QString &filename); + static ClassImport *createImporterByFileExt(const TQString &filename); protected: /** @@ -54,7 +54,7 @@ protected: * * @param filename The file to import. */ - virtual void parseFile(const QString& filename) = 0; + virtual void parseFile(const TQString& filename) = 0; }; diff --git a/umbrello/umbrello/codeimport/cppimport.cpp b/umbrello/umbrello/codeimport/cppimport.cpp index 4537c038..f97a5359 100644 --- a/umbrello/umbrello/codeimport/cppimport.cpp +++ b/umbrello/umbrello/codeimport/cppimport.cpp @@ -12,8 +12,8 @@ // own header #include "cppimport.h" // qt/kde includes -#include -#include +#include +#include #include #include // app includes @@ -33,7 +33,7 @@ // static members CppDriver * CppImport::ms_driver; -QStringList CppImport::ms_seenFiles; +TQStringList CppImport::ms_seenFiles; class CppDriver : public Driver { public: @@ -49,17 +49,17 @@ CppImport::CppImport() { CppImport::~CppImport() {} -void CppImport::feedTheModel(const QString& fileName) { +void CppImport::feedTheModel(const TQString& fileName) { if (ms_seenFiles.find(fileName) != ms_seenFiles.end()) return; ms_seenFiles.append(fileName); - QMap deps = ms_driver->dependences(fileName); + TQMap deps = ms_driver->dependences(fileName); if (! deps.empty()) { - QMap::Iterator it; + TQMap::Iterator it; for (it = deps.begin(); it != deps.end(); ++it) { if (it.data().second == Dep_Global) // don't want these continue; - QString includeFile = it.key(); + TQString includeFile = it.key(); if (includeFile.isEmpty()) { kError() << fileName << ": " << it.data().first << " not found" << endl; @@ -89,10 +89,10 @@ void CppImport::initialize() { ms_driver->addIncludePath( "/usr/include/c++" ); ms_driver->addIncludePath( "/usr/include/g++" ); ms_driver->addIncludePath( "/usr/local/include" ); - QStringList incPathList = Import_Utils::includePathList(); + TQStringList incPathList = Import_Utils::includePathList(); if (incPathList.count()) { - QStringList::Iterator end(incPathList.end()); - for (QStringList::Iterator i(incPathList.begin()); i != end; ++i) { + TQStringList::Iterator end(incPathList.end()); + for (TQStringList::Iterator i(incPathList.begin()); i != end; ++i) { ms_driver->addIncludePath( *i ); } @@ -100,7 +100,7 @@ void CppImport::initialize() { ms_seenFiles.clear(); } -void CppImport::parseFile(const QString& fileName) { +void CppImport::parseFile(const TQString& fileName) { if (ms_seenFiles.find(fileName) != ms_seenFiles.end()) return; ms_driver->parseFile( fileName ); diff --git a/umbrello/umbrello/codeimport/cppimport.h b/umbrello/umbrello/codeimport/cppimport.h index 3d5d8195..bf980bf4 100644 --- a/umbrello/umbrello/codeimport/cppimport.h +++ b/umbrello/umbrello/codeimport/cppimport.h @@ -12,7 +12,7 @@ #ifndef CPPIMPORT_H #define CPPIMPORT_H -#include +#include #include "classimport.h" class CppDriver; @@ -39,7 +39,7 @@ protected: * * @param filename The file to import. */ - void parseFile(const QString& filename); + void parseFile(const TQString& filename); private: /** @@ -49,10 +49,10 @@ private: * in proper order so that references between UML objects are created * properly. */ - void feedTheModel(const QString& fileName); + void feedTheModel(const TQString& fileName); static CppDriver * ms_driver; - static QStringList ms_seenFiles; ///< auxiliary buffer for feedTheModel() + static TQStringList ms_seenFiles; ///< auxiliary buffer for feedTheModel() }; diff --git a/umbrello/umbrello/codeimport/idlimport.cpp b/umbrello/umbrello/codeimport/idlimport.cpp index 6d228baf..cd2db89d 100644 --- a/umbrello/umbrello/codeimport/idlimport.cpp +++ b/umbrello/umbrello/codeimport/idlimport.cpp @@ -14,9 +14,9 @@ #include // qt/kde includes -// #include //should use this instead of popen() -#include -#include +// #include //should use this instead of popen() +#include +#include #include // app includes #include "import_utils.h" @@ -38,8 +38,8 @@ IDLImport::~IDLImport() { } /// Check for split type names (e.g. unsigned long long) -QString IDLImport::joinTypename() { - QString typeName = m_source[m_srcIndex]; +TQString IDLImport::joinTypename() { + TQString typeName = m_source[m_srcIndex]; if (m_source[m_srcIndex] == "unsigned") typeName += ' ' + advance(); if (m_source[m_srcIndex] == "long" && @@ -48,18 +48,18 @@ QString IDLImport::joinTypename() { return typeName; } -bool IDLImport::preprocess(QString& line) { +bool IDLImport::preprocess(TQString& line) { // Ignore C preprocessor generated lines. if (line.startsWith("#")) return true; // done return NativeImportBase::preprocess(line); } -void IDLImport::fillSource(const QString& word) { - QString lexeme; +void IDLImport::fillSource(const TQString& word) { + TQString lexeme; const uint len = word.length(); for (uint i = 0; i < len; i++) { - QChar c = word[i]; + TQChar c = word[i]; if (c.isLetterOrNumber() || c == '_') { lexeme += c; } else if (c == ':' && word[i + 1] == ':') { @@ -74,28 +74,28 @@ void IDLImport::fillSource(const QString& word) { } else { if (!lexeme.isEmpty()) { m_source.append(lexeme); - lexeme = QString(); + lexeme = TQString(); } - m_source.append(QString(c)); + m_source.append(TQString(c)); } } if (!lexeme.isEmpty()) m_source.append(lexeme); } -void IDLImport::parseFile(const QString& filename) { +void IDLImport::parseFile(const TQString& filename) { if (filename.contains('/')) { - QString path = filename; - path.remove( QRegExp("/[^/]+$") ); + TQString path = filename; + path.remove( TQRegExp("/[^/]+$") ); kDebug() << "IDLImport::parseFile: adding path " << path << endl; Import_Utils::addIncludePath(path); } - QStringList includePaths = Import_Utils::includePathList(); - //QProcess command("cpp", UMLAp::app()); - QString command("cpp -C"); // -C means "preserve comments" - for (QStringList::Iterator pathIt = includePaths.begin(); + TQStringList includePaths = Import_Utils::includePathList(); + //TQProcess command("cpp", UMLAp::app()); + TQString command("cpp -C"); // -C means "preserve comments" + for (TQStringList::Iterator pathIt = includePaths.begin(); pathIt != includePaths.end(); ++pathIt) { - QString path = (*pathIt); + TQString path = (*pathIt); //command.addArgument(" -I" + path); command += " -I" + path; } @@ -106,21 +106,21 @@ void IDLImport::parseFile(const QString& filename) { kError() << "IDLImport::parseFile: cannot popen(" << command << ")" << endl; return; } - // Scan the input file into the QStringList m_source. + // Scan the input file into the TQStringList m_source. m_source.clear(); char buf[256]; while (fgets(buf, sizeof(buf), fp) != NULL) { int len = strlen(buf); if (buf[len - 1] == '\n') buf[--len] = '\0'; - NativeImportBase::scan( QString(buf) ); + NativeImportBase::scan( TQString(buf) ); } - // Parse the QStringList m_source. + // Parse the TQStringList m_source. m_scopeIndex = 0; m_scope[0] = NULL; const uint srcLength = m_source.count(); for (m_srcIndex = 0; m_srcIndex < srcLength; m_srcIndex++) { - const QString& keyword = m_source[m_srcIndex]; + const TQString& keyword = m_source[m_srcIndex]; //kDebug() << '"' << keyword << '"' << endl; if (keyword.startsWith(m_singleLineCommentIntro)) { m_comment = keyword.mid(m_singleLineCommentIntro.length()); @@ -129,16 +129,16 @@ void IDLImport::parseFile(const QString& filename) { if (! parseStmt()) skipStmt(); m_currentAccess = Uml::Visibility::Public; - m_comment = QString(); + m_comment = TQString(); } pclose(fp); } bool IDLImport::parseStmt() { - const QString& keyword = m_source[m_srcIndex]; + const TQString& keyword = m_source[m_srcIndex]; const uint srcLength = m_source.count(); if (keyword == "module") { - const QString& name = advance(); + const TQString& name = advance(); UMLObject *ns = Import_Utils::createUMLObject(Uml::ot_Package, name, m_scope[m_scopeIndex], m_comment); m_scope[++m_scopeIndex] = static_cast(ns); @@ -150,19 +150,19 @@ bool IDLImport::parseStmt() { return true; } if (keyword == "interface") { - const QString& name = advance(); + const TQString& name = advance(); UMLObject *ns = Import_Utils::createUMLObject(Uml::ot_Class, name, m_scope[m_scopeIndex], m_comment); m_scope[++m_scopeIndex] = m_klass = static_cast(ns); m_klass->setStereotype("CORBAInterface"); m_klass->setAbstract(m_isAbstract); m_isAbstract = false; - m_comment = QString(); + m_comment = TQString(); if (advance() == ";") // forward declaration return true; if (m_source[m_srcIndex] == ":") { while (++m_srcIndex < srcLength && m_source[m_srcIndex] != "{") { - const QString& baseName = m_source[m_srcIndex]; + const TQString& baseName = m_source[m_srcIndex]; Import_Utils::createGeneralization(m_klass, baseName); if (advance() != ",") break; @@ -176,7 +176,7 @@ bool IDLImport::parseStmt() { return true; } if (keyword == "struct" || keyword == "exception") { - const QString& name = advance(); + const TQString& name = advance(); UMLObject *ns = Import_Utils::createUMLObject(Uml::ot_Class, name, m_scope[m_scopeIndex], m_comment); m_scope[++m_scopeIndex] = m_klass = static_cast(ns); @@ -197,7 +197,7 @@ bool IDLImport::parseStmt() { return true; } if (keyword == "enum") { - const QString& name = advance(); + const TQString& name = advance(); UMLObject *ns = Import_Utils::createUMLObject(Uml::ot_Enum, name, m_scope[m_scopeIndex], m_comment); UMLEnum *enumType = static_cast(ns); @@ -211,8 +211,8 @@ bool IDLImport::parseStmt() { return true; } if (keyword == "typedef") { - const QString& existingType = advance(); - const QString& newType = advance(); + const TQString& existingType = advance(); + const TQString& newType = advance(); Import_Utils::createUMLObject(Uml::ot_Class, newType, m_scope[m_scopeIndex], m_comment, "CORBATypedef" /* stereotype */); // @todo How do we convey the existingType ? @@ -231,7 +231,7 @@ bool IDLImport::parseStmt() { return true; } if (keyword == "valuetype") { - const QString& name = advance(); + const TQString& name = advance(); UMLObject *ns = Import_Utils::createUMLObject(Uml::ot_Class, name, m_scope[m_scopeIndex], m_comment); m_scope[++m_scopeIndex] = m_klass = static_cast(ns); @@ -243,7 +243,7 @@ bool IDLImport::parseStmt() { if (advance() == "truncatable") m_srcIndex++; while (m_srcIndex < srcLength && m_source[m_srcIndex] != "{") { - const QString& baseName = m_source[m_srcIndex]; + const TQString& baseName = m_source[m_srcIndex]; Import_Utils::createGeneralization(m_klass, baseName); if (advance() != ",") break; @@ -290,13 +290,13 @@ bool IDLImport::parseStmt() { // (of a member of struct or valuetype, or return type // of an operation.) Up next is the name of the attribute // or operation. - if (! keyword.contains( QRegExp("^\\w") )) { + if (! keyword.contains( TQRegExp("^\\w") )) { kError() << "importIDL: ignoring " << keyword << endl; return false; } - QString typeName = joinTypename(); - QString name = advance(); - if (name.contains( QRegExp("\\W") )) { + TQString typeName = joinTypename(); + TQString name = advance(); + if (name.contains( TQRegExp("\\W") )) { kError() << "importIDL: expecting name in " << name << endl; return false; } @@ -305,15 +305,15 @@ bool IDLImport::parseStmt() { kError() << "importIDL: no class set for " << name << endl; return false; } - QString nextToken = advance(); + TQString nextToken = advance(); if (nextToken == "(") { // operation UMLOperation *op = Import_Utils::makeOperation(m_klass, name); m_srcIndex++; while (m_srcIndex < srcLength && m_source[m_srcIndex] != ")") { - const QString &direction = m_source[m_srcIndex++]; - QString typeName = joinTypename(); - const QString &parName = advance(); + const TQString &direction = m_source[m_srcIndex++]; + TQString typeName = joinTypename(); + const TQString &parName = advance(); UMLAttribute *att = Import_Utils::addMethodParameter(op, typeName, parName); Uml::Parameter_Direction dir; if (Model_Utils::stringToDirection(direction, dir)) diff --git a/umbrello/umbrello/codeimport/idlimport.h b/umbrello/umbrello/codeimport/idlimport.h index 6945364f..b5e88113 100644 --- a/umbrello/umbrello/codeimport/idlimport.h +++ b/umbrello/umbrello/codeimport/idlimport.h @@ -33,20 +33,20 @@ public: * Reimplement operation from NativeImportBase. * Need to do this because we use the external C preprocessor. */ - void parseFile(const QString& file); + void parseFile(const TQString& file); /** * Override operation from NativeImportBase. */ - bool preprocess(QString& line); + bool preprocess(TQString& line); /** * Implement abstract operation from NativeImportBase. */ - void fillSource(const QString& word); + void fillSource(const TQString& word); protected: - QString joinTypename(); + TQString joinTypename(); bool m_isOneway, m_isReadonly, m_isAttribute; }; diff --git a/umbrello/umbrello/codeimport/import_utils.cpp b/umbrello/umbrello/codeimport/import_utils.cpp index 92a87867..87206ccb 100644 --- a/umbrello/umbrello/codeimport/import_utils.cpp +++ b/umbrello/umbrello/codeimport/import_utils.cpp @@ -12,8 +12,8 @@ // own header #include "import_utils.h" // qt/kde includes -#include -#include +#include +#include #include #include #include @@ -64,7 +64,7 @@ bool bPutAtGlobalScope = false; /** * The include path list (see addIncludePath() and includePathList()) */ -QStringList incPathList; +TQStringList incPathList; void putAtGlobalScope(bool yesno) { bPutAtGlobalScope = yesno; @@ -82,13 +82,13 @@ bool newUMLObjectWasCreated() { return bNewUMLObjectWasCreated; } -QString formatComment(const QString &comment) { +TQString formatComment(const TQString &comment) { if (comment.isEmpty()) return comment; - QStringList lines = QStringList::split("\n", comment); - QString& first = lines.first(); - QRegExp wordex("\\w"); + TQStringList lines = TQStringList::split("\n", comment); + TQString& first = lines.first(); + TQRegExp wordex("\\w"); if (first.startsWith("/*")) { int wordpos = wordex.search(first); if (wordpos != -1) @@ -96,7 +96,7 @@ QString formatComment(const QString &comment) { else lines.pop_front(); // nothing interesting on this line } - QString& last = lines.last(); + TQString& last = lines.last(); int endpos = last.find("*/"); if (endpos != -1) { if (last.contains(wordex)) @@ -107,16 +107,16 @@ QString formatComment(const QString &comment) { if (! lines.count()) return ""; - QStringList::Iterator end(lines.end()); - for (QStringList::Iterator lit(lines.begin()); lit != end; ++lit) { - (*lit).remove(QRegExp("^\\s+")); - (*lit).remove(QRegExp("^\\*+\\s?")); + TQStringList::Iterator end(lines.end()); + for (TQStringList::Iterator lit(lines.begin()); lit != end; ++lit) { + (*lit).remove(TQRegExp("^\\s+")); + (*lit).remove(TQRegExp("^\\*+\\s?")); } return lines.join("\n"); } /* -UMLObject* findUMLObject(QString name, +UMLObject* findUMLObject(TQString name, Uml::Object_Type type) { // Why an extra wrapper? See comment at addMethodParameter() UMLObject * o = umldoc->findUMLObject(name, type); @@ -125,11 +125,11 @@ UMLObject* findUMLObject(QString name, */ UMLObject *createUMLObject(Uml::Object_Type type, - const QString& inName, + const TQString& inName, UMLPackage *parentPkg, - const QString& comment, - const QString& stereotype) { - QString name = inName; + const TQString& comment, + const TQString& stereotype) { + TQString name = inName; UMLDoc *umldoc = UMLApp::app()->getDocument(); UMLFolder *logicalView = umldoc->getRootFolder(Uml::mt_Logical); const Uml::Programming_Language pl = UMLApp::app()->getActiveLanguage(); @@ -142,13 +142,13 @@ UMLObject *createUMLObject(Uml::Object_Type type, bNewUMLObjectWasCreated = false; if (o == NULL) { // Strip possible adornments and look again. - int isConst = name.contains(QRegExp("^const ")); - name.remove(QRegExp("^const\\s+")); - QString typeName(name); - const int isAdorned = typeName.contains( QRegExp("[^\\w:\\. ]") ); + int isConst = name.contains(TQRegExp("^const ")); + name.remove(TQRegExp("^const\\s+")); + TQString typeName(name); + const int isAdorned = typeName.contains( TQRegExp("[^\\w:\\. ]") ); const int isPointer = typeName.contains('*'); const int isRef = typeName.contains('&'); - typeName.remove(QRegExp("[^\\w:\\. ].*$")); + typeName.remove(TQRegExp("[^\\w:\\. ].*$")); typeName = typeName.simplifyWhiteSpace(); UMLObject *origType = umldoc->findUMLObject(typeName, Uml::ot_UMLObject, parentPkg); if (origType == NULL) { @@ -156,17 +156,17 @@ UMLObject *createUMLObject(Uml::Object_Type type, if (bPutAtGlobalScope) parentPkg = logicalView; // Find, or create, the scopes. - QStringList components; + TQStringList components; if (typeName.contains("::")) { - components = QStringList::split("::", typeName); + components = TQStringList::split("::", typeName); } else if (typeName.contains(".")) { - components = QStringList::split(".", typeName); + components = TQStringList::split(".", typeName); } if (components.count() > 1) { typeName = components.back(); components.pop_back(); while ( components.count() ) { - QString scopeName = components.front(); + TQString scopeName = components.front(); components.pop_front(); o = umldoc->findUMLObject(scopeName, Uml::ot_UMLObject, parentPkg); if (o) { @@ -240,7 +240,7 @@ UMLObject *createUMLObject(Uml::Object_Type type, parentPkg->addObject(o); } } - QString strippedComment = formatComment(comment); + TQString strippedComment = formatComment(comment); if (! strippedComment.isEmpty()) { o->setDoc(strippedComment); } @@ -249,17 +249,17 @@ UMLObject *createUMLObject(Uml::Object_Type type, } if (gRelatedClassifier == NULL || gRelatedClassifier == o) return o; - QRegExp templateInstantiation("^[\\w:\\.]+\\s*<(.*)>"); + TQRegExp templateInstantiation("^[\\w:\\.]+\\s*<(.*)>"); int pos = templateInstantiation.search(name); if (pos == -1) return o; // Create dependencies on template parameters. - QString caption = templateInstantiation.cap(1); - QStringList params = QStringList::split(QRegExp("[^\\w:\\.]+"), caption); + TQString caption = templateInstantiation.cap(1); + TQStringList params = TQStringList::split(TQRegExp("[^\\w:\\.]+"), caption); if (!params.count()) return o; - QStringList::Iterator end(params.end()); - for (QStringList::Iterator it(params.begin()); it != end; ++it) { + TQStringList::Iterator end(params.end()); + for (TQStringList::Iterator it(params.begin()); it != end; ++it) { UMLObject *p = umldoc->findUMLObject(*it, Uml::ot_UMLObject, parentPkg); if (p == NULL || p->getBaseType() == Uml::ot_Datatype) continue; @@ -274,16 +274,16 @@ UMLObject *createUMLObject(Uml::Object_Type type, return o; } -UMLOperation* makeOperation(UMLClassifier *parent, const QString &name) { +UMLOperation* makeOperation(UMLClassifier *parent, const TQString &name) { UMLOperation *op = Object_Factory::createOperation(parent, name); return op; } UMLObject* insertAttribute(UMLClassifier *owner, Uml::Visibility scope, - const QString& name, + const TQString& name, UMLClassifier *attrType, - const QString& comment /* ="" */, + const TQString& comment /* ="" */, bool isStatic /* =false */) { Uml::Object_Type ot = owner->getBaseType(); Uml::Programming_Language pl = UMLApp::app()->getActiveLanguage(); @@ -299,7 +299,7 @@ UMLObject* insertAttribute(UMLClassifier *owner, UMLAttribute *attr = owner->addAttribute(name, attrType, scope); attr->setStatic(isStatic); - QString strippedComment = formatComment(comment); + TQString strippedComment = formatComment(comment); if (! strippedComment.isEmpty()) { attr->setDoc(strippedComment); } @@ -309,9 +309,9 @@ UMLObject* insertAttribute(UMLClassifier *owner, } UMLObject* insertAttribute(UMLClassifier *owner, Uml::Visibility scope, - const QString& name, - const QString& type, - const QString& comment /* ="" */, + const TQString& name, + const TQString& type, + const TQString& comment /* ="" */, bool isStatic /* =false */) { UMLObject *attrType = owner->findTemplate(type); if (attrType == NULL) { @@ -327,10 +327,10 @@ UMLObject* insertAttribute(UMLClassifier *owner, Uml::Visibility scope, } void insertMethod(UMLClassifier *klass, UMLOperation* &op, - Uml::Visibility scope, const QString& type, + Uml::Visibility scope, const TQString& type, bool isStatic, bool isAbstract, bool isFriend, bool isConstructor, - const QString& comment) { + const TQString& comment) { op->setVisibility(scope); if (!type.isEmpty() // return type may be missing (constructor/destructor) && type != "void") { @@ -359,7 +359,7 @@ void insertMethod(UMLClassifier *klass, UMLOperation* &op, if (isConstructor) op->setStereotype("constructor"); - QString strippedComment = formatComment(comment); + TQString strippedComment = formatComment(comment); if (! strippedComment.isEmpty()) { op->setDoc(strippedComment); } @@ -394,8 +394,8 @@ void insertMethod(UMLClassifier *klass, UMLOperation* &op, } UMLAttribute* addMethodParameter(UMLOperation *method, - const QString& type, - const QString& name) { + const TQString& type, + const TQString& name) { UMLClassifier *owner = static_cast(method->parent()); UMLObject *typeObj = owner->findTemplate(type); if (typeObj == NULL) { @@ -410,7 +410,7 @@ UMLAttribute* addMethodParameter(UMLOperation *method, return attr; } -void addEnumLiteral(UMLEnum *enumType, const QString &literal, const QString &comment) { +void addEnumLiteral(UMLEnum *enumType, const TQString &literal, const TQString &comment) { UMLObject *el = enumType->addEnumLiteral(literal); el->setDoc(comment); } @@ -433,28 +433,28 @@ void createGeneralization(UMLClassifier *child, UMLClassifier *parent) { umldoc->addAssociation(assoc); } -void createGeneralization(UMLClassifier *child, const QString &parentName) { +void createGeneralization(UMLClassifier *child, const TQString &parentName) { UMLObject *parentObj = createUMLObject( Uml::ot_Class, parentName ); UMLClassifier *parent = static_cast(parentObj); createGeneralization(child, parent); } -QStringList includePathList() { - QStringList includePathList(incPathList); +TQStringList includePathList() { + TQStringList includePathList(incPathList); char *umbrello_incpath = getenv( "UMBRELLO_INCPATH" ); if (umbrello_incpath) { - includePathList += QStringList::split( ':', umbrello_incpath ); + includePathList += TQStringList::split( ':', umbrello_incpath ); } return includePathList; } -void addIncludePath(const QString& path) { +void addIncludePath(const TQString& path) { if (! incPathList.contains(path)) incPathList.append(path); } -bool isDatatype(const QString& name, UMLPackage *parentPkg) { +bool isDatatype(const TQString& name, UMLPackage *parentPkg) { UMLDoc *umldoc = UMLApp::app()->getDocument(); UMLObject * o = umldoc->findUMLObject(name, Uml::ot_Datatype, parentPkg); return (o!=NULL); diff --git a/umbrello/umbrello/codeimport/import_utils.h b/umbrello/umbrello/codeimport/import_utils.h index 7d36bc77..f04aa3be 100644 --- a/umbrello/umbrello/codeimport/import_utils.h +++ b/umbrello/umbrello/codeimport/import_utils.h @@ -12,7 +12,7 @@ #ifndef IMPORT_UTILS_H #define IMPORT_UTILS_H -#include +#include #include "../umlnamespace.h" #include "../umlattributelist.h" @@ -34,10 +34,10 @@ namespace Import_Utils { * Find or create a document object. */ UMLObject* createUMLObject(Uml::Object_Type type, - const QString& name, + const TQString& name, UMLPackage *parentPkg = NULL, - const QString& comment = QString::null, - const QString& stereotype = QString::null); + const TQString& comment = TQString::null, + const TQString& stereotype = TQString::null); /** * Control whether an object which is newly created by createUMLObject() * is put at the global scope. @@ -66,18 +66,18 @@ namespace Import_Utils { * Create a UMLAttribute and insert it into the document. */ UMLObject* insertAttribute(UMLClassifier *klass, Uml::Visibility scope, - const QString& name, - const QString& type, - const QString& comment = QString::null, + const TQString& name, + const TQString& type, + const TQString& comment = TQString::null, bool isStatic = false); /** * Create a UMLAttribute and insert it into the document. * Use the specified existing attrType. */ UMLObject* insertAttribute(UMLClassifier *klass, Uml::Visibility scope, - const QString& name, + const TQString& name, UMLClassifier *attrType, - const QString& comment /* ="" */, + const TQString& comment /* ="" */, bool isStatic /* =false */); /** * Create a UMLOperation. @@ -88,7 +88,7 @@ namespace Import_Utils { * a conflict with a pre-existing parameterless method of the same * name.) */ - UMLOperation* makeOperation(UMLClassifier *parent, const QString &name); + UMLOperation* makeOperation(UMLClassifier *parent, const TQString &name); /** * Insert the UMLOperation into the given classifier. @@ -109,10 +109,10 @@ namespace Import_Utils { * @param comment The Documentation for this method */ void insertMethod(UMLClassifier *klass, UMLOperation* &op, - Uml::Visibility scope, const QString& type, + Uml::Visibility scope, const TQString& type, bool isStatic, bool isAbstract, bool isFriend = false, bool isConstructor = false, - const QString& comment = QString::null); + const TQString& comment = TQString::null); /** * Add an argument to a UMLOperation. @@ -120,14 +120,14 @@ namespace Import_Utils { * prefixes in the `type'. */ UMLAttribute* addMethodParameter(UMLOperation *method, - const QString& type, - const QString& name); + const TQString& type, + const TQString& name); /** * Add an enum literal to an UMLEnum. */ - void addEnumLiteral(UMLEnum *enumType, const QString &literal, - const QString &comment = QString()); + void addEnumLiteral(UMLEnum *enumType, const TQString &literal, + const TQString &comment = TQString()); /** * Create a generalization from the given child classifier to the given @@ -139,12 +139,12 @@ namespace Import_Utils { * Create a generalization from the existing child UMLObject to the given * parent class name. */ - void createGeneralization(UMLClassifier *child, const QString &parentName); + void createGeneralization(UMLClassifier *child, const TQString &parentName); /** * Strip comment lines of leading whitespace and stars. */ - QString formatComment(const QString &comment); + TQString formatComment(const TQString &comment); /** * Return the list of paths set by previous calls to addIncludePath() @@ -152,12 +152,12 @@ namespace Import_Utils { * This list can be used for finding #included (or Ada with'ed or...) * files. */ - QStringList includePathList(); + TQStringList includePathList(); /** * Add a path to the include path list. */ - void addIncludePath(const QString& path); + void addIncludePath(const TQString& path); /** * Returns whether the last createUMLObject() actually created @@ -168,7 +168,7 @@ namespace Import_Utils { /** * Returns true if a type is an actual Datatype */ - bool isDatatype(const QString& name, UMLPackage *parentPkg = NULL); + bool isDatatype(const TQString& name, UMLPackage *parentPkg = NULL); } // end namespace Import_Utils diff --git a/umbrello/umbrello/codeimport/javaimport.cpp b/umbrello/umbrello/codeimport/javaimport.cpp index 8df6e5e7..7f62a1a9 100644 --- a/umbrello/umbrello/codeimport/javaimport.cpp +++ b/umbrello/umbrello/codeimport/javaimport.cpp @@ -13,10 +13,10 @@ #include "javaimport.h" // qt/kde includes -#include -#include -#include -#include +#include +#include +#include +#include #include // app includes #include "import_utils.h" @@ -29,7 +29,7 @@ #include "../operation.h" #include "../attribute.h" -QStringList JavaImport::s_filesAlreadyParsed; +TQStringList JavaImport::s_filesAlreadyParsed; int JavaImport::s_parseDepth = 0; JavaImport::JavaImport() : NativeImportBase("//") { @@ -45,7 +45,7 @@ void JavaImport::initVars() { } /// Catenate possible template arguments/array dimensions to the end of the type name. -QString JavaImport::joinTypename(QString typeName) { +TQString JavaImport::joinTypename(TQString typeName) { if (m_source[m_srcIndex + 1] == "<" || m_source[m_srcIndex + 1] == "[") { uint start = ++m_srcIndex; @@ -62,19 +62,19 @@ QString JavaImport::joinTypename(QString typeName) { return typeName; } -void JavaImport::fillSource(const QString& word) { - QString lexeme; +void JavaImport::fillSource(const TQString& word) { + TQString lexeme; const uint len = word.length(); for (uint i = 0; i < len; i++) { - const QChar& c = word[i]; + const TQChar& c = word[i]; if (c.isLetterOrNumber() || c == '_' || c == '.') { lexeme += c; } else { if (!lexeme.isEmpty()) { m_source.append(lexeme); - lexeme = QString(); + lexeme = TQString(); } - m_source.append(QString(c)); + m_source.append(TQString(c)); } } if (!lexeme.isEmpty()) @@ -83,15 +83,15 @@ void JavaImport::fillSource(const QString& word) { ///Spawn off an import of the specified file -void JavaImport::spawnImport( QString file ) { +void JavaImport::spawnImport( TQString file ) { // if the file is being parsed, don't bother // if (s_filesAlreadyParsed.contains( file ) ) { return; } - if (QFile::exists(file)) { + if (TQFile::exists(file)) { JavaImport importer; - QStringList fileList; + TQStringList fileList; fileList.append( file ); s_filesAlreadyParsed.append( file ); importer.importFiles( fileList ); @@ -100,7 +100,7 @@ void JavaImport::spawnImport( QString file ) { ///returns the UML Object if found, or null otherwise -UMLObject* findObject( QString name, UMLPackage *parentPkg ) { +UMLObject* findObject( TQString name, UMLPackage *parentPkg ) { UMLDoc *umldoc = UMLApp::app()->getDocument(); UMLObject * o = umldoc->findUMLObject(name, Uml::ot_UMLObject , parentPkg); return o; @@ -108,14 +108,14 @@ UMLObject* findObject( QString name, UMLPackage *parentPkg ) { ///Resolve the specified className -UMLObject* JavaImport::resolveClass (QString className) { +UMLObject* JavaImport::resolveClass (TQString className) { kDebug() << "importJava trying to resolve " << className << endl; // keep track if we are dealing with an array // bool isArray = className.contains('['); // remove any [] so that the class itself can be resolved // - QString baseClassName = className; + TQString baseClassName = className; baseClassName.remove('['); baseClassName.remove(']'); @@ -123,7 +123,7 @@ UMLObject* JavaImport::resolveClass (QString className) { // current package, which is in the same directory as the current file // being parsed // - QStringList file = QStringList::split( '/', m_currentFileName); + TQStringList file = TQStringList::split( '/', m_currentFileName); // remove the filename. This leaves the full path to the containing // dir which should also include the package hierarchy // @@ -132,9 +132,9 @@ UMLObject* JavaImport::resolveClass (QString className) { // the file we're looking for might be in the same directory as the // current class // - QString myDir = file.join( "/" ); - QString myFile = '/' + myDir + '/' + baseClassName + ".java"; - if ( QFile::exists(myFile) ) { + TQString myDir = file.join( "/" ); + TQString myFile = '/' + myDir + '/' + baseClassName + ".java"; + if ( TQFile::exists(myFile) ) { spawnImport( myFile ); if ( isArray ) { // we have imported the type. For arrays we want to return @@ -147,7 +147,7 @@ UMLObject* JavaImport::resolveClass (QString className) { // the class we want is not in the same package as the one being imported. // use the imports to find the one we want. // - QStringList package = QStringList::split( '.', m_currentPackage); + TQStringList package = TQStringList::split( '.', m_currentPackage); int dirsInPackageCount = package.size(); for (int count=0; count < dirsInPackageCount; count ++ ) { @@ -156,27 +156,27 @@ UMLObject* JavaImport::resolveClass (QString className) { file.pop_back(); } // this is now the root of any further source imports - QString sourceRoot = '/' + file.join("/") + '/'; + TQString sourceRoot = '/' + file.join("/") + '/'; - for (QStringList::Iterator pathIt = m_imports.begin(); + for (TQStringList::Iterator pathIt = m_imports.begin(); pathIt != m_imports.end(); ++pathIt) { - QString import = (*pathIt); - QStringList split = QStringList::split( '.', import ); + TQString import = (*pathIt); + TQStringList split = TQStringList::split( '.', import ); split.pop_back(); // remove the * or the classname if ( import.endsWith( "*" ) || import.endsWith( baseClassName) ) { // check if the file we want is in this imported package // convert the org.test type package into a filename // - QString aFile = sourceRoot + split.join("/") + '/' + baseClassName + ".java"; - if ( QFile::exists(aFile) ) { + TQString aFile = sourceRoot + split.join("/") + '/' + baseClassName + ".java"; + if ( TQFile::exists(aFile) ) { spawnImport( aFile ); // we need to set the package for the class that will be resolved // start at the root package UMLPackage *parent = m_scope[0]; UMLPackage *current = NULL; - for (QStringList::Iterator it = split.begin(); it != split.end(); ++it) { - QString name = (*it); + for (TQStringList::Iterator it = split.begin(); it != split.end(); ++it) { + TQString name = (*it); UMLObject *ns = Import_Utils::createUMLObject(Uml::ot_Package, name, parent); current = static_cast(ns); @@ -197,7 +197,7 @@ UMLObject* JavaImport::resolveClass (QString className) { /// keep track of the current file being parsed and reset the list of imports -void JavaImport::parseFile(const QString& filename) { +void JavaImport::parseFile(const TQString& filename) { m_currentFileName= filename; m_imports.clear(); // default visibility is Impl, unless we are an interface, then it is @@ -223,14 +223,14 @@ void JavaImport::parseFile(const QString& filename) { bool JavaImport::parseStmt() { const uint srcLength = m_source.count(); - const QString& keyword = m_source[m_srcIndex]; + const TQString& keyword = m_source[m_srcIndex]; //kDebug() << '"' << keyword << '"' << endl; if (keyword == "package") { m_currentPackage = advance(); - const QString& qualifiedName = m_currentPackage; - QStringList names = QStringList::split(".", qualifiedName); - for (QStringList::Iterator it = names.begin(); it != names.end(); ++it) { - QString name = (*it); + const TQString& qualifiedName = m_currentPackage; + TQStringList names = TQStringList::split(".", qualifiedName); + for (TQStringList::Iterator it = names.begin(); it != names.end(); ++it) { + TQString name = (*it); UMLObject *ns = Import_Utils::createUMLObject(Uml::ot_Package, name, m_scope[m_scopeIndex], m_comment); m_scope[++m_scopeIndex] = static_cast(ns); @@ -242,7 +242,7 @@ bool JavaImport::parseStmt() { return true; } if (keyword == "class" || keyword == "interface") { - const QString& name = advance(); + const TQString& name = advance(); const Uml::Object_Type t = (keyword == "class" ? Uml::ot_Class : Uml::ot_Interface); UMLObject *ns = Import_Utils::createUMLObject(t, name, m_scope[m_scopeIndex], m_comment); m_scope[++m_scopeIndex] = m_klass = static_cast(ns); @@ -270,14 +270,14 @@ bool JavaImport::parseStmt() { return false; } while (1) { - const QString arg = m_source[++start]; - if (! arg.contains( QRegExp("^[A-Za-z_]") )) { + const TQString arg = m_source[++start]; + if (! arg.contains( TQRegExp("^[A-Za-z_]") )) { kDebug() << "importJava(" << name << "): cannot handle template syntax (" << arg << ")" << endl; break; } /* UMLTemplate *tmpl = */ m_klass->addTemplate(arg); - const QString next = m_source[++start]; + const TQString next = m_source[++start]; if (next == ">") break; if (next != ",") { @@ -289,7 +289,7 @@ bool JavaImport::parseStmt() { advance(); // skip over ">" } if (m_source[m_srcIndex] == "extends") { - const QString& baseName = advance(); + const TQString& baseName = advance(); // try to resolve the class we are extending, or if impossible // create a placeholder UMLObject *parent = resolveClass( baseName ); @@ -304,7 +304,7 @@ bool JavaImport::parseStmt() { } if (m_source[m_srcIndex] == "implements") { while (m_srcIndex < srcLength - 1 && advance() != "{") { - const QString& baseName = m_source[m_srcIndex]; + const TQString& baseName = m_source[m_srcIndex]; // try to resolve the interface we are implementing, if this fails // create a placeholder UMLObject *interface = resolveClass( baseName ); @@ -327,14 +327,14 @@ bool JavaImport::parseStmt() { return true; } if (keyword == "enum") { - const QString& name = advance(); + const TQString& name = advance(); UMLObject *ns = Import_Utils::createUMLObject(Uml::ot_Enum, name, m_scope[m_scopeIndex], m_comment); UMLEnum *enumType = static_cast(ns); skipStmt("{"); while (m_srcIndex < srcLength - 1 && advance() != "}") { Import_Utils::addEnumLiteral(enumType, m_source[m_srcIndex]); - QString next = advance(); + TQString next = advance(); if (next == "{" || next == "(") { if (! skipToClosing(next[0])) return false; @@ -389,7 +389,7 @@ bool JavaImport::parseStmt() { } if (keyword == "import") { // keep track of imports so we can resolve classes we are dependent on - QString import = advance(); + TQString import = advance(); if ( import.endsWith(".") ) { //this most likely an import that ends with a * // @@ -420,28 +420,28 @@ bool JavaImport::parseStmt() { // (of a member of class or interface, or return type // of an operation.) Up next is the name of the attribute // or operation. - if (! keyword.contains( QRegExp("^\\w") )) { + if (! keyword.contains( TQRegExp("^\\w") )) { kError() << "importJava: ignoring " << keyword << endl; return false; } - QString typeName = m_source[m_srcIndex]; + TQString typeName = m_source[m_srcIndex]; typeName = joinTypename(typeName); // At this point we need a class. if (m_klass == NULL) { kError() << "importJava: no class set for " << typeName << endl; return false; } - QString name = advance(); - QString nextToken; + TQString name = advance(); + TQString nextToken; if (typeName == m_klass->getName() && name == "(") { // Constructor. nextToken = name; name = typeName; - typeName = QString(); + typeName = TQString(); } else { nextToken = advance(); } - if (name.contains( QRegExp("\\W") )) { + if (name.contains( TQRegExp("\\W") )) { kError() << "importJava: expecting name in " << name << endl; return false; } @@ -450,13 +450,13 @@ bool JavaImport::parseStmt() { UMLOperation *op = Import_Utils::makeOperation(m_klass, name); m_srcIndex++; while (m_srcIndex < srcLength && m_source[m_srcIndex] != ")") { - QString typeName = m_source[m_srcIndex]; + TQString typeName = m_source[m_srcIndex]; if ( typeName == "final" || typeName.startsWith( "//") ) { // ignore the "final" keyword and any comments in method args typeName = advance(); } typeName = joinTypename(typeName); - QString parName = advance(); + TQString parName = advance(); // the Class might not be resolved yet so resolve it if necessary UMLObject *obj = resolveClass(typeName); if (obj) { diff --git a/umbrello/umbrello/codeimport/javaimport.h b/umbrello/umbrello/codeimport/javaimport.h index 30fa2395..05dcbcb1 100644 --- a/umbrello/umbrello/codeimport/javaimport.h +++ b/umbrello/umbrello/codeimport/javaimport.h @@ -40,27 +40,27 @@ protected: /** * Implement abstract operation from NativeImportBase. */ - void fillSource(const QString& word); + void fillSource(const TQString& word); /** * Keep track of the filename currently being parsed */ - void parseFile(const QString& filename); + void parseFile(const TQString& filename); /** * Try to resolve the specified class the current class depends on */ - UMLObject* resolveClass (QString className); + UMLObject* resolveClass (TQString className); /** * spawn off an import of the specified file */ - void spawnImport(QString file); + void spawnImport(TQString file); /** * figure out if the type is really an array or template of the given typeName */ - QString joinTypename(QString typeName); + TQString joinTypename(TQString typeName); /** * true if the member var or method is declared static @@ -70,23 +70,23 @@ protected: /** * The current filename being parsed */ - QString m_currentFileName; + TQString m_currentFileName; /** * the current package of the file being parsed */ - QString m_currentPackage; + TQString m_currentPackage; /** * the imports included in the current file */ - QStringList m_imports; + TQStringList m_imports; /** * Keep track of the files we have already parsed so we don't * reparse the same ones over and over again. */ - static QStringList s_filesAlreadyParsed; + static TQStringList s_filesAlreadyParsed; /** * Keep track of the parses so that the filesAlreadyParsed diff --git a/umbrello/umbrello/codeimport/kdevcppparser/ast.cpp b/umbrello/umbrello/codeimport/kdevcppparser/ast.cpp index 1ca07eb6..e6a7e2b5 100644 --- a/umbrello/umbrello/codeimport/kdevcppparser/ast.cpp +++ b/umbrello/umbrello/codeimport/kdevcppparser/ast.cpp @@ -18,10 +18,10 @@ */ #include "ast.h" -#include +#include #include -QString nodeTypeToString( int type ) +TQString nodeTypeToString( int type ) { switch( type ) { @@ -117,7 +117,7 @@ QString nodeTypeToString( int type ) return "Custom"; } - return QString::null; + return TQString::null; } @@ -224,18 +224,18 @@ void NameAST::addClassOrNamespaceName( ClassOrNamespaceNameAST::Node& classOrNam m_classOrNamespaceNameList.append( classOrNamespaceName.release() ); } -QString NameAST::text() const +TQString NameAST::text() const { if( !m_unqualifiedName.get() ) - return QString::null; + return TQString::null; - QString str; + TQString str; if( m_global ) str += "::"; - QStringList l; - QPtrListIterator it( m_classOrNamespaceNameList ); + TQStringList l; + TQPtrListIterator it( m_classOrNamespaceNameList ); while( it.current() ){ str += it.current()->text() + "::"; ++it; @@ -406,11 +406,11 @@ void TemplateArgumentListAST::addArgument( AST::Node& arg ) m_argumentList.append( arg.release() ); } -QString TemplateArgumentListAST::text() const +TQString TemplateArgumentListAST::text() const { - QStringList l; + TQStringList l; - QPtrListIterator it( m_argumentList ); + TQPtrListIterator it( m_argumentList ); while( it.current() ){ l.append( it.current()->text() ); ++it; @@ -459,14 +459,14 @@ void ClassOrNamespaceNameAST::setTemplateArgumentList( TemplateArgumentListAST:: if( m_templateArgumentList.get() ) m_templateArgumentList->setParent( this ); } -QString ClassOrNamespaceNameAST::text() const +TQString ClassOrNamespaceNameAST::text() const { if( !m_name.get() ) - return QString::null; + return TQString::null; - QString str = m_name->text(); + TQString str = m_name->text(); if( m_templateArgumentList.get() ) - str += QString::fromLatin1("< ") + m_templateArgumentList->text() + QString::fromLatin1(" >"); + str += TQString::fromLatin1("< ") + m_templateArgumentList->text() + TQString::fromLatin1(" >"); return str; } @@ -488,9 +488,9 @@ void TypeSpecifierAST::setCv2Qualify( GroupAST::Node& cv2Qualify ) if( m_cv2Qualify.get() ) m_cv2Qualify->setParent( this ); } -QString TypeSpecifierAST::text() const +TQString TypeSpecifierAST::text() const { - QString str; + TQString str; if( m_cvQualify.get() ) str += m_cvQualify->text() + ' '; @@ -499,7 +499,7 @@ QString TypeSpecifierAST::text() const str += m_name->text(); if( m_cv2Qualify.get() ) - str += QString(" ") + m_cv2Qualify->text(); + str += TQString(" ") + m_cv2Qualify->text(); return str; } @@ -558,7 +558,7 @@ void ElaboratedTypeSpecifierAST::setKind( AST::Node& kind ) if( m_kind.get() ) m_kind->setParent( this ); } -QString ElaboratedTypeSpecifierAST::text() const +TQString ElaboratedTypeSpecifierAST::text() const { if( m_kind.get() ) return m_kind->text() + ' ' + TypeSpecifierAST::text(); @@ -960,9 +960,9 @@ void ParameterDeclarationAST::setExpression( AST::Node& expression ) if( m_expression.get() ) m_expression->setParent( this ); } -QString ParameterDeclarationAST::text() const +TQString ParameterDeclarationAST::text() const { - QString str; + TQString str; if( m_typeSpec.get() ) str += m_typeSpec->text() + ' '; @@ -970,7 +970,7 @@ QString ParameterDeclarationAST::text() const str += m_declarator->text(); if( m_expression.get() ) - str += QString( " = " ) + m_expression->text(); + str += TQString( " = " ) + m_expression->text(); return str; } @@ -990,11 +990,11 @@ void ParameterDeclarationListAST::addParameter( ParameterDeclarationAST::Node& p m_parameterList.append( parameter.release() ); } -QString ParameterDeclarationListAST::text() const +TQString ParameterDeclarationListAST::text() const { - QStringList l; + TQStringList l; - QPtrListIterator it( m_parameterList ); + TQPtrListIterator it( m_parameterList ); while( it.current() ){ l.append( it.current()->text() ); ++it; @@ -1021,9 +1021,9 @@ void ParameterDeclarationClauseAST::setEllipsis( AST::Node& ellipsis ) if( m_ellipsis.get() ) m_ellipsis->setParent( this ); } -QString ParameterDeclarationClauseAST::text() const +TQString ParameterDeclarationClauseAST::text() const { - QString str; + TQString str; if( m_parameterDeclarationList.get() ) str += m_parameterDeclarationList->text(); @@ -1050,11 +1050,11 @@ void GroupAST::addNode( AST::Node& node ) m_nodeList.append( node.release() ); } -QString GroupAST::text() const +TQString GroupAST::text() const { - QStringList l; + TQStringList l; - QPtrListIterator it( m_nodeList ); + TQPtrListIterator it( m_nodeList ); while( it.current() ){ l.append( it.current()->text() ); ++it; @@ -1078,11 +1078,11 @@ void AccessDeclarationAST::addAccess( AST::Node& access ) m_accessList.append( access.release() ); } -QString AccessDeclarationAST::text() const +TQString AccessDeclarationAST::text() const { - QStringList l; + TQStringList l; - QPtrListIterator it( m_accessList ); + TQPtrListIterator it( m_accessList ); while( it.current() ){ l.append( it.current()->text() ); ++it; diff --git a/umbrello/umbrello/codeimport/kdevcppparser/ast.h b/umbrello/umbrello/codeimport/kdevcppparser/ast.h index 932cf5dd..e2bd7835 100644 --- a/umbrello/umbrello/codeimport/kdevcppparser/ast.h +++ b/umbrello/umbrello/codeimport/kdevcppparser/ast.h @@ -21,8 +21,8 @@ #define __ast_h #include -#include -#include +#include +#include #if defined( Q_OS_WIN32 ) || defined( Q_CC_SUN ) @@ -174,7 +174,7 @@ enum NodeType NodeType_Custom = 2000 }; -QString nodeTypeToString( int type ); +TQString nodeTypeToString( int type ); #if defined(CPPPARSER_QUICK_ALLOCATOR) @@ -199,7 +199,7 @@ QString nodeTypeToString( int type ); struct Slice { - QString source; + TQString source; int position; int length; @@ -232,31 +232,31 @@ public: void getEndPosition( int* line, int* col ) const; #ifndef CPPPARSER_NO_CHILDREN - QPtrList children() { return m_children; } + TQPtrList children() { return m_children; } void appendChild( AST* child ); void removeChild( AST* child ); #endif - virtual inline QString text() const + virtual inline TQString text() const { return m_slice.source.mid(m_slice.position, m_slice.length); } - QString comment() const + TQString comment() const { return m_comment; } inline void setSlice( const Slice& slice ) { m_slice = slice; } - inline void setSlice( const QString &text, int position, int length ) + inline void setSlice( const TQString &text, int position, int length ) { m_slice.source = text; m_slice.position = position; m_slice.length = length; } - inline void setText(const QString &text) + inline void setText(const TQString &text) { setSlice(text, 0, text.length()); } - void setComment( const QString &comment ) + void setComment( const TQString &comment ) { m_comment = comment; } private: @@ -266,9 +266,9 @@ private: int m_endLine, m_endColumn; Slice m_slice; #ifndef CPPPARSER_NO_CHILDREN - QPtrList m_children; + TQPtrList m_children; #endif - QString m_comment; + TQString m_comment; private: AST( const AST& source ); @@ -286,13 +286,13 @@ public: public: GroupAST(); - QPtrList nodeList() { return m_nodeList; } + TQPtrList nodeList() { return m_nodeList; } void addNode( AST::Node& node ); - virtual QString text() const; + virtual TQString text() const; private: - QPtrList m_nodeList; + TQPtrList m_nodeList; private: GroupAST( const GroupAST& source ); @@ -312,12 +312,12 @@ public: TemplateArgumentListAST(); void addArgument( AST::Node& arg ); - QPtrList argumentList() { return m_argumentList; } + TQPtrList argumentList() { return m_argumentList; } - virtual QString text() const; + virtual TQString text() const; private: - QPtrList m_argumentList; + TQPtrList m_argumentList; private: TemplateArgumentListAST( const TemplateArgumentListAST& source ); @@ -341,7 +341,7 @@ public: TemplateArgumentListAST* templateArgumentList() { return m_templateArgumentList.get(); } void setTemplateArgumentList( TemplateArgumentListAST::Node& templateArgumentList ); - virtual QString text() const; + virtual TQString text() const; private: AST::Node m_name; @@ -367,17 +367,17 @@ public: void setGlobal( bool b ); void addClassOrNamespaceName( ClassOrNamespaceNameAST::Node& classOrNamespaceName ); - QPtrList classOrNamespaceNameList() { return m_classOrNamespaceNameList; } + TQPtrList classOrNamespaceNameList() { return m_classOrNamespaceNameList; } ClassOrNamespaceNameAST* unqualifiedName() { return m_unqualifiedName.get(); } void setUnqualifiedName( ClassOrNamespaceNameAST::Node& unqualifiedName ); - virtual QString text() const; + virtual TQString text() const; private: bool m_global; ClassOrNamespaceNameAST::Node m_unqualifiedName; - QPtrList m_classOrNamespaceNameList; + TQPtrList m_classOrNamespaceNameList; private: NameAST( const NameAST& source ); @@ -445,13 +445,13 @@ public: public: AccessDeclarationAST(); - QPtrList accessList() { return m_accessList; } + TQPtrList accessList() { return m_accessList; } void addAccess( AST::Node& access ); - virtual QString text() const; + virtual TQString text() const; private: - QPtrList m_accessList; + TQPtrList m_accessList; private: AccessDeclarationAST( const AccessDeclarationAST& source ); @@ -478,7 +478,7 @@ public: GroupAST* cv2Qualify() { return m_cv2Qualify.get(); } void setCv2Qualify( GroupAST::Node& cv2Qualify ); - virtual QString text() const; + virtual TQString text() const; private: NameAST::Node m_name; @@ -532,10 +532,10 @@ public: BaseClauseAST(); void addBaseSpecifier( BaseSpecifierAST::Node& baseSpecifier ); - QPtrList baseSpecifierList() { return m_baseSpecifierList; } + TQPtrList baseSpecifierList() { return m_baseSpecifierList; } private: - QPtrList m_baseSpecifierList; + TQPtrList m_baseSpecifierList; private: BaseClauseAST( const BaseClauseAST& source ); @@ -562,14 +562,14 @@ public: BaseClauseAST* baseClause() { return m_baseClause.get(); } void setBaseClause( BaseClauseAST::Node& baseClause ); - QPtrList declarationList() { return m_declarationList; } + TQPtrList declarationList() { return m_declarationList; } void addDeclaration( DeclarationAST::Node& declaration ); private: GroupAST::Node m_winDeclSpec; AST::Node m_classKey; BaseClauseAST::Node m_baseClause; - QPtrList m_declarationList; + TQPtrList m_declarationList; private: ClassSpecifierAST( const ClassSpecifierAST& source ); @@ -614,10 +614,10 @@ public: EnumSpecifierAST(); void addEnumerator( EnumeratorAST::Node& enumerator ); - QPtrList enumeratorList() { return m_enumeratorList; } + TQPtrList enumeratorList() { return m_enumeratorList; } private: - QPtrList m_enumeratorList; + TQPtrList m_enumeratorList; private: EnumSpecifierAST( const EnumSpecifierAST& source ); @@ -638,7 +638,7 @@ public: AST* kind() { return m_kind.get(); } void setKind( AST::Node& kind ); - virtual QString text() const; + virtual TQString text() const; private: AST::Node m_kind; @@ -661,10 +661,10 @@ public: LinkageBodyAST(); void addDeclaration( DeclarationAST::Node& ast ); - QPtrList declarationList() { return m_declarationList; } + TQPtrList declarationList() { return m_declarationList; } private: - QPtrList m_declarationList; + TQPtrList m_declarationList; private: LinkageBodyAST( const LinkageBodyAST& source ); @@ -812,7 +812,7 @@ public: public: DeclaratorAST(); - QPtrList ptrOpList() { return m_ptrOpList; } + TQPtrList ptrOpList() { return m_ptrOpList; } void addPtrOp( AST::Node& ptrOp ); DeclaratorAST* subDeclarator() { return m_subDeclarator.get(); } @@ -824,7 +824,7 @@ public: AST* bitfieldInitialization() { return m_bitfieldInitialization.get(); } void setBitfieldInitialization( AST::Node& bitfieldInitialization ); - QPtrList arrayDimensionList() { return m_arrayDimensionList; } + TQPtrList arrayDimensionList() { return m_arrayDimensionList; } void addArrayDimension( AST::Node& arrayDimension ); class ParameterDeclarationClauseAST* parameterDeclarationClause() { return m_parameterDeclarationClause.get(); } @@ -838,11 +838,11 @@ public: void setExceptionSpecification( GroupAST::Node& exceptionSpecification ); private: - QPtrList m_ptrOpList; + TQPtrList m_ptrOpList; Node m_subDeclarator; NameAST::Node m_declaratorId; AST::Node m_bitfieldInitialization; - QPtrList m_arrayDimensionList; + TQPtrList m_arrayDimensionList; AUTO_PTR m_parameterDeclarationClause; AST::Node m_constant; GroupAST::Node m_exceptionSpecification; @@ -872,7 +872,7 @@ public: AST* expression() { return m_expression.get(); } void setExpression( AST::Node& expression ); - virtual QString text() const; + virtual TQString text() const; private: TypeSpecifierAST::Node m_typeSpec; @@ -895,13 +895,13 @@ public: public: ParameterDeclarationListAST(); - QPtrList parameterList() { return m_parameterList; } + TQPtrList parameterList() { return m_parameterList; } void addParameter( ParameterDeclarationAST::Node& parameter ); - virtual QString text() const; + virtual TQString text() const; private: - QPtrList m_parameterList; + TQPtrList m_parameterList; private: ParameterDeclarationListAST( const ParameterDeclarationListAST& source ); @@ -925,7 +925,7 @@ public: AST* ellipsis() { return m_ellipsis.get(); } void setEllipsis( AST::Node& ellipsis ); - virtual QString text() const; + virtual TQString text() const; private: ParameterDeclarationListAST::Node m_parameterDeclarationList; @@ -974,11 +974,11 @@ public: public: InitDeclaratorListAST(); - QPtrList initDeclaratorList() { return m_initDeclaratorList; } + TQPtrList initDeclaratorList() { return m_initDeclaratorList; } void addInitDeclarator( InitDeclaratorAST::Node& decl ); private: - QPtrList m_initDeclaratorList; + TQPtrList m_initDeclaratorList; private: InitDeclaratorListAST( const InitDeclaratorListAST& source ); @@ -1048,11 +1048,11 @@ public: public: TemplateParameterListAST(); - QPtrList templateParameterList() { return m_templateParameterList; } + TQPtrList templateParameterList() { return m_templateParameterList; } void addTemplateParameter( TemplateParameterAST::Node& templateParameter ); private: - QPtrList m_templateParameterList; + TQPtrList m_templateParameterList; private: TemplateParameterListAST( const TemplateParameterListAST& source ); @@ -1348,11 +1348,11 @@ public: public: StatementListAST(); - QPtrList statementList() { return m_statementList; } + TQPtrList statementList() { return m_statementList; } void addStatement( StatementAST::Node& statement ); private: - QPtrList m_statementList; + TQPtrList m_statementList; private: StatementListAST( const StatementListAST& source ); @@ -1436,10 +1436,10 @@ public: TranslationUnitAST(); void addDeclaration( DeclarationAST::Node& ast ); - QPtrList declarationList() { return m_declarationList; } + TQPtrList declarationList() { return m_declarationList; } private: - QPtrList m_declarationList; + TQPtrList m_declarationList; private: TranslationUnitAST( const TranslationUnitAST& source ); diff --git a/umbrello/umbrello/codeimport/kdevcppparser/ast_utils.cpp b/umbrello/umbrello/codeimport/kdevcppparser/ast_utils.cpp index e30f0c1e..45cfd8ed 100644 --- a/umbrello/umbrello/codeimport/kdevcppparser/ast_utils.cpp +++ b/umbrello/umbrello/codeimport/kdevcppparser/ast_utils.cpp @@ -12,8 +12,8 @@ #include "ast_utils.h" #include "ast.h" -#include -#include +#include +#include #include #include @@ -35,8 +35,8 @@ AST* findNodeAt( AST* node, int line, int column ) if( (line > startLine || (line == startLine && column >= startColumn)) && (line < endLine || (line == endLine && column < endColumn)) ){ - QPtrList children = node->children(); - QPtrListIterator it( children ); + TQPtrList children = node->children(); + TQPtrListIterator it( children ); while( it.current() ){ AST* a = it.current(); ++it; @@ -52,7 +52,7 @@ AST* findNodeAt( AST* node, int line, int column ) return 0; } -void scopeOfNode( AST* ast, QStringList& scope ) +void scopeOfNode( AST* ast, TQStringList& scope ) { if( !ast ) return; @@ -60,13 +60,13 @@ void scopeOfNode( AST* ast, QStringList& scope ) if( ast->parent() ) scopeOfNode( ast->parent(), scope ); - QString s; + TQString s; switch( ast->nodeType() ) { case NodeType_ClassSpecifier: if( ((ClassSpecifierAST*)ast)->name() ){ s = ((ClassSpecifierAST*)ast)->name()->text(); - s = s.isEmpty() ? QString::fromLatin1("") : s; + s = s.isEmpty() ? TQString::fromLatin1("") : s; scope.push_back( s ); } break; @@ -74,7 +74,7 @@ void scopeOfNode( AST* ast, QStringList& scope ) case NodeType_Namespace: { AST* namespaceName = ((NamespaceAST*)ast)->namespaceName(); - s = namespaceName ? namespaceName->text() : QString::fromLatin1(""); + s = namespaceName ? namespaceName->text() : TQString::fromLatin1(""); scope.push_back( s ); } break; @@ -88,8 +88,8 @@ void scopeOfNode( AST* ast, QStringList& scope ) if ( !d->declaratorId() ) break; - QPtrList l = d->declaratorId()->classOrNamespaceNameList(); - QPtrListIterator nameIt( l ); + TQPtrList l = d->declaratorId()->classOrNamespaceNameList(); + TQPtrListIterator nameIt( l ); while( nameIt.current() ){ AST* name = nameIt.current()->name(); scope.push_back( name->text() ); @@ -105,24 +105,24 @@ void scopeOfNode( AST* ast, QStringList& scope ) } -QString typeSpecToString( TypeSpecifierAST* typeSpec ) /// @todo remove +TQString typeSpecToString( TypeSpecifierAST* typeSpec ) /// @todo remove { if( !typeSpec ) - return QString::null; + return TQString::null; - return typeSpec->text().replace( QRegExp(" :: "), "::" ); + return typeSpec->text().replace( TQRegExp(" :: "), "::" ); } -QString declaratorToString( DeclaratorAST* declarator, const QString& scope, bool skipPtrOp ) +TQString declaratorToString( DeclaratorAST* declarator, const TQString& scope, bool skipPtrOp ) { if( !declarator ) - return QString::null; + return TQString::null; - QString text; + TQString text; if( !skipPtrOp ){ - QPtrList ptrOpList = declarator->ptrOpList(); - for( QPtrListIterator it(ptrOpList); it.current(); ++it ){ + TQPtrList ptrOpList = declarator->ptrOpList(); + for( TQPtrListIterator it(ptrOpList); it.current(); ++it ){ text += it.current()->text(); } text += ' '; @@ -131,13 +131,13 @@ QString declaratorToString( DeclaratorAST* declarator, const QString& scope, boo text += scope; if( declarator->subDeclarator() ) - text += QString::fromLatin1("(") + declaratorToString(declarator->subDeclarator()) + QString::fromLatin1(")"); + text += TQString::fromLatin1("(") + declaratorToString(declarator->subDeclarator()) + TQString::fromLatin1(")"); if( declarator->declaratorId() ) text += declarator->declaratorId()->text(); - QPtrList arrays = declarator->arrayDimensionList(); - QPtrListIterator it( arrays ); + TQPtrList arrays = declarator->arrayDimensionList(); + TQPtrListIterator it( arrays ); while( it.current() ){ text += "[]"; ++it; @@ -148,11 +148,11 @@ QString declaratorToString( DeclaratorAST* declarator, const QString& scope, boo ParameterDeclarationListAST* l = declarator->parameterDeclarationClause()->parameterDeclarationList(); if( l != 0 ){ - QPtrList params = l->parameterList(); - QPtrListIterator it( params ); + TQPtrList params = l->parameterList(); + TQPtrListIterator it( params ); while( it.current() ){ - QString type = typeSpecToString( it.current()->typeSpec() ); + TQString type = typeSpecToString( it.current()->typeSpec() ); text += type; if( !type.isEmpty() ) text += ' '; @@ -171,6 +171,6 @@ QString declaratorToString( DeclaratorAST* declarator, const QString& scope, boo text += " const"; } - return text.replace( QRegExp(" :: "), "::" ).simplifyWhiteSpace(); + return text.replace( TQRegExp(" :: "), "::" ).simplifyWhiteSpace(); } diff --git a/umbrello/umbrello/codeimport/kdevcppparser/ast_utils.h b/umbrello/umbrello/codeimport/kdevcppparser/ast_utils.h index 187647b7..1e3c86e1 100644 --- a/umbrello/umbrello/codeimport/kdevcppparser/ast_utils.h +++ b/umbrello/umbrello/codeimport/kdevcppparser/ast_utils.h @@ -12,7 +12,7 @@ #ifndef __ast_utils_h #define __ast_utils_h -#include +#include class AST; class DeclaratorAST; @@ -22,8 +22,8 @@ class QStringList; namespace KTextEditor{ class EditInterface; } AST* findNodeAt( AST* unit, int line, int column ); -void scopeOfNode( AST* ast, QStringList& ); -QString typeSpecToString( TypeSpecifierAST* typeSpec ); -QString declaratorToString( DeclaratorAST* declarator, const QString& scope = QString::null, bool skipPtrOp=false ); +void scopeOfNode( AST* ast, TQStringList& ); +TQString typeSpecToString( TypeSpecifierAST* typeSpec ); +TQString declaratorToString( DeclaratorAST* declarator, const TQString& scope = TQString::null, bool skipPtrOp=false ); #endif // __ast_utils_h diff --git a/umbrello/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp b/umbrello/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp index e7d0b848..5763ec5e 100644 --- a/umbrello/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp +++ b/umbrello/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp @@ -13,9 +13,9 @@ // own header #include "cpptree2uml.h" // qt/kde includes -#include -#include -#include +#include +#include +#include #include // app includes #include "ast_utils.h" @@ -27,7 +27,7 @@ // FIXME The next include is motivated by template params #include "../../template.h" -CppTree2Uml::CppTree2Uml( const QString& fileName) +CppTree2Uml::CppTree2Uml( const TQString& fileName) : m_anon( 0 ), m_nsCnt( 0 ), m_clsCnt( 0 ) { m_fileName = URLUtil::canonicalPath(fileName); @@ -64,10 +64,10 @@ void CppTree2Uml::parseNamespace( NamespaceAST* ast ) return; } - QString nsName; + TQString nsName; if( !ast->namespaceName() || ast->namespaceName()->text().isEmpty() ){ - QFileInfo fileInfo( m_fileName ); - QString shortFileName = fileInfo.baseName(); + TQFileInfo fileInfo( m_fileName ); + TQString shortFileName = fileInfo.baseName(); nsName.sprintf( "(%s_%d)", shortFileName.local8Bit().data(), m_anon++ ); } else { @@ -100,7 +100,7 @@ void CppTree2Uml::parseTypedef( TypedefAST* ast ) DeclaratorAST* oldDeclarator = m_currentDeclarator; if( ast && ast->initDeclaratorList() && ast->initDeclaratorList()->initDeclaratorList().count() > 0 ) { - QPtrList lst( ast->initDeclaratorList()->initDeclaratorList() ); + TQPtrList lst( ast->initDeclaratorList()->initDeclaratorList() ); m_currentDeclarator = lst.at( 0 )->declarator(); } @@ -115,18 +115,18 @@ void CppTree2Uml::parseTypedef( TypedefAST* ast ) InitDeclaratorListAST* declarators = ast->initDeclaratorList(); if( typeSpec && declarators ){ - QString typeId; + TQString typeId; if( typeSpec->name() ) typeId = typeSpec->name()->text(); - QPtrList l( declarators->initDeclaratorList() ); - QPtrListIterator it( l ); + TQPtrList l( declarators->initDeclaratorList() ); + TQPtrListIterator it( l ); InitDeclaratorAST* initDecl = 0; while( 0 != (initDecl = it.current()) ){ - QString type, id; + TQString type, id; if( initDecl->declarator() ){ type = typeOfDeclaration( typeSpec, initDecl->declarator() ); @@ -178,8 +178,8 @@ void CppTree2Uml::parseTemplateDeclaration( TemplateDeclarationAST* ast ) TemplateParameterListAST* parmListAST = ast->templateParameterList(); if (parmListAST == NULL) return; - QPtrList parmList = parmListAST->templateParameterList(); - for (QPtrListIterator it(parmList); it.current(); ++it) { + TQPtrList parmList = parmListAST->templateParameterList(); + for (TQPtrListIterator it(parmList); it.current(); ++it) { // The template is either a typeParameter or a typeValueParameter. TemplateParameterAST* tmplParmNode = it.current(); @@ -187,7 +187,7 @@ void CppTree2Uml::parseTemplateDeclaration( TemplateDeclarationAST* ast ) if (typeParmNode) { NameAST* nameNode = typeParmNode->name(); if (nameNode) { - QString typeName = nameNode->unqualifiedName()->text(); + TQString typeName = nameNode->unqualifiedName()->text(); Model_Utils::NameAndType nt(typeName, NULL); m_templateParams.append(nt); } else { @@ -204,7 +204,7 @@ void CppTree2Uml::parseTemplateDeclaration( TemplateDeclarationAST* ast ) << " typeSpec is NULL" << endl; continue; } - QString typeName = typeSpec->name()->text(); + TQString typeName = typeSpec->name()->text(); UMLObject *t = Import_Utils::createUMLObject( Uml::ot_UMLObject, typeName, m_currentNamespace[m_nsCnt] ); DeclaratorAST* declNode = valueNode->declarator(); @@ -214,7 +214,7 @@ void CppTree2Uml::parseTemplateDeclaration( TemplateDeclarationAST* ast ) << " nameNode is NULL" << endl; continue; } - QString paramName = nameNode->unqualifiedName()->text(); + TQString paramName = nameNode->unqualifiedName()->text(); Model_Utils::NameAndType nt(paramName, t); m_templateParams.append(nt); } @@ -235,9 +235,9 @@ void CppTree2Uml::parseSimpleDeclaration( SimpleDeclarationAST* ast ) parseTypeSpecifier( typeSpec ); if( declarators ){ - QPtrList l = declarators->initDeclaratorList(); + TQPtrList l = declarators->initDeclaratorList(); - QPtrListIterator it( l ); + TQPtrListIterator it( l ); while( it.current() ){ parseDeclaration( ast->functionSpecifier(), ast->storageSpecifier(), typeSpec, it.current() ); ++it; @@ -266,10 +266,10 @@ void CppTree2Uml::parseFunctionDefinition( FunctionDefinitionAST* ast ) bool isConstructor = false; if( funSpec ){ - QPtrList l = funSpec->nodeList(); - QPtrListIterator it( l ); + TQPtrList l = funSpec->nodeList(); + TQPtrListIterator it( l ); while( it.current() ){ - QString text = it.current()->text(); + TQString text = it.current()->text(); if( text == "virtual" ) isVirtual = true; else if( text == "inline" ) isInline = true; ++it; @@ -277,17 +277,17 @@ void CppTree2Uml::parseFunctionDefinition( FunctionDefinitionAST* ast ) } if( storageSpec ){ - QPtrList l = storageSpec->nodeList(); - QPtrListIterator it( l ); + TQPtrList l = storageSpec->nodeList(); + TQPtrListIterator it( l ); while( it.current() ){ - QString text = it.current()->text(); + TQString text = it.current()->text(); if( text == "friend" ) isFriend = true; else if( text == "static" ) isStatic = true; ++it; } } - QString id = d->declaratorId()->unqualifiedName()->text().stripWhiteSpace(); + TQString id = d->declaratorId()->unqualifiedName()->text().stripWhiteSpace(); UMLClassifier *c = m_currentClass[m_clsCnt]; if (c == NULL) { @@ -296,7 +296,7 @@ void CppTree2Uml::parseFunctionDefinition( FunctionDefinitionAST* ast ) return; } - QString returnType = typeOfDeclaration( typeSpec, d ); + TQString returnType = typeOfDeclaration( typeSpec, d ); UMLOperation *m = Import_Utils::makeOperation(c, id); // if a class has no return type, it could be a constructor or // a destructor @@ -323,17 +323,17 @@ void CppTree2Uml::parseClassSpecifier( ClassSpecifierAST* ast ) bool oldInSlots = m_inSlots; bool oldInSignals = m_inSignals; - QString kind = ast->classKey()->text(); + TQString kind = ast->classKey()->text(); m_currentAccess=Uml::Visibility::fromString(kind); m_inSlots = false; m_inSignals = false; - QString className; + TQString className; if( !ast->name() && m_currentDeclarator && m_currentDeclarator->declaratorId() ) { className = m_currentDeclarator->declaratorId()->text().stripWhiteSpace(); } else if( !ast->name() ){ - QFileInfo fileInfo( m_fileName ); - QString shortFileName = fileInfo.baseName(); + TQFileInfo fileInfo( m_fileName ); + TQString shortFileName = fileInfo.baseName(); className.sprintf( "(%s_%d)", shortFileName.local8Bit().data(), m_anon++ ); } else { className = ast->name()->unqualifiedName()->text().stripWhiteSpace(); @@ -341,13 +341,13 @@ void CppTree2Uml::parseClassSpecifier( ClassSpecifierAST* ast ) //#ifdef DEBUG_CPPTREE2UML kDebug() << "CppTree2Uml::parseClassSpecifier: name=" << className << endl; //#endif - if( !scopeOfName( ast->name(), QStringList() ).isEmpty() ){ + if( !scopeOfName( ast->name(), TQStringList() ).isEmpty() ){ kDebug() << "skip private class declarations" << endl; return; } if (className.isEmpty()) { - className = "anon_" + QString::number(m_anon); + className = "anon_" + TQString::number(m_anon); m_anon++; } UMLObject * o = Import_Utils::createUMLObject( Uml::ot_Class, className, @@ -387,17 +387,17 @@ void CppTree2Uml::parseEnumSpecifier( EnumSpecifierAST* ast ) NameAST *nameNode = ast->name(); if (nameNode == NULL) return; // skip constants - QString typeName = nameNode->unqualifiedName()->text().stripWhiteSpace(); + TQString typeName = nameNode->unqualifiedName()->text().stripWhiteSpace(); if (typeName.isEmpty()) return; // skip constants UMLObject *o = Import_Utils::createUMLObject( Uml::ot_Enum, typeName, m_currentNamespace[m_nsCnt], ast->comment() ); - QPtrList l = ast->enumeratorList(); - QPtrListIterator it( l ); + TQPtrList l = ast->enumeratorList(); + TQPtrListIterator it( l ); while ( it.current() ) { - QString enumLiteral = it.current()->id()->text(); + TQString enumLiteral = it.current()->id()->text(); Import_Utils::addEnumLiteral( (UMLEnum*)o, enumLiteral ); ++it; } @@ -409,9 +409,9 @@ void CppTree2Uml::parseElaboratedTypeSpecifier( ElaboratedTypeSpecifierAST* type /// @todo Refine - Currently only handles class forward declarations. /// - Using typeSpec->text() is probably not good, decode /// the kind() instead. - QString text = typeSpec->text(); + TQString text = typeSpec->text(); kDebug() << "CppTree2Uml::parseElaboratedTypeSpecifier: text is " << text << endl; - text.remove(QRegExp("^class\\s+")); + text.remove(TQRegExp("^class\\s+")); UMLObject *o = Import_Utils::createUMLObject(Uml::ot_Class, text, m_currentNamespace[m_nsCnt]); flushTemplateParams( static_cast(o) ); } @@ -434,11 +434,11 @@ void CppTree2Uml::parseDeclaration( GroupAST* funSpec, GroupAST* storageSpec, while( t && t->subDeclarator() ) t = t->subDeclarator(); - QString id; + TQString id; if( t && t->declaratorId() && t->declaratorId()->unqualifiedName() ) id = t->declaratorId()->unqualifiedName()->text(); - if( !scopeOfDeclarator(d, QStringList()).isEmpty() ){ + if( !scopeOfDeclarator(d, TQStringList()).isEmpty() ){ kDebug() << "CppTree2Uml::parseDeclaration (" << id << "): skipping." << endl; return; @@ -451,16 +451,16 @@ void CppTree2Uml::parseDeclaration( GroupAST* funSpec, GroupAST* storageSpec, return; } - QString typeName = typeOfDeclaration( typeSpec, d ); + TQString typeName = typeOfDeclaration( typeSpec, d ); bool isFriend = false; bool isStatic = false; //bool isInitialized = decl->initializer() != 0; if( storageSpec ){ - QPtrList l = storageSpec->nodeList(); - QPtrListIterator it( l ); + TQPtrList l = storageSpec->nodeList(); + TQPtrListIterator it( l ); while( it.current() ){ - QString text = it.current()->text(); + TQString text = it.current()->text(); if( text == "friend" ) isFriend = true; else if( text == "static" ) isStatic = true; ++it; @@ -474,9 +474,9 @@ void CppTree2Uml::parseDeclaration( GroupAST* funSpec, GroupAST* storageSpec, void CppTree2Uml::parseAccessDeclaration( AccessDeclarationAST * access ) { - QPtrList l = access->accessList(); + TQPtrList l = access->accessList(); - QString accessStr = l.at( 0 )->text(); + TQString accessStr = l.at( 0 )->text(); m_currentAccess=Uml::Visibility::fromString(accessStr); @@ -495,10 +495,10 @@ void CppTree2Uml::parseFunctionDeclaration( GroupAST* funSpec, GroupAST* storag bool isConstructor = false; if( funSpec ){ - QPtrList l = funSpec->nodeList(); - QPtrListIterator it( l ); + TQPtrList l = funSpec->nodeList(); + TQPtrListIterator it( l ); while( it.current() ){ - QString text = it.current()->text(); + TQString text = it.current()->text(); if( text == "virtual" ) isVirtual = true; else if( text == "inline" ) isInline = true; ++it; @@ -506,10 +506,10 @@ void CppTree2Uml::parseFunctionDeclaration( GroupAST* funSpec, GroupAST* storag } if( storageSpec ){ - QPtrList l = storageSpec->nodeList(); - QPtrListIterator it( l ); + TQPtrList l = storageSpec->nodeList(); + TQPtrListIterator it( l ); while( it.current() ){ - QString text = it.current()->text(); + TQString text = it.current()->text(); if( text == "friend" ) isFriend = true; else if( text == "static" ) isStatic = true; ++it; @@ -517,7 +517,7 @@ void CppTree2Uml::parseFunctionDeclaration( GroupAST* funSpec, GroupAST* storag } DeclaratorAST* d = decl->declarator(); - QString id = d->declaratorId()->unqualifiedName()->text(); + TQString id = d->declaratorId()->unqualifiedName()->text(); UMLClassifier *c = m_currentClass[m_clsCnt]; if (c == NULL) { @@ -526,7 +526,7 @@ void CppTree2Uml::parseFunctionDeclaration( GroupAST* funSpec, GroupAST* storag return; } - QString returnType = typeOfDeclaration( typeSpec, d ); + TQString returnType = typeOfDeclaration( typeSpec, d ); UMLOperation *m = Import_Utils::makeOperation(c, id); // if a class has no return type, it could be a constructor or // a destructor @@ -546,17 +546,17 @@ void CppTree2Uml::parseFunctionArguments(DeclaratorAST* declarator, if( clause && clause->parameterDeclarationList() ){ ParameterDeclarationListAST* params = clause->parameterDeclarationList(); - QPtrList l( params->parameterList() ); - QPtrListIterator it( l ); + TQPtrList l( params->parameterList() ); + TQPtrListIterator it( l ); while( it.current() ){ ParameterDeclarationAST* param = it.current(); ++it; - QString name; + TQString name; if (param->declarator()) - name = declaratorToString(param->declarator(), QString::null, true ); + name = declaratorToString(param->declarator(), TQString::null, true ); - QString tp = typeOfDeclaration( param->typeSpec(), param->declarator() ); + TQString tp = typeOfDeclaration( param->typeSpec(), param->declarator() ); if (tp != "void") Import_Utils::addMethodParameter( method, tp, name ); @@ -564,17 +564,17 @@ void CppTree2Uml::parseFunctionArguments(DeclaratorAST* declarator, } } -QString CppTree2Uml::typeOfDeclaration( TypeSpecifierAST* typeSpec, DeclaratorAST* declarator ) +TQString CppTree2Uml::typeOfDeclaration( TypeSpecifierAST* typeSpec, DeclaratorAST* declarator ) { if( !typeSpec || !declarator ) - return QString::null; + return TQString::null; - QString text; + TQString text; text += typeSpec->text(); - QPtrList ptrOpList = declarator->ptrOpList(); - for( QPtrListIterator it(ptrOpList); it.current(); ++it ){ + TQPtrList ptrOpList = declarator->ptrOpList(); + for( TQPtrListIterator it(ptrOpList); it.current(); ++it ){ text += it.current()->text(); } @@ -583,8 +583,8 @@ QString CppTree2Uml::typeOfDeclaration( TypeSpecifierAST* typeSpec, DeclaratorAS void CppTree2Uml::parseBaseClause( BaseClauseAST * baseClause, UMLClassifier* klass ) { - QPtrList l = baseClause->baseSpecifierList(); - QPtrListIterator it( l ); + TQPtrList l = baseClause->baseSpecifierList(); + TQPtrListIterator it( l ); while( it.current() ){ BaseSpecifierAST* baseSpecifier = it.current(); ++it; @@ -595,19 +595,19 @@ void CppTree2Uml::parseBaseClause( BaseClauseAST * baseClause, UMLClassifier* kl continue; } - QString baseName = baseSpecifier->name()->text(); + TQString baseName = baseSpecifier->name()->text(); Import_Utils::createGeneralization( klass, baseName ); } } -QStringList CppTree2Uml::scopeOfName( NameAST* id, const QStringList& startScope ) +TQStringList CppTree2Uml::scopeOfName( NameAST* id, const TQStringList& startScope ) { - QStringList scope = startScope; + TQStringList scope = startScope; if( id && id->classOrNamespaceNameList().count() ){ if( id->isGlobal() ) scope.clear(); - QPtrList l = id->classOrNamespaceNameList(); - QPtrListIterator it( l ); + TQPtrList l = id->classOrNamespaceNameList(); + TQPtrListIterator it( l ); while( it.current() ){ if( it.current()->name() ){ scope << it.current()->name()->text(); @@ -619,7 +619,7 @@ QStringList CppTree2Uml::scopeOfName( NameAST* id, const QStringList& startScope return scope; } -QStringList CppTree2Uml::scopeOfDeclarator( DeclaratorAST* d, const QStringList& startScope ) +TQStringList CppTree2Uml::scopeOfDeclarator( DeclaratorAST* d, const TQStringList& startScope ) { return scopeOfName( d->declaratorId(), startScope ); } diff --git a/umbrello/umbrello/codeimport/kdevcppparser/cpptree2uml.h b/umbrello/umbrello/codeimport/kdevcppparser/cpptree2uml.h index b9791372..7248c782 100644 --- a/umbrello/umbrello/codeimport/kdevcppparser/cpptree2uml.h +++ b/umbrello/umbrello/codeimport/kdevcppparser/cpptree2uml.h @@ -13,7 +13,7 @@ #define CPPTREE2UML_H #include "tree_parser.h" -#include +#include #include "../../model_utils.h" // fwd decls @@ -24,7 +24,7 @@ class UMLPackage; class CppTree2Uml: public TreeParser { public: - CppTree2Uml( const QString& fileName); + CppTree2Uml( const TQString& fileName); virtual ~CppTree2Uml(); //FileDom file() { return m_file; } @@ -60,11 +60,11 @@ public: virtual void parseBaseClause( BaseClauseAST* baseClause, UMLClassifier* klass ); private: - //NamespaceDom findOrInsertNamespace( NamespaceAST* ast, const QString& name ); + //NamespaceDom findOrInsertNamespace( NamespaceAST* ast, const TQString& name ); - QString typeOfDeclaration( TypeSpecifierAST* typeSpec, DeclaratorAST* declarator ); - QStringList scopeOfName( NameAST* id, const QStringList& scope ); - QStringList scopeOfDeclarator( DeclaratorAST* d, const QStringList& scope ); + TQString typeOfDeclaration( TypeSpecifierAST* typeSpec, DeclaratorAST* declarator ); + TQStringList scopeOfName( NameAST* id, const TQStringList& scope ); + TQStringList scopeOfDeclarator( DeclaratorAST* d, const TQStringList& scope ); /** * Flush template parameters pending in m_templateParams to the klass. */ @@ -72,15 +72,15 @@ private: private: //FileDom m_file; - QString m_fileName; - QStringList m_currentScope; + TQString m_fileName; + TQStringList m_currentScope; Uml::Visibility m_currentAccess; bool m_inSlots; bool m_inSignals; int m_anon; bool m_inStorageSpec; bool m_inTypedef; - QString m_comment; + TQString m_comment; Model_Utils::NameAndType_List m_templateParams; DeclaratorAST* m_currentDeclarator; diff --git a/umbrello/umbrello/codeimport/kdevcppparser/driver.cpp b/umbrello/umbrello/codeimport/kdevcppparser/driver.cpp index ac626c00..1a804c81 100644 --- a/umbrello/umbrello/codeimport/kdevcppparser/driver.cpp +++ b/umbrello/umbrello/codeimport/kdevcppparser/driver.cpp @@ -22,29 +22,29 @@ #include "parser.h" #include #include -#include -#include -#include +#include +#include +#include class DefaultSourceProvider: public SourceProvider { public: DefaultSourceProvider() {} - virtual QString contents( const QString& fileName ) + virtual TQString contents( const TQString& fileName ) { - QString source; + TQString source; - QFile f( fileName ); + TQFile f( fileName ); if( f.open(IO_ReadOnly) ){ - QTextStream s( &f ); + TQTextStream s( &f ); source = s.read(); f.close(); } return source; } - virtual bool isModified( const QString& fileName ) + virtual bool isModified( const TQString& fileName ) { Q_UNUSED( fileName ); return true; @@ -94,13 +94,13 @@ void Driver::reset( ) } } -void Driver::remove( const QString & fileName ) +void Driver::remove( const TQString & fileName ) { m_dependences.remove( fileName ); m_problems.remove( fileName ); removeAllMacrosInFile( fileName ); - QMap::Iterator it = m_parsedUnits.find( fileName ); + TQMap::Iterator it = m_parsedUnits.find( fileName ); if( it != m_parsedUnits.end() ){ TranslationUnitAST* unit = *it; m_parsedUnits.remove( it ); @@ -108,9 +108,9 @@ void Driver::remove( const QString & fileName ) } } -void Driver::removeAllMacrosInFile( const QString& fileName ) +void Driver::removeAllMacrosInFile( const TQString& fileName ) { - QMap::Iterator it = m_macros.begin(); + TQMap::Iterator it = m_macros.begin(); while( it != m_macros.end() ){ Macro m = *it++; if( m.fileName() == fileName ) @@ -118,38 +118,38 @@ void Driver::removeAllMacrosInFile( const QString& fileName ) } } -TranslationUnitAST::Node Driver::takeTranslationUnit( const QString& fileName ) +TranslationUnitAST::Node Driver::takeTranslationUnit( const TQString& fileName ) { - QMap::Iterator it = m_parsedUnits.find( fileName ); + TQMap::Iterator it = m_parsedUnits.find( fileName ); TranslationUnitAST::Node unit( *it ); //m_parsedUnits.remove( it ); m_parsedUnits[ fileName] = 0; return unit; } -TranslationUnitAST* Driver::translationUnit( const QString& fileName ) const +TranslationUnitAST* Driver::translationUnit( const TQString& fileName ) const { - QMap::ConstIterator it = m_parsedUnits.find( fileName ); + TQMap::ConstIterator it = m_parsedUnits.find( fileName ); return it != m_parsedUnits.end() ? *it : 0; } -void Driver::addDependence( const QString & fileName, const Dependence & dep ) +void Driver::addDependence( const TQString & fileName, const Dependence & dep ) { - QFileInfo fileInfo( dep.first ); - QString fn = fileInfo.absFilePath(); + TQFileInfo fileInfo( dep.first ); + TQString fn = fileInfo.absFilePath(); if ( !depresolv ){ findOrInsertDependenceList( fileName ).insert( fn, dep ); return; } - QString file = findIncludeFile( dep ); + TQString file = findIncludeFile( dep ); findOrInsertDependenceList( fileName ).insert( file, dep ); if ( m_parsedUnits.find(file) != m_parsedUnits.end() ) return; - if ( !QFile::exists( file ) ) { + if ( !TQFile::exists( file ) ) { Problem p( "Couldn't find include file " + dep.first, lexer ? lexer->currentLine() : -1, lexer ? lexer->currentColumn() : -1 ); @@ -157,7 +157,7 @@ void Driver::addDependence( const QString & fileName, const Dependence & dep ) return; } - QString cfn = m_currentFileName; + TQString cfn = m_currentFileName; Lexer *l = lexer; parseFile( file ); m_currentFileName = cfn; @@ -169,60 +169,60 @@ void Driver::addMacro( const Macro & macro ) m_macros.insert( macro.name(), macro ); } -void Driver::addProblem( const QString & fileName, const Problem & problem ) +void Driver::addProblem( const TQString & fileName, const Problem & problem ) { findOrInsertProblemList( fileName ).append( problem ); } -QMap< QString, Dependence >& Driver::findOrInsertDependenceList( const QString & fileName ) +TQMap< TQString, Dependence >& Driver::findOrInsertDependenceList( const TQString & fileName ) { - QMap >::Iterator it = m_dependences.find( fileName ); + TQMap >::Iterator it = m_dependences.find( fileName ); if( it != m_dependences.end() ) return it.data(); - QMap l; + TQMap l; m_dependences.insert( fileName, l ); return m_dependences[ fileName ]; } -QValueList < Problem >& Driver::findOrInsertProblemList( const QString & fileName ) +TQValueList < Problem >& Driver::findOrInsertProblemList( const TQString & fileName ) { - QMap >::Iterator it = m_problems.find( fileName ); + TQMap >::Iterator it = m_problems.find( fileName ); if( it != m_problems.end() ) return it.data(); - QValueList l; + TQValueList l; m_problems.insert( fileName, l ); return m_problems[ fileName ]; } -QMap< QString, Dependence > Driver::dependences( const QString & fileName ) const +TQMap< TQString, Dependence > Driver::dependences( const TQString & fileName ) const { - QMap >::ConstIterator it = m_dependences.find( fileName ); + TQMap >::ConstIterator it = m_dependences.find( fileName ); if( it != m_dependences.end() ) return it.data(); - return QMap(); + return TQMap(); } -QMap< QString, Macro > Driver::macros() const +TQMap< TQString, Macro > Driver::macros() const { return m_macros; } -QValueList < Problem > Driver::problems( const QString & fileName ) const +TQValueList < Problem > Driver::problems( const TQString & fileName ) const { - QMap >::ConstIterator it = m_problems.find( fileName ); + TQMap >::ConstIterator it = m_problems.find( fileName ); if( it != m_problems.end() ) return it.data(); - return QValueList(); + return TQValueList(); } -void Driver::parseFile( const QString& fileName, bool onlyPreProcess, bool force ) +void Driver::parseFile( const TQString& fileName, bool onlyPreProcess, bool force ) { - QFileInfo fileInfo( fileName ); - QString absFilePath = fileInfo.absFilePath(); + TQFileInfo fileInfo( fileName ); + TQString absFilePath = fileInfo.absFilePath(); - QMap::Iterator it = m_parsedUnits.find( absFilePath ); + TQMap::Iterator it = m_parsedUnits.find( absFilePath ); if( force && it != m_parsedUnits.end() ){ takeTranslationUnit( absFilePath ); @@ -252,7 +252,7 @@ void Driver::parseFile( const QString& fileName, bool onlyPreProcess, bool force fileParsed( fileName ); } - m_currentFileName = QString::null; + m_currentFileName = TQString::null; lexer = 0; } @@ -385,37 +385,37 @@ void Driver::setupParser( Parser * parser ) Q_UNUSED( parser ); } -void Driver::removeMacro( const QString& macroName ) +void Driver::removeMacro( const TQString& macroName ) { m_macros.remove( macroName ); } -void Driver::addIncludePath( const QString &path ) +void Driver::addIncludePath( const TQString &path ) { if( !path.stripWhiteSpace().isEmpty() ) m_includePaths << path; } -QString Driver::findIncludeFile( const Dependence& dep ) const +TQString Driver::findIncludeFile( const Dependence& dep ) const { - QString fileName = dep.first; + TQString fileName = dep.first; if( dep.second == Dep_Local ){ - QString path = QFileInfo( currentFileName() ).dirPath( true ); - QFileInfo fileInfo( QFileInfo(path, fileName) ); + TQString path = TQFileInfo( currentFileName() ).dirPath( true ); + TQFileInfo fileInfo( TQFileInfo(path, fileName) ); if ( fileInfo.exists() && fileInfo.isFile() ) return fileInfo.absFilePath(); } - QStringList::ConstIterator end(m_includePaths.end()); - for ( QStringList::ConstIterator it(m_includePaths.begin()); it != end; ++it ) { - QFileInfo fileInfo( *it, fileName ); + TQStringList::ConstIterator end(m_includePaths.end()); + for ( TQStringList::ConstIterator it(m_includePaths.begin()); it != end; ++it ) { + TQFileInfo fileInfo( *it, fileName ); if ( fileInfo.exists() && fileInfo.isFile() ) return fileInfo.absFilePath(); } - return QString::null; + return TQString::null; } void Driver::setResolveDependencesEnabled( bool enabled ) @@ -429,7 +429,7 @@ void Driver::setupPreProcessor() { } -void Driver::fileParsed( const QString & fileName ) +void Driver::fileParsed( const TQString & fileName ) { Q_UNUSED( fileName ); } diff --git a/umbrello/umbrello/codeimport/kdevcppparser/driver.h b/umbrello/umbrello/codeimport/kdevcppparser/driver.h index f6e9f100..6c53a939 100644 --- a/umbrello/umbrello/codeimport/kdevcppparser/driver.h +++ b/umbrello/umbrello/codeimport/kdevcppparser/driver.h @@ -22,10 +22,10 @@ #include "ast.h" -#include -#include -#include -#include +#include +#include +#include +#include class Lexer; class Parser; @@ -46,7 +46,7 @@ public: Problem( const Problem& source ) : m_text( source.m_text ), m_line( source.m_line ), m_column( source.m_column ), m_level( source.m_level ) {} - Problem( const QString& text, int line, int column, int level=Level_Error ) + Problem( const TQString& text, int line, int column, int level=Level_Error ) : m_text( text ), m_line( line ), m_column( column ), m_level(level) {} Problem& operator = ( const Problem& source ) @@ -63,13 +63,13 @@ public: return m_text == p.m_text && m_line == p.m_line && m_column == p.m_column && m_level == p.m_level; } - QString text() const { return m_text; } + TQString text() const { return m_text; } int line() const { return m_line; } int column() const { return m_column; } int level() const { return m_level; } private: - QString m_text; + TQString m_text; int m_line; int m_column; int m_level; @@ -81,16 +81,16 @@ enum Dep_Local }; -typedef QPair Dependence; +typedef QPair Dependence; class Macro { public: - typedef QString Argument; + typedef TQString Argument; public: Macro( bool hasArguments = false ): m_hasArguments( hasArguments ) {} - Macro( const QString &n, const QString &b ) : m_name( n ), m_body( b ), m_hasArguments( false ) {} + Macro( const TQString &n, const TQString &b ) : m_name( n ), m_body( b ), m_hasArguments( false ) {} Macro( const Macro& source ) : m_name( source.m_name), @@ -119,29 +119,29 @@ public: m_argumentList == source.m_argumentList; } - QString name() const { return m_name; } - void setName( const QString& name ) { m_name = name; } + TQString name() const { return m_name; } + void setName( const TQString& name ) { m_name = name; } - QString fileName() const { return m_fileName; } - void setFileName( const QString& fileName ) { m_fileName = fileName; } + TQString fileName() const { return m_fileName; } + void setFileName( const TQString& fileName ) { m_fileName = fileName; } - QString body() const { return m_body; } - void setBody( const QString& body ) { m_body = body; } + TQString body() const { return m_body; } + void setBody( const TQString& body ) { m_body = body; } bool hasArguments() const { return m_hasArguments; } void setHasArguments( bool hasArguments ) { m_hasArguments = hasArguments; } - QValueList argumentList() const { return m_argumentList; } + TQValueList argumentList() const { return m_argumentList; } void clearArgumentList() { m_argumentList.clear(); m_hasArguments = false; } void addArgument( const Argument& argument ) { m_argumentList << argument; } - void addArgumentList( const QValueList& arguments ) { m_argumentList += arguments; } + void addArgumentList( const TQValueList& arguments ) { m_argumentList += arguments; } private: - QString m_name; - QString m_fileName; - QString m_body; + TQString m_name; + TQString m_fileName; + TQString m_body; bool m_hasArguments; - QValueList m_argumentList; + TQValueList m_argumentList; }; class SourceProvider @@ -150,8 +150,8 @@ public: SourceProvider() {} virtual ~SourceProvider() {} - virtual QString contents( const QString& fileName ) = 0; - virtual bool isModified( const QString& fileName ) = 0; + virtual TQString contents( const TQString& fileName ) = 0; + virtual bool isModified( const TQString& fileName ) = 0; private: SourceProvider( const SourceProvider& source ); @@ -169,34 +169,34 @@ public: virtual void reset(); - virtual void parseFile( const QString& fileName, bool onlyPreProcesss=false, bool force=false ); - virtual void fileParsed( const QString& fileName ); - virtual void remove( const QString& fileName ); + virtual void parseFile( const TQString& fileName, bool onlyPreProcesss=false, bool force=false ); + virtual void fileParsed( const TQString& fileName ); + virtual void remove( const TQString& fileName ); - virtual void addDependence( const QString& fileName, const Dependence& dep ); + virtual void addDependence( const TQString& fileName, const Dependence& dep ); virtual void addMacro( const Macro& macro ); - virtual void addProblem( const QString& fileName, const Problem& problem ); + virtual void addProblem( const TQString& fileName, const Problem& problem ); - QString currentFileName() const { return m_currentFileName; } - TranslationUnitAST::Node takeTranslationUnit( const QString& fileName ); - TranslationUnitAST* translationUnit( const QString& fileName ) const; - QMap dependences( const QString& fileName ) const; - QMap macros() const; - QValueList problems( const QString& fileName ) const; + TQString currentFileName() const { return m_currentFileName; } + TranslationUnitAST::Node takeTranslationUnit( const TQString& fileName ); + TranslationUnitAST* translationUnit( const TQString& fileName ) const; + TQMap dependences( const TQString& fileName ) const; + TQMap macros() const; + TQValueList problems( const TQString& fileName ) const; - bool hasMacro( const QString& name ) const { return m_macros.contains( name ); } - const Macro& macro( const QString& name ) const { return m_macros[ name ]; } - Macro& macro( const QString& name ) { return m_macros[ name ]; } + bool hasMacro( const TQString& name ) const { return m_macros.contains( name ); } + const Macro& macro( const TQString& name ) const { return m_macros[ name ]; } + Macro& macro( const TQString& name ) { return m_macros[ name ]; } - virtual void removeMacro( const QString& macroName ); - virtual void removeAllMacrosInFile( const QString& fileName ); + virtual void removeMacro( const TQString& macroName ); + virtual void removeAllMacrosInFile( const TQString& fileName ); - QStringList includePaths() const { return m_includePaths; } - virtual void addIncludePath( const QString &path ); + TQStringList includePaths() const { return m_includePaths; } + virtual void addIncludePath( const TQString &path ); /// @todo remove - const QMap &parsedUnits() const { return m_parsedUnits; } + const TQMap &parsedUnits() const { return m_parsedUnits; } virtual void setResolveDependencesEnabled( bool enabled ); bool isResolveDependencesEnabled() const { return depresolv; } @@ -207,17 +207,17 @@ protected: virtual void setupPreProcessor(); private: - QMap& findOrInsertDependenceList( const QString& fileName ); - QValueList& findOrInsertProblemList( const QString& fileName ); - QString findIncludeFile( const Dependence& dep ) const; + TQMap& findOrInsertDependenceList( const TQString& fileName ); + TQValueList& findOrInsertProblemList( const TQString& fileName ); + TQString findIncludeFile( const Dependence& dep ) const; private: - QString m_currentFileName; - QMap< QString, QMap > m_dependences; - QMap m_macros; - QMap< QString, QValueList > m_problems; - QMap m_parsedUnits; - QStringList m_includePaths; + TQString m_currentFileName; + TQMap< TQString, TQMap > m_dependences; + TQMap m_macros; + TQMap< TQString, TQValueList > m_problems; + TQMap m_parsedUnits; + TQStringList m_includePaths; uint depresolv : 1; Lexer *lexer; SourceProvider* m_sourceProvider; diff --git a/umbrello/umbrello/codeimport/kdevcppparser/errors.h b/umbrello/umbrello/codeimport/kdevcppparser/errors.h index 813d3a3f..6751475e 100644 --- a/umbrello/umbrello/codeimport/kdevcppparser/errors.h +++ b/umbrello/umbrello/codeimport/kdevcppparser/errors.h @@ -20,15 +20,15 @@ #ifndef ERRORS_H #define ERRORS_H -#include +#include struct Error{ int code; int level; - QString text; + TQString text; - Error( int c, int l, const QString& s ) + Error( int c, int l, const TQString& s ) : code( c ), level( l ), text( s ) {} }; diff --git a/umbrello/umbrello/codeimport/kdevcppparser/lexer.cpp b/umbrello/umbrello/codeimport/kdevcppparser/lexer.cpp index 68dd2e6f..11b326f6 100644 --- a/umbrello/umbrello/codeimport/kdevcppparser/lexer.cpp +++ b/umbrello/umbrello/codeimport/kdevcppparser/lexer.cpp @@ -24,12 +24,12 @@ #include #include -#include -#include -#include +#include +#include +#include #if defined( KDEVELOP_BGPARSER ) -#include +#include class KDevTread: public QThread { @@ -54,8 +54,8 @@ using namespace std; struct LexerData { - typedef QMap Scope; - typedef QValueList StaticChain; + typedef TQMap Scope; + typedef TQValueList StaticChain; StaticChain staticChain; @@ -70,13 +70,13 @@ struct LexerData staticChain.pop_front(); } - void bind( const QString& name, const QString& value ) + void bind( const TQString& name, const TQString& value ) { Q_ASSERT( staticChain.size() > 0 ); staticChain.front().insert( name, value ); } - bool hasBind( const QString& name ) const + bool hasBind( const TQString& name ) const { StaticChain::ConstIterator it = staticChain.begin(); while( it != staticChain.end() ){ @@ -90,7 +90,7 @@ struct LexerData return false; } - QString apply( const QString& name ) const + TQString apply( const TQString& name ) const { StaticChain::ConstIterator it = staticChain.begin(); while( it != staticChain.end() ){ @@ -101,7 +101,7 @@ struct LexerData return scope[ name ]; } - return QString::null; + return TQString::null; } }; @@ -127,7 +127,7 @@ Lexer::~Lexer() delete( d ); } -void Lexer::setSource( const QString& source ) +void Lexer::setSource( const TQString& source ) { reset(); m_source = source; @@ -143,7 +143,7 @@ void Lexer::reset() m_index = 0; m_size = 0; m_tokens.clear(); - m_source = QString::null; + m_source = TQString::null; m_ptr = 0; m_endPtr = 0; m_startLine = false; @@ -160,12 +160,12 @@ void Lexer::reset() // ### should all be done with a "long" type IMO int Lexer::toInt( const Token& token ) { - QString s = token.text(); + TQString s = token.text(); if( token.type() == Token_number_literal ){ // hex literal ? if( s[0] == '0' && (s[1] == 'x' || s[1] == 'X')) return s.mid( 2 ).toInt( 0, 16 ); - QString n; + TQString n; int i = 0; while( i < int(s.length()) && s[i].isDigit() ) n += s[i++]; @@ -211,8 +211,8 @@ void Lexer::nextToken( Token& tk, bool stopOnNewline ) int startLine = m_currentLine; int startColumn = m_currentColumn; - QChar ch = currentChar(); - QChar ch1 = peekChar(); + TQChar ch = currentChar(); + TQChar ch1 = peekChar(); if( ch.isNull() || ch.isSpace() ){ /* skip */ @@ -224,7 +224,7 @@ void Lexer::nextToken( Token& tk, bool stopOnNewline ) int start = currentPosition(); readIdentifier(); // read the directive - QString directive = m_source.mid( start, currentPosition() - start ); + TQString directive = m_source.mid( start, currentPosition() - start ); handleDirective( directive ); } else if( m_startLine && m_skipping[ m_ifLevel ] ){ @@ -272,7 +272,7 @@ void Lexer::nextToken( Token& tk, bool stopOnNewline ) } else if( ch.isLetter() || ch == '_' ){ int start = currentPosition(); readIdentifier(); - QString ide = m_source.mid( start, currentPosition() - start ); + TQString ide = m_source.mid( start, currentPosition() - start ); int k = Lookup::find( &keyword, ide ); if( m_preprocessorEnabled && m_driver->hasMacro(ide) && (k == -1 || !m_driver->macro(ide).body().isEmpty()) ){ @@ -290,7 +290,7 @@ void Lexer::nextToken( Token& tk, bool stopOnNewline ) Macro m = m_driver->macro( ide ); //m_driver->removeMacro( m.name() ); - QString ellipsisArg; + TQString ellipsisArg; if( m.hasArguments() ){ int endIde = currentPosition(); @@ -303,11 +303,11 @@ void Lexer::nextToken( Token& tk, bool stopOnNewline ) while( currentChar() && argIdxbind( argName, arg ); @@ -352,7 +352,7 @@ void Lexer::nextToken( Token& tk, bool stopOnNewline ) // tokenize the macro body - QString textToInsert; + TQString textToInsert; m_endPtr = currentPosition() + m.body().length(); while( currentChar() ){ @@ -371,24 +371,24 @@ void Lexer::nextToken( Token& tk, bool stopOnNewline ) if( tok == Token_eof ) break; - QString tokText = tok.text(); - QString str = (tok == Token_identifier && d->hasBind(tokText)) ? d->apply( tokText ) : tokText; + TQString tokText = tok.text(); + TQString str = (tok == Token_identifier && d->hasBind(tokText)) ? d->apply( tokText ) : tokText; if( str == ide ){ //Problem p( i18n("unsafe use of macro '%1'").arg(ide), m_currentLine, m_currentColumn ); //m_driver->addProblem( m_driver->currentFileName(), p ); m_driver->removeMacro( ide ); - // str = QString::null; + // str = TQString::null; } if( stringify ) { - textToInsert.append( QString::fromLatin1("\"") + str + QString::fromLatin1("\" ") ); + textToInsert.append( TQString::fromLatin1("\"") + str + TQString::fromLatin1("\" ") ); } else if( merge ){ textToInsert.truncate( textToInsert.length() - 1 ); textToInsert.append( str ); } else if( tok == Token_ellipsis && d->hasBind("...") ){ textToInsert.append( ellipsisArg ); } else { - textToInsert.append( str + QString::fromLatin1(" ") ); + textToInsert.append( str + TQString::fromLatin1(" ") ); } } @@ -408,7 +408,7 @@ void Lexer::nextToken( Token& tk, bool stopOnNewline ) tk.setStartPosition( startLine, startColumn ); tk.setEndPosition( m_currentLine, m_currentColumn ); } else if( m_skipWordsEnabled ){ - QMap< QString, QPair >::Iterator pos = m_words.find( ide ); + TQMap< TQString, QPair >::Iterator pos = m_words.find( ide ); if( pos != m_words.end() ){ if( (*pos).first == SkipWordAndArguments ){ readWhiteSpaces(); @@ -419,7 +419,7 @@ void Lexer::nextToken( Token& tk, bool stopOnNewline ) #if defined( KDEVELOP_BGPARSER ) qthread_yield(); #endif - m_source.insert( currentPosition(), QString(" ") + (*pos).second + QString(" ") ); + m_source.insert( currentPosition(), TQString(" ") + (*pos).second + TQString(" ") ); m_endPtr = m_source.length(); } } else if( /*qt_rx.exactMatch(ide) ||*/ @@ -502,7 +502,7 @@ void Lexer::resetSkipWords() m_words.clear(); } -void Lexer::addSkipWord( const QString& word, SkipType skipType, const QString& str ) +void Lexer::addSkipWord( const TQString& word, SkipType skipType, const TQString& str ) { m_words[ word ] = qMakePair( skipType, str ); } @@ -531,17 +531,17 @@ void Lexer::skip( int l, int r ) m_currentColumn = svCurrentColumn; } -QString Lexer::readArgument() +TQString Lexer::readArgument() { int count = 0; - QString arg; + TQString arg; readWhiteSpaces(); while( currentChar() ){ readWhiteSpaces(); - QChar ch = currentChar(); + TQChar ch = currentChar(); if( ch.isNull() || (!count && (ch == ',' || ch == ')')) ) break; @@ -562,7 +562,7 @@ QString Lexer::readArgument() return arg.stripWhiteSpace(); } -void Lexer::handleDirective( const QString& directive ) +void Lexer::handleDirective( const TQString& directive ) { m_inPreproc = true; @@ -623,7 +623,7 @@ int Lexer::macroDefined() readWhiteSpaces( false ); int startWord = currentPosition(); readIdentifier(); - QString word = m_source.mid( startWord, currentPosition() - startWord ); + TQString word = m_source.mid( startWord, currentPosition() - startWord ); bool r = m_driver->hasMacro( word ); return r; @@ -636,7 +636,7 @@ void Lexer::processDefine( Macro& m ) int startMacroName = currentPosition(); readIdentifier(); - QString macroName = m_source.mid( startMacroName, int(currentPosition()-startMacroName) ); + TQString macroName = m_source.mid( startMacroName, int(currentPosition()-startMacroName) ); m_driver->removeMacro( macroName ); m.setName( macroName ); @@ -656,7 +656,7 @@ void Lexer::processDefine( Macro& m ) else readIdentifier(); - QString arg = m_source.mid( startArg, int(currentPosition()-startArg) ); + TQString arg = m_source.mid( startArg, int(currentPosition()-startArg) ); m.addArgument( Macro::Argument(arg) ); @@ -673,7 +673,7 @@ void Lexer::processDefine( Macro& m ) setPreprocessorEnabled( true ); - QString body; + TQString body; while( currentChar() && currentChar() != '\n' ){ if( currentChar().isSpace() ){ @@ -685,7 +685,7 @@ void Lexer::processDefine( Macro& m ) nextToken( tk, true ); if( tk.type() != -1 ){ - QString s = tk.text(); + TQString s = tk.text(); body += s; } } @@ -777,16 +777,16 @@ void Lexer::processInclude() readWhiteSpaces( false ); if( currentChar() ){ - QChar ch = currentChar(); + TQChar ch = currentChar(); if( ch == '"' || ch == '<' ){ nextChar(); - QChar ch2 = ch == QChar('"') ? QChar('"') : QChar('>'); + TQChar ch2 = ch == TQChar('"') ? TQChar('"') : TQChar('>'); int startWord = currentPosition(); while( currentChar() && currentChar() != ch2 ) nextChar(); if( currentChar() ){ - QString word = m_source.mid( startWord, int(currentPosition()-startWord) ); + TQString word = m_source.mid( startWord, int(currentPosition()-startWord) ); m_driver->addDependence( m_driver->currentFileName(), Dependence(word, ch == '"' ? Dep_Local : Dep_Global) ); nextChar(); @@ -800,7 +800,7 @@ void Lexer::processUndef() readWhiteSpaces(); int startWord = currentPosition(); readIdentifier(); - QString word = m_source.mid( startWord, currentPosition() - startWord ); + TQString word = m_source.mid( startWord, currentPosition() - startWord ); m_driver->removeMacro( word ); } @@ -824,7 +824,7 @@ int Lexer::macroPrimary() case '!': case '~': { - QChar tk = currentChar(); + TQChar tk = currentChar(); nextChar(); int result = macroPrimary(); if( tk == '-' ) return -result; @@ -973,7 +973,7 @@ int Lexer::macroLogicalAnd() nextChar( 2 ); int start = currentPosition(); result = macroBoolOr() && result; - QString s = m_source.mid( start, currentPosition() - start ); + TQString s = m_source.mid( start, currentPosition() - start ); } return result; } @@ -996,7 +996,7 @@ int Lexer::macroExpression() } // *IMPORTANT* -// please, don't include lexer.moc here, because Lexer isn't a QObject class!! +// please, don't include lexer.moc here, because Lexer isn't a TQObject class!! // if you have problem while recompiling try to remove cppsupport/.deps, // cppsupport/Makefile.in and rerun automake/autoconf diff --git a/umbrello/umbrello/codeimport/kdevcppparser/lexer.h b/umbrello/umbrello/codeimport/kdevcppparser/lexer.h index da656591..4851c183 100644 --- a/umbrello/umbrello/codeimport/kdevcppparser/lexer.h +++ b/umbrello/umbrello/codeimport/kdevcppparser/lexer.h @@ -22,11 +22,11 @@ #include "driver.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include enum Type { Token_eof = 0, @@ -148,7 +148,7 @@ class Token { public: Token(); - Token( int type, int position, int length, const QString& text ); + Token( int type, int position, int length, const TQString& text ); Token( const Token& source ); Token& operator = ( const Token& source ); @@ -171,7 +171,7 @@ public: int position() const; void setPosition( int position ); - QString text() const; + TQString text() const; private: int m_type; @@ -181,7 +181,7 @@ private: int m_startColumn; int m_endLine; int m_endColumn; - QString m_text; + TQString m_text; friend class Lexer; friend class Parser; @@ -212,10 +212,10 @@ public: void setPreprocessorEnabled( bool enabled ); void resetSkipWords(); - void addSkipWord( const QString& word, SkipType skipType=SkipWord, const QString& str = QString::null ); + void addSkipWord( const TQString& word, SkipType skipType=SkipWord, const TQString& str = TQString::null ); - QString source() const; - void setSource( const QString& source ); + TQString source() const; + void setSource( const TQString& source ); int index() const; void setIndex( int index ); @@ -235,8 +235,8 @@ public: int currentColumn() const { return m_currentColumn; } private: - QChar currentChar() const; - QChar peekChar( int n=1 ) const; + TQChar currentChar() const; + TQChar peekChar( int n=1 ) const; int currentPosition() const; void tokenize(); @@ -259,7 +259,7 @@ private: // preprocessor (based on an article of Al Stevens on Dr.Dobb's journal) int testIfLevel(); int macroDefined(); - QString readArgument(); + TQString readArgument(); int macroPrimary(); int macroMultiplyDivide(); @@ -273,7 +273,7 @@ private: int macroLogicalOr(); int macroExpression(); - void handleDirective( const QString& directive ); + void handleDirective( const TQString& directive ); void processDefine( Macro& macro ); void processElse(); void processElif(); @@ -287,24 +287,24 @@ private: private: LexerData* d; Driver* m_driver; - QPtrVector< Token > m_tokens; + TQPtrVector< Token > m_tokens; int m_size; int m_index; - QString m_source; + TQString m_source; int m_ptr; int m_endPtr; bool m_recordComments; bool m_recordWhiteSpaces; bool m_startLine; - QMap< QString, QPair > m_words; + TQMap< TQString, QPair > m_words; int m_currentLine; int m_currentColumn; bool m_skipWordsEnabled; // preprocessor - QMemArray m_skipping; - QMemArray m_trueTest; + TQMemArray m_skipping; + TQMemArray m_trueTest; int m_ifLevel; bool m_preprocessorEnabled; bool m_inPreproc; @@ -326,7 +326,7 @@ inline Token::Token() { } -inline Token::Token( int type, int position, int length, const QString& text ) +inline Token::Token( int type, int position, int length, const TQString& text ) : m_type( type ), m_position( position ), m_length( length ), @@ -396,7 +396,7 @@ inline int Token::position() const return m_position; } -inline QString Token::text() const +inline TQString Token::text() const { return m_text.mid(m_position, m_length); } @@ -460,7 +460,7 @@ inline void Lexer::setRecordWhiteSpaces( bool record ) m_recordWhiteSpaces = record; } -inline QString Lexer::source() const +inline TQString Lexer::source() const { return m_source; } @@ -524,7 +524,7 @@ inline void Lexer::readIdentifier() inline void Lexer::readWhiteSpaces( bool skipNewLine ) { while( !currentChar().isNull() ){ - QChar ch = currentChar(); + TQChar ch = currentChar(); if( ch == '\n' && !skipNewLine ){ break; @@ -544,7 +544,7 @@ inline void Lexer::readLineComment() while( !currentChar().isNull() && currentChar() != '\n' ){ if( m_reportMessages && currentChar() == '@' && m_source.mid(currentPosition()+1, 4).lower() == "todo" ){ nextChar( 5 ); - QString msg; + TQString msg; int line = m_currentLine; int col = m_currentColumn; @@ -561,7 +561,7 @@ inline void Lexer::readLineComment() } else if( m_reportMessages && m_source.mid(currentPosition(), 5).lower() == "fixme" ){ nextChar( 5 ); - QString msg; + TQString msg; int line = m_currentLine; int col = m_currentColumn; @@ -588,7 +588,7 @@ inline void Lexer::readMultiLineComment() return; } else if( m_reportMessages && currentChar() == '@' && m_source.mid(currentPosition()+1, 4).lower() == "todo" ){ nextChar( 5 ); - QString msg; + TQString msg; int line = m_currentLine; int col = m_currentColumn; @@ -604,7 +604,7 @@ inline void Lexer::readMultiLineComment() } else if( m_reportMessages && m_source.mid(currentPosition(), 5).lower() == "fixme" ){ nextChar( 5 ); - QString msg; + TQString msg; int line = m_currentLine; int col = m_currentColumn; @@ -682,7 +682,7 @@ inline int Lexer::findOperator3() const int n = int(m_endPtr - m_ptr); if( n >= 3){ - QChar ch = currentChar(), ch1=peekChar(), ch2=peekChar(2); + TQChar ch = currentChar(), ch1=peekChar(), ch2=peekChar(2); if( ch == '<' && ch1 == '<' && ch2 == '=' ) return Token_assign; else if( ch == '>' && ch1 == '>' && ch2 == '=' ) return Token_assign; @@ -698,7 +698,7 @@ inline int Lexer::findOperator2() const int n = int(m_endPtr - m_ptr); if( n>=2 ){ - QChar ch = currentChar(), ch1=peekChar(); + TQChar ch = currentChar(), ch1=peekChar(); if( ch == ':' && ch1 == ':' ) return Token_scope; else if( ch == '.' && ch1 == '*' ) return Token_ptrmem; @@ -752,14 +752,14 @@ inline int Lexer::currentPosition() const return m_ptr; } -inline QChar Lexer::currentChar() const +inline TQChar Lexer::currentChar() const { - return m_ptr < m_endPtr ? m_source[m_ptr] : QChar::null; + return m_ptr < m_endPtr ? m_source[m_ptr] : TQChar::null; } -inline QChar Lexer::peekChar( int n ) const +inline TQChar Lexer::peekChar( int n ) const { - return m_ptr+n < m_endPtr ? m_source[m_ptr + n] : QChar::null; + return m_ptr+n < m_endPtr ? m_source[m_ptr + n] : TQChar::null; } inline bool Lexer::eof() const diff --git a/umbrello/umbrello/codeimport/kdevcppparser/lookup.cpp b/umbrello/umbrello/codeimport/kdevcppparser/lookup.cpp index 8831e6f3..f46b9270 100644 --- a/umbrello/umbrello/codeimport/kdevcppparser/lookup.cpp +++ b/umbrello/umbrello/codeimport/kdevcppparser/lookup.cpp @@ -29,7 +29,7 @@ #include const HashEntry* Lookup::findEntry( const struct HashTable *table, - const QChar *c, unsigned int len ) + const TQChar *c, unsigned int len ) { if (table->type != 2) { kdDebug() << "KJS: Unknown hash table version" << endl; @@ -69,13 +69,13 @@ const HashEntry* Lookup::findEntry( const struct HashTable *table, } const HashEntry* Lookup::findEntry( const struct HashTable *table, - const QString &s ) + const TQString &s ) { return findEntry( table, s.unicode(), s.length() ); } int Lookup::find(const struct HashTable *table, - const QChar *c, unsigned int len) + const TQChar *c, unsigned int len) { const HashEntry *entry = findEntry( table, c, len ); if (entry) @@ -83,12 +83,12 @@ int Lookup::find(const struct HashTable *table, return -1; } -int Lookup::find(const struct HashTable *table, const QString &s) +int Lookup::find(const struct HashTable *table, const TQString &s) { return find(table, s.unicode(), s.length()); } -unsigned int Lookup::hash(const QChar *c, unsigned int len) +unsigned int Lookup::hash(const TQChar *c, unsigned int len) { unsigned int val = 0; // ignoring rower byte @@ -98,7 +98,7 @@ unsigned int Lookup::hash(const QChar *c, unsigned int len) return val; } -unsigned int Lookup::hash(const QString &key) +unsigned int Lookup::hash(const TQString &key) { return hash(key.unicode(), key.length()); } diff --git a/umbrello/umbrello/codeimport/kdevcppparser/lookup.h b/umbrello/umbrello/codeimport/kdevcppparser/lookup.h index 225c3ab0..b2bad4de 100644 --- a/umbrello/umbrello/codeimport/kdevcppparser/lookup.h +++ b/umbrello/umbrello/codeimport/kdevcppparser/lookup.h @@ -24,7 +24,7 @@ #ifndef _KJSLOOKUP_H_ #define _KJSLOOKUP_H_ -#include +#include #include /** @@ -95,8 +95,8 @@ /** * Find an entry in the table, and return its value (i.e. the value field of HashEntry) */ - static int find(const struct HashTable *table, const QString& s); - static int find(const struct HashTable *table, const QChar *c, unsigned int len); + static int find(const struct HashTable *table, const TQString& s); + static int find(const struct HashTable *table, const TQChar *c, unsigned int len); /** * Find an entry in the table, and return the entry @@ -104,15 +104,15 @@ * especially the attr field. */ static const HashEntry* findEntry(const struct HashTable *table, - const QString &s); + const TQString &s); static const HashEntry* findEntry(const struct HashTable *table, - const QChar *c, unsigned int len); + const TQChar *c, unsigned int len); /** * Calculate the hash value for a given key */ - static unsigned int hash(const QString &key); - static unsigned int hash(const QChar *c, unsigned int len); + static unsigned int hash(const TQString &key); + static unsigned int hash(const TQChar *c, unsigned int len); static unsigned int hash(const char *s); }; diff --git a/umbrello/umbrello/codeimport/kdevcppparser/parser.cpp b/umbrello/umbrello/codeimport/kdevcppparser/parser.cpp index 184352d5..9b93384c 100644 --- a/umbrello/umbrello/codeimport/kdevcppparser/parser.cpp +++ b/umbrello/umbrello/codeimport/kdevcppparser/parser.cpp @@ -24,9 +24,9 @@ #include "errors.h" // qt -#include -#include -#include +#include +#include +#include #include #include @@ -132,7 +132,7 @@ bool Parser::reportError( const Error& err ) const Token& token = lex->lookAhead( 0 ); lex->getTokenPosition( token, &line, &col ); - QString s = lex->lookAhead(0).text(); + TQString s = lex->lookAhead(0).text(); s = s.left( 30 ).stripWhiteSpace(); if( s.isEmpty() ) s = i18n( "" ); @@ -143,7 +143,7 @@ bool Parser::reportError( const Error& err ) return true; } -bool Parser::reportError( const QString& msg ) +bool Parser::reportError( const TQString& msg ) { //kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::reportError()" << endl; if( m_problems < m_maxProblems ){ @@ -314,9 +314,9 @@ bool Parser::skipCommaExpression( AST::Node& node ) if( !skipExpression(expr) ) return false; - QString comment; + TQString comment; while( lex->lookAhead(0) == ',' ){ - comment = QString::null; + comment = TQString::null; advanceAndCheckTrailingComment( comment ); if( !skipExpression(expr) ){ @@ -468,7 +468,7 @@ bool Parser::parseDeclaration( DeclarationAST::Node& node ) { //kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseDeclaration()" << endl; - QString comment; + TQString comment; while( lex->lookAhead(0) == Token_comment ) { comment += lex->lookAhead(0).text(); lex->nextToken(); @@ -830,9 +830,9 @@ bool Parser::parseTemplateArgumentList( TemplateArgumentListAST::Node& node, boo return false; ast->addArgument( templArg ); - QString comment; + TQString comment; while( lex->lookAhead(0) == ',' ){ - comment = QString::null; + comment = TQString::null; advanceAndCheckTrailingComment( comment ); if( !parseTemplateArgument(templArg) ){ @@ -951,7 +951,7 @@ bool Parser::parseTemplateDeclaration( DeclarationAST::Node& node ) bool Parser::parseOperator( AST::Node& /*node*/ ) { //kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseOperator()" << endl; - QString text = lex->lookAhead(0).text(); + TQString text = lex->lookAhead(0).text(); switch( lex->lookAhead(0) ){ case Token_new: @@ -1394,7 +1394,7 @@ bool Parser::parseEnumSpecifier( TypeSpecifierAST::Node& node ) { //kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseEnumSpecifier()" << endl; - QString comment; + TQString comment; while( lex->lookAhead(0) == Token_comment ) { comment += lex->lookAhead(0).text(); lex->nextToken(); @@ -1426,7 +1426,7 @@ bool Parser::parseEnumSpecifier( TypeSpecifierAST::Node& node ) if( parseEnumerator(enumerator) ){ ast->addEnumerator( enumerator ); - QString comment; + TQString comment; while( lex->lookAhead(0) == ',' ){ comment = ""; advanceAndCheckTrailingComment( comment ); @@ -1472,9 +1472,9 @@ bool Parser::parseTemplateParameterList( TemplateParameterListAST::Node& node ) } ast->addTemplateParameter( param ); - QString comment; + TQString comment; while( lex->lookAhead(0) == ',' ){ - comment = QString::null; + comment = TQString::null; advanceAndCheckTrailingComment( comment ); if( !parseTemplateParameter(param) ){ @@ -1702,7 +1702,7 @@ bool Parser::parseInitDeclaratorList( InitDeclaratorListAST::Node& node ) } ast->addInitDeclarator( decl ); - QString comment; + TQString comment; while( lex->lookAhead(0) == ',' ){ comment = ""; advanceAndCheckTrailingComment( comment ); @@ -1777,9 +1777,9 @@ bool Parser::parseParameterDeclarationList( ParameterDeclarationListAST::Node& n } ast->addParameter( param ); - QString comment; + TQString comment; while( lex->lookAhead(0) == ',' ){ - comment = QString::null; + comment = TQString::null; advanceAndCheckTrailingComment( comment ); if( lex->lookAhead(0) == Token_ellipsis ) @@ -1878,7 +1878,7 @@ bool Parser::parseClassSpecifier( TypeSpecifierAST::Node& node ) } } - QString comment; + TQString comment; while (lex->lookAhead(0) == Token_comment) { comment += lex->lookAhead(0).text(); lex->nextToken(); @@ -1942,7 +1942,7 @@ bool Parser::parseAccessSpecifier( AST::Node& node ) return false; } -void Parser::advanceAndCheckTrailingComment(QString& comment) +void Parser::advanceAndCheckTrailingComment(TQString& comment) { Token t = lex->tokenAt( lex->index() ); int previousTokenEndLine = 0; @@ -1963,7 +1963,7 @@ bool Parser::parseMemberSpecification( DeclarationAST::Node& node ) { //kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseMemberSpecification()" << endl; - QString comment; + TQString comment; while( lex->lookAhead(0) == Token_comment ) { comment += lex->lookAhead(0).text(); lex->nextToken(); @@ -2148,7 +2148,7 @@ bool Parser::parseEnumerator( EnumeratorAST::Node& node ) { //kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseEnumerator()" << endl; - QString comment; + TQString comment; while( lex->lookAhead(0) == Token_comment ) { comment += lex->lookAhead(0).text(); lex->nextToken(); @@ -2226,9 +2226,9 @@ bool Parser::parseBaseClause( BaseClauseAST::Node& node ) if( parseBaseSpecifier(baseSpec) ){ bca->addBaseSpecifier( baseSpec ); - QString comment; + TQString comment; while( lex->lookAhead(0) == ',' ){ - comment = QString::null; + comment = TQString::null; advanceAndCheckTrailingComment( comment ); if( !parseBaseSpecifier(baseSpec) ){ @@ -2280,9 +2280,9 @@ bool Parser::parseMemInitializerList( AST::Node& /*node*/ ) return false; } - QString comment; + TQString comment; while( lex->lookAhead(0) == ',' ){ - comment = QString::null; + comment = TQString::null; advanceAndCheckTrailingComment( comment ); if( parseMemInitializer(init) ){ @@ -2325,9 +2325,9 @@ bool Parser::parseTypeIdList( GroupAST::Node& node ) GroupAST::Node ast = CreateNode(); ast->addNode( typeId ); - QString comment; + TQString comment; while( lex->lookAhead(0) == ',' ){ - comment = QString::null; + comment = TQString::null; advanceAndCheckTrailingComment( comment ); if( parseTypeId(typeId) ){ if (!comment.isEmpty()) @@ -2991,7 +2991,7 @@ bool Parser::parseDeclarationStatement( StatementAST::Node& node ) return true; } -bool Parser::parseDeclarationInternal( DeclarationAST::Node& node, QString& comment ) +bool Parser::parseDeclarationInternal( DeclarationAST::Node& node, TQString& comment ) { //kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseDeclarationInternal()" << endl; @@ -3231,9 +3231,9 @@ bool Parser::parseFunctionBody( StatementListAST::Node& node ) return true; } -QString Parser::toString( int start, int end, const QString& sep ) const +TQString Parser::toString( int start, int end, const TQString& sep ) const { - QStringList l; + TQStringList l; for( int i=start; itokenAt(i).text(); @@ -3902,9 +3902,9 @@ bool Parser::parseCommaExpression( AST::Node& node ) if( !parseAssignmentExpression(expr) ) return false; - QString comment; + TQString comment; while( lex->lookAhead(0) == ',' ){ - comment = QString::null; + comment = TQString::null; advanceAndCheckTrailingComment( comment ); if( !parseAssignmentExpression(expr) ) @@ -4108,9 +4108,9 @@ bool Parser::parseIdentifierList( GroupAST::Node & node ) ast->addNode( tk ); lex->nextToken(); - QString comment; + TQString comment; while( lex->lookAhead(0) == ',' ){ - comment = QString::null; + comment = TQString::null; advanceAndCheckTrailingComment( comment ); if( lex->lookAhead(0) == Token_identifier ){ AST_FROM_TOKEN( tk, lex->index() ); diff --git a/umbrello/umbrello/codeimport/kdevcppparser/parser.h b/umbrello/umbrello/codeimport/kdevcppparser/parser.h index 23876e9f..9be954c2 100644 --- a/umbrello/umbrello/codeimport/kdevcppparser/parser.h +++ b/umbrello/umbrello/codeimport/kdevcppparser/parser.h @@ -22,10 +22,10 @@ #include "ast.h" -#include -#include -#include -#include +#include +#include +#include +#include struct ParserPrivateData; @@ -42,7 +42,7 @@ public: private: virtual bool reportError( const Error& err ); - /** @todo remove*/ virtual bool reportError( const QString& msg ); + /** @todo remove*/ virtual bool reportError( const TQString& msg ); /** @todo remove*/ virtual void syntaxError(); public: /*rules*/ @@ -60,7 +60,7 @@ public: /*rules*/ bool parseTypedef( DeclarationAST::Node& node ); bool parseAsmDefinition( DeclarationAST::Node& node ); bool parseTemplateDeclaration( DeclarationAST::Node& node ); - bool parseDeclarationInternal( DeclarationAST::Node& node, QString& comment ); + bool parseDeclarationInternal( DeclarationAST::Node& node, TQString& comment ); bool parseUnqualifiedName( ClassOrNamespaceNameAST::Node& node ); bool parseStringLiteral( AST::Node& node ); @@ -196,13 +196,13 @@ public: /*rules*/ bool parseObjcOpenBracketExpr( AST::Node& node ); bool parseObjcCloseBracket( AST::Node& node ); - void advanceAndCheckTrailingComment(QString& comment); + void advanceAndCheckTrailingComment(TQString& comment); bool skipUntil( int token ); bool skipUntilDeclaration(); bool skipUntilStatement(); bool skip( int l, int r ); - QString toString( int start, int end, const QString& sep=" " ) const; + TQString toString( int start, int end, const TQString& sep=" " ) const; private: ParserPrivateData* d; diff --git a/umbrello/umbrello/codeimport/kdevcppparser/tree_parser.cpp b/umbrello/umbrello/codeimport/kdevcppparser/tree_parser.cpp index 2f81c3b6..454c4b99 100644 --- a/umbrello/umbrello/codeimport/kdevcppparser/tree_parser.cpp +++ b/umbrello/umbrello/codeimport/kdevcppparser/tree_parser.cpp @@ -32,8 +32,8 @@ void TreeParser::parseTranslationUnit( TranslationUnitAST* translationUnit ) { //kdDebug(9007) << "TreeParser::parseTranslationUnit()" << endl; - QPtrList declarations = translationUnit->declarationList(); - QPtrListIterator it( declarations ); + TQPtrList declarations = translationUnit->declarationList(); + TQPtrListIterator it( declarations ); while( it.current() ){ parseDeclaration( it.current() ); ++it; @@ -153,8 +153,8 @@ void TreeParser::parseFunctionDefinition( FunctionDefinitionAST* def ) void TreeParser::parseLinkageBody( LinkageBodyAST* linkageBody ) { //kdDebug(9007) << "TreeParser::parseLinkageBody()" << endl; - QPtrList declarations = linkageBody->declarationList(); - for( QPtrListIterator it(declarations); it.current(); ++it ){ + TQPtrList declarations = linkageBody->declarationList(); + for( TQPtrListIterator it(declarations); it.current(); ++it ){ parseDeclaration( it.current() ); } } @@ -181,8 +181,8 @@ void TreeParser::parseTypeSpecifier( TypeSpecifierAST* typeSpec ) void TreeParser::parseClassSpecifier( ClassSpecifierAST* classSpec ) { //kdDebug(9007) << "TreeParser::parseClassSpecifier()" << endl; - QPtrList declarations = classSpec->declarationList(); - for( QPtrListIterator it(declarations); it.current(); ++it ){ + TQPtrList declarations = classSpec->declarationList(); + for( TQPtrListIterator it(declarations); it.current(); ++it ){ parseDeclaration( it.current() ); } } diff --git a/umbrello/umbrello/codeimport/kdevcppparser/urlutil.cpp b/umbrello/umbrello/codeimport/kdevcppparser/urlutil.cpp index 9b48649d..5235bc3c 100644 --- a/umbrello/umbrello/codeimport/kdevcppparser/urlutil.cpp +++ b/umbrello/umbrello/codeimport/kdevcppparser/urlutil.cpp @@ -20,10 +20,10 @@ */ #include "urlutil.h" -#include +#include -#include -#include +#include +#include #include #include @@ -39,27 +39,27 @@ // Namespace URLUtil /////////////////////////////////////////////////////////////////////////////// -QString URLUtil::filename(const QString & name) { +TQString URLUtil::filename(const TQString & name) { int slashPos = name.findRev("/"); return slashPos<0 ? name : name.mid(slashPos+1); } /////////////////////////////////////////////////////////////////////////////// -QString URLUtil::directory(const QString & name) { +TQString URLUtil::directory(const TQString & name) { int slashPos = name.findRev("/"); - return slashPos<0 ? QString("") : name.left(slashPos); + return slashPos<0 ? TQString("") : name.left(slashPos); } /////////////////////////////////////////////////////////////////////////////// -QString URLUtil::relativePath(const KURL & parent, const KURL & child, uint slashPolicy) { +TQString URLUtil::relativePath(const KURL & parent, const KURL & child, uint slashPolicy) { bool slashPrefix = slashPolicy & SLASH_PREFIX; bool slashSuffix = slashPolicy & SLASH_SUFFIX; if (parent == child) - return slashPrefix ? QString("/") : QString(""); + return slashPrefix ? TQString("/") : TQString(""); - if (!parent.isParentOf(child)) return QString(); + if (!parent.isParentOf(child)) return TQString(); int a=slashPrefix ? -1 : 1; int b=slashSuffix ? 1 : -1; return child.path(b).mid(parent.path(a).length()); @@ -67,15 +67,15 @@ QString URLUtil::relativePath(const KURL & parent, const KURL & child, uint slas /////////////////////////////////////////////////////////////////////////////// -QString URLUtil::relativePath(const QString & parent, const QString & child, uint slashPolicy) { +TQString URLUtil::relativePath(const TQString & parent, const TQString & child, uint slashPolicy) { return relativePath(KURL(parent), KURL(child), slashPolicy); } /////////////////////////////////////////////////////////////////////////////// -QString URLUtil::upDir(const QString & path, bool slashSuffix) { +TQString URLUtil::upDir(const TQString & path, bool slashSuffix) { int slashPos = path.findRev("/"); - if (slashPos<1) return QString::null; + if (slashPos<1) return TQString::null; return path.mid(0,slashPos+ (slashSuffix ? 1 : 0) ); } @@ -93,41 +93,41 @@ KURL URLUtil::mergeURL(const KURL & source, const KURL & dest, const KURL & chil if (dest == child) return source; // calculate - QString childUrlStr = child.url(-1); - QString destStemStr = dest.url(1); - QString sourceStemStr = source.url(1); + TQString childUrlStr = child.url(-1); + TQString destStemStr = dest.url(1); + TQString sourceStemStr = source.url(1); return KURL(sourceStemStr.append( childUrlStr.mid( destStemStr.length() ) ) ); } /////////////////////////////////////////////////////////////////////////////// -QString URLUtil::getExtension(const QString & path) { +TQString URLUtil::getExtension(const TQString & path) { int dotPos = path.findRev('.'); - if (dotPos<0) return QString(""); + if (dotPos<0) return TQString(""); return path.mid(dotPos+1); } /////////////////////////////////////////////////////////////////////////////// -QString URLUtil::extractPathNameRelative(const KURL &baseDirUrl, const KURL &url ) +TQString URLUtil::extractPathNameRelative(const KURL &baseDirUrl, const KURL &url ) { - QString absBase = extractPathNameAbsolute( baseDirUrl ), + TQString absBase = extractPathNameAbsolute( baseDirUrl ), absRef = extractPathNameAbsolute( url ); int i = absRef.find( absBase, 0, true ); if (i == -1) - return QString(); + return TQString(); if (absRef == absBase) - return QString( "." ); + return TQString( "." ); else - return absRef.replace( 0, absBase.length(), QString() ); + return absRef.replace( 0, absBase.length(), TQString() ); } /////////////////////////////////////////////////////////////////////////////// -QString URLUtil::extractPathNameRelative(const QString &basePath, const KURL &url ) +TQString URLUtil::extractPathNameRelative(const TQString &basePath, const KURL &url ) { #if (KDE_VERSION_MINOR!=0) || (KDE_VERSION_MAJOR!=3) KURL baseDirUrl = KURL::fromPathOrURL( basePath ); @@ -139,7 +139,7 @@ QString URLUtil::extractPathNameRelative(const QString &basePath, const KURL &ur /////////////////////////////////////////////////////////////////////////////// -QString URLUtil::extractPathNameRelative(const QString &basePath, const QString &absFilePath ) +TQString URLUtil::extractPathNameRelative(const TQString &basePath, const TQString &absFilePath ) { #if (KDE_VERSION_MINOR!=0) || (KDE_VERSION_MAJOR!=3) KURL baseDirUrl = KURL::fromPathOrURL( basePath ), @@ -153,7 +153,7 @@ QString URLUtil::extractPathNameRelative(const QString &basePath, const QString /////////////////////////////////////////////////////////////////////////////// -QString URLUtil::extractPathNameAbsolute( const KURL &url ) +TQString URLUtil::extractPathNameAbsolute( const KURL &url ) { if (isDirectory( url )) return url.path( +1 ); // with trailing "/" if none is present @@ -162,9 +162,9 @@ QString URLUtil::extractPathNameAbsolute( const KURL &url ) // Ok, this is an over-tight pre-condition on "url" since I hope nobody will never // stress this function with absurd cases ... but who knows? /* - QString path = url.path(); - QFileInfo fi( path ); // Argh: QFileInfo is back ;)) - return ( fi.exists()? path : QString() ); + TQString path = url.path(); + TQFileInfo fi( path ); // Argh: TQFileInfo is back ;)) + return ( fi.exists()? path : TQString() ); */ return url.path(); } @@ -179,14 +179,14 @@ bool URLUtil::isDirectory( const KURL &url ) /////////////////////////////////////////////////////////////////////////////// -bool URLUtil::isDirectory( const QString &absFilePath ) +bool URLUtil::isDirectory( const TQString &absFilePath ) { - return QDir( absFilePath ).exists(); + return TQDir( absFilePath ).exists(); } /////////////////////////////////////////////////////////////////////////////// -void URLUtil::dump( const KURL::List &urls, const QString &aMessage ) +void URLUtil::dump( const KURL::List &urls, const TQString &aMessage ) { if (!aMessage.isNull()) { @@ -203,9 +203,9 @@ void URLUtil::dump( const KURL::List &urls, const QString &aMessage ) /////////////////////////////////////////////////////////////////////////////// -QStringList URLUtil::toRelativePaths( const QString &baseDir, const KURL::List &urls) +TQStringList URLUtil::toRelativePaths( const TQString &baseDir, const KURL::List &urls) { - QStringList paths; + TQStringList paths; for (size_t i=0; i= dir.count() ? currDir = "" : currDir = dir[i]; @@ -261,17 +261,17 @@ QString URLUtil::relativePathToFile( const QString & dirUrl, const QString & fil /////////////////////////////////////////////////////////////////////////////// -// code from qt-3.1.2 version of QDir::canonicalPath() -QString URLUtil::canonicalPath( const QString & path ) +// code from qt-3.1.2 version of TQDir::canonicalPath() +TQString URLUtil::canonicalPath( const TQString & path ) { - QString r; + TQString r; char cur[PATH_MAX+1]; if ( ::getcwd( cur, PATH_MAX ) ) { char tmp[PATH_MAX+1]; - if( ::realpath( QFile::encodeName( path ), tmp ) ) + if( ::realpath( TQFile::encodeName( path ), tmp ) ) { - r = QFile::decodeName( tmp ); + r = TQFile::decodeName( tmp ); } //always make sure we go back to the current dir ::chdir( cur ); @@ -283,7 +283,7 @@ QString URLUtil::canonicalPath( const QString & path ) //written by "Dawit A." //borrowed from his patch to KShell -QString URLUtil::envExpand ( const QString& str ) +TQString URLUtil::envExpand ( const TQString& str ) { uint len = str.length(); @@ -294,11 +294,11 @@ QString URLUtil::envExpand ( const QString& str ) if (pos < 0) pos = len; - char* ret = getenv( QConstString(str.unicode()+1, pos-1).string().local8Bit().data() ); + char* ret = getenv( TQConstString(str.unicode()+1, pos-1).string().local8Bit().data() ); if (ret) { - QString expandedStr ( QFile::decodeName( ret ) ); + TQString expandedStr ( TQFile::decodeName( ret ) ); if (pos < (int)len) expandedStr += str.mid(pos); return expandedStr; diff --git a/umbrello/umbrello/codeimport/kdevcppparser/urlutil.h b/umbrello/umbrello/codeimport/kdevcppparser/urlutil.h index 590069dc..75486983 100644 --- a/umbrello/umbrello/codeimport/kdevcppparser/urlutil.h +++ b/umbrello/umbrello/codeimport/kdevcppparser/urlutil.h @@ -21,8 +21,8 @@ #ifndef _URLUTIL_H_ #define _URLUTIL_H_ -#include -#include +#include +#include #include namespace URLUtil @@ -32,19 +32,19 @@ namespace URLUtil /** * Returns the filename part of a pathname (i.e. everything past the last slash) */ - QString filename(const QString & pathName); + TQString filename(const TQString & pathName); /** * Returns the directory part of a path (i.e. everything up to but not including the last slash) */ - QString directory(const QString & pathName); + TQString directory(const TQString & pathName); /** * Returns the relative path between a parent and child URL, or blank if the specified child is not a child of parent */ - QString relativePath(const KURL & parent, const KURL & child, uint slashPolicy = SLASH_PREFIX); + TQString relativePath(const KURL & parent, const KURL & child, uint slashPolicy = SLASH_PREFIX); /** * Returns the relative path between a parent and child URL, or blank if the specified child is not a child of parent */ - QString relativePath(const QString & parent, const QString & child, uint slashPolicy = SLASH_PREFIX); + TQString relativePath(const TQString & parent, const TQString & child, uint slashPolicy = SLASH_PREFIX); /** * Returns the relative path between a directory and file. Should never return empty path. * Example: @@ -52,11 +52,11 @@ namespace URLUtil * fileUrl: /home/test/lib/mylib.cpp * returns: ../lib/mylib.cpp */ - QString relativePathToFile( const QString & dirUrl, const QString & fileUrl ); + TQString relativePathToFile( const TQString & dirUrl, const TQString & fileUrl ); /** *Returns the path 'up one level' - the opposite of what filename returns */ - QString upDir(const QString & path, bool slashSuffix = false); + TQString upDir(const TQString & path, bool slashSuffix = false); /** * 'Merges' URLs - changes a URL that starts with dest to start with source instead * Example: @@ -69,7 +69,7 @@ namespace URLUtil /** * Returns the file extension for a filename or path */ - QString getExtension(const QString & path); + TQString getExtension(const TQString & path); /** * Given a base directory url in @p baseDirUrl and the url referring to a date sub-directory or file, @@ -79,44 +79,44 @@ namespace URLUtil * KURL baseUrl, dirUrl; * baseUrl.setPath( "/home/mario/src/kdevelop/" ); * dirUrl.setPath( "/home/mario/src/kdevelop/parts/cvs/" ); - * QString relPathName = extractDirPathRelative( baseUrl, url ); // == "parts/cvs/" - * QString absPathName = extractDirPathAbsolute( url ); // == "/home/mario/src/kdevelop/parts/cvs/" + * TQString relPathName = extractDirPathRelative( baseUrl, url ); // == "parts/cvs/" + * TQString absPathName = extractDirPathAbsolute( url ); // == "/home/mario/src/kdevelop/parts/cvs/" * * Note that if you pass a file name in @p url (instead of a directory) or the @p baseUrl is not contained * in @p url then the function will return "" (void string). */ - QString extractPathNameRelative(const KURL &baseDirUrl, const KURL &url ); - QString extractPathNameRelative(const QString &basePath, const KURL &url ); - QString extractPathNameRelative(const QString &basePath, const QString &absFilePath ); + TQString extractPathNameRelative(const KURL &baseDirUrl, const KURL &url ); + TQString extractPathNameRelative(const TQString &basePath, const KURL &url ); + TQString extractPathNameRelative(const TQString &basePath, const TQString &absFilePath ); /** * Will return the absolute path name referred in @p url. * Look at above for an example. */ - QString extractPathNameAbsolute( const KURL &url ); + TQString extractPathNameAbsolute( const KURL &url ); /** - * Returns a QStringList of relative (to @p baseDir) paths from a list of KURLs in @p urls + * Returns a TQStringList of relative (to @p baseDir) paths from a list of KURLs in @p urls */ - QStringList toRelativePaths( const QString &baseDir, const KURL::List &urls); + TQStringList toRelativePaths( const TQString &baseDir, const KURL::List &urls); /** * If @p url is a directory will return true, false otherwise. */ bool isDirectory( const KURL &url ); - bool isDirectory( const QString &absFilePath ); + bool isDirectory( const TQString &absFilePath ); /** * Will dump the list of KURL @p urls on standard output, eventually printing @ aMessage if it * is not null. */ - void dump( const KURL::List &urls, const QString &aMessage = QString::null ); + void dump( const KURL::List &urls, const TQString &aMessage = TQString::null ); /** - * Same as QDir::canonicalPath in later versions of QT. Earlier versions of QT + * Same as TQDir::canonicalPath in later versions of QT. Earlier versions of QT * had this broken, so it's reproduced here. */ - QString canonicalPath( const QString & path ); + TQString canonicalPath( const TQString & path ); /** * Performs environment variable expansion on @p variable. @@ -125,7 +125,7 @@ namespace URLUtil * @return the expanded environment variable value. if the variable * cannot be expanded, @p variable itself is returned. */ - QString envExpand ( const QString &variable ); + TQString envExpand ( const TQString &variable ); } diff --git a/umbrello/umbrello/codeimport/nativeimportbase.cpp b/umbrello/umbrello/codeimport/nativeimportbase.cpp index 058b4d19..b2f7dac3 100644 --- a/umbrello/umbrello/codeimport/nativeimportbase.cpp +++ b/umbrello/umbrello/codeimport/nativeimportbase.cpp @@ -13,15 +13,15 @@ #include "nativeimportbase.h" // qt/kde includes -#include -#include -#include +#include +#include +#include #include #include // app includes #include "import_utils.h" -NativeImportBase::NativeImportBase(const QString &singleLineCommentIntro) { +NativeImportBase::NativeImportBase(const TQString &singleLineCommentIntro) { m_singleLineCommentIntro = singleLineCommentIntro; m_srcIndex = 0; m_scopeIndex = 0; // index 0 is reserved for global scope @@ -34,24 +34,24 @@ NativeImportBase::NativeImportBase(const QString &singleLineCommentIntro) { NativeImportBase::~NativeImportBase() { } -void NativeImportBase::setMultiLineComment(const QString &intro, const QString &end) { +void NativeImportBase::setMultiLineComment(const TQString &intro, const TQString &end) { m_multiLineCommentIntro = intro; m_multiLineCommentEnd = end; } -void NativeImportBase::setMultiLineAltComment(const QString &intro, const QString &end) { +void NativeImportBase::setMultiLineAltComment(const TQString &intro, const TQString &end) { m_multiLineAltCommentIntro = intro; m_multiLineAltCommentEnd = end; } -void NativeImportBase::skipStmt(QString until /* = ";" */) { +void NativeImportBase::skipStmt(TQString until /* = ";" */) { const uint srcLength = m_source.count(); while (m_srcIndex < srcLength && m_source[m_srcIndex] != until) m_srcIndex++; } -bool NativeImportBase::skipToClosing(QChar opener) { - QString closing; +bool NativeImportBase::skipToClosing(TQChar opener) { + TQString closing; switch (opener) { case '{': closing = "}"; @@ -70,12 +70,12 @@ bool NativeImportBase::skipToClosing(QChar opener) { << "): " << "illegal input character" << endl; return false; } - const QString opening(opener); + const TQString opening(opener); skipStmt(opening); const uint srcLength = m_source.count(); int nesting = 0; while (m_srcIndex < srcLength) { - QString nextToken = advance(); + TQString nextToken = advance(); if (nextToken.isEmpty()) break; if (nextToken == closing) { @@ -91,7 +91,7 @@ bool NativeImportBase::skipToClosing(QChar opener) { return true; } -QString NativeImportBase::advance() { +TQString NativeImportBase::advance() { while (m_srcIndex < m_source.count() - 1) { if (m_source[++m_srcIndex].startsWith(m_singleLineCommentIntro)) m_comment += m_source[m_srcIndex]; @@ -102,12 +102,12 @@ QString NativeImportBase::advance() { // if last item in m_source is a comment then it is dropped too (m_srcIndex == m_source.count() - 1 && m_source[m_srcIndex].startsWith(m_singleLineCommentIntro))) { - return QString(); + return TQString(); } return m_source[m_srcIndex]; } -bool NativeImportBase::preprocess(QString& line) { +bool NativeImportBase::preprocess(TQString& line) { if (m_multiLineCommentIntro.isEmpty()) return false; // Check for end of multi line comment. @@ -126,7 +126,7 @@ bool NativeImportBase::preprocess(QString& line) { delimiterLen = m_multiLineCommentEnd.length(); } if (pos > 0) { - QString text = line.mid(0, pos - 1); + TQString text = line.mid(0, pos - 1); m_comment += text.stripWhiteSpace(); } m_source.append(m_singleLineCommentIntro + m_comment); // denotes comments in `m_source' @@ -162,7 +162,7 @@ bool NativeImportBase::preprocess(QString& line) { if (endpos == -1) { m_inComment = true; if (pos + delimIntroLen < (int)line.length()) { - QString cmnt = line.mid(pos + delimIntroLen); + TQString cmnt = line.mid(pos + delimIntroLen); m_comment += cmnt.stripWhiteSpace() + "\n"; } if (pos == 0) @@ -170,16 +170,16 @@ bool NativeImportBase::preprocess(QString& line) { line = line.left(pos); } else { // It's a multiline comment on a single line. if (endpos > pos + delimIntroLen) { - QString cmnt = line.mid(pos + delimIntroLen, endpos - pos - delimIntroLen); + TQString cmnt = line.mid(pos + delimIntroLen, endpos - pos - delimIntroLen); cmnt = cmnt.stripWhiteSpace(); if (!cmnt.isEmpty()) m_source.append(m_singleLineCommentIntro + cmnt); } endpos++; // endpos now points at the slash of "*/" - QString pre; + TQString pre; if (pos > 0) pre = line.left(pos); - QString post; + TQString post; if (endpos + delimEndLen < (int)line.length()) post = line.mid(endpos + 1); line = pre + post; @@ -190,20 +190,20 @@ bool NativeImportBase::preprocess(QString& line) { /// Split the line so that a string is returned as a single element of the list, /// when not in a string then split at white space. -QStringList NativeImportBase::split(const QString& lin) { - QStringList list; - QString listElement; - QChar stringIntro = 0; // buffers the string introducer character +TQStringList NativeImportBase::split(const TQString& lin) { + TQStringList list; + TQString listElement; + TQChar stringIntro = 0; // buffers the string introducer character bool seenSpace = false; - QString line = lin.stripWhiteSpace(); + TQString line = lin.stripWhiteSpace(); for (uint i = 0; i < line.length(); i++) { - const QChar& c = line[i]; + const TQChar& c = line[i]; if (stringIntro) { // we are in a string listElement += c; if (c == stringIntro) { if (line[i - 1] != '\\') { list.append(listElement); - listElement = QString(); + listElement = TQString(); stringIntro = 0; // we are no longer in a string } } @@ -219,7 +219,7 @@ QStringList NativeImportBase::split(const QString& lin) { seenSpace = true; if (!listElement.isEmpty()) { list.append(listElement); - listElement = QString(); + listElement = TQString(); } } else { listElement += c; @@ -233,23 +233,23 @@ QStringList NativeImportBase::split(const QString& lin) { /// The lexer. Tokenizes the given string and fills `m_source'. /// Stores possible comments in `m_comment'. -void NativeImportBase::scan(QString line) { +void NativeImportBase::scan(TQString line) { if (preprocess(line)) return; // Check for single line comment. int pos = line.find(m_singleLineCommentIntro); if (pos != -1) { - QString cmnt = line.mid(pos); + TQString cmnt = line.mid(pos); m_source.append(cmnt); if (pos == 0) return; line = line.left(pos); } - if (line.contains(QRegExp("^\\s*$"))) + if (line.contains(TQRegExp("^\\s*$"))) return; - QStringList words = split(line); - for (QStringList::Iterator it = words.begin(); it != words.end(); ++it) { - QString word = *it; + TQStringList words = split(line); + for (TQStringList::Iterator it = words.begin(); it != words.end(); ++it) { + TQString word = *it; if (word[0] == '"' || word[0] == '\'') m_source.append(word); // string constants are handled by split() else @@ -260,34 +260,34 @@ void NativeImportBase::scan(QString line) { void NativeImportBase::initVars() { } -void NativeImportBase::parseFile(const QString& filename) { - QString nameWithoutPath = filename; - nameWithoutPath.remove(QRegExp("^.*/")); +void NativeImportBase::parseFile(const TQString& filename) { + TQString nameWithoutPath = filename; + nameWithoutPath.remove(TQRegExp("^.*/")); if (m_parsedFiles.contains(nameWithoutPath)) return; m_parsedFiles.append(nameWithoutPath); - QString fname = filename; - const QString msgPrefix = "NativeImportBase::parseFile(" + filename + "): "; + TQString fname = filename; + const TQString msgPrefix = "NativeImportBase::parseFile(" + filename + "): "; if (filename.contains('/')) { - QString path = filename; - path.remove( QRegExp("/[^/]+$") ); + TQString path = filename; + path.remove( TQRegExp("/[^/]+$") ); kDebug() << msgPrefix << "adding path " << path << endl; Import_Utils::addIncludePath(path); } - if (! QFile::exists(filename)) { + if (! TQFile::exists(filename)) { if (filename.startsWith("/")) { kError() << msgPrefix << "cannot find file" << endl; return; } bool found = false; - QStringList includePaths = Import_Utils::includePathList(); - for (QStringList::Iterator pathIt = includePaths.begin(); + TQStringList includePaths = Import_Utils::includePathList(); + for (TQStringList::Iterator pathIt = includePaths.begin(); pathIt != includePaths.end(); ++pathIt) { - QString path = (*pathIt); + TQString path = (*pathIt); if (! path.endsWith("/")) { path.append("/"); } - if (QFile::exists(path + filename)) { + if (TQFile::exists(path + filename)) { fname.prepend(path); found = true; break; @@ -298,30 +298,30 @@ void NativeImportBase::parseFile(const QString& filename) { return; } } - QFile file(fname); + TQFile file(fname); if (! file.open(IO_ReadOnly)) { kError() << msgPrefix << "cannot open file" << endl; return; } kDebug() << msgPrefix << "parsing." << endl; - // Scan the input file into the QStringList m_source. + // Scan the input file into the TQStringList m_source. m_source.clear(); m_srcIndex = 0; initVars(); - QTextStream stream(&file); + TQTextStream stream(&file); while (! stream.atEnd()) { - QString line = stream.readLine(); + TQString line = stream.readLine(); scan(line); } file.close(); - // Parse the QStringList m_source. + // Parse the TQStringList m_source. m_klass = NULL; m_currentAccess = Uml::Visibility::Public; m_scopeIndex = 0; m_scope[0] = NULL; // index 0 is reserved for global scope const uint srcLength = m_source.count(); for (m_srcIndex = 0; m_srcIndex < srcLength; m_srcIndex++) { - const QString& firstToken = m_source[m_srcIndex]; + const TQString& firstToken = m_source[m_srcIndex]; //kDebug() << '"' << firstToken << '"' << endl; if (firstToken.startsWith(m_singleLineCommentIntro)) { m_comment = firstToken.mid(m_singleLineCommentIntro.length()); @@ -329,7 +329,7 @@ void NativeImportBase::parseFile(const QString& filename) { } if (! parseStmt()) skipStmt(); - m_comment = QString(); + m_comment = TQString(); } kDebug() << msgPrefix << "end of parse." << endl; } diff --git a/umbrello/umbrello/codeimport/nativeimportbase.h b/umbrello/umbrello/codeimport/nativeimportbase.h index cc82fd91..03a78a5c 100644 --- a/umbrello/umbrello/codeimport/nativeimportbase.h +++ b/umbrello/umbrello/codeimport/nativeimportbase.h @@ -12,8 +12,8 @@ #ifndef NATIVEIMPORTBASE_H #define NATIVEIMPORTBASE_H -#include -#include +#include +#include #include "classimport.h" #include "../umlnamespace.h" @@ -47,7 +47,7 @@ public: * Constructor * @param singleLineCommentIntro "//" for IDL and Java, "--" for Ada */ - NativeImportBase(const QString &singleLineCommentIntro); + NativeImportBase(const TQString &singleLineCommentIntro); virtual ~NativeImportBase(); protected: @@ -64,12 +64,12 @@ protected: * @param end In languages with a C style multiline comment * this is star-slash. */ - void setMultiLineComment(const QString &intro, const QString &end); + void setMultiLineComment(const TQString &intro, const TQString &end); /** * Set the delimiter strings for an alternative form of * multi line comment. See setMultiLineComment(). */ - void setMultiLineAltComment(const QString &intro, const QString &end); + void setMultiLineAltComment(const TQString &intro, const TQString &end); /** * Import a single file. @@ -78,12 +78,12 @@ protected: * * @param filename The file to import. */ - virtual void parseFile(const QString& filename); + virtual void parseFile(const TQString& filename); /** * Initialize auxiliary variables. * This is called by the default implementation of parseFile() - * after scanning (before parsing the QStringList m_source.) + * after scanning (before parsing the TQStringList m_source.) * The default implementation is empty. */ virtual void initVars(); @@ -95,7 +95,7 @@ protected: * * @param line The line to scan. */ - void scan(QString line); + void scan(TQString line); /** * Preprocess a line. @@ -108,21 +108,21 @@ protected: * false if there are still items left in the line * for further analysis. */ - virtual bool preprocess(QString& line); + virtual bool preprocess(TQString& line); /** * Split the line so that a string is returned as a single element of the list. * When not in a string then split at white space. * The default implementation is suitable for C style strings and char constants. */ - virtual QStringList split(const QString& line); + virtual TQStringList split(const TQString& line); /** * Analyze the given word and fill `m_source'. * A "word" is a whitespace delimited item from the input line. * To be provided by the specific importer class. */ - virtual void fillSource(const QString& word) = 0; + virtual void fillSource(const TQString& word) = 0; /** * Parse the statement which starts at m_source[m_srcIndex] @@ -138,7 +138,7 @@ protected: * Advance m_srcIndex until m_source[m_srcIndex] contains the lexeme * given by `until'. */ - void skipStmt(QString until = ";"); + void skipStmt(TQString until = ";"); /** * Advance m_srcIndex to the index of the corresponding closing character @@ -148,24 +148,24 @@ protected: * @return True for success, false for misuse (invalid opener) or * if no matching closing character is found in m_source. */ - bool skipToClosing(QChar opener); + bool skipToClosing(TQChar opener); /** * Advance m_srcIndex until m_source[m_srcIndex] contains a non-comment. * Comments encountered during advancement are accumulated in `m_comment'. - * If m_srcIndex hits the end of m_source then QString::null is returned. + * If m_srcIndex hits the end of m_source then TQString::null is returned. */ - QString advance(); + TQString advance(); /** * How to start a single line comment in this programming language. */ - QString m_singleLineCommentIntro; + TQString m_singleLineCommentIntro; /** * The scanned lexemes. */ - QStringList m_source; + TQStringList m_source; /** * Used for indexing m_source. */ @@ -191,7 +191,7 @@ protected: /** * Intermediate accumulator for comment text. */ - QString m_comment; + TQString m_comment; /** * True if we are currently in a multi-line comment. * Only applies to languages with multi-line comments. @@ -208,19 +208,19 @@ protected: * whether the name is already present in this list in order to * avoid parsing the same file multiple times. */ - QStringList m_parsedFiles; + TQStringList m_parsedFiles; /** * Multi line comment delimiters */ - QString m_multiLineCommentIntro; - QString m_multiLineCommentEnd; + TQString m_multiLineCommentIntro; + TQString m_multiLineCommentEnd; /** * Some languages support an alternative set of multi line * comment delimiters. */ - QString m_multiLineAltCommentIntro; - QString m_multiLineAltCommentEnd; + TQString m_multiLineAltCommentIntro; + TQString m_multiLineAltCommentEnd; }; #endif diff --git a/umbrello/umbrello/codeimport/pascalimport.cpp b/umbrello/umbrello/codeimport/pascalimport.cpp index ffe291ff..a769571d 100644 --- a/umbrello/umbrello/codeimport/pascalimport.cpp +++ b/umbrello/umbrello/codeimport/pascalimport.cpp @@ -14,7 +14,7 @@ #include // qt/kde includes -#include +#include #include // app includes #include "import_utils.h" @@ -41,23 +41,23 @@ void PascalImport::initVars() { NativeImportBase::m_currentAccess = Uml::Visibility::Public; } -void PascalImport::fillSource(const QString& word) { - QString lexeme; +void PascalImport::fillSource(const TQString& word) { + TQString lexeme; const uint len = word.length(); for (uint i = 0; i < len; i++) { - QChar c = word[i]; + TQChar c = word[i]; if (c.isLetterOrNumber() || c == '_' || c == '.' || c == '#') { lexeme += c; } else { if (!lexeme.isEmpty()) { m_source.append(lexeme); - lexeme = QString(); + lexeme = TQString(); } if (c == ':' && word[i + 1] == '=') { m_source.append(":="); i++; } else { - m_source.append(QString(c)); + m_source.append(TQString(c)); } } } @@ -68,7 +68,7 @@ void PascalImport::fillSource(const QString& word) { void PascalImport::checkModifiers(bool& isVirtual, bool& isAbstract) { const uint srcLength = m_source.count(); while (m_srcIndex < srcLength - 1) { - QString lookAhead = m_source[m_srcIndex + 1].lower(); + TQString lookAhead = m_source[m_srcIndex + 1].lower(); if (lookAhead != "virtual" && lookAhead != "abstract" && lookAhead != "override" && lookAhead != "register" && lookAhead != "cdecl" && @@ -87,12 +87,12 @@ void PascalImport::checkModifiers(bool& isVirtual, bool& isAbstract) { bool PascalImport::parseStmt() { const uint srcLength = m_source.count(); - QString keyword = m_source[m_srcIndex].lower(); + TQString keyword = m_source[m_srcIndex].lower(); //kDebug() << '"' << keyword << '"' << endl; if (keyword == "uses") { while (m_srcIndex < srcLength - 1) { - QString unit = advance(); - const QString& prefix = unit.lower(); + TQString unit = advance(); + const TQString& prefix = unit.lower(); if (prefix == "sysutils" || prefix == "types" || prefix == "classes" || prefix == "graphics" || prefix == "controls" || prefix == "strings" || prefix == "forms" || prefix == "windows" || prefix == "messages" || @@ -103,10 +103,10 @@ bool PascalImport::parseStmt() { break; continue; } - QString filename = unit + ".pas"; + TQString filename = unit + ".pas"; if (! m_parsedFiles.contains(unit)) { // Save current m_source and m_srcIndex. - QStringList source(m_source); + TQStringList source(m_source); uint srcIndex = m_srcIndex; m_source.clear(); parseFile(filename); @@ -123,7 +123,7 @@ bool PascalImport::parseStmt() { return true; } if (keyword == "unit") { - const QString& name = advance(); + const TQString& name = advance(); UMLObject *ns = Import_Utils::createUMLObject(Uml::ot_Package, name, m_scope[m_scopeIndex], m_comment); m_scope[++m_scopeIndex] = static_cast(ns); @@ -209,13 +209,13 @@ bool PascalImport::parseStmt() { checkModifiers(dummyVirtual, dummyAbstract); return true; } - const QString& name = advance(); + const TQString& name = advance(); UMLOperation *op = Import_Utils::makeOperation(m_klass, name); if (m_source[m_srcIndex + 1] == "(") { advance(); const uint MAX_PARNAMES = 16; while (m_srcIndex < srcLength && m_source[m_srcIndex] != ")") { - QString nextToken = m_source[m_srcIndex + 1].lower(); + TQString nextToken = m_source[m_srcIndex + 1].lower(); Uml::Parameter_Direction dir = Uml::pd_In; if (nextToken == "var") { dir = Uml::pd_InOut; @@ -226,7 +226,7 @@ bool PascalImport::parseStmt() { dir = Uml::pd_Out; advance(); } - QString parName[MAX_PARNAMES]; + TQString parName[MAX_PARNAMES]; uint parNameCount = 0; do { if (parNameCount >= MAX_PARNAMES) { @@ -259,7 +259,7 @@ bool PascalImport::parseStmt() { break; } } - QString returnType; + TQString returnType; if (keyword == "function") { if (advance() != ":") { kError() << "importPascal: expecting \":\" at function " @@ -283,8 +283,8 @@ bool PascalImport::parseStmt() { return true; } if (m_klass == NULL) { - const QString& name = m_source[m_srcIndex]; - QString nextToken = advance(); + const TQString& name = m_source[m_srcIndex]; + TQString nextToken = advance(); if (nextToken != "=") { kDebug() << "PascalImport::parseStmt(" << name << "): " << "expecting '=' at " << nextToken << endl; @@ -325,15 +325,15 @@ bool PascalImport::parseStmt() { UMLObject *ns = Import_Utils::createUMLObject(t, name, m_scope[m_scopeIndex], m_comment); UMLClassifier *klass = static_cast(ns); - m_comment = QString(); - QString lookAhead = m_source[m_srcIndex + 1]; + m_comment = TQString(); + TQString lookAhead = m_source[m_srcIndex + 1]; if (lookAhead == "(") { advance(); do { - QString base = advance(); + TQString base = advance(); UMLObject *ns = Import_Utils::createUMLObject(Uml::ot_Class, base, NULL); UMLClassifier *parent = static_cast(ns); - m_comment = QString(); + m_comment = TQString(); Import_Utils::createGeneralization(klass, parent); } while (advance() == ","); if (m_source[m_srcIndex] != ")") { @@ -379,7 +379,7 @@ bool PascalImport::parseStmt() { skipStmt(); return true; } - QString name, stereotype; + TQString name, stereotype; if (keyword == "property") { stereotype = keyword; name = advance(); @@ -392,11 +392,11 @@ bool PascalImport::parseStmt() { skipStmt(); return true; } - QString typeName = advance(); - QString initialValue; + TQString typeName = advance(); + TQString initialValue; if (advance() == "=") { initialValue = advance(); - QString token; + TQString token; while ((token = advance()) != ";") { initialValue.append(' ' + token); } diff --git a/umbrello/umbrello/codeimport/pascalimport.h b/umbrello/umbrello/codeimport/pascalimport.h index 975dc423..55c0b2bd 100644 --- a/umbrello/umbrello/codeimport/pascalimport.h +++ b/umbrello/umbrello/codeimport/pascalimport.h @@ -38,7 +38,7 @@ protected: /** * Implement abstract operation from NativeImportBase. */ - void fillSource(const QString& word); + void fillSource(const TQString& word); /** * Check for, and skip over, all modifiers following a method. diff --git a/umbrello/umbrello/codeimport/pythonimport.cpp b/umbrello/umbrello/codeimport/pythonimport.cpp index af59cf8a..2436699a 100644 --- a/umbrello/umbrello/codeimport/pythonimport.cpp +++ b/umbrello/umbrello/codeimport/pythonimport.cpp @@ -13,8 +13,8 @@ #include "pythonimport.h" // qt/kde includes -#include -#include +#include +#include #include // app includes #include "import_utils.h" @@ -41,26 +41,26 @@ void PythonImport::initVars() { m_braceWasOpened = false; } -bool PythonImport::preprocess(QString& line) { +bool PythonImport::preprocess(TQString& line) { if (NativeImportBase::preprocess(line)) return true; // Handle single line comment int pos = line.find(m_singleLineCommentIntro); if (pos != -1) { - QString cmnt = line.mid(pos); + TQString cmnt = line.mid(pos); m_source.append(cmnt); m_srcIndex++; if (pos == 0) return true; line = line.left(pos); - line.remove( QRegExp("\\s+$") ); + line.remove( TQRegExp("\\s+$") ); } // Transform changes in indentation into braces a la C++/Java/Perl/... - pos = line.find( QRegExp("\\S") ); + pos = line.find( TQRegExp("\\S") ); if (pos == -1) return true; bool isContinuation = false; - int leadingWhite = line.left(pos).contains( QRegExp("\\s") ); + int leadingWhite = line.left(pos).contains( TQRegExp("\\s") ); if (leadingWhite > m_srcIndent[m_srcIndentIndex]) { if (m_srcIndex == 0) { kError() << "PythonImport::preprocess(): internal error 1" << endl; @@ -80,7 +80,7 @@ bool PythonImport::preprocess(QString& line) { } } if (line.endsWith(":")) { - line.replace( QRegExp(":$"), "{" ); + line.replace( TQRegExp(":$"), "{" ); m_braceWasOpened = true; } else { m_braceWasOpened = false; @@ -90,20 +90,20 @@ bool PythonImport::preprocess(QString& line) { return false; // The input was not completely consumed by preprocessing. } -void PythonImport::fillSource(const QString& word) { - QString lexeme; +void PythonImport::fillSource(const TQString& word) { + TQString lexeme; const uint len = word.length(); for (uint i = 0; i < len; i++) { - const QChar& c = word[i]; + const TQChar& c = word[i]; if (c.isLetterOrNumber() || c == '_' || c == '.') { lexeme += c; } else { if (!lexeme.isEmpty()) { m_source.append(lexeme); m_srcIndex++; - lexeme = QString(); + lexeme = TQString(); } - m_source.append(QString(c)); + m_source.append(TQString(c)); m_srcIndex++; } } @@ -117,7 +117,7 @@ void PythonImport::skipBody() { if (m_source[m_srcIndex] != "{") skipStmt("{"); int braceNesting = 0; - QString token; + TQString token; while (!(token = advance()).isNull()) { if (token == "}") { if (braceNesting <= 0) @@ -131,16 +131,16 @@ void PythonImport::skipBody() { bool PythonImport::parseStmt() { const uint srcLength = m_source.count(); - const QString& keyword = m_source[m_srcIndex]; + const TQString& keyword = m_source[m_srcIndex]; if (keyword == "class") { - const QString& name = advance(); + const TQString& name = advance(); UMLObject *ns = Import_Utils::createUMLObject(Uml::ot_Class, name, m_scope[m_scopeIndex], m_comment); m_scope[++m_scopeIndex] = m_klass = static_cast(ns); - m_comment = QString(); + m_comment = TQString(); if (advance() == "(") { while (m_srcIndex < srcLength - 1 && advance() != ")") { - const QString& baseName = m_source[m_srcIndex]; + const TQString& baseName = m_source[m_srcIndex]; Import_Utils::createGeneralization(m_klass, baseName); if (advance() != ",") break; @@ -157,7 +157,7 @@ bool PythonImport::parseStmt() { skipBody(); return true; } - const QString& name = advance(); + const TQString& name = advance(); // operation UMLOperation *op = Import_Utils::makeOperation(m_klass, name); if (advance() != "(") { @@ -166,7 +166,7 @@ bool PythonImport::parseStmt() { return true; } while (m_srcIndex < srcLength && advance() != ")") { - const QString& parName = m_source[m_srcIndex]; + const TQString& parName = m_source[m_srcIndex]; UMLAttribute *att = Import_Utils::addMethodParameter(op, "string", parName); if (advance() != ",") break; diff --git a/umbrello/umbrello/codeimport/pythonimport.h b/umbrello/umbrello/codeimport/pythonimport.h index 41fea0d4..d5c62a91 100644 --- a/umbrello/umbrello/codeimport/pythonimport.h +++ b/umbrello/umbrello/codeimport/pythonimport.h @@ -38,7 +38,7 @@ protected: /** * Implement abstract operation from NativeImportBase. */ - void fillSource(const QString& line); + void fillSource(const TQString& line); /** * Reimplement operation from NativeImportBase. @@ -48,7 +48,7 @@ protected: * Removal of Python's indentation sensitivity simplifies subsequent * processing using Umbrello's native import framework. */ - bool preprocess(QString& line); + bool preprocess(TQString& line); /** * Skip ahead to outermost closing brace -- cgit v1.2.3