diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
commit | 4ae0c208b66e0f7954e194384464fe2d0a2c56dd (patch) | |
tree | b0a7cd1c184f0003c0292eb416ed27f674f9cc43 /umbrello/umbrello/codegenerators | |
parent | 1964ea0fb4ab57493ca2ebb709c8d3b5395fd653 (diff) | |
download | tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.tar.gz tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1157652 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'umbrello/umbrello/codegenerators')
124 files changed, 1793 insertions, 1793 deletions
diff --git a/umbrello/umbrello/codegenerators/adawriter.cpp b/umbrello/umbrello/codegenerators/adawriter.cpp index e1c79839..ec2bf59a 100644 --- a/umbrello/umbrello/codegenerators/adawriter.cpp +++ b/umbrello/umbrello/codegenerators/adawriter.cpp @@ -18,9 +18,9 @@ #include <kdebug.h> #include <klocale.h> #include <kmessagebox.h> -#include <qfile.h> -#include <qregexp.h> -#include <qtextstream.h> +#include <tqfile.h> +#include <tqregexp.h> +#include <tqtextstream.h> #include "../umldoc.h" #include "../uml.h" @@ -36,7 +36,7 @@ #include "../template.h" #include "../umlnamespace.h" -const QString AdaWriter::defaultPackageSuffix = "_Holder"; +const TQString AdaWriter::defaultPackageSuffix = "_Holder"; AdaWriter::AdaWriter() { } @@ -61,7 +61,7 @@ bool AdaWriter::isOOClass(UMLClassifier *c) { kDebug() << "AdaWriter::isOOClass: unknown object type " << ot << endl; return false; } - QString stype = c->getStereotype(); + TQString stype = c->getStereotype(); if (stype == "CORBAConstant" || stype == "CORBATypedef" || stype == "CORBAStruct" || stype == "CORBAUnion") return false; @@ -70,13 +70,13 @@ bool AdaWriter::isOOClass(UMLClassifier *c) { return true; } -QString AdaWriter::className(UMLClassifier *c, bool inOwnScope) { +TQString AdaWriter::className(UMLClassifier *c, bool inOwnScope) { // If the class has an enclosing package then it is assumed that // the class name is the type name; if the class does not have an // enclosing package then the class name acts as the Ada package // name. - QString retval; - QString className = cleanName(c->getName()); + TQString retval; + TQString className = cleanName(c->getName()); UMLPackage *umlPkg = c->getUMLPackage(); if (umlPkg == UMLApp::app()->getDocument()->getRootFolder(Uml::mt_Logical)) { if (! inOwnScope) @@ -90,14 +90,14 @@ QString AdaWriter::className(UMLClassifier *c, bool inOwnScope) { return retval; } -QString AdaWriter::packageName(UMLPackage *p) { +TQString AdaWriter::packageName(UMLPackage *p) { // If the class has an enclosing package then it is assumed that // the class name is the type name; if the class does not have an // enclosing package then the class name acts as the Ada package // name. UMLPackage *umlPkg = p->getUMLPackage(); - QString className = cleanName(p->getName()); - QString retval; + TQString className = cleanName(p->getName()); + TQString retval; if (umlPkg == UMLApp::app()->getDocument()->getRootFolder(Uml::mt_Logical)) umlPkg = NULL; @@ -115,21 +115,21 @@ QString AdaWriter::packageName(UMLPackage *p) { void AdaWriter::computeAssocTypeAndRole(UMLClassifier *c, UMLAssociation *a, - QString& typeName, QString& roleName) { + TQString& typeName, TQString& roleName) { UMLClassifier* assocEnd = dynamic_cast<UMLClassifier*>(a->getObject(Uml::B)); if (assocEnd == NULL) return; const Uml::Association_Type assocType = a->getAssocType(); if (assocType != Uml::at_Aggregation && assocType != Uml::at_Composition) return; - const QString multi = a->getMulti(Uml::B); + const TQString multi = a->getMulti(Uml::B); bool hasNonUnityMultiplicity = (!multi.isEmpty() && multi != "1"); - hasNonUnityMultiplicity &= !multi.contains(QRegExp("^1 *\\.\\. *1$")); + hasNonUnityMultiplicity &= !multi.contains(TQRegExp("^1 *\\.\\. *1$")); roleName = cleanName(a->getRoleName(Uml::B)); if (roleName.isEmpty()) roleName = cleanName(a->getName()); if (roleName.isEmpty()) { - QString artificialName = cleanName(assocEnd->getName()); + TQString artificialName = cleanName(assocEnd->getName()); if (hasNonUnityMultiplicity) { roleName = artificialName; roleName.append("_Vector"); @@ -152,8 +152,8 @@ void AdaWriter::writeClass(UMLClassifier *c) { } const bool isClass = !c->isInterface(); - QString classname = cleanName(c->getName()); - QString fileName = packageName(c).lower(); + TQString classname = cleanName(c->getName()); + TQString fileName = packageName(c).lower(); fileName.replace('.', '-'); //find an appropriate name for our file @@ -163,7 +163,7 @@ void AdaWriter::writeClass(UMLClassifier *c) { return; } - QFile file; + TQFile file; if (!openFile(file, fileName)) { emit codeGenerated(c, false); return; @@ -171,13 +171,13 @@ void AdaWriter::writeClass(UMLClassifier *c) { // Start generating the code. - QTextStream ada(&file); + TQTextStream ada(&file); //try to find a heading file(license, comments, etc) - QString str; + TQString str; str = getHeadingFile(".ads"); if (!str.isEmpty()) { - str.replace(QRegExp("%filename%"), fileName); - str.replace(QRegExp("%filepath%"), file.name()); + str.replace(TQRegExp("%filename%"), fileName); + str.replace(TQRegExp("%filepath%"), file.name()); ada << str << endl; } @@ -198,8 +198,8 @@ void AdaWriter::writeClass(UMLClassifier *c) { ada << getIndent() << "generic" << m_endl; m_indentLevel++; for (UMLTemplate *t = template_params.first(); t; t = template_params.next()) { - QString formalName = t->getName(); - QString typeName = t->getTypeName(); + TQString formalName = t->getName(); + TQString typeName = t->getTypeName(); if (typeName == "class") { ada << getIndent() << "type " << formalName << " is tagged private;" << m_endl; @@ -225,7 +225,7 @@ void AdaWriter::writeClass(UMLClassifier *c) { } // Here comes the package proper. - QString pkg = packageName(c); + TQString pkg = packageName(c); ada << getIndent() << "package " << pkg << " is" << m_endl << m_endl; m_indentLevel++; if (c->getBaseType() == Uml::ot_Enum) { @@ -235,7 +235,7 @@ void AdaWriter::writeClass(UMLClassifier *c) { ada << getIndent() << "type " << classname << " is (" << m_endl; m_indentLevel++; for (UMLClassifierListItem *lit = litList.first(); lit; lit = litList.next()) { - QString enumLiteral = cleanName(lit->getName()); + TQString enumLiteral = cleanName(lit->getName()); ada << getIndent() << enumLiteral; if (++i < litList.count()) ada << "," << m_endl; @@ -247,7 +247,7 @@ void AdaWriter::writeClass(UMLClassifier *c) { return; } if (! isOOClass(c)) { - QString stype = c->getStereotype(); + TQString stype = c->getStereotype(); if (stype == "CORBAConstant") { ada << getIndent() << "-- " << stype << " is Not Yet Implemented" << m_endl << m_endl; } else if(stype == "CORBAStruct") { @@ -257,10 +257,10 @@ void AdaWriter::writeClass(UMLClassifier *c) { ada << getIndent() << "type " << classname << " is record" << m_endl; m_indentLevel++; for (at = atl.first(); at; at = atl.next()) { - QString name = cleanName(at->getName()); - QString typeName = at->getTypeName(); + TQString name = cleanName(at->getName()); + TQString typeName = at->getTypeName(); ada << getIndent() << name << " : " << typeName; - QString initialVal = at->getInitialValue(); + TQString initialVal = at->getInitialValue(); if (initialVal.latin1() && ! initialVal.isEmpty()) ada << " := " << initialVal; ada << ";" << m_endl; @@ -290,7 +290,7 @@ void AdaWriter::writeClass(UMLClassifier *c) { UMLClassifierList superclasses = c->getSuperClasses(); - const QString name = className(c); + const TQString name = className(c); ada << getIndent() << "type " << name << " is "; if (c->getAbstract()) ada << "abstract "; @@ -322,7 +322,7 @@ void AdaWriter::writeClass(UMLClassifier *c) { if (forceSections() || atpub.count()) ada << getIndent() << "-- Accessors for public attributes:" << m_endl << m_endl; for (at = atpub.first(); at; at = atpub.next()) { - QString member = cleanName(at->getName()); + TQString member = cleanName(at->getName()); ada << getIndent() << "procedure Set_" << member << " ("; if (! at->getStatic()) ada << "Self : access " << name << "; "; @@ -374,7 +374,7 @@ void AdaWriter::writeClass(UMLClassifier *c) { for (UMLAssociation *a = aggregations.first(); a; a = aggregations.next()) { if (c != a->getObject(Uml::A)) continue; - QString typeName, roleName; + TQString typeName, roleName; computeAssocTypeAndRole(c, a, typeName, roleName); ada << getIndent() << roleName << " : " << typeName << ";" << m_endl; } @@ -385,7 +385,7 @@ void AdaWriter::writeClass(UMLClassifier *c) { for (UMLAssociation *a = compositions.first(); a; a = compositions.next()) { if (c != a->getObject(Uml::A)) continue; - QString typeName, roleName; + TQString typeName, roleName; computeAssocTypeAndRole(c, a, typeName, roleName); ada << getIndent() << roleName << " : " << typeName << ";" << m_endl; } @@ -468,9 +468,9 @@ void AdaWriter::writeClass(UMLClassifier *c) { } -void AdaWriter::writeOperation(UMLOperation *op, QTextStream &ada, bool is_comment) { +void AdaWriter::writeOperation(UMLOperation *op, TQTextStream &ada, bool is_comment) { UMLAttributeList atl = op->getParmList(); - QString rettype = op->getTypeName(); + TQString rettype = op->getTypeName(); bool use_procedure = (rettype.isEmpty() || rettype == "void"); ada << getIndent(); @@ -521,8 +521,8 @@ void AdaWriter::writeOperation(UMLOperation *op, QTextStream &ada, bool is_comme ada << ";" << m_endl << m_endl; } -QStringList AdaWriter::defaultDatatypes() { - QStringList l; +TQStringList AdaWriter::defaultDatatypes() { + TQStringList l; l.append("Boolean"); l.append("Character"); l.append("Positive"); @@ -543,11 +543,11 @@ QStringList AdaWriter::defaultDatatypes() { * * @param rPossiblyReservedKeyword The string to check. */ -bool AdaWriter::isReservedKeyword(const QString & rPossiblyReservedKeyword) { +bool AdaWriter::isReservedKeyword(const TQString & rPossiblyReservedKeyword) { - const QStringList keywords = reservedKeywords(); + const TQStringList keywords = reservedKeywords(); - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = keywords.begin(); it != keywords.end(); ++it) if ((*it).lower() == rPossiblyReservedKeyword.lower()) return true; @@ -558,9 +558,9 @@ bool AdaWriter::isReservedKeyword(const QString & rPossiblyReservedKeyword) { /** * get list of reserved keywords */ -const QStringList AdaWriter::reservedKeywords() const { +const TQStringList AdaWriter::reservedKeywords() const { - static QStringList keywords; + static TQStringList keywords; if ( keywords.isEmpty() ) { keywords.append( "abort" ); diff --git a/umbrello/umbrello/codegenerators/adawriter.h b/umbrello/umbrello/codegenerators/adawriter.h index ca5d9f67..779fc7d5 100644 --- a/umbrello/umbrello/codegenerators/adawriter.h +++ b/umbrello/umbrello/codegenerators/adawriter.h @@ -55,7 +55,7 @@ public: */ virtual Uml::Programming_Language getLanguage(); - QStringList defaultDatatypes(); + TQStringList defaultDatatypes(); /** * Check whether the given string is a reserved word for the @@ -64,12 +64,12 @@ public: * @param rPossiblyReservedKeyword The string to check. * @return true if the keyword is reserved */ - virtual bool isReservedKeyword(const QString & rPossiblyReservedKeyword); + virtual bool isReservedKeyword(const TQString & rPossiblyReservedKeyword); /** * get list of reserved keywords */ - virtual const QStringList reservedKeywords() const; + virtual const TQStringList reservedKeywords() const; private: @@ -78,7 +78,7 @@ private: * @param op the class for which we are generating code * @param ada the stream associated with the output file */ - void writeOperation (UMLOperation *op, QTextStream &ada, bool is_comment = false); + void writeOperation (UMLOperation *op, TQTextStream &ada, bool is_comment = false); /** * Compute the type and role name from the given association. @@ -90,15 +90,15 @@ private: */ void computeAssocTypeAndRole (UMLClassifier *c, UMLAssociation *a, - QString& typeName, QString& roleName); + TQString& typeName, TQString& roleName); bool isOOClass (UMLClassifier *c); - QString className(UMLClassifier *c, bool inOwnScope = true); + TQString className(UMLClassifier *c, bool inOwnScope = true); - QString packageName(UMLPackage *p); + TQString packageName(UMLPackage *p); - static const QString defaultPackageSuffix; + static const TQString defaultPackageSuffix; }; diff --git a/umbrello/umbrello/codegenerators/aswriter.cpp b/umbrello/umbrello/codegenerators/aswriter.cpp index ad55839d..e973a55e 100644 --- a/umbrello/umbrello/codegenerators/aswriter.cpp +++ b/umbrello/umbrello/codegenerators/aswriter.cpp @@ -21,8 +21,8 @@ #include "../attribute.h" #include <kdebug.h> -#include <qregexp.h> -#include <qtextstream.h> +#include <tqregexp.h> +#include <tqtextstream.h> ASWriter::ASWriter() { } @@ -38,8 +38,8 @@ void ASWriter::writeClass(UMLClassifier *c) return; } - QString classname = cleanName(c->getName()); - QString fileName = c->getName().lower(); + TQString classname = cleanName(c->getName()); + TQString fileName = c->getName().lower(); //find an appropriate name for our file fileName = findFileName(c,".as"); @@ -49,13 +49,13 @@ void ASWriter::writeClass(UMLClassifier *c) return; } - QFile fileas; + TQFile fileas; if(!openFile(fileas,fileName)) { emit codeGenerated(c, false); return; } - QTextStream as(&fileas); + TQTextStream as(&fileas); ////////////////////////////// //Start generating the code!! @@ -63,12 +63,12 @@ void ASWriter::writeClass(UMLClassifier *c) //try to find a heading file (license, coments, etc) - QString str; + TQString str; str = getHeadingFile(".as"); if(!str.isEmpty()) { - str.replace(QRegExp("%filename%"),fileName+".as"); - str.replace(QRegExp("%filepath%"),fileas.name()); + str.replace(TQRegExp("%filename%"),fileName+".as"); + str.replace(TQRegExp("%filepath%"),fileas.name()); as << str << m_endl; } @@ -78,7 +78,7 @@ void ASWriter::writeClass(UMLClassifier *c) findObjectsRelated(c,includes); for (UMLPackage *conc = includes.first(); conc; conc = includes.next()) { - QString headerName = findFileName(conc, ".as"); + TQString headerName = findFileName(conc, ".as"); if ( !headerName.isEmpty() ) { as << "#include \"" << findFileName(conc,".as") << "\"" << m_endl; @@ -126,7 +126,7 @@ void ASWriter::writeClass(UMLClassifier *c) UMLAttributeList atl = c->getAttributeList(); as << "/**" << m_endl; - QString temp = "_init sets all " + classname + + TQString temp = "_init sets all " + classname + " attributes to their default values. " + "Make sure to call this method within your class constructor"; as << formatDoc(temp, " * "); @@ -229,14 +229,14 @@ void ASWriter::writeClass(UMLClassifier *c) // Helper Methods -void ASWriter::writeAssociation(QString& classname, UMLAssociationList& assocList , QTextStream &as ) +void ASWriter::writeAssociation(TQString& classname, UMLAssociationList& assocList , TQTextStream &as ) { for(UMLAssociation *a = assocList.first(); a; a = assocList.next()) { // association side Uml::Role_Type role = a->getObject(Uml::A)->getName() == classname ? Uml::B:Uml::A; - QString roleName(cleanName(a->getRoleName(role))); + TQString roleName(cleanName(a->getRoleName(role))); if (!roleName.isEmpty()) { @@ -258,7 +258,7 @@ void ASWriter::writeAssociation(QString& classname, UMLAssociationList& assocLis int nMulti = a->getMulti(role).toInt(&okCvt,10); bool isNotMulti = a->getMulti(role).isEmpty() || (okCvt && nMulti == 1); - QString typeName(cleanName(a->getObject(role)->getName())); + TQString typeName(cleanName(a->getObject(role)->getName())); if (isNotMulti) as << m_indentation << "this.m_" << roleName << " = new " << typeName << "();" << m_endl; @@ -278,7 +278,7 @@ void ASWriter::writeAssociation(QString& classname, UMLAssociationList& assocLis } } -void ASWriter::writeOperations(QString classname, UMLOperationList *opList, QTextStream &as) +void ASWriter::writeOperations(TQString classname, UMLOperationList *opList, TQTextStream &as) { UMLOperation *op; UMLAttributeList atl; @@ -314,7 +314,7 @@ void ASWriter::writeOperations(QString classname, UMLOperationList *opList, QTex for (at = atl.first(); at; at = atl.next(),j++) { as << cleanName(at->getName()) - << (!(at->getInitialValue().isEmpty()) ? (QString(" = ")+at->getInitialValue()) : QString("")) + << (!(at->getInitialValue().isEmpty()) ? (TQString(" = ")+at->getInitialValue()) : TQString("")) << ((j < i-1)?", ":""); } as << ")" << m_endl << "{" << m_endl << @@ -330,9 +330,9 @@ Uml::Programming_Language ASWriter::getLanguage() { return Uml::pl_ActionScript; } -const QStringList ASWriter::reservedKeywords() const { +const TQStringList ASWriter::reservedKeywords() const { - static QStringList keywords; + static TQStringList keywords; if ( keywords.isEmpty() ) { keywords << "abs" diff --git a/umbrello/umbrello/codegenerators/aswriter.h b/umbrello/umbrello/codegenerators/aswriter.h index 51a4a922..75399f13 100644 --- a/umbrello/umbrello/codegenerators/aswriter.h +++ b/umbrello/umbrello/codegenerators/aswriter.h @@ -47,7 +47,7 @@ public: /** * get list of reserved keywords */ - virtual const QStringList reservedKeywords() const; + virtual const TQStringList reservedKeywords() const; private: @@ -64,7 +64,7 @@ private: * @param opList the list of operations * @param as output stream for the AS file */ - void writeOperations(QString classname, UMLOperationList *opList, QTextStream &as); + void writeOperations(TQString classname, UMLOperationList *opList, TQTextStream &as); /** * write a list of associations @@ -73,7 +73,7 @@ private: * @param assocList the list of associations * @param as output stream for the AS file */ - void writeAssociation(QString& classname, UMLAssociationList& assoclist , QTextStream &as); + void writeAssociation(TQString& classname, UMLAssociationList& assoclist , TQTextStream &as); }; diff --git a/umbrello/umbrello/codegenerators/classifierinfo.h b/umbrello/umbrello/codegenerators/classifierinfo.h index 53b7c02b..981dc8be 100644 --- a/umbrello/umbrello/codegenerators/classifierinfo.h +++ b/umbrello/umbrello/codegenerators/classifierinfo.h @@ -20,7 +20,7 @@ #include "../umlassociationlist.h" #include "../umlattributelist.h" -#include <qstring.h> +#include <tqstring.h> class UMLClassifier; @@ -90,8 +90,8 @@ public: /** * Class and File names */ - QString className; - QString fileName; + TQString className; + TQString fileName; /** * utility functions to allow easy determination of what classifiers diff --git a/umbrello/umbrello/codegenerators/codegen_utils.cpp b/umbrello/umbrello/codegenerators/codegen_utils.cpp index cb94cdde..dad11e14 100644 --- a/umbrello/umbrello/codegenerators/codegen_utils.cpp +++ b/umbrello/umbrello/codegenerators/codegen_utils.cpp @@ -17,8 +17,8 @@ namespace Codegen_Utils { -QStringList cppDatatypes() { - QStringList l; +TQStringList cppDatatypes() { + TQStringList l; l.append("int"); l.append("char"); l.append("bool"); @@ -33,9 +33,9 @@ QStringList cppDatatypes() { return l; } -const QStringList reservedCppKeywords() { +const TQStringList reservedCppKeywords() { - static QStringList keywords; + static TQStringList keywords; if (keywords.isEmpty()) { keywords.append( "and" ); @@ -404,8 +404,8 @@ void createCppStereotypes() { umldoc->findOrCreateStereotype("virtual"); } -QString capitalizeFirstLetter(const QString &string) { - QChar firstChar = string.at(0); +TQString capitalizeFirstLetter(const TQString &string) { + TQChar firstChar = string.at(0); return firstChar.upper() + string.mid(1); } diff --git a/umbrello/umbrello/codegenerators/codegen_utils.h b/umbrello/umbrello/codegenerators/codegen_utils.h index aaa7d117..e84c61e1 100644 --- a/umbrello/umbrello/codegenerators/codegen_utils.h +++ b/umbrello/umbrello/codegenerators/codegen_utils.h @@ -12,19 +12,19 @@ #ifndef CODEGEN_UTILS_H #define CODEGEN_UTILS_H -#include <qstringlist.h> +#include <tqstringlist.h> namespace Codegen_Utils { /** * Return list of C++ datatypes */ -QStringList cppDatatypes(); +TQStringList cppDatatypes(); /** * Get list of C++ reserved keywords */ -const QStringList reservedCppKeywords(); +const TQStringList reservedCppKeywords(); /** * Add C++ stereotypes @@ -34,7 +34,7 @@ void createCppStereotypes(); /** * Return the input string with the first letter capitalized. */ -QString capitalizeFirstLetter(const QString &string); +TQString capitalizeFirstLetter(const TQString &string); } diff --git a/umbrello/umbrello/codegenerators/codegenpolicyext.h b/umbrello/umbrello/codegenerators/codegenpolicyext.h index 97ace9f2..b9113c9d 100644 --- a/umbrello/umbrello/codegenerators/codegenpolicyext.h +++ b/umbrello/umbrello/codegenerators/codegenpolicyext.h @@ -12,7 +12,7 @@ #ifndef CODEGENPOLICYEXT_H #define CODEGENPOLICYEXT_H -#include <qobject.h> +#include <tqobject.h> class QWidget; class KConfig; @@ -27,7 +27,7 @@ class CodeGenerationPolicyPage; * Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org */ -class CodeGenPolicyExt : public QObject { +class CodeGenPolicyExt : public TQObject { public: CodeGenPolicyExt() {} virtual ~CodeGenPolicyExt() {} @@ -36,7 +36,7 @@ public: * Create a new dialog interface for this object. * @return dialog object */ - virtual CodeGenerationPolicyPage * createPage(QWidget *parent = 0, const char *name = 0) = 0; + virtual CodeGenerationPolicyPage * createPage(TQWidget *parent = 0, const char *name = 0) = 0; /** * set the defaults from a config file for this code generator from the passed KConfig pointer. diff --git a/umbrello/umbrello/codegenerators/cppcodeclassfield.cpp b/umbrello/umbrello/codegenerators/cppcodeclassfield.cpp index b6b2fb72..4742cd6d 100644 --- a/umbrello/umbrello/codegenerators/cppcodeclassfield.cpp +++ b/umbrello/umbrello/codegenerators/cppcodeclassfield.cpp @@ -54,7 +54,7 @@ CPPCodeClassField::~CPPCodeClassField ( ) { } // Other methods // -QString CPPCodeClassField::getFieldName() { +TQString CPPCodeClassField::getFieldName() { if (parentIsAttribute()) { UMLAttribute * at = (UMLAttribute*) getParentObject(); @@ -63,7 +63,7 @@ QString CPPCodeClassField::getFieldName() { else { UMLRole * role = (UMLRole*) getParentObject(); - QString roleName = role->getName(); + TQString roleName = role->getName(); if(fieldIsSingleValue()) { return roleName.replace(0, 1, roleName.left(1).lower()); } else { @@ -72,13 +72,13 @@ QString CPPCodeClassField::getFieldName() { } } -QString CPPCodeClassField::getListFieldClassName () { +TQString CPPCodeClassField::getListFieldClassName () { CodeGenPolicyExt * p = UMLApp::app()->getPolicyExt(); CPPCodeGenerationPolicy *policy = dynamic_cast<CPPCodeGenerationPolicy*>(p); return policy->getVectorClassName(); } -QString CPPCodeClassField::getInitialValue() { +TQString CPPCodeClassField::getInitialValue() { if (parentIsAttribute()) { diff --git a/umbrello/umbrello/codegenerators/cppcodeclassfield.h b/umbrello/umbrello/codegenerators/cppcodeclassfield.h index d9c20255..929e5178 100644 --- a/umbrello/umbrello/codegenerators/cppcodeclassfield.h +++ b/umbrello/umbrello/codegenerators/cppcodeclassfield.h @@ -19,7 +19,7 @@ #ifndef CPPCODECLASSFIELD_H #define CPPCODECLASSFIELD_H -#include <qstring.h> +#include <tqstring.h> #include "../codeclassfield.h" @@ -44,13 +44,13 @@ public: */ virtual ~CPPCodeClassField ( ); - QString getFieldType(); - QString getFieldName(); - QString getInitialValue(); + TQString getFieldType(); + TQString getFieldName(); + TQString getInitialValue(); /** get the name of the class which holds lists, e.g. "QPtrlist" or * "Vector" or "List" and so on. */ - QString getListFieldClassName(); + TQString getListFieldClassName(); protected: diff --git a/umbrello/umbrello/codegenerators/cppcodecomment.cpp b/umbrello/umbrello/codegenerators/cppcodecomment.cpp index 8d480e93..d0e386c0 100644 --- a/umbrello/umbrello/codegenerators/cppcodecomment.cpp +++ b/umbrello/umbrello/codegenerators/cppcodecomment.cpp @@ -19,12 +19,12 @@ #include "cppcodecomment.h" // qt/kde includes -#include <qregexp.h> +#include <tqregexp.h> // Constructors/Destructors // -CPPCodeComment::CPPCodeComment ( CodeDocument * doc, const QString & text ) +CPPCodeComment::CPPCodeComment ( CodeDocument * doc, const TQString & text ) : CodeComment (doc, text) { @@ -50,8 +50,8 @@ CPPCodeComment::~CPPCodeComment ( ) { } /** * Save the XMI representation of this object */ -void CPPCodeComment::saveToXMI ( QDomDocument & doc, QDomElement & root ) { - QDomElement blockElement = doc.createElement( "cppcodecomment" ); +void CPPCodeComment::saveToXMI ( TQDomDocument & doc, TQDomElement & root ) { + TQDomElement blockElement = doc.createElement( "cppcodecomment" ); setAttributesOnNode(doc, blockElement); // as we added no additional fields to this class we may // just use parent TextBlock method root.appendChild( blockElement ); @@ -60,38 +60,38 @@ void CPPCodeComment::saveToXMI ( QDomDocument & doc, QDomElement & root ) { /** * @return QString */ -QString CPPCodeComment::toString ( ) +TQString CPPCodeComment::toString ( ) { - QString output = ""; + TQString output = ""; // simple output method if(getWriteOutText()) { - QString indent = getIndentationString(); - QString endLine = getNewLineEndingChars(); + TQString indent = getIndentationString(); + TQString endLine = getNewLineEndingChars(); output.append(formatMultiLineText (getText()+endLine, indent +"// ", endLine)); } return output; } -QString CPPCodeComment::getNewEditorLine ( int amount ) { - QString line = getIndentationString(amount) + "// "; +TQString CPPCodeComment::getNewEditorLine ( int amount ) { + TQString line = getIndentationString(amount) + "// "; return line; } /** UnFormat a long text string. Typically, this means removing * the indentaion (linePrefix) and/or newline chars from each line. */ -QString CPPCodeComment::unformatText ( const QString & text , const QString & indent) +TQString CPPCodeComment::unformatText ( const TQString & text , const TQString & indent) { // remove leading or trailing comment stuff - QString mytext = TextBlock::unformatText(text, indent); + TQString mytext = TextBlock::unformatText(text, indent); // now leading slashes - mytext.remove(QRegExp("^\\/\\/\\s*")); + mytext.remove(TQRegExp("^\\/\\/\\s*")); return mytext; } diff --git a/umbrello/umbrello/codegenerators/cppcodecomment.h b/umbrello/umbrello/codegenerators/cppcodecomment.h index 085e1a7f..28fb4004 100644 --- a/umbrello/umbrello/codegenerators/cppcodecomment.h +++ b/umbrello/umbrello/codegenerators/cppcodecomment.h @@ -18,7 +18,7 @@ #ifndef CPPCODECOMMENT_H #define CPPCODECOMMENT_H -#include <qstring.h> +#include <tqstring.h> #include "../codecomment.h" /** @@ -40,7 +40,7 @@ public: /** * Constructors */ - explicit CPPCodeComment ( CodeDocument * doc, const QString & text = ""); + explicit CPPCodeComment ( CodeDocument * doc, const TQString & text = ""); /** * Empty Destructor @@ -56,23 +56,23 @@ public: /** * Save the XMI representation of this object */ - virtual void saveToXMI ( QDomDocument & doc, QDomElement & root ); + virtual void saveToXMI ( TQDomDocument & doc, TQDomElement & root ); /** * @return QString */ - QString toString ( ); + TQString toString ( ); /** UnFormat a long text string. Typically, this means removing * the indentaion (linePrefix) and/or newline chars from each line. */ - virtual QString unformatText ( const QString & text, const QString & indent = "" ); + virtual TQString unformatText ( const TQString & text, const TQString & indent = "" ); /** a special version here because we want to not only indent * the new line, but to add the "//" sequence as well. */ - virtual QString getNewEditorLine ( int amount ); + virtual TQString getNewEditorLine ( int amount ); protected: diff --git a/umbrello/umbrello/codegenerators/cppcodedocumentation.cpp b/umbrello/umbrello/codegenerators/cppcodedocumentation.cpp index 833e648e..6328fd3b 100644 --- a/umbrello/umbrello/codegenerators/cppcodedocumentation.cpp +++ b/umbrello/umbrello/codegenerators/cppcodedocumentation.cpp @@ -17,7 +17,7 @@ // own header #include "cppcodedocumentation.h" // qt/kde includes -#include <qregexp.h> +#include <tqregexp.h> #include <kdebug.h> // app includes #include "../codedocument.h" @@ -28,7 +28,7 @@ // Constructors/Destructors // -CPPCodeDocumentation::CPPCodeDocumentation ( CodeDocument * doc, const QString & text ) +CPPCodeDocumentation::CPPCodeDocumentation ( CodeDocument * doc, const TQString & text ) : CodeComment (doc, text) { @@ -50,8 +50,8 @@ CPPCodeDocumentation::~CPPCodeDocumentation ( ) { } /** * Save the XMI representation of this object */ -void CPPCodeDocumentation::saveToXMI ( QDomDocument & doc, QDomElement & root ) { - QDomElement blockElement = doc.createElement( "cppcodedocumentation" ); +void CPPCodeDocumentation::saveToXMI ( TQDomDocument & doc, TQDomElement & root ) { + TQDomElement blockElement = doc.createElement( "cppcodedocumentation" ); setAttributesOnNode(doc, blockElement); // as we added no additional fields to this class we may // just use parent TextBlock method root.appendChild( blockElement ); @@ -60,10 +60,10 @@ void CPPCodeDocumentation::saveToXMI ( QDomDocument & doc, QDomElement & root ) /** * @return QString */ -QString CPPCodeDocumentation::toString ( ) +TQString CPPCodeDocumentation::toString ( ) { - QString output = ""; + TQString output = ""; // simple output method if(getWriteOutText()) @@ -75,9 +75,9 @@ QString CPPCodeDocumentation::toString ( ) if(p->getCommentStyle() == CodeGenerationPolicy::MultiLine) useDoubleDashOutput = false; - QString indent = getIndentationString(); - QString endLine = getNewLineEndingChars(); - QString body = getText(); + TQString indent = getIndentationString(); + TQString endLine = getNewLineEndingChars(); + TQString body = getText(); if(useDoubleDashOutput) { if(!body.isEmpty()) @@ -92,7 +92,7 @@ QString CPPCodeDocumentation::toString ( ) return output; } -QString CPPCodeDocumentation::getNewEditorLine ( int amount ) +TQString CPPCodeDocumentation::getNewEditorLine ( int amount ) { CodeGenerationPolicy * p = UMLApp::app()->getCommonPolicy(); if(p->getCommentStyle() == CodeGenerationPolicy::MultiLine) @@ -120,20 +120,20 @@ int CPPCodeDocumentation::lastEditableLine() { /** UnFormat a long text string. Typically, this means removing * the indentaion (linePrefix) and/or newline chars from each line. */ -QString CPPCodeDocumentation::unformatText ( const QString & text , const QString & indent) +TQString CPPCodeDocumentation::unformatText ( const TQString & text , const TQString & indent) { - QString mytext = TextBlock::unformatText(text, indent); + TQString mytext = TextBlock::unformatText(text, indent); CodeGenerationPolicy * p = UMLApp::app()->getCommonPolicy(); // remove leading or trailing comment stuff - mytext.remove(QRegExp('^'+indent)); + mytext.remove(TQRegExp('^'+indent)); if(p->getCommentStyle() == CodeGenerationPolicy::MultiLine) { - mytext.remove(QRegExp("^\\/\\*\\*\\s*\n?")); - mytext.remove(QRegExp("\\s*\\*\\/\\s*\n?$")); - mytext.remove(QRegExp("^\\s*\\*\\s*")); + mytext.remove(TQRegExp("^\\/\\*\\*\\s*\n?")); + mytext.remove(TQRegExp("\\s*\\*\\/\\s*\n?$")); + mytext.remove(TQRegExp("^\\s*\\*\\s*")); } else - mytext.remove(QRegExp("^\\/\\/\\s*")); + mytext.remove(TQRegExp("^\\/\\/\\s*")); return mytext; } diff --git a/umbrello/umbrello/codegenerators/cppcodedocumentation.h b/umbrello/umbrello/codegenerators/cppcodedocumentation.h index 79bc4fe0..505fc8bb 100644 --- a/umbrello/umbrello/codegenerators/cppcodedocumentation.h +++ b/umbrello/umbrello/codegenerators/cppcodedocumentation.h @@ -19,7 +19,7 @@ #ifndef CPPCODEDOCUMENTATION_H #define CPPCODEDOCUMENTATION_H -#include <qstring.h> +#include <tqstring.h> #include "../codecomment.h" class CodeDocument; @@ -42,7 +42,7 @@ public: /** * Constructors */ - explicit CPPCodeDocumentation ( CodeDocument * doc, const QString & text = ""); + explicit CPPCodeDocumentation ( CodeDocument * doc, const TQString & text = ""); /** * Empty Destructor @@ -58,23 +58,23 @@ public: /** * Save the XMI representation of this object */ - virtual void saveToXMI ( QDomDocument & doc, QDomElement & root ); + virtual void saveToXMI ( TQDomDocument & doc, TQDomElement & root ); /** * @return QString */ - QString toString ( ); + TQString toString ( ); /** UnFormat a long text string. Typically, this means removing * the indentaion (linePrefix) and/or newline chars from each line. */ - virtual QString unformatText ( const QString & text, const QString & indent = "" ); + virtual TQString unformatText ( const TQString & text, const TQString & indent = "" ); /** a special version here because we want to not only indent * the new line, but to add the " * " sequence as well. */ - virtual QString getNewEditorLine ( int amount ); + virtual TQString getNewEditorLine ( int amount ); /** Ush. These are terrifically bad and must one day go away. * Both methods indicate the range of lines in this textblock diff --git a/umbrello/umbrello/codegenerators/cppcodegenerationform.cpp b/umbrello/umbrello/codegenerators/cppcodegenerationform.cpp index a4acf713..f5d8ec42 100644 --- a/umbrello/umbrello/codegenerators/cppcodegenerationform.cpp +++ b/umbrello/umbrello/codegenerators/cppcodegenerationform.cpp @@ -18,9 +18,9 @@ #include "cppcodegenerationform.h" // qt/kde includes -#include <qlabel.h> -#include <qregexp.h> -#include <qlistview.h> +#include <tqlabel.h> +#include <tqregexp.h> +#include <tqlistview.h> #include <kfiledialog.h> #include <kdebug.h> #include <klocale.h> @@ -28,38 +28,38 @@ #include <kmessagebox.h> -CPPCodeGenerationForm::CPPCodeGenerationForm( QWidget *parent, const char *name ) +CPPCodeGenerationForm::CPPCodeGenerationForm( TQWidget *parent, const char *name ) : CPPCodeGenerationFormBase (parent,name) { init(); GeneralOptionsListView->addColumn(tr2i18n("General Options")); - pOptionPackageIsANamespace = new QCheckListItem( GeneralOptionsListView, + pOptionPackageIsANamespace = new TQCheckListItem( GeneralOptionsListView, tr2i18n("Package is a namespace"), - QCheckListItem::CheckBox ); - pOptionVirtualDestructors = new QCheckListItem( GeneralOptionsListView, + TQCheckListItem::CheckBox ); + pOptionVirtualDestructors = new TQCheckListItem( GeneralOptionsListView, tr2i18n("Virtual destructors"), - QCheckListItem::CheckBox ); - pOptionGenerateEmptyConstructors = new QCheckListItem( GeneralOptionsListView, + TQCheckListItem::CheckBox ); + pOptionGenerateEmptyConstructors = new TQCheckListItem( GeneralOptionsListView, tr2i18n("Generate empty constructors"), - QCheckListItem::CheckBox ); - pOptionGenerateAccessorMethods = new QCheckListItem( GeneralOptionsListView, + TQCheckListItem::CheckBox ); + pOptionGenerateAccessorMethods = new TQCheckListItem( GeneralOptionsListView, tr2i18n("Generate accessor methods"), - QCheckListItem::CheckBox ); - pOptionOperationsAreInline = new QCheckListItem( GeneralOptionsListView, + TQCheckListItem::CheckBox ); + pOptionOperationsAreInline = new TQCheckListItem( GeneralOptionsListView, tr2i18n("Operations are inline"), - QCheckListItem::CheckBox ); - pOptionAccessorsAreInline = new QCheckListItem( GeneralOptionsListView, + TQCheckListItem::CheckBox ); + pOptionAccessorsAreInline = new TQCheckListItem( GeneralOptionsListView, tr2i18n("Accessors are inline"), - QCheckListItem::CheckBox ); + TQCheckListItem::CheckBox ); - pOptionAccessorsArePublic = new QCheckListItem( GeneralOptionsListView, + pOptionAccessorsArePublic = new TQCheckListItem( GeneralOptionsListView, tr2i18n("Accessors are public"), - QCheckListItem::CheckBox ); + TQCheckListItem::CheckBox ); connect(GeneralOptionsListView, - SIGNAL(clicked(QListViewItem *)), this, - SLOT(generalOptionsListViewClicked(QListViewItem *)) + TQT_SIGNAL(clicked(TQListViewItem *)), this, + TQT_SLOT(generalOptionsListViewClicked(TQListViewItem *)) ); } @@ -70,8 +70,8 @@ CPPCodeGenerationForm::~CPPCodeGenerationForm() void CPPCodeGenerationForm::browseClicked() { - QString button = sender()->name(); - QString file = KFileDialog::getOpenFileName( QString::null, "*.h", this, "Get Header File"); + TQString button = sender()->name(); + TQString file = KFileDialog::getOpenFileName( TQString::null, "*.h", this, "Get Header File"); if(file.isEmpty()) return; @@ -86,7 +86,7 @@ void CPPCodeGenerationForm::browseClicked() } } -void CPPCodeGenerationForm::generalOptionsListViewClicked(QListViewItem *pSender) { +void CPPCodeGenerationForm::generalOptionsListViewClicked(TQListViewItem *pSender) { // operations are inline and accessors are operations :) if (pOptionOperationsAreInline->isOn() && pOptionGenerateAccessorMethods->isOn()) diff --git a/umbrello/umbrello/codegenerators/cppcodegenerationform.h b/umbrello/umbrello/codegenerators/cppcodegenerationform.h index 73441a82..68cbea1f 100644 --- a/umbrello/umbrello/codegenerators/cppcodegenerationform.h +++ b/umbrello/umbrello/codegenerators/cppcodegenerationform.h @@ -30,7 +30,7 @@ public: /** * std ctor */ - explicit CPPCodeGenerationForm (QWidget *parent=0, const char *name=0); + explicit CPPCodeGenerationForm (TQWidget *parent=0, const char *name=0); /** * std dtor @@ -124,20 +124,20 @@ public slots: virtual void browseClicked(); private slots: - virtual void generalOptionsListViewClicked(QListViewItem *); + virtual void generalOptionsListViewClicked(TQListViewItem *); private: /* * check boxes for the available options */ - QCheckListItem *pOptionPackageIsANamespace; - QCheckListItem *pOptionVirtualDestructors; - QCheckListItem *pOptionGenerateEmptyConstructors; - QCheckListItem *pOptionGenerateAccessorMethods; - QCheckListItem *pOptionOperationsAreInline; - QCheckListItem *pOptionAccessorsAreInline; - QCheckListItem *pOptionAccessorsArePublic; + TQCheckListItem *pOptionPackageIsANamespace; + TQCheckListItem *pOptionVirtualDestructors; + TQCheckListItem *pOptionGenerateEmptyConstructors; + TQCheckListItem *pOptionGenerateAccessorMethods; + TQCheckListItem *pOptionOperationsAreInline; + TQCheckListItem *pOptionAccessorsAreInline; + TQCheckListItem *pOptionAccessorsArePublic; /** * initialize all attributes diff --git a/umbrello/umbrello/codegenerators/cppcodegenerationpolicy.cpp b/umbrello/umbrello/codegenerators/cppcodegenerationpolicy.cpp index d0359603..8aec0351 100644 --- a/umbrello/umbrello/codegenerators/cppcodegenerationpolicy.cpp +++ b/umbrello/umbrello/codegenerators/cppcodegenerationpolicy.cpp @@ -17,7 +17,7 @@ // own header #include "cppcodegenerationpolicy.h" // qt/kde includes -#include <qregexp.h> +#include <tqregexp.h> #include <kdebug.h> #include <kconfig.h> // app includes @@ -166,38 +166,38 @@ bool CPPCodeGenerationPolicy::getAutoGenerateAccessors( ){ return m_autoGenerateAccessors; } -QString CPPCodeGenerationPolicy::getStringClassName() { +TQString CPPCodeGenerationPolicy::getStringClassName() { return m_stringClassName; } -QString CPPCodeGenerationPolicy::getStringClassNameInclude() { +TQString CPPCodeGenerationPolicy::getStringClassNameInclude() { return m_stringClassNameInclude; } -QString CPPCodeGenerationPolicy::getVectorClassName() { +TQString CPPCodeGenerationPolicy::getVectorClassName() { return m_vectorClassName; } -QString CPPCodeGenerationPolicy::getVectorClassNameInclude() { +TQString CPPCodeGenerationPolicy::getVectorClassNameInclude() { return m_vectorClassNameInclude; } -void CPPCodeGenerationPolicy::setStringClassName(const QString &value) { +void CPPCodeGenerationPolicy::setStringClassName(const TQString &value) { m_stringClassName = value; UMLApp::app()->getCommonPolicy()->emitModifiedCodeContentSig(); } -void CPPCodeGenerationPolicy::setStringClassNameInclude(const QString &value) { +void CPPCodeGenerationPolicy::setStringClassNameInclude(const TQString &value) { m_stringClassNameInclude = value; UMLApp::app()->getCommonPolicy()->emitModifiedCodeContentSig(); } -void CPPCodeGenerationPolicy::setVectorClassName(const QString &value) { +void CPPCodeGenerationPolicy::setVectorClassName(const TQString &value) { m_vectorClassName = value; UMLApp::app()->getCommonPolicy()->emitModifiedCodeContentSig(); } -void CPPCodeGenerationPolicy::setVectorClassNameInclude(const QString &value) { +void CPPCodeGenerationPolicy::setVectorClassNameInclude(const TQString &value) { m_vectorClassNameInclude = value; UMLApp::app()->getCommonPolicy()->emitModifiedCodeContentSig(); } @@ -221,43 +221,43 @@ void CPPCodeGenerationPolicy::setVectorIncludeIsGlobal(bool value) { UMLApp::app()->getCommonPolicy()->emitModifiedCodeContentSig(); } -QString CPPCodeGenerationPolicy::getVectorMethodAppend(const QString & variableName, const QString & itemClassName) { - QString value = m_vectorMethodAppendBase; +TQString CPPCodeGenerationPolicy::getVectorMethodAppend(const TQString & variableName, const TQString & itemClassName) { + TQString value = m_vectorMethodAppendBase; if(!variableName.isEmpty()) - value.replace(QRegExp("%VARNAME%"),variableName); - value.replace(QRegExp("%VECTORTYPENAME%"), m_vectorClassName); + value.replace(TQRegExp("%VARNAME%"),variableName); + value.replace(TQRegExp("%VECTORTYPENAME%"), m_vectorClassName); if(!itemClassName.isEmpty()) - value.replace(QRegExp("%ITEMCLASS%"),itemClassName); + value.replace(TQRegExp("%ITEMCLASS%"),itemClassName); return value; } -QString CPPCodeGenerationPolicy::getVectorMethodRemove(const QString & variableName, const QString & itemClassName) { - QString value = m_vectorMethodRemoveBase; +TQString CPPCodeGenerationPolicy::getVectorMethodRemove(const TQString & variableName, const TQString & itemClassName) { + TQString value = m_vectorMethodRemoveBase; if(!variableName.isEmpty()) - value.replace(QRegExp("%VARNAME%"),variableName); - value.replace(QRegExp("%VECTORTYPENAME%"), m_vectorClassName); + value.replace(TQRegExp("%VARNAME%"),variableName); + value.replace(TQRegExp("%VECTORTYPENAME%"), m_vectorClassName); if(!itemClassName.isEmpty()) - value.replace(QRegExp("%ITEMCLASS%"),itemClassName); + value.replace(TQRegExp("%ITEMCLASS%"),itemClassName); return value; } -QString CPPCodeGenerationPolicy::getVectorMethodInit(const QString & variableName, const QString & itemClassName) { - QString value = m_vectorMethodInitBase; +TQString CPPCodeGenerationPolicy::getVectorMethodInit(const TQString & variableName, const TQString & itemClassName) { + TQString value = m_vectorMethodInitBase; if(!variableName.isEmpty()) - value.replace(QRegExp("%VARNAME%"),variableName); - value.replace(QRegExp("%VECTORTYPENAME%"), m_vectorClassName); + value.replace(TQRegExp("%VARNAME%"),variableName); + value.replace(TQRegExp("%VECTORTYPENAME%"), m_vectorClassName); if(!itemClassName.isEmpty()) - value.replace(QRegExp("%ITEMCLASS%"),itemClassName); + value.replace(TQRegExp("%ITEMCLASS%"),itemClassName); return value; } -QString CPPCodeGenerationPolicy::getObjectMethodInit(const QString & variableName, const QString & itemClassName) { - QString value = m_objectMethodInitBase; +TQString CPPCodeGenerationPolicy::getObjectMethodInit(const TQString & variableName, const TQString & itemClassName) { + TQString value = m_objectMethodInitBase; if(!variableName.isEmpty()) - value.replace(QRegExp("%VARNAME%"),variableName); - value.replace(QRegExp("%VECTORTYPENAME%"), m_vectorClassName); + value.replace(TQRegExp("%VARNAME%"),variableName); + value.replace(TQRegExp("%VECTORTYPENAME%"), m_vectorClassName); if(!itemClassName.isEmpty()) - value.replace(QRegExp("%ITEMCLASS%"),itemClassName); + value.replace(TQRegExp("%ITEMCLASS%"),itemClassName); return value; } @@ -359,7 +359,7 @@ void CPPCodeGenerationPolicy::setDefaults( KConfig * config, bool emitUpdateSign * Create a new dialog interface for this object. * @return dialog object */ -CodeGenerationPolicyPage * CPPCodeGenerationPolicy::createPage ( QWidget *parent, const char *name ) { +CodeGenerationPolicyPage * CPPCodeGenerationPolicy::createPage ( TQWidget *parent, const char *name ) { return new CPPCodeGenerationPolicyPage ( parent, name, this ); } diff --git a/umbrello/umbrello/codegenerators/cppcodegenerationpolicy.h b/umbrello/umbrello/codegenerators/cppcodegenerationpolicy.h index cda5d1f8..69d3490f 100644 --- a/umbrello/umbrello/codegenerators/cppcodegenerationpolicy.h +++ b/umbrello/umbrello/codegenerators/cppcodegenerationpolicy.h @@ -17,7 +17,7 @@ #ifndef CPPCODEGENERATIONPOLICY_H #define CPPCODEGENERATIONPOLICY_H -#include <qstring.h> +#include <tqstring.h> #include "codegenpolicyext.h" #include "../codegenerationpolicy.h" @@ -142,20 +142,20 @@ public: * of the CPP code. In the next 4 methods, we give accessors that allow getting * the names of the classes, and their include files for string and vectors. */ - QString getStringClassName(); - QString getStringClassNameInclude(); - QString getVectorClassName(); - QString getVectorClassNameInclude(); + TQString getStringClassName(); + TQString getStringClassNameInclude(); + TQString getVectorClassName(); + TQString getVectorClassNameInclude(); /** determine if the string include is global one */ bool stringIncludeIsGlobal (); bool vectorIncludeIsGlobal (); /** also allow setting these parameters! */ - void setStringClassName(const QString &value); - void setStringClassNameInclude(const QString &value); - void setVectorClassName(const QString &value); - void setVectorClassNameInclude(const QString &value); + void setStringClassName(const TQString &value); + void setStringClassNameInclude(const TQString &value); + void setVectorClassName(const TQString &value); + void setVectorClassNameInclude(const TQString &value); /** allow setting of these params */ void setStringIncludeIsGlobal (bool value); @@ -164,14 +164,14 @@ public: /** More flexible generation. We want to allow the user to specify how the * bodies of the vector methods should be auto-generated. */ - QString getVectorMethodAppend(const QString & variableName ="", const QString & itemClassName = ""); - QString getVectorMethodRemove(const QString & variableName ="", const QString & itemClassName = ""); - QString getVectorMethodInit(const QString & variableName ="", const QString & itemClassName = ""); + TQString getVectorMethodAppend(const TQString & variableName ="", const TQString & itemClassName = ""); + TQString getVectorMethodRemove(const TQString & variableName ="", const TQString & itemClassName = ""); + TQString getVectorMethodInit(const TQString & variableName ="", const TQString & itemClassName = ""); /** Be somewhat flexible about how new object classes are initialized. * Not sure if this should be user configureable. For now, it isnt. */ - QString getObjectMethodInit(const QString & variableName ="", const QString & itemClassName = ""); + TQString getObjectMethodInit(const TQString & variableName ="", const TQString & itemClassName = ""); /** * set the defaults for this code generator from the passed generator. @@ -192,7 +192,7 @@ public: * Create a new dialog interface for this object. * @return dialog object */ - CodeGenerationPolicyPage * createPage ( QWidget *parent = 0, const char * name = 0); + CodeGenerationPolicyPage * createPage ( TQWidget *parent = 0, const char * name = 0); protected: @@ -213,14 +213,14 @@ private: bool m_stringIncludeIsGlobal; bool m_vectorIncludeIsGlobal; - QString m_stringClassName; - QString m_stringClassNameInclude; - QString m_vectorClassName; - QString m_vectorClassNameInclude; - QString m_vectorMethodAppendBase; - QString m_vectorMethodRemoveBase; - QString m_vectorMethodInitBase; - QString m_objectMethodInitBase; + TQString m_stringClassName; + TQString m_stringClassNameInclude; + TQString m_vectorClassName; + TQString m_vectorClassNameInclude; + TQString m_vectorMethodAppendBase; + TQString m_vectorMethodRemoveBase; + TQString m_vectorMethodInitBase; + TQString m_objectMethodInitBase; }; diff --git a/umbrello/umbrello/codegenerators/cppcodegenerationpolicypage.cpp b/umbrello/umbrello/codegenerators/cppcodegenerationpolicypage.cpp index f05833dc..60d37bac 100644 --- a/umbrello/umbrello/codegenerators/cppcodegenerationpolicypage.cpp +++ b/umbrello/umbrello/codegenerators/cppcodegenerationpolicypage.cpp @@ -19,14 +19,14 @@ // qt/kde includes #include <kdebug.h> #include <klocale.h> -#include <qlabel.h> +#include <tqlabel.h> #include <kcombobox.h> -#include <qcheckbox.h> +#include <tqcheckbox.h> // app includes #include "cppcodegenerationformbase.h" #include "../uml.h" -CPPCodeGenerationPolicyPage::CPPCodeGenerationPolicyPage( QWidget *parent, const char *name, CPPCodeGenerationPolicy * policy ) +CPPCodeGenerationPolicyPage::CPPCodeGenerationPolicyPage( TQWidget *parent, const char *name, CPPCodeGenerationPolicy * policy ) : CodeGenerationPolicyPage(parent, name, policy) { CodeGenerationPolicy *common = UMLApp::app()->getCommonPolicy(); diff --git a/umbrello/umbrello/codegenerators/cppcodegenerationpolicypage.h b/umbrello/umbrello/codegenerators/cppcodegenerationpolicypage.h index a1d6633b..eb7aa9ce 100644 --- a/umbrello/umbrello/codegenerators/cppcodegenerationpolicypage.h +++ b/umbrello/umbrello/codegenerators/cppcodegenerationpolicypage.h @@ -30,7 +30,7 @@ class CPPCodeGenerationPolicyPage : public CodeGenerationPolicyPage { Q_OBJECT public: - explicit CPPCodeGenerationPolicyPage (QWidget *parent=0, const char *name=0, CPPCodeGenerationPolicy * policy = 0); + explicit CPPCodeGenerationPolicyPage (TQWidget *parent=0, const char *name=0, CPPCodeGenerationPolicy * policy = 0); virtual ~CPPCodeGenerationPolicyPage(); diff --git a/umbrello/umbrello/codegenerators/cppcodegenerator.cpp b/umbrello/umbrello/codegenerators/cppcodegenerator.cpp index 1130107b..b5c12dd6 100644 --- a/umbrello/umbrello/codegenerators/cppcodegenerator.cpp +++ b/umbrello/umbrello/codegenerators/cppcodegenerator.cpp @@ -18,7 +18,7 @@ #include "cppcodegenerator.h" // qt/kde includes -#include <qregexp.h> +#include <tqregexp.h> #include <kdebug.h> #include <kconfig.h> @@ -86,7 +86,7 @@ bool CPPCodeGenerator::getCreateProjectMakefile ( ) { bool CPPCodeGenerator::addHeaderCodeDocument ( CPPHeaderCodeDocument * doc ) { - QString tag = doc->getID(); + TQString tag = doc->getID(); // assign a tag if one doesn't already exist if(tag.isEmpty()) @@ -108,7 +108,7 @@ bool CPPCodeGenerator::addHeaderCodeDocument ( CPPHeaderCodeDocument * doc ) * Remove a header CodeDocument object from m_headercodedocumentVector List */ bool CPPCodeGenerator::removeHeaderCodeDocument ( CPPHeaderCodeDocument * remove_object ) { - QString tag = remove_object->getID(); + TQString tag = remove_object->getID(); if(!(tag.isEmpty())) m_codeDocumentDictionary.remove(tag); else @@ -120,7 +120,7 @@ bool CPPCodeGenerator::removeHeaderCodeDocument ( CPPHeaderCodeDocument * remove // In the C++ version, we need to make both source and header files as well // as the makefile available. -CodeViewerDialog * CPPCodeGenerator::getCodeViewerDialog ( QWidget* parent, CodeDocument *doc, +CodeViewerDialog * CPPCodeGenerator::getCodeViewerDialog ( TQWidget* parent, CodeDocument *doc, Settings::CodeViewerState state) { @@ -157,14 +157,14 @@ CodeViewerDialog * CPPCodeGenerator::getCodeViewerDialog ( QWidget* parent, Code // Change the following dataTypes to the ones the user really // wants in their code. Not yet complete. -QString CPPCodeGenerator::fixTypeName(const QString &string) +TQString CPPCodeGenerator::fixTypeName(const TQString &string) { return cleanName(string); } // special method needed so that we write out the header code documents -void CPPCodeGenerator::saveToXMI ( QDomDocument & doc, QDomElement & root ) { - QDomElement docElement = doc.createElement( "codegenerator" ); +void CPPCodeGenerator::saveToXMI ( TQDomDocument & doc, TQDomElement & root ) { + TQDomElement docElement = doc.createElement( "codegenerator" ); docElement.setAttribute("language", "C++"); CodeDocumentList * docList = getCodeDocumentList(); @@ -351,11 +351,11 @@ void CPPCodeGenerator::initAttributes ( ) //initFromParentDocument(); } -QStringList CPPCodeGenerator::defaultDatatypes() { +TQStringList CPPCodeGenerator::defaultDatatypes() { return Codegen_Utils::cppDatatypes(); } -const QStringList CPPCodeGenerator::reservedKeywords() const { +const TQStringList CPPCodeGenerator::reservedKeywords() const { return Codegen_Utils::reservedCppKeywords(); } diff --git a/umbrello/umbrello/codegenerators/cppcodegenerator.h b/umbrello/umbrello/codegenerators/cppcodegenerator.h index 7104d403..2290c6e3 100644 --- a/umbrello/umbrello/codegenerators/cppcodegenerator.h +++ b/umbrello/umbrello/codegenerators/cppcodegenerator.h @@ -18,7 +18,7 @@ #ifndef CPPCODEGENERATOR_H #define CPPCODEGENERATOR_H -#include <qstring.h> +#include <tqstring.h> #include "../codedocumentlist.h" #include "../codeviewerstate.h" #include "../codegenerator.h" @@ -65,7 +65,7 @@ public: // Public attribute accessor methods // - QString fixTypeName(const QString &string); + TQString fixTypeName(const TQString &string); /** * Add a header CodeDocument object from m_headercodedocumentVector List @@ -88,7 +88,7 @@ public: /** Get the editing dialog for this code document */ - virtual CodeViewerDialog * getCodeViewerDialog( QWidget* parent, CodeDocument * doc, + virtual CodeViewerDialog * getCodeViewerDialog( TQWidget* parent, CodeDocument * doc, Settings::CodeViewerState state); /** @@ -104,17 +104,17 @@ public: /** * Add C++ primitives as datatypes */ - QStringList defaultDatatypes(); + TQStringList defaultDatatypes(); /** * Save the XMI representation of this object */ - virtual void saveToXMI ( QDomDocument & doc, QDomElement & root ); + virtual void saveToXMI ( TQDomDocument & doc, TQDomElement & root ); /** * get list of reserved keywords */ - virtual const QStringList reservedKeywords() const; + virtual const TQStringList reservedKeywords() const; /** * Add the default stereotypes for c++ (constructor, int etc) diff --git a/umbrello/umbrello/codegenerators/cppheaderclassdeclarationblock.cpp b/umbrello/umbrello/codegenerators/cppheaderclassdeclarationblock.cpp index ea5612c9..868dea41 100644 --- a/umbrello/umbrello/codegenerators/cppheaderclassdeclarationblock.cpp +++ b/umbrello/umbrello/codegenerators/cppheaderclassdeclarationblock.cpp @@ -25,7 +25,7 @@ // CPPHeaderClassDeclarationBlock::CPPHeaderClassDeclarationBlock - ( CPPHeaderCodeDocument * parentDoc, const QString &startText, const QString &endText, const QString &comment) + ( CPPHeaderCodeDocument * parentDoc, const TQString &startText, const TQString &endText, const TQString &comment) : OwnedHierarchicalCodeBlock(parentDoc->getParentClassifier(), parentDoc, startText, endText, comment) { init(parentDoc, comment); @@ -40,7 +40,7 @@ CPPHeaderClassDeclarationBlock::~CPPHeaderClassDeclarationBlock ( ) { } /** * load params from the appropriate XMI element node. */ -void CPPHeaderClassDeclarationBlock::loadFromXMI ( QDomElement & root ) +void CPPHeaderClassDeclarationBlock::loadFromXMI ( TQDomElement & root ) { setAttributesFromNode(root); } @@ -55,8 +55,8 @@ void CPPHeaderClassDeclarationBlock::setAttributesFromObject (TextBlock * obj) /** * Save the XMI representation of this object */ -void CPPHeaderClassDeclarationBlock::saveToXMI ( QDomDocument & doc, QDomElement & root ) { - QDomElement blockElement = doc.createElement( "cppheaderclassdeclarationblock" ); +void CPPHeaderClassDeclarationBlock::saveToXMI ( TQDomDocument & doc, TQDomElement & root ) { + TQDomElement blockElement = doc.createElement( "cppheaderclassdeclarationblock" ); setAttributesOnNode(doc, blockElement); @@ -77,9 +77,9 @@ void CPPHeaderClassDeclarationBlock::updateContent ( ) CPPHeaderCodeDocument *parentDoc = dynamic_cast<CPPHeaderCodeDocument*>(getParentDocument()); UMLClassifier *c = parentDoc->getParentClassifier(); - QString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); + TQString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); bool isInterface = parentDoc->parentIsInterface(); // a little shortcut - QString CPPHeaderClassName = CodeGenerator::cleanName(c->getName()); + TQString CPPHeaderClassName = CodeGenerator::cleanName(c->getName()); bool forceDoc = UMLApp::app()->getCommonPolicy()->getCodeVerboseDocumentComments(); // COMMENT @@ -106,7 +106,7 @@ void CPPHeaderClassDeclarationBlock::updateContent ( ) // Now set START/ENDING Text - QString startText = ""; + TQString startText = ""; /* */ @@ -144,7 +144,7 @@ void CPPHeaderClassDeclarationBlock::updateContent ( ) } -void CPPHeaderClassDeclarationBlock::init (CPPHeaderCodeDocument *parentDoc, const QString &comment) +void CPPHeaderClassDeclarationBlock::init (CPPHeaderCodeDocument *parentDoc, const TQString &comment) { setComment(new CPPCodeDocumentation(parentDoc)); diff --git a/umbrello/umbrello/codegenerators/cppheaderclassdeclarationblock.h b/umbrello/umbrello/codegenerators/cppheaderclassdeclarationblock.h index 683f0475..0710560f 100644 --- a/umbrello/umbrello/codegenerators/cppheaderclassdeclarationblock.h +++ b/umbrello/umbrello/codegenerators/cppheaderclassdeclarationblock.h @@ -17,7 +17,7 @@ #ifndef CPPHEADERCLASSDECLARATIONBLOCK_H #define CPPHEADERCLASSDECLARATIONBLOCK_H -#include <qstring.h> +#include <tqstring.h> #include "cppheadercodedocument.h" #include "../ownedhierarchicalcodeblock.h" @@ -33,7 +33,7 @@ public: /** * Empty Constructor */ - explicit CPPHeaderClassDeclarationBlock ( CPPHeaderCodeDocument * parentDoc, const QString &start = "", const QString &endText = "}", const QString &comment = ""); + explicit CPPHeaderClassDeclarationBlock ( CPPHeaderCodeDocument * parentDoc, const TQString &start = "", const TQString &endText = "}", const TQString &comment = ""); /** * Empty Destructor @@ -43,9 +43,9 @@ public: /** * Save the XMI representation of this object */ - virtual void saveToXMI ( QDomDocument & doc, QDomElement & root ); + virtual void saveToXMI ( TQDomDocument & doc, TQDomElement & root ); - virtual void loadFromXMI ( QDomElement & root ); + virtual void loadFromXMI ( TQDomElement & root ); protected: @@ -60,7 +60,7 @@ protected: private: - void init (CPPHeaderCodeDocument * parent, const QString &comment); + void init (CPPHeaderCodeDocument * parent, const TQString &comment); }; diff --git a/umbrello/umbrello/codegenerators/cppheadercodeaccessormethod.cpp b/umbrello/umbrello/codegenerators/cppheadercodeaccessormethod.cpp index 0ab67b85..d96ad398 100644 --- a/umbrello/umbrello/codegenerators/cppheadercodeaccessormethod.cpp +++ b/umbrello/umbrello/codegenerators/cppheadercodeaccessormethod.cpp @@ -62,9 +62,9 @@ void CPPHeaderCodeAccessorMethod::updateContent( ) CPPCodeGenerationPolicy * policy = dynamic_cast<CPPCodeGenerationPolicy*>(pe); bool isInlineMethod = policy->getAccessorsAreInline( ); Uml::Visibility scope = parentField->getVisibility(); - QString variableName = cppfield->getFieldName(); - QString itemClassName = cppfield->getTypeName(); - QString text; + TQString variableName = cppfield->getFieldName(); + TQString itemClassName = cppfield->getTypeName(); + TQString text; if(isInlineMethod) { switch(getType()) { @@ -100,18 +100,18 @@ void CPPHeaderCodeAccessorMethod::updateMethodDeclaration() bool isInlineMethod = policy->getAccessorsAreInline( ); - QString vectorClassName = policy->getVectorClassName(); - QString fieldName = cppfield->getFieldName(); - QString fieldType = cppfield->getTypeName(); - QString objectType = cppfield->getListObjectType(); + TQString vectorClassName = policy->getVectorClassName(); + TQString fieldName = cppfield->getFieldName(); + TQString fieldType = cppfield->getTypeName(); + TQString objectType = cppfield->getListObjectType(); if(objectType.isEmpty()) objectType = fieldName; - QString methodReturnType = "void"; - QString methodName; - QString methodParams; - QString headerText; - QString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); + TQString methodReturnType = "void"; + TQString methodName; + TQString methodParams; + TQString headerText; + TQString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); switch(getType()) { case CodeAccessorMethod::ADD: @@ -152,12 +152,12 @@ void CPPHeaderCodeAccessorMethod::updateMethodDeclaration() setComment(header); // set start/end method text - QString startText = methodReturnType + ' ' + methodName + " (" + methodParams +')'; + TQString startText = methodReturnType + ' ' + methodName + " (" + methodParams +')'; if (isInlineMethod) startText += " {"; else startText += ';'; - QString endText = (isInlineMethod ? "}" : ""); + TQString endText = (isInlineMethod ? "}" : ""); setStartMethodText(startText); setEndMethodText(endText); diff --git a/umbrello/umbrello/codegenerators/cppheadercodeaccessormethod.h b/umbrello/umbrello/codegenerators/cppheadercodeaccessormethod.h index 7b39fc6d..dea417fc 100644 --- a/umbrello/umbrello/codegenerators/cppheadercodeaccessormethod.h +++ b/umbrello/umbrello/codegenerators/cppheadercodeaccessormethod.h @@ -18,7 +18,7 @@ #include "../codeaccessormethod.h" -#include <qstring.h> +#include <tqstring.h> class CodeClassField; diff --git a/umbrello/umbrello/codegenerators/cppheadercodeclassfielddeclarationblock.cpp b/umbrello/umbrello/codegenerators/cppheadercodeclassfielddeclarationblock.cpp index 0fdfeb0a..3f15d05b 100644 --- a/umbrello/umbrello/codegenerators/cppheadercodeclassfielddeclarationblock.cpp +++ b/umbrello/umbrello/codegenerators/cppheadercodeclassfielddeclarationblock.cpp @@ -50,7 +50,7 @@ void CPPHeaderCodeClassFieldDeclarationBlock::updateContent( ) CPPCodeClassField * hcppcf = dynamic_cast<CPPCodeClassField*>(cf); // Set the comment - QString notes = umlparent->getDoc(); + TQString notes = umlparent->getDoc(); getComment()->setText(notes); if(notes.isEmpty()) getComment()->setWriteOutText(false); @@ -59,15 +59,15 @@ void CPPHeaderCodeClassFieldDeclarationBlock::updateContent( ) // Set the body - QString staticValue = umlparent->getStatic() ? "static " : ""; - QString typeName = hcppcf->getTypeName(); - QString fieldName = hcppcf->getFieldName(); + TQString staticValue = umlparent->getStatic() ? "static " : ""; + TQString typeName = hcppcf->getTypeName(); + TQString fieldName = hcppcf->getFieldName(); // Ugh. Sloppy exception. if (!cf->parentIsAttribute() && !cf->fieldIsSingleValue()) typeName = hcppcf->getListFieldClassName(); - QString body = staticValue + ' ' + typeName + ' ' + fieldName + ';'; + TQString body = staticValue + ' ' + typeName + ' ' + fieldName + ';'; setText(body); diff --git a/umbrello/umbrello/codegenerators/cppheadercodeclassfielddeclarationblock.h b/umbrello/umbrello/codegenerators/cppheadercodeclassfielddeclarationblock.h index 755507c6..6a77047c 100644 --- a/umbrello/umbrello/codegenerators/cppheadercodeclassfielddeclarationblock.h +++ b/umbrello/umbrello/codegenerators/cppheadercodeclassfielddeclarationblock.h @@ -16,7 +16,7 @@ #ifndef CPPHEADERCODECLASSFIELDDECLARATIONBLOCK_H #define CPPHEADERCODECLASSFIELDDECLARATIONBLOCK_H -#include <qstring.h> +#include <tqstring.h> #include "../codeclassfielddeclarationblock.h" diff --git a/umbrello/umbrello/codegenerators/cppheadercodedocument.cpp b/umbrello/umbrello/codegenerators/cppheadercodedocument.cpp index fe909c5d..2c471667 100644 --- a/umbrello/umbrello/codegenerators/cppheadercodedocument.cpp +++ b/umbrello/umbrello/codegenerators/cppheadercodedocument.cpp @@ -30,7 +30,7 @@ #include "cppheadercodedocument.h" // qt/kde includes -#include <qregexp.h> +#include <tqregexp.h> #include <kdebug.h> // local includes @@ -106,25 +106,25 @@ CPPHeaderClassDeclarationBlock * CPPHeaderCodeDocument::getClassDecl() // is so we can create the CPPHeaderClassDeclarationBlock. // would be better if we could create a handler interface that each // codeblock used so all we have to do here is add the handler -void CPPHeaderCodeDocument::loadChildTextBlocksFromNode ( QDomElement & root) +void CPPHeaderCodeDocument::loadChildTextBlocksFromNode ( TQDomElement & root) { - QDomNode tnode = root.firstChild(); - QDomElement telement = tnode.toElement(); + TQDomNode tnode = root.firstChild(); + TQDomElement telement = tnode.toElement(); bool loadCheckForChildrenOK = false; while( !telement.isNull() ) { - QString nodeName = telement.tagName(); + TQString nodeName = telement.tagName(); if( nodeName == "textblocks" ) { - QDomNode node = telement.firstChild(); - QDomElement element = node.toElement(); + TQDomNode node = telement.firstChild(); + TQDomElement element = node.toElement(); // if there is nothing to begin with, then we don't worry about it loadCheckForChildrenOK = element.isNull() ? true : false; while( !element.isNull() ) { - QString name = element.tagName(); + TQString name = element.tagName(); if( name == "codecomment" ) { CodeComment * block = new CPPCodeDocumentation(this); @@ -139,7 +139,7 @@ void CPPHeaderCodeDocument::loadChildTextBlocksFromNode ( QDomElement & root) if( name == "codeaccessormethod" || name == "ccfdeclarationcodeblock" ) { - QString acctag = element.attribute("tag",""); + TQString acctag = element.attribute("tag",""); // search for our method in the TextBlock * tb = findCodeClassFieldTextBlockByTag(acctag); if(!tb || !addTextBlock(tb)) @@ -185,7 +185,7 @@ void CPPHeaderCodeDocument::loadChildTextBlocksFromNode ( QDomElement & root) } else if( name == "codeoperation" ) { // find the code operation by id - QString id = element.attribute("parent_id","-1"); + TQString id = element.attribute("parent_id","-1"); UMLObject * obj = UMLApp::app()->getDocument()->findObjectById(STR2ID(id)); UMLOperation * op = dynamic_cast<UMLOperation*>(obj); if(op) { @@ -315,9 +315,9 @@ bool CPPHeaderCodeDocument::addCodeOperation (CodeOperation * op ) * @return bool status of save */ /* -void CPPHeaderCodeDocument::saveToXMI ( QDomDocument & doc, QDomElement & root ) +void CPPHeaderCodeDocument::saveToXMI ( TQDomDocument & doc, TQDomElement & root ) { - QDomElement docElement = doc.createElement( "" ); + TQDomElement docElement = doc.createElement( "" ); setAttributesOnNode(doc, docElement); @@ -373,7 +373,7 @@ void CPPHeaderCodeDocument::updateContent( ) bool isInterface = parentIsInterface(); bool hasclassFields = hasClassFields(); bool forcedoc = UMLApp::app()->getCommonPolicy()->getCodeVerboseDocumentComments(); - QString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); + TQString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); UMLClassifierList superclasses = c->findSuperClassConcepts(); @@ -382,9 +382,9 @@ void CPPHeaderCodeDocument::updateContent( ) // // Write the hash define stuff to prevent multiple parsing/inclusion of header - QString cppClassName = CodeGenerator::cleanName(c->getName()); - QString hashDefine = CodeGenerator::cleanName(c->getName().upper().simplifyWhiteSpace()); - QString defText = "#ifndef "+hashDefine + "_H"+ endLine + "#define "+ hashDefine + "_H"; + TQString cppClassName = CodeGenerator::cleanName(c->getName()); + TQString hashDefine = CodeGenerator::cleanName(c->getName().upper().simplifyWhiteSpace()); + TQString defText = "#ifndef "+hashDefine + "_H"+ endLine + "#define "+ hashDefine + "_H"; addOrUpdateTaggedCodeBlockWithComments("hashDefBlock", defText, "", 0, false); // INCLUDE CODEBLOCK @@ -392,23 +392,23 @@ void CPPHeaderCodeDocument::updateContent( ) // Q: Why all utils? Isnt just List and Vector the only classes we are using? // A: doesn't matter at all; its more readable to just include '*' and cpp compilers // don't slow down or anything. (TZ) - QString includeStatement = ""; + TQString includeStatement = ""; bool stringGlobal = policy->stringIncludeIsGlobal(); - QString sStartBrak = stringGlobal ? "<" : "\""; - QString sEndBrak = stringGlobal ? ">" : "\""; + TQString sStartBrak = stringGlobal ? "<" : "\""; + TQString sEndBrak = stringGlobal ? ">" : "\""; includeStatement.append("#include "+sStartBrak+policy->getStringClassNameInclude()+sEndBrak+endLine); if ( hasObjectVectorClassFields() ) { bool vecGlobal = policy->vectorIncludeIsGlobal(); - QString vStartBrak = vecGlobal ? "<" : "\""; - QString vEndBrak = vecGlobal ? ">" : "\""; - QString value ="#include "+vStartBrak+policy->getVectorClassNameInclude()+vEndBrak; + TQString vStartBrak = vecGlobal ? "<" : "\""; + TQString vEndBrak = vecGlobal ? ">" : "\""; + TQString value ="#include "+vStartBrak+policy->getVectorClassNameInclude()+vEndBrak; includeStatement.append(value+endLine); } //only include classes in a different package from this class UMLPackageList includes; - QMap<UMLPackage *,QString> packageMap; // so we don't repeat packages + TQMap<UMLPackage *,TQString> packageMap; // so we don't repeat packages CodeGenerator::findObjectsRelated(c,includes); for(UMLPackage *con = includes.first(); con ; con = includes.next()) @@ -419,14 +419,14 @@ void CPPHeaderCodeDocument::updateContent( ) includeStatement.append("#include \""+CodeGenerator::cleanName(con->getName().lower())+".h\""+endLine); } // now, add/update the includes codeblock - CodeBlockWithComments * inclBlock = addOrUpdateTaggedCodeBlockWithComments("includes", includeStatement, QString::null, 0, false); + CodeBlockWithComments * inclBlock = addOrUpdateTaggedCodeBlockWithComments("includes", includeStatement, TQString::null, 0, false); if(includeStatement.isEmpty() && inclBlock->getContentType() == CodeBlock::AutoGenerated) inclBlock->setWriteOutText(false); else inclBlock->setWriteOutText(true); // Using - QString usingStatement; + TQString usingStatement; for(UMLClassifier *classifier = superclasses.first(); classifier ; classifier = superclasses.next()) { if(classifier->getPackage()!=c->getPackage() && !classifier->getPackage().isEmpty()) { usingStatement.append("using "+CodeGenerator::cleanName(c->getPackage())+"::"+cleanName(c->getName())+';'+endLine); @@ -452,13 +452,13 @@ void CPPHeaderCodeDocument::updateContent( ) namespaceBlock = getHierarchicalCodeBlock("namespace", "Namespace", 0); if(hasNamespace) { UMLPackageList pkgList = c->getPackages(); - QString pkgs; + TQString pkgs; UMLPackage *pkg; for (pkg = pkgList.first(); pkg != NULL; pkg = pkgList.next()) { pkgs += "namespace " + CodeGenerator::cleanName(pkg->getName()) + " { "; } namespaceBlock->setStartText(pkgs); - QString closingBraces; + TQString closingBraces; for (pkg = pkgList.first(); pkg != NULL; pkg = pkgList.next()) { closingBraces += "} "; } @@ -472,8 +472,8 @@ void CPPHeaderCodeDocument::updateContent( ) // Enum types for include if (!isInterface) { - QString enumStatement; - QString indent = UMLApp::app()->getCommonPolicy()->getIndentation(); + TQString enumStatement; + TQString indent = UMLApp::app()->getCommonPolicy()->getIndentation(); UMLEnum* e = dynamic_cast<UMLEnum*>(c); if (e) { enumStatement.append(indent + "enum " + cppClassName + " {" + endLine); @@ -659,7 +659,7 @@ void CPPHeaderCodeDocument::updateContent( ) // meta-data to state what the scope of this method is, we will make it // "public" as a default. This might present problems if the user wants // to move the block into the "private" or "protected" blocks. - QString emptyConstStatement = cppClassName + " ( ) { }"; + TQString emptyConstStatement = cppClassName + " ( ) { }"; // search for this first in the entire document. IF not present, put // it in the public constructor method block @@ -804,7 +804,7 @@ void CPPHeaderCodeDocument::updateContent( ) // in the right place using the "addCodeOperation" method we defined in this class // FINISH up with hash def block close - QString defTextEnd = "#endif //"+hashDefine + "_H"; + TQString defTextEnd = "#endif //"+hashDefine + "_H"; addOrUpdateTaggedCodeBlockWithComments("hashDefBlockEnd", defTextEnd, "", 0, false); } diff --git a/umbrello/umbrello/codegenerators/cppheadercodedocument.h b/umbrello/umbrello/codegenerators/cppheadercodedocument.h index ca75627f..ed7723d0 100644 --- a/umbrello/umbrello/codegenerators/cppheadercodedocument.h +++ b/umbrello/umbrello/codegenerators/cppheadercodedocument.h @@ -17,7 +17,7 @@ #ifndef CPPHEADERCODEDOCUMENT_H #define CPPHEADERCODEDOCUMENT_H -#include <qstring.h> +#include <tqstring.h> #include "../codeclassfieldlist.h" #include "../classifiercodedocument.h" @@ -57,7 +57,7 @@ public: /** * Save the XMI representation of this object */ - //virtual void saveToXMI ( QDomDocument & doc, QDomElement & root ); + //virtual void saveToXMI ( TQDomDocument & doc, TQDomElement & root ); protected: @@ -68,7 +68,7 @@ protected: * need to overwrite this for cpp header since we need to pick up the * header class declaration block. */ - virtual void loadChildTextBlocksFromNode ( QDomElement & root); + virtual void loadChildTextBlocksFromNode ( TQDomElement & root); void addOrUpdateCodeClassFieldMethodsInCodeBlock(CodeClassFieldList &list, CPPHeaderClassDeclarationBlock * codeBlock); diff --git a/umbrello/umbrello/codegenerators/cppheadercodeoperation.cpp b/umbrello/umbrello/codegenerators/cppheadercodeoperation.cpp index ca8ad727..471c7734 100644 --- a/umbrello/umbrello/codegenerators/cppheadercodeoperation.cpp +++ b/umbrello/umbrello/codegenerators/cppheadercodeoperation.cpp @@ -26,7 +26,7 @@ // CPPHeaderCodeOperation::CPPHeaderCodeOperation - ( CPPHeaderCodeDocument * doc, UMLOperation *parent, const QString & body, const QString & comment ) + ( CPPHeaderCodeDocument * doc, UMLOperation *parent, const TQString & body, const TQString & comment ) : CodeOperation (doc, parent, body, comment) { // lets not go with the default comment and instead use @@ -75,10 +75,10 @@ void CPPHeaderCodeOperation::updateMethodDeclaration() CPPCodeGenerationPolicy * policy = dynamic_cast<CPPCodeGenerationPolicy*>(pe); bool isInlineMethod = policy->getOperationsAreInline( ); - QString endLine = getNewLineEndingChars(); + TQString endLine = getNewLineEndingChars(); // first, the comment on the operation, IF its autogenerated/empty - QString comment = o->getDoc(); + TQString comment = o->getDoc(); if(comment.isEmpty() && getContentType() == CodeBlock::AutoGenerated) { UMLAttributeList parameters = o->getParmList(); @@ -90,9 +90,9 @@ void CPPHeaderCodeOperation::updateMethodDeclaration() } // no return type for constructors - QString methodReturnType = o->getTypeName(); - QString methodName = o->getName(); - QString paramStr = QString(""); + TQString methodReturnType = o->getTypeName(); + TQString methodName = o->getName(); + TQString paramStr = TQString(""); // assemble parameters UMLAttributeList list = getParentOperation()->getParmList(); @@ -100,9 +100,9 @@ void CPPHeaderCodeOperation::updateMethodDeclaration() int paramNum = 0; for(UMLAttribute* parm = list.first(); parm; parm=list.next()) { - QString rType = parm->getTypeName(); - QString paramName = parm->getName(); - QString initialValue = parm->getInitialValue(); + TQString rType = parm->getTypeName(); + TQString paramName = parm->getName(); + TQString initialValue = parm->getInitialValue(); paramStr += rType + ' ' + paramName; if(!initialValue.isEmpty()) paramStr += '=' + initialValue; @@ -117,13 +117,13 @@ void CPPHeaderCodeOperation::updateMethodDeclaration() if (o->isLifeOperation()) // constructor/destructor has no type methodReturnType = ""; else if (methodReturnType.isEmpty()) // this operation should be 'void' - methodReturnType = QString("void"); + methodReturnType = TQString("void"); // set start/end method text - QString prototype = methodReturnType+' '+methodName+" ("+paramStr+')'; + TQString prototype = methodReturnType+' '+methodName+" ("+paramStr+')'; - QString startText; - QString endText; + TQString startText; + TQString endText; applyStereotypes (prototype, o, isInlineMethod, isInterface, startText, endText); @@ -140,9 +140,9 @@ int CPPHeaderCodeOperation::lastEditableLine() { return 0; } -void CPPHeaderCodeOperation::applyStereotypes (QString& prototype, UMLOperation * pOp, +void CPPHeaderCodeOperation::applyStereotypes (TQString& prototype, UMLOperation * pOp, bool inlinePolicy, bool interface, - QString& start, QString& end) + TQString& start, TQString& end) { // if the class is an interface, all methods will be declared as pure // virtual functions diff --git a/umbrello/umbrello/codegenerators/cppheadercodeoperation.h b/umbrello/umbrello/codegenerators/cppheadercodeoperation.h index 1d4fbca7..18b7f33f 100644 --- a/umbrello/umbrello/codegenerators/cppheadercodeoperation.h +++ b/umbrello/umbrello/codegenerators/cppheadercodeoperation.h @@ -18,7 +18,7 @@ #ifndef CPPHEADERCODEOPERATION_H #define CPPHEADERCODEOPERATION_H -#include <qstring.h> +#include <tqstring.h> #include "../codeoperation.h" class CPPHeaderCodeDocument; @@ -35,7 +35,7 @@ public: * Constructor */ CPPHeaderCodeOperation ( CPPHeaderCodeDocument * doc, UMLOperation * op, - const QString & body = "", const QString & comment = ""); + const TQString & body = "", const TQString & comment = ""); /** * Empty Destructor @@ -52,7 +52,7 @@ protected: /** * Check to see if we have a valid stereotype to apply in the operation */ - virtual void applyStereotypes (QString&, UMLOperation *, bool, bool, QString&, QString&); + virtual void applyStereotypes (TQString&, UMLOperation *, bool, bool, TQString&, TQString&); }; diff --git a/umbrello/umbrello/codegenerators/cppmakecodedocument.cpp b/umbrello/umbrello/codegenerators/cppmakecodedocument.cpp index d13152b4..33f945ae 100644 --- a/umbrello/umbrello/codegenerators/cppmakecodedocument.cpp +++ b/umbrello/umbrello/codegenerators/cppmakecodedocument.cpp @@ -17,7 +17,7 @@ #include "cppcodegenerator.h" -#include <qregexp.h> +#include <tqregexp.h> const char * CPPMakefileCodeDocument::DOCUMENT_ID_VALUE = "Makefile_DOC"; @@ -49,24 +49,24 @@ void CPPMakefileCodeDocument::updateContent( ) { /** * @return QString */ -QString CPPMakefileCodeDocument::toString ( ) { +TQString CPPMakefileCodeDocument::toString ( ) { return "# cpp make build document"; } // We overwritten by CPP language implementation to get lowercase path -QString CPPMakefileCodeDocument::getPath ( ) +TQString CPPMakefileCodeDocument::getPath ( ) { - QString path = getPackage(); + TQString path = getPackage(); // Replace all white spaces with blanks path.simplifyWhiteSpace(); // Replace all blanks with underscore - path.replace(QRegExp(" "), "_"); + path.replace(TQRegExp(" "), "_"); - path.replace(QRegExp("\\."),"/"); - path.replace(QRegExp("::"),"/"); + path.replace(TQRegExp("\\."),"/"); + path.replace(TQRegExp("::"),"/"); path.lower(); diff --git a/umbrello/umbrello/codegenerators/cppmakecodedocument.h b/umbrello/umbrello/codegenerators/cppmakecodedocument.h index 98efe272..1b1c109b 100644 --- a/umbrello/umbrello/codegenerators/cppmakecodedocument.h +++ b/umbrello/umbrello/codegenerators/cppmakecodedocument.h @@ -20,7 +20,7 @@ #define CPPMAKECODEDOCUMENT_H #include "../codedocument.h" -#include <qstring.h> +#include <tqstring.h> /** * class CPPMakefileCodeDocument @@ -50,9 +50,9 @@ public: /** * @return QString */ - QString toString ( ); + TQString toString ( ); - QString getPath ( ); + TQString getPath ( ); void updateContent(); diff --git a/umbrello/umbrello/codegenerators/cppsourcecodeaccessormethod.cpp b/umbrello/umbrello/codegenerators/cppsourcecodeaccessormethod.cpp index da2a86cb..c71f6d2a 100644 --- a/umbrello/umbrello/codegenerators/cppsourcecodeaccessormethod.cpp +++ b/umbrello/umbrello/codegenerators/cppsourcecodeaccessormethod.cpp @@ -62,9 +62,9 @@ void CPPSourceCodeAccessorMethod::updateContent( ) CPPCodeGenerationPolicy * policy = dynamic_cast<CPPCodeGenerationPolicy*>(pe); bool isInlineMethod = policy->getAccessorsAreInline( ); - QString variableName = cppfield->getFieldName(); - QString itemClassName = cppfield->getTypeName(); - QString text; + TQString variableName = cppfield->getFieldName(); + TQString itemClassName = cppfield->getTypeName(); + TQString text; if(isInlineMethod) { switch(getType()) { @@ -101,19 +101,19 @@ void CPPSourceCodeAccessorMethod::updateMethodDeclaration() bool isInlineMethod = policy->getAccessorsAreInline( ); - QString vectorClassName = policy->getVectorClassName(); - QString fieldName = cppfield->getFieldName(); - QString fieldType = cppfield->getTypeName(); - QString objectType = cppfield->getListObjectType(); + TQString vectorClassName = policy->getVectorClassName(); + TQString fieldName = cppfield->getFieldName(); + TQString fieldType = cppfield->getTypeName(); + TQString objectType = cppfield->getListObjectType(); if(objectType.isEmpty()) objectType = fieldName; - QString methodReturnType = "void"; - QString methodName; - QString methodParams; - QString headerText; - QString className = CodeGenerator::cleanName(c->getName()); - QString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); + TQString methodReturnType = "void"; + TQString methodName; + TQString methodParams; + TQString headerText; + TQString className = CodeGenerator::cleanName(c->getName()); + TQString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); switch(getType()) { case CodeAccessorMethod::ADD: diff --git a/umbrello/umbrello/codegenerators/cppsourcecodeaccessormethod.h b/umbrello/umbrello/codegenerators/cppsourcecodeaccessormethod.h index 60d9c369..7c4088e9 100644 --- a/umbrello/umbrello/codegenerators/cppsourcecodeaccessormethod.h +++ b/umbrello/umbrello/codegenerators/cppsourcecodeaccessormethod.h @@ -16,7 +16,7 @@ #ifndef CPPSOURCECODEACCESSORMETHOD_H #define CPPSOURCECODEACCESSORMETHOD_H -#include <qstring.h> +#include <tqstring.h> #include "../codeaccessormethod.h" diff --git a/umbrello/umbrello/codegenerators/cppsourcecodeclassfielddeclarationblock.cpp b/umbrello/umbrello/codegenerators/cppsourcecodeclassfielddeclarationblock.cpp index 7d60b1c3..016249e5 100644 --- a/umbrello/umbrello/codegenerators/cppsourcecodeclassfielddeclarationblock.cpp +++ b/umbrello/umbrello/codegenerators/cppsourcecodeclassfielddeclarationblock.cpp @@ -48,18 +48,18 @@ void CPPSourceCodeClassFieldDeclarationBlock::updateContent( ) CPPClassifierCodeDocument* jdoc = dynamic_cast<CPPClassifierCodeDocument*>(doc); // Set the comment - QString notes = getParentObject()->getDoc(); + TQString notes = getParentObject()->getDoc(); getComment()->setText(notes); // Set the body - QString staticValue = getParentObject()->getStatic() ? "static " : ""; - QString scopeStr = getParentObject()->getVisibility().toString(); + TQString staticValue = getParentObject()->getStatic() ? "static " : ""; + TQString scopeStr = getParentObject()->getVisibility().toString(); - QString typeName = jcf->getTypeName(); - QString fieldName = jcf->getFieldName(); - QString initialV = jcf->getInitialValue(); + TQString typeName = jcf->getTypeName(); + TQString fieldName = jcf->getFieldName(); + TQString initialV = jcf->getInitialValue(); - QString body = staticValue+scopeStr+" "+typeName+" "+fieldName; + TQString body = staticValue+scopeStr+" "+typeName+" "+fieldName; if (!initialV.isEmpty()) body.append(" = " + initialV); setText(body+";"); diff --git a/umbrello/umbrello/codegenerators/cppsourcecodeclassfielddeclarationblock.h b/umbrello/umbrello/codegenerators/cppsourcecodeclassfielddeclarationblock.h index e5b908a0..a27c0684 100644 --- a/umbrello/umbrello/codegenerators/cppsourcecodeclassfielddeclarationblock.h +++ b/umbrello/umbrello/codegenerators/cppsourcecodeclassfielddeclarationblock.h @@ -16,7 +16,7 @@ #ifndef CPPSOURCECODECLASSFIELDDECLARATIONBLOCK_H #define CPPSOURCECODECLASSFIELDDECLARATIONBLOCK_H -#include <qstring.h> +#include <tqstring.h> #include "../codeclassfielddeclarationblock.h" diff --git a/umbrello/umbrello/codegenerators/cppsourcecodedocument.cpp b/umbrello/umbrello/codegenerators/cppsourcecodedocument.cpp index be054937..3caefe82 100644 --- a/umbrello/umbrello/codegenerators/cppsourcecodedocument.cpp +++ b/umbrello/umbrello/codegenerators/cppsourcecodedocument.cpp @@ -29,7 +29,7 @@ #include "cppsourcecodedocument.h" // qt/kde includes #include <kdebug.h> -#include <qregexp.h> +#include <tqregexp.h> // app includes #include "cppcodegenerator.h" #include "cppcodegenerationpolicy.h" @@ -58,7 +58,7 @@ CPPSourceCodeDocument::~CPPSourceCodeDocument ( ) { } // Other methods // -QString CPPSourceCodeDocument::getCPPClassName (const QString &name) { +TQString CPPSourceCodeDocument::getCPPClassName (const TQString &name) { return CodeGenerator::cleanName(name); } @@ -119,7 +119,7 @@ void CPPSourceCodeDocument::updateContent( ) //UMLClassifier * c = getParentClassifier(); CodeGenPolicyExt *pe = UMLApp::app()->getPolicyExt(); CPPCodeGenerationPolicy * policy = dynamic_cast<CPPCodeGenerationPolicy*>(pe); - QString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); + TQString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); // first, set the global flag on whether or not to show classfield info CodeClassFieldList * cfList = getCodeClassFieldList(); @@ -140,11 +140,11 @@ void CPPSourceCodeDocument::updateContent( ) // // INCLUDE CODEBLOCK - QString includeStatement = ""; + TQString includeStatement = ""; // Include own header file - QString myOwnName( getParentClassifier()->getName() ); + TQString myOwnName( getParentClassifier()->getName() ); includeStatement.append("#include \""+CodeGenerator::cleanName(myOwnName.lower())+".h\""+endLine); - CodeBlockWithComments * iblock = addOrUpdateTaggedCodeBlockWithComments("includes", includeStatement, QString::null, 0, false); + CodeBlockWithComments * iblock = addOrUpdateTaggedCodeBlockWithComments("includes", includeStatement, TQString::null, 0, false); iblock->setWriteOutText(true); // After the includes we have just 2 big blocks basically, the "constructor" block and the diff --git a/umbrello/umbrello/codegenerators/cppsourcecodedocument.h b/umbrello/umbrello/codegenerators/cppsourcecodedocument.h index 8ca59c95..09ee93e6 100644 --- a/umbrello/umbrello/codegenerators/cppsourcecodedocument.h +++ b/umbrello/umbrello/codegenerators/cppsourcecodedocument.h @@ -17,7 +17,7 @@ #ifndef CPPSOURCECODEDOCUMENT_H #define CPPSOURCECODEDOCUMENT_H -#include <qstring.h> +#include <tqstring.h> #include "../classifiercodedocument.h" #include "../hierarchicalcodeblock.h" @@ -57,7 +57,7 @@ protected: void resetTextBlocks(); // a little utility method to save us some work - QString getCPPClassName (const QString &name); + TQString getCPPClassName (const TQString &name); void updateContent(); diff --git a/umbrello/umbrello/codegenerators/cppsourcecodeoperation.cpp b/umbrello/umbrello/codegenerators/cppsourcecodeoperation.cpp index 0d8115b6..61b1950e 100644 --- a/umbrello/umbrello/codegenerators/cppsourcecodeoperation.cpp +++ b/umbrello/umbrello/codegenerators/cppsourcecodeoperation.cpp @@ -25,7 +25,7 @@ // Constructors/Destructors // -CPPSourceCodeOperation::CPPSourceCodeOperation ( CPPSourceCodeDocument * doc, UMLOperation *parent, const QString & body, const QString & comment ) +CPPSourceCodeOperation::CPPSourceCodeOperation ( CPPSourceCodeDocument * doc, UMLOperation *parent, const TQString & body, const TQString & comment ) : CodeOperation (doc, parent, body, comment) { // lets not go with the default comment and instead use @@ -45,13 +45,13 @@ CPPSourceCodeOperation::CPPSourceCodeOperation ( CPPSourceCodeDocument * doc, UM bool isInlineMethod = policy->getOperationsAreInline( ); // first, the comment on the operation - QString cmnt = o->getDoc(); + TQString cmnt = o->getDoc(); getComment()->setText(cmnt); - QString returnType = o->getTypeName(); - QString methodName = o->getName(); - QString paramStr = QString(""); - QString className = CodeGenerator::cleanName(c->getName()); + TQString returnType = o->getTypeName(); + TQString methodName = o->getName(); + TQString paramStr = TQString(""); + TQString className = CodeGenerator::cleanName(c->getName()); // assemble parameters UMLAttributeList list = getParentOperation()->getParmList(); @@ -59,8 +59,8 @@ CPPSourceCodeOperation::CPPSourceCodeOperation ( CPPSourceCodeDocument * doc, UM int paramNum = 0; for(UMLAttribute* parm = list.first(); parm; parm=list.next()) { - QString rType = parm->getTypeName(); - QString paramName = parm->getName(); + TQString rType = parm->getTypeName(); + TQString paramName = parm->getName(); paramStr += rType + ' ' + paramName; paramNum++; @@ -74,9 +74,9 @@ CPPSourceCodeOperation::CPPSourceCodeOperation ( CPPSourceCodeDocument * doc, UM // if an operation isn't a constructor/destructor and it has no return type // this operation should be void else if (returnType.isEmpty()) - returnType = QString("void"); + returnType = TQString("void"); - QString startText = returnType + ' '; + TQString startText = returnType + ' '; // if a property has a friend stereotype, the operation should // not be a class name @@ -135,13 +135,13 @@ void CPPSourceCodeOperation::updateMethodDeclaration() bool isInlineMethod = policy->getOperationsAreInline( ); // first, the comment on the operation - QString comment = o->getDoc(); + TQString comment = o->getDoc(); getComment()->setText(comment); - QString returnType = o->getTypeName(); - QString methodName = o->getName(); - QString paramStr = QString(""); - QString className = CodeGenerator::cleanName(c->getName()); + TQString returnType = o->getTypeName(); + TQString methodName = o->getName(); + TQString paramStr = TQString(""); + TQString className = CodeGenerator::cleanName(c->getName()); // assemble parameters UMLAttributeList list = getParentOperation()->getParmList(); @@ -149,8 +149,8 @@ void CPPSourceCodeOperation::updateMethodDeclaration() int paramNum = 0; for(UMLAttribute* parm = list.first(); parm; parm=list.next()) { - QString rType = parm->getTypeName(); - QString paramName = parm->getName(); + TQString rType = parm->getTypeName(); + TQString paramName = parm->getName(); paramStr += rType + ' ' + paramName; paramNum++; @@ -164,9 +164,9 @@ void CPPSourceCodeOperation::updateMethodDeclaration() // if an operation isn't a constructor/destructor and it has no return type // this operation should be void else if (returnType.isEmpty()) - returnType = QString("void"); + returnType = TQString("void"); - QString startText = returnType + ' '; + TQString startText = returnType + ' '; // if a property has a friend stereotype, the operation should // not be a class name diff --git a/umbrello/umbrello/codegenerators/cppsourcecodeoperation.h b/umbrello/umbrello/codegenerators/cppsourcecodeoperation.h index e2112178..95073eea 100644 --- a/umbrello/umbrello/codegenerators/cppsourcecodeoperation.h +++ b/umbrello/umbrello/codegenerators/cppsourcecodeoperation.h @@ -18,7 +18,7 @@ #ifndef CPPSOURCECODEOPERATION_H #define CPPSOURCECODEOPERATION_H -#include <qstring.h> +#include <tqstring.h> #include "../codeoperation.h" class CPPSourceCodeDocument; @@ -34,7 +34,7 @@ public: /** * Empty Constructor */ - CPPSourceCodeOperation ( CPPSourceCodeDocument * doc, UMLOperation * op, const QString & body = "", const QString & comment = ""); + CPPSourceCodeOperation ( CPPSourceCodeDocument * doc, UMLOperation * op, const TQString & body = "", const TQString & comment = ""); /** * Empty Destructor diff --git a/umbrello/umbrello/codegenerators/cppwriter.cpp b/umbrello/umbrello/codegenerators/cppwriter.cpp index b24c12b0..ab2b8fcb 100644 --- a/umbrello/umbrello/codegenerators/cppwriter.cpp +++ b/umbrello/umbrello/codegenerators/cppwriter.cpp @@ -19,9 +19,9 @@ // own header #include "cppwriter.h" // qt/kde includes -#include <qfile.h> -#include <qtextstream.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqregexp.h> #include <kdebug.h> // app includes #include "classifierinfo.h" @@ -50,7 +50,7 @@ CppWriter::CppWriter() // and "%ITEMCLASS%", if needed, where the class of the item is declared. VECTOR_METHOD_APPEND = "%VARNAME%.push_back(add_object);"; // for std::vector VECTOR_METHOD_REMOVE = "int i, size = %VARNAME%.size();\nfor ( i = 0; i < size; i++) {\n\t%ITEMCLASS% item = %VARNAME%.at(i);\n\tif(item == remove_object) {\n\t\tvector<%ITEMCLASS%>::iterator it = %VARNAME%.begin() + i;\n\t\t%VARNAME%.erase(it);\n\t\treturn;\n\t}\n }"; // for std::vector - VECTOR_METHOD_INIT = QString(); // nothing to be done + VECTOR_METHOD_INIT = TQString(); // nothing to be done /* VECTOR_METHOD_APPEND = "%VARNAME%.append(&add_object);"; // Qt lib implementation VECTOR_METHOD_REMOVE = "%VARNAME%.removeRef(&remove_object);"; // Qt lib implementation @@ -82,10 +82,10 @@ void CppWriter::writeClass(UMLClassifier *c) return; } - QFile fileh, filecpp; + TQFile fileh, filecpp; // find an appropriate name for our file - QString fileName = findFileName(c, ".h"); + TQString fileName = findFileName(c, ".h"); if (fileName.isEmpty()) { emit codeGenerated(c, false); return; @@ -113,7 +113,7 @@ void CppWriter::writeClass(UMLClassifier *c) need_impl = false; } if (need_impl) { - fileName.replace( QRegExp(".h$"), ".cpp"); + fileName.replace( TQRegExp(".h$"), ".cpp"); if( !openFile(filecpp, fileName)) { emit codeGenerated(c, false); return; @@ -130,24 +130,24 @@ void CppWriter::writeClass(UMLClassifier *c) } -void CppWriter::writeHeaderFile (UMLClassifier *c, QFile &fileh) { +void CppWriter::writeHeaderFile (UMLClassifier *c, TQFile &fileh) { // open stream for writing - QTextStream h (&fileh); + TQTextStream h (&fileh); // up the indent level to one m_indentLevel = 1; // write header blurb - QString str = getHeadingFile(".h"); + TQString str = getHeadingFile(".h"); if(!str.isEmpty()) { - str.replace(QRegExp("%filename%"),m_classifierInfo->fileName + ".h"); - str.replace(QRegExp("%filepath%"),fileh.name()); + str.replace(TQRegExp("%filename%"),m_classifierInfo->fileName + ".h"); + str.replace(TQRegExp("%filepath%"),fileh.name()); h << str<< m_endl; } // Write the hash define stuff to prevent multiple parsing/inclusion of header - QString hashDefine = m_classifierInfo->className.upper().simplifyWhiteSpace().replace(QRegExp(" "), "_"); + TQString hashDefine = m_classifierInfo->className.upper().simplifyWhiteSpace().replace(TQRegExp(" "), "_"); writeBlankLine(h); h << "#ifndef "<< hashDefine + "_H" << m_endl; h << "#define "<< hashDefine + "_H" << m_endl; @@ -159,7 +159,7 @@ void CppWriter::writeHeaderFile (UMLClassifier *c, QFile &fileh) { } -void CppWriter::writeHeaderAccessorMethodDecl(UMLClassifier *c, Uml::Visibility permitScope, QTextStream &stream) +void CppWriter::writeHeaderAccessorMethodDecl(UMLClassifier *c, Uml::Visibility permitScope, TQTextStream &stream) { // attributes @@ -180,7 +180,7 @@ void CppWriter::writeHeaderAccessorMethodDecl(UMLClassifier *c, Uml::Visibility } -void CppWriter::writeHeaderFieldDecl(UMLClassifier *c, Uml::Visibility permitScope, QTextStream &stream) +void CppWriter::writeHeaderFieldDecl(UMLClassifier *c, Uml::Visibility permitScope, TQTextStream &stream) { // attributes writeAttributeDecls(permitScope, true, stream); // write static attributes first @@ -194,20 +194,20 @@ void CppWriter::writeHeaderFieldDecl(UMLClassifier *c, Uml::Visibility permitSco } -void CppWriter::writeSourceFile (UMLClassifier *c, QFile &filecpp ) { +void CppWriter::writeSourceFile (UMLClassifier *c, TQFile &filecpp ) { // open stream for writing - QTextStream cpp (&filecpp); + TQTextStream cpp (&filecpp); // set the starting indentation at zero m_indentLevel = 0; //try to find a heading file (license, coments, etc) - QString str; + TQString str; str = getHeadingFile(".cpp"); if(!str.isEmpty()) { - str.replace(QRegExp("%filename%"),m_classifierInfo->fileName + ".cpp"); - str.replace(QRegExp("%filepath%"),filecpp.name()); + str.replace(TQRegExp("%filename%"),m_classifierInfo->fileName + ".cpp"); + str.replace(TQRegExp("%filepath%"),filecpp.name()); cpp << str << m_endl; } @@ -233,7 +233,7 @@ void CppWriter::writeSourceFile (UMLClassifier *c, QFile &filecpp ) { // // write comment for section IF needed - QString indent = getIndent(); + TQString indent = getIndent(); if (forceDoc() || m_classifierInfo->hasAccessorMethods || m_classifierInfo->hasOperationMethods) { @@ -323,11 +323,11 @@ void CppWriter::writeSourceFile (UMLClassifier *c, QFile &filecpp ) { } -void CppWriter::writeClassDecl(UMLClassifier *c, QTextStream &cpp) +void CppWriter::writeClassDecl(UMLClassifier *c, TQTextStream &cpp) { UMLClassifierList superclasses = m_classifierInfo->superclasses; for(UMLClassifier *classifier = superclasses.first(); classifier ;classifier = superclasses.next()) { - QString headerName = findFileName(classifier, ".h"); + TQString headerName = findFileName(classifier, ".h"); if (!headerName.isEmpty()) { cpp << "#include \"" << headerName << "\"" << m_endl; } @@ -386,7 +386,7 @@ void CppWriter::writeClassDecl(UMLClassifier *c, QTextStream &cpp) uint i = 0; cpp << "enum " << m_classifierInfo->className << " {" << m_endl; for (UMLClassifierListItem *lit = litList.first(); lit; lit = litList.next()) { - QString enumLiteral = cleanName(lit->getName()); + TQString enumLiteral = cleanName(lit->getName()); cpp << getIndent() << enumLiteral; if (++i < litList.count()) cpp << ","; @@ -403,8 +403,8 @@ void CppWriter::writeClassDecl(UMLClassifier *c, QTextStream &cpp) if (template_params.count()) { cpp << "template<"; for (UMLTemplate *t = template_params.first(); t; ) { - QString formalName = t->getName(); - QString typeName = t->getTypeName(); + TQString formalName = t->getName(); + TQString typeName = t->getTypeName(); cpp << typeName << " " << formalName; if ((t = template_params.next()) != NULL) cpp << ", "; @@ -471,7 +471,7 @@ void CppWriter::writeClassDecl(UMLClassifier *c, QTextStream &cpp) } -void CppWriter::writeAttributeDecls (Uml::Visibility visibility, bool writeStatic, QTextStream &stream ) +void CppWriter::writeAttributeDecls (Uml::Visibility visibility, bool writeStatic, TQTextStream &stream ) { if(m_classifierInfo->isInterface) @@ -506,8 +506,8 @@ void CppWriter::writeAttributeDecls (Uml::Visibility visibility, bool writeStati //write documentation if(forceDoc() || list->count() > 0) { - QString strVis = Codegen_Utils::capitalizeFirstLetter(visibility.toString()); - QString strStatic = writeStatic ? "Static ":""; + TQString strVis = Codegen_Utils::capitalizeFirstLetter(visibility.toString()); + TQString strStatic = writeStatic ? "Static ":""; writeComment(strStatic + strVis + " attributes",getIndent(), stream); writeComment(" ",getIndent(), stream); writeBlankLine(stream); @@ -517,7 +517,7 @@ void CppWriter::writeAttributeDecls (Uml::Visibility visibility, bool writeStati // write attrib declarations now bool isFirstAttrib = true; - QString documentation; + TQString documentation; for(UMLAttribute *at=list->first(); at; at=list->next()) { @@ -531,10 +531,10 @@ void CppWriter::writeAttributeDecls (Uml::Visibility visibility, bool writeStati isFirstAttrib = false; - QString varName = getAttributeVariableName(at); + TQString varName = getAttributeVariableName(at); - QString staticValue = at->getStatic() ? "static " : ""; - QString typeName = fixTypeName(at->getTypeName()); + TQString staticValue = at->getStatic() ? "static " : ""; + TQString typeName = fixTypeName(at->getTypeName()); if(!documentation.isEmpty()) writeComment(documentation, getIndent(), stream); stream << getIndent() << staticValue << typeName << " " << varName << ";" << m_endl; @@ -550,7 +550,7 @@ void CppWriter::writeAttributeDecls (Uml::Visibility visibility, bool writeStati } -void CppWriter::writeHeaderAttributeAccessorMethods (Uml::Visibility visibility, bool writeStatic, QTextStream &stream ) +void CppWriter::writeHeaderAttributeAccessorMethods (Uml::Visibility visibility, bool writeStatic, TQTextStream &stream ) { // check the current policy about generate accessors as public UMLAttributeList * list; @@ -596,7 +596,7 @@ void CppWriter::writeHeaderAttributeAccessorMethods (Uml::Visibility visibility, void CppWriter::writeAttributeMethods(UMLAttributeList *attribs, Uml::Visibility visibility, bool isHeaderMethod, bool isStatic, - bool writeMethodBody, QTextStream &stream) + bool writeMethodBody, TQTextStream &stream) { if (!policyExt()->getAutoGenerateAccessors()) @@ -604,8 +604,8 @@ void CppWriter::writeAttributeMethods(UMLAttributeList *attribs, if (forceDoc() || attribs->count() > 0) { - QString strVis = Codegen_Utils::capitalizeFirstLetter(visibility.toString()); - QString strStatic = (isStatic ? " static" : ""); + TQString strVis = Codegen_Utils::capitalizeFirstLetter(visibility.toString()); + TQString strStatic = (isStatic ? " static" : ""); writeBlankLine(stream); writeComment(strVis + strStatic + " attribute accessor methods",getIndent(),stream); writeComment(" ",getIndent(), stream); @@ -620,8 +620,8 @@ void CppWriter::writeAttributeMethods(UMLAttributeList *attribs, for(at=attribs->first(); at; at=attribs->next()) { - QString varName = getAttributeVariableName(at); - QString methodBaseName = cleanName(at->getName()); + TQString varName = getAttributeVariableName(at); + TQString methodBaseName = cleanName(at->getName()); // force capitalizing the field name, this is silly, // from what I can tell, this IS the default behavior for @@ -636,14 +636,14 @@ void CppWriter::writeAttributeMethods(UMLAttributeList *attribs, } -void CppWriter::writeComment(const QString &comment, const QString &myIndent, QTextStream &cpp) +void CppWriter::writeComment(const TQString &comment, const TQString &myIndent, TQTextStream &cpp) { // in the case we have several line comment.. // NOTE: this part of the method has the problem of adopting UNIX newline, // need to resolve for using with MAC/WinDoze eventually I assume - if (comment.contains(QRegExp("\n"))) { + if (comment.contains(TQRegExp("\n"))) { - QStringList lines = QStringList::split( "\n", comment); + TQStringList lines = TQStringList::split( "\n", comment); for(uint i= 0; i < lines.count(); i++) { cpp << myIndent << "// " << lines[i] << m_endl; @@ -655,10 +655,10 @@ void CppWriter::writeComment(const QString &comment, const QString &myIndent, QT } } -void CppWriter::writeDocumentation(QString header, QString body, QString end, QTextStream &cpp) +void CppWriter::writeDocumentation(TQString header, TQString body, TQString end, TQTextStream &cpp) { writeBlankLine(cpp); - QString indent = getIndent(); + TQString indent = getIndent(); cpp << indent << "/**" << m_endl; if (!header.isEmpty()) @@ -667,14 +667,14 @@ void CppWriter::writeDocumentation(QString header, QString body, QString end, QT cpp << formatDoc(body, indent + " * "); if (!end.isEmpty()) { - QStringList lines = QStringList::split( "\n", end); + TQStringList lines = TQStringList::split( "\n", end); for(uint i= 0; i < lines.count(); i++) cpp << formatDoc(lines[i], indent + " * "); } cpp << indent << " */" << m_endl; } -void CppWriter::writeAssociationDecls(UMLAssociationList associations, Uml::Visibility permitScope, Uml::IDType id, QTextStream &h) +void CppWriter::writeAssociationDecls(UMLAssociationList associations, Uml::Visibility permitScope, Uml::IDType id, TQTextStream &h) { if( forceSections() || !associations.isEmpty() ) @@ -699,14 +699,14 @@ void CppWriter::writeAssociationDecls(UMLAssociationList associations, Uml::Visi if (printRoleB && a->getVisibility(Uml::B) == permitScope) { - QString fieldClassName = cleanName(getUMLObjectName(a->getObject(Uml::B))); + TQString fieldClassName = cleanName(getUMLObjectName(a->getObject(Uml::B))); writeAssociationRoleDecl(fieldClassName, a->getRoleName(Uml::B), a->getMulti(Uml::B), a->getRoleDoc(Uml::B), h); } // print RoleA decl if (printRoleA && a->getVisibility(Uml::A) == permitScope) { - QString fieldClassName = cleanName(getUMLObjectName(a->getObject(Uml::A))); + TQString fieldClassName = cleanName(getUMLObjectName(a->getObject(Uml::A))); writeAssociationRoleDecl(fieldClassName, a->getRoleName(Uml::A), a->getMulti(Uml::A), a->getRoleDoc(Uml::A), h); } @@ -717,15 +717,15 @@ void CppWriter::writeAssociationDecls(UMLAssociationList associations, Uml::Visi } } -void CppWriter::writeAssociationRoleDecl(QString fieldClassName, QString roleName, QString multi, - QString doc, QTextStream &stream) +void CppWriter::writeAssociationRoleDecl(TQString fieldClassName, TQString roleName, TQString multi, + TQString doc, TQTextStream &stream) { // ONLY write out IF there is a rolename given // otherwise its not meant to be declared in the code if (roleName.isEmpty()) return; - QString indent = getIndent(); + TQString indent = getIndent(); // always put space between this and prior decl, if any writeBlankLine(stream); @@ -736,14 +736,14 @@ void CppWriter::writeAssociationRoleDecl(QString fieldClassName, QString roleNam // declare the association based on whether it is this a single variable // or a List (Vector). One day this will be done correctly with special // multiplicity object that we don't have to figure out what it means via regex. - if(multi.isEmpty() || multi.contains(QRegExp("^[01]$"))) + if(multi.isEmpty() || multi.contains(TQRegExp("^[01]$"))) { - QString fieldVarName = "m_" + roleName.lower(); + TQString fieldVarName = "m_" + roleName.lower(); // record this for later consideration of initialization IF the // multi value requires 1 of these objects if(ObjectFieldVariables.findIndex(fieldVarName) == -1 && - multi.contains(QRegExp("^1$")) + multi.contains(TQRegExp("^1$")) ) { // ugh. UGLY. Storing variable name and its class in pairs. @@ -755,7 +755,7 @@ void CppWriter::writeAssociationRoleDecl(QString fieldClassName, QString roleNam } else { - QString fieldVarName = "m_" + roleName.lower() + "Vector"; + TQString fieldVarName = "m_" + roleName.lower() + "Vector"; // record unique occurrences for later when we want to check // for initialization of this vector @@ -773,7 +773,7 @@ void CppWriter::writeAssociationMethods (UMLAssociationList associations, bool isHeaderMethod, bool writeMethodBody, bool writePointerVar, - Uml::IDType myID, QTextStream &stream) + Uml::IDType myID, TQTextStream &stream) { if( forceSections() || !associations.isEmpty() ) { @@ -786,7 +786,7 @@ void CppWriter::writeAssociationMethods (UMLAssociationList associations, { // only write out IF there is a rolename given if(!a->getRoleName(Uml::B).isEmpty()) { - QString fieldClassName = getUMLObjectName(a->getObject(Uml::B)) + (writePointerVar ? " *":""); + TQString fieldClassName = getUMLObjectName(a->getObject(Uml::B)) + (writePointerVar ? " *":""); writeAssociationRoleMethod(fieldClassName, isHeaderMethod, writeMethodBody, @@ -800,7 +800,7 @@ void CppWriter::writeAssociationMethods (UMLAssociationList associations, { // only write out IF there is a rolename given if(!a->getRoleName(Uml::A).isEmpty()) { - QString fieldClassName = getUMLObjectName(a->getObject(Uml::A)) + (writePointerVar ? " *":""); + TQString fieldClassName = getUMLObjectName(a->getObject(Uml::A)) + (writePointerVar ? " *":""); writeAssociationRoleMethod(fieldClassName, isHeaderMethod, writeMethodBody, @@ -816,39 +816,39 @@ void CppWriter::writeAssociationMethods (UMLAssociationList associations, } } -void CppWriter::writeAssociationRoleMethod (const QString &fieldClassName, +void CppWriter::writeAssociationRoleMethod (const TQString &fieldClassName, bool isHeaderMethod, bool writeMethodBody, - const QString &roleName, const QString &multi, - const QString &description, Uml::Changeability_Type change, - QTextStream &stream) + const TQString &roleName, const TQString &multi, + const TQString &description, Uml::Changeability_Type change, + TQTextStream &stream) { - if(multi.isEmpty() || multi.contains(QRegExp("^[01]$"))) + if(multi.isEmpty() || multi.contains(TQRegExp("^[01]$"))) { - QString fieldVarName = "m_" + roleName.lower(); + TQString fieldVarName = "m_" + roleName.lower(); writeSingleAttributeAccessorMethods(fieldClassName, fieldVarName, roleName, description, change, isHeaderMethod, false, writeMethodBody, stream); } else { - QString fieldVarName = "m_" + roleName.lower() + "Vector"; + TQString fieldVarName = "m_" + roleName.lower() + "Vector"; writeVectorAttributeAccessorMethods(fieldClassName, fieldVarName, roleName, description, change, isHeaderMethod, writeMethodBody, stream); } } void CppWriter::writeVectorAttributeAccessorMethods ( - const QString &fieldClassName, const QString &fieldVarName, - const QString &fieldName, const QString &description, + const TQString &fieldClassName, const TQString &fieldVarName, + const TQString &fieldName, const TQString &description, Uml::Changeability_Type changeType, bool isHeaderMethod, bool writeMethodBody, - QTextStream &stream) + TQTextStream &stream) { - QString className = fixTypeName(fieldClassName); - QString fldName = Codegen_Utils::capitalizeFirstLetter(fieldName); - QString indent = getIndent(); + TQString className = fixTypeName(fieldClassName); + TQString fldName = Codegen_Utils::capitalizeFirstLetter(fieldName); + TQString indent = getIndent(); // ONLY IF changeability is NOT Frozen if (changeType != Uml::chg_Frozen) @@ -859,10 +859,10 @@ void CppWriter::writeVectorAttributeAccessorMethods ( stream << m_classifierInfo->className << "::"; stream << "add" << fldName << " ( " << className << " add_object )"; if (writeMethodBody) { - QString method = VECTOR_METHOD_APPEND; - method.replace(QRegExp("%VARNAME%"),fieldVarName); - method.replace(QRegExp("%VECTORTYPENAME%"), policyExt()->getVectorClassName()); - method.replace(QRegExp("%ITEMCLASS%"),className); + TQString method = VECTOR_METHOD_APPEND; + method.replace(TQRegExp("%VARNAME%"),fieldVarName); + method.replace(TQRegExp("%VECTORTYPENAME%"), policyExt()->getVectorClassName()); + method.replace(TQRegExp("%ITEMCLASS%"),className); stream << indent << " {" << m_endl; m_indentLevel++; printTextAsSeparateLinesWithIndent(method,getIndent(),stream); @@ -882,10 +882,10 @@ void CppWriter::writeVectorAttributeAccessorMethods ( stream << m_classifierInfo->className << "::"; stream << "remove" << fldName << " ( " << className << " remove_object )"; if (writeMethodBody) { - QString method = VECTOR_METHOD_REMOVE; - method.replace(QRegExp("%VARNAME%"),fieldVarName); - method.replace(QRegExp("%VECTORTYPENAME%"), policyExt()->getVectorClassName()); - method.replace(QRegExp("%ITEMCLASS%"),className); + TQString method = VECTOR_METHOD_REMOVE; + method.replace(TQRegExp("%VARNAME%"),fieldVarName); + method.replace(TQRegExp("%VECTORTYPENAME%"), policyExt()->getVectorClassName()); + method.replace(TQRegExp("%ITEMCLASS%"),className); stream << indent << " {" << m_endl; m_indentLevel++; printTextAsSeparateLinesWithIndent(method,getIndent(),stream); @@ -896,7 +896,7 @@ void CppWriter::writeVectorAttributeAccessorMethods ( } // always allow getting the list of stuff - QString returnVarName = policyExt()->getVectorClassName() + '<' + className + '>'; + TQString returnVarName = policyExt()->getVectorClassName() + '<' + className + '>'; writeDocumentation("Get the list of " + fldName + " objects held by " + fieldVarName, description, "@return " + returnVarName + " list of " + fldName + " objects held by " + fieldVarName, @@ -918,22 +918,22 @@ void CppWriter::writeVectorAttributeAccessorMethods ( void CppWriter::writeSingleAttributeAccessorMethods( - const QString& fieldClassName, const QString& fieldVarName, - const QString& fieldName, const QString &description, + const TQString& fieldClassName, const TQString& fieldVarName, + const TQString& fieldName, const TQString &description, Uml::Changeability_Type change, bool isHeaderMethod, bool isStatic, bool writeMethodBody, - QTextStream &stream) + TQTextStream &stream) { // DON'T write this IF its a source method AND writeMethodBody is "false" if(!isHeaderMethod && !writeMethodBody) return; - QString className = fixTypeName(fieldClassName); - QString fldName = Codegen_Utils::capitalizeFirstLetter(fieldName); - QString indent = getIndent(); + TQString className = fixTypeName(fieldClassName); + TQString fldName = Codegen_Utils::capitalizeFirstLetter(fieldName); + TQString indent = getIndent(); // set method if (change == Uml::chg_Changeable && !isStatic) { @@ -979,7 +979,7 @@ void CppWriter::writeSingleAttributeAccessorMethods( } // one day, this should print out non-empty constructor operations too. -void CppWriter::writeConstructorDecls(QTextStream &stream) +void CppWriter::writeConstructorDecls(TQTextStream &stream) { const bool generateEmptyConstructors = UMLApp::app()->getCommonPolicy()->getAutoGenerateConstructors(); @@ -1000,22 +1000,22 @@ void CppWriter::writeConstructorDecls(QTextStream &stream) writeBlankLine(stream); } -void CppWriter::writeInitAttibuteDecl (QTextStream &stream) +void CppWriter::writeInitAttibuteDecl (TQTextStream &stream) { if (UMLApp::app()->getCommonPolicy()->getAutoGenerateConstructors() && m_classifierInfo->hasAttributes) stream << getIndent() << "void initAttributes ( ) ;" << m_endl; } -void CppWriter::writeInitAttibuteMethod (QTextStream &stream) +void CppWriter::writeInitAttibuteMethod (TQTextStream &stream) { // only need to do this under certain conditions if (!UMLApp::app()->getCommonPolicy()->getAutoGenerateConstructors() || !m_classifierInfo->hasAttributes) return; - QString className = m_classifierInfo->className; - QString indent = getIndent(); + TQString className = m_classifierInfo->className; + TQString indent = getIndent(); stream << indent << "void " << className << "::" << "initAttributes ( ) {" << m_endl; @@ -1024,31 +1024,31 @@ void CppWriter::writeInitAttibuteMethod (QTextStream &stream) UMLAttributeList atl = m_classifierInfo->getAttList(); for(UMLAttribute *at = atl.first(); at ; at = atl.next()) { if(!at->getInitialValue().isEmpty()) { - QString varName = getAttributeVariableName(at); + TQString varName = getAttributeVariableName(at); stream << getIndent() << varName << " = " << at->getInitialValue() << ";" << m_endl; } } // Now initialize the association related fields (e.g. vectors) if (!VECTOR_METHOD_INIT.isEmpty()) { - QStringList::Iterator it; + TQStringList::Iterator it; for( it = VectorFieldVariables.begin(); it != VectorFieldVariables.end(); ++it ) { - QString fieldVarName = *it; - QString method = VECTOR_METHOD_INIT; - method.replace(QRegExp("%VARNAME%"),fieldVarName); - method.replace(QRegExp("%VECTORTYPENAME%"), policyExt()->getVectorClassName()); + TQString fieldVarName = *it; + TQString method = VECTOR_METHOD_INIT; + method.replace(TQRegExp("%VARNAME%"),fieldVarName); + method.replace(TQRegExp("%VECTORTYPENAME%"), policyExt()->getVectorClassName()); stream << getIndent() << method << m_endl; } } if (!OBJECT_METHOD_INIT.isEmpty()) { - QStringList::Iterator it; + TQStringList::Iterator it; for( it = ObjectFieldVariables.begin(); it != ObjectFieldVariables.end(); ++it ) { - QString fieldVarName = *it; + TQString fieldVarName = *it; it++; - QString fieldClassName = *it; - QString method = OBJECT_METHOD_INIT; - method.replace(QRegExp("%VARNAME%"),fieldVarName); - method.replace(QRegExp("%ITEMCLASS%"),fieldClassName); + TQString fieldClassName = *it; + TQString method = OBJECT_METHOD_INIT; + method.replace(TQRegExp("%VARNAME%"),fieldVarName); + method.replace(TQRegExp("%ITEMCLASS%"),fieldClassName); stream << getIndent() << method << m_endl; } } @@ -1063,7 +1063,7 @@ void CppWriter::writeInitAttibuteMethod (QTextStream &stream) } // one day, this should print out non-empty constructor operations too. -void CppWriter::writeConstructorMethods(QTextStream &stream) +void CppWriter::writeConstructorMethods(TQTextStream &stream) { const bool generateEmptyConstructors = UMLApp::app()->getCommonPolicy()->getAutoGenerateConstructors(); @@ -1076,9 +1076,9 @@ void CppWriter::writeConstructorMethods(QTextStream &stream) if (!generateEmptyConstructors) return; - QString className = m_classifierInfo->className; + TQString className = m_classifierInfo->className; // empty constructor - QString indent = getIndent(); + TQString indent = getIndent(); stream << indent << className << "::" << className << " ( ) {" << m_endl; if(m_classifierInfo->hasAttributes) stream << indent << indent << "initAttributes();" << m_endl; @@ -1092,7 +1092,7 @@ void CppWriter::writeConstructorMethods(QTextStream &stream) // IF the type is "string" we need to declare it as // the Java Object "String" (there is no string primative in Java). -QString CppWriter::fixTypeName(const QString &string) +TQString CppWriter::fixTypeName(const TQString &string) { if (string.isEmpty()) return "void"; @@ -1102,7 +1102,7 @@ QString CppWriter::fixTypeName(const QString &string) } void CppWriter::writeOperations(UMLClassifier *c, bool isHeaderMethod, - Uml::Visibility permitScope, QTextStream &cpp) { + Uml::Visibility permitScope, TQTextStream &cpp) { UMLOperationList oplist; @@ -1128,16 +1128,16 @@ void CppWriter::writeOperations(UMLClassifier *c, bool isHeaderMethod, // write operation in either header or // a source file -void CppWriter::writeOperations(UMLOperationList &oplist, bool isHeaderMethod, QTextStream &cpp) { - QString className = m_classifierInfo->className; +void CppWriter::writeOperations(UMLOperationList &oplist, bool isHeaderMethod, TQTextStream &cpp) { + TQString className = m_classifierInfo->className; const bool generateEmptyConstructors = UMLApp::app()->getCommonPolicy()->getAutoGenerateConstructors(); // generate method decl for each operation given for (UMLOperation *op = oplist.first(); op; op = oplist.next()) { - QString returnStr; // buffer for documentation - QString methodReturnType; + TQString returnStr; // buffer for documentation + TQString methodReturnType; UMLAttributeList atl = op->getParmList(); // method parameters if (op->isConstructorOperation()) { @@ -1152,7 +1152,7 @@ void CppWriter::writeOperations(UMLOperationList &oplist, bool isHeaderMethod, Q returnStr += "@return " + methodReturnType + '\n'; } - QString str; + TQString str; if (op->getAbstract() || m_classifierInfo->isInterface) { if (isHeaderMethod) { // declare abstract method as 'virtual' @@ -1175,10 +1175,10 @@ void CppWriter::writeOperations(UMLOperationList &oplist, bool isHeaderMethod, Q // generate parameters uint j = 0; for (UMLAttribute *at = atl.first(); at; at = atl.next(), j++) { - QString typeName = fixTypeName(at->getTypeName()); - QString atName = cleanName(at->getName()); + TQString typeName = fixTypeName(at->getTypeName()); + TQString atName = cleanName(at->getName()); str += typeName + ' ' + atName; - const QString initVal = at->getInitialValue(); + const TQString initVal = at->getInitialValue(); if (! initVal.isEmpty()) str += " = " + initVal; if (j < atl.count() - 1) @@ -1207,7 +1207,7 @@ void CppWriter::writeOperations(UMLOperationList &oplist, bool isHeaderMethod, Q // of an association have roles we need to have forward declaration of // the other class...but only IF its not THIS class (as could happen // in self-association relationship). -void CppWriter::printAssociationIncludeDecl (UMLAssociationList list, Uml::IDType myId, QTextStream &stream) +void CppWriter::printAssociationIncludeDecl (UMLAssociationList list, Uml::IDType myId, TQTextStream &stream) { for (UMLAssociation *a = list.first(); a; a = list.next()) { @@ -1233,9 +1233,9 @@ void CppWriter::printAssociationIncludeDecl (UMLAssociationList list, Uml::IDTyp } } -QString CppWriter::fixInitialStringDeclValue(const QString &value, const QString &type) +TQString CppWriter::fixInitialStringDeclValue(const TQString &value, const TQString &type) { - QString val = value; + TQString val = value; // check for strings only if (!val.isEmpty() && type == policyExt()->getStringClassName()) { if (!val.startsWith("\"")) @@ -1247,37 +1247,37 @@ QString CppWriter::fixInitialStringDeclValue(const QString &value, const QString } // methods like this _shouldn't_ be needed IF we properly did things thruought the code. -QString CppWriter::getUMLObjectName(UMLObject *obj) +TQString CppWriter::getUMLObjectName(UMLObject *obj) { - return(obj!=0)?obj->getName():QString("NULL"); + return(obj!=0)?obj->getName():TQString("NULL"); } -void CppWriter::writeBlankLine(QTextStream &stream) +void CppWriter::writeBlankLine(TQTextStream &stream) { stream << m_endl; } -void CppWriter::printTextAsSeparateLinesWithIndent (const QString &text, const QString &indent, QTextStream &stream) +void CppWriter::printTextAsSeparateLinesWithIndent (const TQString &text, const TQString &indent, TQTextStream &stream) { if(text.isEmpty()) return; - QStringList lines = QStringList::split( "\n", text); + TQStringList lines = TQStringList::split( "\n", text); for(uint i= 0; i < lines.count(); i++) stream << indent << lines[i] << m_endl; } -QString CppWriter::getAttributeVariableName (UMLAttribute *at) +TQString CppWriter::getAttributeVariableName (UMLAttribute *at) { - QString fieldName = "m_" + cleanName(at->getName()); + TQString fieldName = "m_" + cleanName(at->getName()); return fieldName; } -QStringList CppWriter::defaultDatatypes() { +TQStringList CppWriter::defaultDatatypes() { return Codegen_Utils::cppDatatypes(); } -const QStringList CppWriter::reservedKeywords() const { +const TQStringList CppWriter::reservedKeywords() const { return Codegen_Utils::reservedCppKeywords(); } diff --git a/umbrello/umbrello/codegenerators/cppwriter.h b/umbrello/umbrello/codegenerators/cppwriter.h index 8ae58226..06f914e4 100644 --- a/umbrello/umbrello/codegenerators/cppwriter.h +++ b/umbrello/umbrello/codegenerators/cppwriter.h @@ -62,12 +62,12 @@ public: /** * Add C++ primitives as datatypes */ - QStringList defaultDatatypes(); + TQStringList defaultDatatypes(); /** * get list of reserved keywords */ - virtual const QStringList reservedKeywords() const; + virtual const TQStringList reservedKeywords() const; private: @@ -75,25 +75,25 @@ private: * Writes class's documentation to the class header * public abstract class Foo extents { */ - void writeClassDecl(UMLClassifier *c, QTextStream &cpp); + void writeClassDecl(UMLClassifier *c, TQTextStream &cpp); /** * Writes the comment and class constructor declaration or methods */ - void writeConstructorDecls(QTextStream &h); - void writeConstructorMethods(QTextStream &cpp); + void writeConstructorDecls(TQTextStream &h); + void writeConstructorMethods(TQTextStream &cpp); /** * write all field declarations, for both attributes and associations for the * given permitted scope. */ - void writeFieldDecl(UMLClassifier *c, Uml::Visibility permitScope, QTextStream &stream); + void writeFieldDecl(UMLClassifier *c, Uml::Visibility permitScope, TQTextStream &stream); /** * write all method declarations, for attributes and associations * for the given permitted scope. */ - void writeAccessorMethodDecl(UMLClassifier *c, Uml::Visibility permitScope, QTextStream &stream); + void writeAccessorMethodDecl(UMLClassifier *c, Uml::Visibility permitScope, TQTextStream &stream); /** * write all operations for a given class @@ -102,7 +102,7 @@ private: * @param permitScope what type of method to write (by Scope) * @param j the stream associated with the output file */ - void writeOperations(UMLClassifier *c, bool isHeaderMethod, Uml::Visibility permitScope, QTextStream &j); + void writeOperations(UMLClassifier *c, bool isHeaderMethod, Uml::Visibility permitScope, TQTextStream &j); /** * write a list of operations for a given class @@ -110,14 +110,14 @@ private: * @param isHeaderMethod true when writing to a header file, false for body file * @param j the stream associated with the output file */ - void writeOperations(UMLOperationList &list, bool isHeaderMethod, QTextStream &j); + void writeOperations(UMLOperationList &list, bool isHeaderMethod, TQTextStream &j); /** * write all attributes for a given class * @param c the class for which we are generating code * @param j the stream associated with the output file */ - void writeAttributes(UMLClassifier *c, QTextStream &j); + void writeAttributes(UMLClassifier *c, TQTextStream &j); /** * writes the Attribute declarations @@ -125,143 +125,143 @@ private: * @param writeStatic whether to write static or non-static attributes out * @param stream text stream */ - void writeAttributeDecls (Uml::Visibility visibility, bool writeStatic, QTextStream &stream ); + void writeAttributeDecls (Uml::Visibility visibility, bool writeStatic, TQTextStream &stream ); /** * Write out fields and operations for this class selected on a particular * visibility. */ - void writeHeaderFieldDecl(UMLClassifier *c, Uml::Visibility permitVisibility, QTextStream &stream); + void writeHeaderFieldDecl(UMLClassifier *c, Uml::Visibility permitVisibility, TQTextStream &stream); - void writeHeaderAttributeAccessorMethods (Uml::Visibility visibility, bool writeStatic, QTextStream &stream ); + void writeHeaderAttributeAccessorMethods (Uml::Visibility visibility, bool writeStatic, TQTextStream &stream ); - void writeHeaderAttributeAccessorMethodDecls(UMLClassifier *c, Uml::Visibility permitVisibility, QTextStream &stream); - void writeHeaderAccessorMethodDecl(UMLClassifier *c, Uml::Visibility permitScope, QTextStream &stream); + void writeHeaderAttributeAccessorMethodDecls(UMLClassifier *c, Uml::Visibility permitVisibility, TQTextStream &stream); + void writeHeaderAccessorMethodDecl(UMLClassifier *c, Uml::Visibility permitScope, TQTextStream &stream); /** * Searches a list of associations for appropriate ones to write out as attributes */ - void writeAssociationDecls(UMLAssociationList associations, Uml::Visibility permit, Uml::IDType id, QTextStream &stream); + void writeAssociationDecls(UMLAssociationList associations, Uml::Visibility permit, Uml::IDType id, TQTextStream &stream); /** * Writes out an association as an attribute using Vector */ - void writeAssociationRoleDecl(QString fieldClassName, QString roleName, QString multi, - QString doc, QTextStream &stream); + void writeAssociationRoleDecl(TQString fieldClassName, TQString roleName, TQString multi, + TQString doc, TQTextStream &stream); /** * calls @ref writeSingleAttributeAccessorMethods() on each of the attributes in attribs list. */ void writeAttributeMethods(UMLAttributeList *attribs, Uml::Visibility visib, bool isHeaderMethod, bool isStatic, - bool writeMethodBody, QTextStream &stream); + bool writeMethodBody, TQTextStream &stream); /** * calls @ref writeAssociationRoleMethod() on each of the associations in the given list */ void writeAssociationMethods(UMLAssociationList associations, Uml::Visibility permitVisib, bool isHeaderMethod, - bool writeMethodBody, bool writePointerVar, Uml::IDType id, QTextStream &stream); + bool writeMethodBody, bool writePointerVar, Uml::IDType id, TQTextStream &stream); /** * calls @ref writeSingleAttributeAccessorMethods() or @ref * writeVectorAttributeAccessorMethods() on the association * role */ - void writeAssociationRoleMethod(const QString &fieldClassName, bool isHeaderMethod, bool writeMethodBody, - const QString &roleName, const QString &multi, - const QString &description, Uml::Changeability_Type change, - QTextStream &stream); + void writeAssociationRoleMethod(const TQString &fieldClassName, bool isHeaderMethod, bool writeMethodBody, + const TQString &roleName, const TQString &multi, + const TQString &description, Uml::Changeability_Type change, + TQTextStream &stream); /** * Writes getFoo() and setFoo() accessor methods for the attribute */ void writeSingleAttributeAccessorMethods( - const QString &fieldClassName, const QString &Name, - const QString &fieldName, const QString &description, + const TQString &fieldClassName, const TQString &Name, + const TQString &fieldName, const TQString &description, Uml::Changeability_Type change, bool isHeaderMethod, - bool isStatic, bool writeMethodBody, QTextStream &cpp); + bool isStatic, bool writeMethodBody, TQTextStream &cpp); /** * Writes addFoo() and removeFoo() accessor methods for the Vector attribute */ void writeVectorAttributeAccessorMethods( - const QString &fieldClassName, const QString &fieldVarName, - const QString &fieldName, const QString &description, + const TQString &fieldClassName, const TQString &fieldVarName, + const TQString &fieldName, const TQString &description, Uml::Changeability_Type change, bool isHeaderMethod, bool writeMethodBody, - QTextStream &cpp); + TQTextStream &cpp); /** * Writes a // style comment */ - void writeComment(const QString &text, const QString &indent, QTextStream &cpp); + void writeComment(const TQString &text, const TQString &indent, TQTextStream &cpp); /** * Writes a documentation comment */ - void writeDocumentation(QString header, QString body, QString end, QTextStream &cpp); + void writeDocumentation(TQString header, TQString body, TQString end, TQTextStream &cpp); /** * write the header file for this classifier. */ - void writeHeaderFile (UMLClassifier *c, QFile &file); + void writeHeaderFile (UMLClassifier *c, TQFile &file); /** * write the source code body file for this classifier. */ - void writeSourceFile (UMLClassifier *c, QFile &file); + void writeSourceFile (UMLClassifier *c, TQFile &file); /** * utility method to break up a block of text, which has embedded newline chars, * and print them to a stream as separate lines of text, indented as directed. */ - void printTextAsSeparateLinesWithIndent (const QString &text, const QString &indent, - QTextStream &stream); + void printTextAsSeparateLinesWithIndent (const TQString &text, const TQString &indent, + TQTextStream &stream); /** * Intellegently print out header include/forward decl. for associated classes. */ - void printAssociationIncludeDecl (UMLAssociationList list, Uml::IDType this_id, QTextStream &stream); + void printAssociationIncludeDecl (UMLAssociationList list, Uml::IDType this_id, TQTextStream &stream); /** * If needed, write out the method to initialize attributes of our class. */ - void writeInitAttibuteMethod (QTextStream &stream); + void writeInitAttibuteMethod (TQTextStream &stream); /** * If needed, write out the declaration for the method to initialize attributes of our class. */ - void writeInitAttibuteDecl (QTextStream &stream); + void writeInitAttibuteDecl (TQTextStream &stream); /** * Returns the name of the given object (if it exists) */ - QString getUMLObjectName(UMLObject *obj); + TQString getUMLObjectName(UMLObject *obj); /** * Replaces `string' with STRING_TYPENAME. */ - QString fixTypeName(const QString &string); + TQString fixTypeName(const TQString &string); /** * check that initial values of strings have quotes around them */ - QString fixInitialStringDeclValue(const QString &value, const QString &type); + TQString fixInitialStringDeclValue(const TQString &value, const TQString &type); /** * Determine what the variable name of this attribute should be. */ - QString getAttributeVariableName (UMLAttribute *at); + TQString getAttributeVariableName (UMLAttribute *at); /** * Write a blank line */ - void writeBlankLine(QTextStream &stream); + void writeBlankLine(TQTextStream &stream); /** * Return the policy object @@ -273,18 +273,18 @@ private: */ ClassifierInfo * m_classifierInfo; - QString VECTOR_METHOD_APPEND; - QString VECTOR_METHOD_REMOVE; - QString VECTOR_METHOD_INIT; - QString OBJECT_METHOD_INIT; + TQString VECTOR_METHOD_APPEND; + TQString VECTOR_METHOD_REMOVE; + TQString VECTOR_METHOD_INIT; + TQString OBJECT_METHOD_INIT; /** * Create association methods for class attributes/associations/operations as inline decl in header. */ bool INLINE_ASSOCIATION_METHODS; - QStringList ObjectFieldVariables; - QStringList VectorFieldVariables; + TQStringList ObjectFieldVariables; + TQStringList VectorFieldVariables; }; diff --git a/umbrello/umbrello/codegenerators/csharpwriter.cpp b/umbrello/umbrello/codegenerators/csharpwriter.cpp index 73975b48..42b055e5 100644 --- a/umbrello/umbrello/codegenerators/csharpwriter.cpp +++ b/umbrello/umbrello/codegenerators/csharpwriter.cpp @@ -15,8 +15,8 @@ #include "csharpwriter.h" #include <kdebug.h> -#include <qregexp.h> -#include <qtextstream.h> +#include <tqregexp.h> +#include <tqtextstream.h> #include "../uml.h" #include "../umldoc.h" @@ -116,8 +116,8 @@ CSharpWriter::~CSharpWriter() { } -QStringList CSharpWriter::defaultDatatypes() { - QStringList l; +TQStringList CSharpWriter::defaultDatatypes() { + TQStringList l; l.append("bool"); l.append("byte"); l.append("char"); @@ -145,20 +145,20 @@ void CSharpWriter::writeClass(UMLClassifier *c) { return; } - QString classname = cleanName(c->getName()); + TQString classname = cleanName(c->getName()); //find an appropriate name for our file - QString fileName = findFileName(c, ".cs"); + TQString fileName = findFileName(c, ".cs"); if (fileName.isEmpty()) { emit codeGenerated(c, false); return; } - QFile filecs; + TQFile filecs; if (!openFile(filecs, fileName)) { emit codeGenerated(c, false); return; } - QTextStream cs(&filecs); + TQTextStream cs(&filecs); ////////////////////////////// //Start generating the code!! @@ -166,11 +166,11 @@ void CSharpWriter::writeClass(UMLClassifier *c) { //try to find a heading file (license, coments, etc) - QString str; + TQString str; str = getHeadingFile(".cs"); if (!str.isEmpty()) { - str.replace(QRegExp("%filename%"),fileName); - str.replace(QRegExp("%filepath%"),filecs.name()); + str.replace(TQRegExp("%filename%"),fileName); + str.replace(TQRegExp("%filepath%"),filecs.name()); cs<<str<<m_endl; } @@ -314,7 +314,7 @@ void CSharpWriter::writeClass(UMLClassifier *c) { //////////////////////////////////////////////////////////////////////////////////// // Helper Methods -void CSharpWriter::writeOperations(UMLClassifier *c, QTextStream &cs) { +void CSharpWriter::writeOperations(UMLClassifier *c, TQTextStream &cs) { //Lists to store operations sorted by scope UMLOperationList oppub,opprot,oppriv; @@ -382,7 +382,7 @@ void CSharpWriter::writeOperations(UMLClassifier *c, QTextStream &cs) { } -void CSharpWriter::writeOverridesRecursive(UMLClassifierList *superclasses, QTextStream &cs) { +void CSharpWriter::writeOverridesRecursive(UMLClassifierList *superclasses, TQTextStream &cs) { // oplist for implemented abstract operations UMLOperationList opabstract; opabstract.setAutoDelete(false); @@ -413,7 +413,7 @@ void CSharpWriter::writeOverridesRecursive(UMLClassifierList *superclasses, QTex } } } -void CSharpWriter::writeRealizationsRecursive(UMLClassifier *currentClass, UMLAssociationList *realizations, QTextStream &cs) { +void CSharpWriter::writeRealizationsRecursive(UMLClassifier *currentClass, UMLAssociationList *realizations, TQTextStream &cs) { UMLAssociation *a; for (a = realizations->first(); a; a = realizations->next()) { @@ -442,7 +442,7 @@ void CSharpWriter::writeRealizationsRecursive(UMLClassifier *currentClass, UMLAs } void CSharpWriter::writeOperations(UMLOperationList opList, - QTextStream &cs, bool isInterface /* = false */, + TQTextStream &cs, bool isInterface /* = false */, bool isOverride /* = false */, bool generateErrorStub /* = false */) { @@ -470,7 +470,7 @@ void CSharpWriter::writeOperations(UMLOperationList opList, if (forceDoc() || !at->getDoc().isEmpty()) { cs << m_container_indent << m_indentation << "/// <param name=\"" << cleanName(at->getName()) << "\">"; //removing newlines from parameter doc - cs << formatDoc(at->getDoc(), "").replace("\n", " ").remove('\r').replace(QRegExp(" $"), ""); + cs << formatDoc(at->getDoc(), "").replace("\n", " ").remove('\r').replace(TQRegExp(" $"), ""); cs << "</param>" << m_endl; } } @@ -521,8 +521,8 @@ void CSharpWriter::writeOperations(UMLOperationList opList, // no initial values in C# //<< (!(at->getInitialValue().isEmpty()) ? - // (QString(" = ")+at->getInitialValue()) : - // QString("")) + // (TQString(" = ")+at->getInitialValue()) : + // TQString("")) cs << ((j < i-1)?", ":""); } cs << ")"; @@ -543,7 +543,7 @@ void CSharpWriter::writeOperations(UMLOperationList opList, } } -void CSharpWriter::writeAttributes(UMLClassifier *c, QTextStream &cs) { +void CSharpWriter::writeAttributes(UMLClassifier *c, TQTextStream &cs) { UMLAttributeList atpub, atprot, atpriv, atdefval; atpub.setAutoDelete(false); @@ -597,7 +597,7 @@ void CSharpWriter::writeAttributes(UMLClassifier *c, QTextStream &cs) { } -void CSharpWriter::writeAttributes(UMLAttributeList &atList, QTextStream &cs) { +void CSharpWriter::writeAttributes(UMLAttributeList &atList, TQTextStream &cs) { for (UMLAttribute *at = atList.first(); at ; at = atList.next()) { @@ -613,7 +613,7 @@ void CSharpWriter::writeAttributes(UMLAttributeList &atList, QTextStream &cs) { return; } -void CSharpWriter::writeAssociatedAttributes(UMLAssociationList &associated, UMLClassifier *c, QTextStream &cs) { +void CSharpWriter::writeAssociatedAttributes(UMLAssociationList &associated, UMLClassifier *c, TQTextStream &cs) { UMLAssociation *a; for (a = associated.first(); a ; a = associated.next()) { @@ -626,12 +626,12 @@ void CSharpWriter::writeAssociatedAttributes(UMLAssociationList &associated, UML continue; } // Take name and documentaton from Role, take type name from the referenced object - QString roleName = cleanName(a->getRoleName(Uml::B)); - QString typeName = cleanName(o->getName()); + TQString roleName = cleanName(a->getRoleName(Uml::B)); + TQString typeName = cleanName(o->getName()); if (roleName.isEmpty()) { - roleName = QString("UnnamedRoleB_%1").arg(m_unnamedRoles++); + roleName = TQString("UnnamedRoleB_%1").arg(m_unnamedRoles++); } - QString roleDoc = a->getRoleDoc(Uml::B); + TQString roleDoc = a->getRoleDoc(Uml::B); //FIXME:is this simple condition enough? if (a->getMulti(Uml::B).isEmpty() || a->getMulti(Uml::B) == "1") { @@ -645,7 +645,7 @@ void CSharpWriter::writeAssociatedAttributes(UMLAssociationList &associated, UML } } -void CSharpWriter::writeAttribute(QString doc, Uml::Visibility visibility, bool isStatic, QString typeName, QString name, QString initialValue, bool asProperty, QTextStream &cs) { +void CSharpWriter::writeAttribute(TQString doc, Uml::Visibility visibility, bool isStatic, TQString typeName, TQString name, TQString initialValue, bool asProperty, TQTextStream &cs) { if (forceDoc() || !doc.isEmpty()) { @@ -691,7 +691,7 @@ void CSharpWriter::writeAttribute(QString doc, Uml::Visibility visibility, bool cs << ";" << m_endl << m_endl; } -QString CSharpWriter::makeLocalTypeName(UMLClassifierListItem *cl) { +TQString CSharpWriter::makeLocalTypeName(UMLClassifierListItem *cl) { UMLPackage *p = cl->getType()->getUMLPackage(); if (m_seenIncludes.findRef(p) != -1) { return cl->getType()->getName(); @@ -709,9 +709,9 @@ Uml::Programming_Language CSharpWriter::getLanguage() { return Uml::pl_CSharp; } -const QStringList CSharpWriter::reservedKeywords() const { +const TQStringList CSharpWriter::reservedKeywords() const { - static QStringList keywords; + static TQStringList keywords; if (keywords.isEmpty()) { for (int i = 0; reserved_words[i]; i++) diff --git a/umbrello/umbrello/codegenerators/csharpwriter.h b/umbrello/umbrello/codegenerators/csharpwriter.h index a6d20f2d..ef09bac5 100644 --- a/umbrello/umbrello/codegenerators/csharpwriter.h +++ b/umbrello/umbrello/codegenerators/csharpwriter.h @@ -49,12 +49,12 @@ public: /** * get list of reserved keywords */ - virtual const QStringList reservedKeywords() const; + virtual const TQStringList reservedKeywords() const; /** * get list of predefined data types */ - QStringList defaultDatatypes(); + TQStringList defaultDatatypes(); private: @@ -66,7 +66,7 @@ private: /** * Adds extra indenting if the class is in a container (namespace) */ - QString m_container_indent; + TQString m_container_indent; /** * Collection of included namespaces, to skip them from variable types. @@ -87,7 +87,7 @@ private: */ void writeRealizationsRecursive(UMLClassifier *currentClass, UMLAssociationList *realizations, - QTextStream &cs); + TQTextStream &cs); /** * write all operations for a given class @@ -95,7 +95,7 @@ private: * @param c the concept we are generating code for * @param cs output stream */ - void writeOperations(UMLClassifier *c, QTextStream &cs); + void writeOperations(UMLClassifier *c, TQTextStream &cs); /** * write a list of class operations @@ -106,7 +106,7 @@ private: * @param isOverride implementation of an inherited abstract function */ void writeOperations(UMLOperationList opList, - QTextStream &cs, + TQTextStream &cs, bool interface = false, bool isOverride = false, bool generateErrorStub = false); @@ -117,19 +117,19 @@ private: * @param superclasses List of superclasses to start recursing on * @param cs output stream */ - void writeOverridesRecursive(UMLClassifierList *superclasses, QTextStream &cs); + void writeOverridesRecursive(UMLClassifierList *superclasses, TQTextStream &cs); /** write all the attributes of a class * @param c the class we are generating code for * @param cs output stream */ - void writeAttributes(UMLClassifier *c, QTextStream &cs); + void writeAttributes(UMLClassifier *c, TQTextStream &cs); /** write a list of class attributes * @param atList the list of attributes * @param cs output stream */ - void writeAttributes(UMLAttributeList &atList, QTextStream &cs); + void writeAttributes(UMLAttributeList &atList, TQTextStream &cs); /** * write attributes from associated objects (compositions, aggregations) @@ -137,7 +137,7 @@ private: * @param c currently written class, to see association direction * @param cs output stream */ - void writeAssociatedAttributes(UMLAssociationList &associated, UMLClassifier *c, QTextStream &cs); + void writeAssociatedAttributes(UMLAssociationList &associated, UMLClassifier *c, TQTextStream &cs); /** * write a single attribute to the output stream @@ -150,13 +150,13 @@ private: * @param asProperty true writes as property (get/set), false writes single line variable * @param cs output stream */ - void writeAttribute(QString doc, Uml::Visibility visibility, bool isStatic, QString typeName, QString name, QString initialValue, bool asProperty, QTextStream &cs); + void writeAttribute(TQString doc, Uml::Visibility visibility, bool isStatic, TQString typeName, TQString name, TQString initialValue, bool asProperty, TQTextStream &cs); /** find the type in used namespaces, if namespace found return short name, complete otherwise. * * @param at Operation or Attribute to check type */ - QString makeLocalTypeName(UMLClassifierListItem *cl); + TQString makeLocalTypeName(UMLClassifierListItem *cl); }; diff --git a/umbrello/umbrello/codegenerators/dwriter.cpp b/umbrello/umbrello/codegenerators/dwriter.cpp index 3e16b136..088ab9c1 100644 --- a/umbrello/umbrello/codegenerators/dwriter.cpp +++ b/umbrello/umbrello/codegenerators/dwriter.cpp @@ -19,9 +19,9 @@ // own header #include "dwriter.h" // qt includes -#include <qfile.h> -#include <qtextstream.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqregexp.h> // kde includes #include <kdebug.h> // app includes @@ -45,14 +45,14 @@ Uml::Programming_Language DWriter::getLanguage() { } // FIXME: doesn't work yet -void DWriter::writeModuleDecl(UMLClassifier *c, QTextStream &d) { +void DWriter::writeModuleDecl(UMLClassifier *c, TQTextStream &d) { if(!c->getPackage().isEmpty()) d << "module " << c->getPackage() << ";" << m_endl; writeBlankLine(d); } -void DWriter::writeModuleImports(UMLClassifier *c, QTextStream &d) { +void DWriter::writeModuleImports(UMLClassifier *c, TQTextStream &d) { // another preparation, determine what we have UMLAssociationList associations = c->getSpecificAssocs(Uml::at_Association); // BAD! only way to get "general" associations. UMLAssociationList uniAssociations = c->getUniAssociationToBeImplemented(); @@ -74,7 +74,7 @@ void DWriter::writeModuleImports(UMLClassifier *c, QTextStream &d) { for (UMLPackage *con = imports.first(); con; con = imports.next()) { if (con->getBaseType() == Uml::ot_Datatype) continue; - QString pkg = con->getPackage(); + TQString pkg = con->getPackage(); if (!pkg.isEmpty() && pkg != c->getPackage()) d << "import " << pkg << "." << cleanName(con->getName()) << ";" << m_endl; @@ -91,7 +91,7 @@ void DWriter::writeClass(UMLClassifier *c) { isInterface = c->isInterface(); - QString fileName = cleanName(c->getName().lower()); + TQString fileName = cleanName(c->getName().lower()); //find an appropriate name for our file fileName = findFileName(c, ".d"); @@ -101,21 +101,21 @@ void DWriter::writeClass(UMLClassifier *c) { } // check that we may open that file for writing - QFile file; + TQFile file; if ( !openFile(file, fileName) ) { emit codeGenerated(c, false); return; } // open text stream to file - QTextStream d(&file); + TQTextStream d(&file); //try to find a heading file (license, coments, etc) - QString str; + TQString str; str = getHeadingFile(".d"); if(!str.isEmpty()) { - str.replace(QRegExp("%filename%"),fileName); - str.replace(QRegExp("%filepath%"),file.name()); + str.replace(TQRegExp("%filename%"),fileName); + str.replace(TQRegExp("%filepath%"),file.name()); d<<str<<m_endl; } @@ -278,7 +278,7 @@ void DWriter::writeClass(UMLClassifier *c) { emit codeGenerated(c, true); } -void DWriter::writeClassDecl(UMLClassifier *c, QTextStream &d) { +void DWriter::writeClassDecl(UMLClassifier *c, TQTextStream &d) { // class documentation if (!c->getDoc().isEmpty()) { @@ -311,7 +311,7 @@ void DWriter::writeClassDecl(UMLClassifier *c, QTextStream &d) { } // (c) class name - QString classname = cleanName(c->getName()); // our class name + TQString classname = cleanName(c->getName()); // our class name d << classname; // (d) template parameters @@ -367,11 +367,11 @@ void DWriter::writeClassDecl(UMLClassifier *c, QTextStream &d) { } } -void DWriter::writeProtectionMod(Uml::Visibility visibility, QTextStream &d) { +void DWriter::writeProtectionMod(Uml::Visibility visibility, TQTextStream &d) { d << m_indentation << scopeToDDecl(visibility) << ":" << m_endl << m_endl; } -void DWriter::writeAttributeDecl(Uml::Visibility visibility, UMLAttributeList &atlist, QTextStream &d) { +void DWriter::writeAttributeDecl(Uml::Visibility visibility, UMLAttributeList &atlist, TQTextStream &d) { if (atlist.count()==0) return; writeProtectionMod(visibility, d); @@ -400,14 +400,14 @@ void DWriter::writeAttributeDecl(Uml::Visibility visibility, UMLAttributeList &a d << cleanName(at->getName()); // initial value - QString initVal = fixInitialStringDeclValue(at->getInitialValue(), at->getTypeName()); + TQString initVal = fixInitialStringDeclValue(at->getInitialValue(), at->getTypeName()); if (!initVal.isEmpty()) d << " = " << initVal; d << ";" << m_endl << m_endl; } } void DWriter::writeAttributeDecls(UMLAttributeList &atpub, UMLAttributeList &atprot, - UMLAttributeList &atpriv, QTextStream &d ) { + UMLAttributeList &atpriv, TQTextStream &d ) { writeAttributeDecl(Uml::Visibility::Public, atpub, d); writeAttributeDecl(Uml::Visibility::Protected, atprot, d); @@ -415,31 +415,31 @@ void DWriter::writeAttributeDecls(UMLAttributeList &atpub, UMLAttributeList &atp //TODO: export and package } -void DWriter::writeAttributeMethods(UMLAttributeList &atpub, Uml::Visibility visibility, QTextStream &d) { +void DWriter::writeAttributeMethods(UMLAttributeList &atpub, Uml::Visibility visibility, TQTextStream &d) { if (atpub.count()==0) return; writeProtectionMod(visibility, d); for(UMLAttribute *at=atpub.first(); at; at=atpub.next()) { - QString fieldName = cleanName(at->getName()); + TQString fieldName = cleanName(at->getName()); writeSingleAttributeAccessorMethods( at->getTypeName(), "m_" + fieldName, fieldName, at->getDoc(), visibility, Uml::chg_Changeable, at->getStatic(), d); } } -void DWriter::writeComment(const QString &comment, const QString &myIndent, - QTextStream &d, bool dDocStyle) { +void DWriter::writeComment(const TQString &comment, const TQString &myIndent, + TQTextStream &d, bool dDocStyle) { if(dDocStyle) { d << myIndent << "/**" << m_endl; } - QStringList lines = QStringList::split("\n", comment); + TQStringList lines = TQStringList::split("\n", comment); if (lines.count() == 0) lines << comment; for (uint i = 0; i < lines.count(); ++i) { - QString tmp = lines[i]; + TQString tmp = lines[i]; while (tmp.length() > 77) { uint l = tmp.left(77).findRev(' '); @@ -460,7 +460,7 @@ void DWriter::writeComment(const QString &comment, const QString &myIndent, } } -void DWriter::writeDocumentation(QString header, QString body, QString end, QString indent, QTextStream &d) { +void DWriter::writeDocumentation(TQString header, TQString body, TQString end, TQString indent, TQTextStream &d) { d << indent << "/**" << m_endl; if (!header.isEmpty()) d << formatDoc(header, indent+" * "); @@ -468,14 +468,14 @@ void DWriter::writeDocumentation(QString header, QString body, QString end, QStr d << formatDoc(body, indent+" * "); if (!end.isEmpty()) { - QStringList lines = QStringList::split( "\n", end); + TQStringList lines = TQStringList::split( "\n", end); for (uint i= 0; i < lines.count(); i++) d << formatDoc(lines[i], indent + " * "); } d<<indent<< " */" << m_endl; } -void DWriter::writeAssociationDecls(UMLAssociationList associations, Uml::IDType id, QTextStream &d) { +void DWriter::writeAssociationDecls(UMLAssociationList associations, Uml::IDType id, TQTextStream &d) { if( forceSections() || !associations.isEmpty() ) { @@ -497,23 +497,23 @@ void DWriter::writeAssociationDecls(UMLAssociationList associations, Uml::IDType // print RoleB decl if (printRoleB) { - QString fieldClassName = cleanName(getUMLObjectName(a->getObject(Uml::B))); + TQString fieldClassName = cleanName(getUMLObjectName(a->getObject(Uml::B))); writeAssociationRoleDecl(fieldClassName, a->getRoleName(Uml::B), a->getMulti(Uml::B), a->getRoleDoc(Uml::B), a->getVisibility(Uml::B), d); } // print RoleA decl if (printRoleA) { - QString fieldClassName = cleanName(getUMLObjectName(a->getObject(Uml::A))); + TQString fieldClassName = cleanName(getUMLObjectName(a->getObject(Uml::A))); writeAssociationRoleDecl(fieldClassName, a->getRoleName(Uml::A), a->getMulti(Uml::A), a->getRoleDoc(Uml::A), a->getVisibility(Uml::A), d); } } } } -void DWriter::writeAssociationRoleDecl(QString fieldClassName, - QString roleName, QString multi, - QString doc, Uml::Visibility /*visib*/, QTextStream &d) { +void DWriter::writeAssociationRoleDecl(TQString fieldClassName, + TQString roleName, TQString multi, + TQString doc, Uml::Visibility /*visib*/, TQTextStream &d) { // ONLY write out IF there is a rolename given // otherwise its not meant to be declared in the code if (roleName.isEmpty()) return; @@ -527,7 +527,7 @@ void DWriter::writeAssociationRoleDecl(QString fieldClassName, // declare the association based on whether it is this a single variable // or a List (Vector). One day this will be done correctly with special // multiplicity object that we don't have to figure out what it means via regex. - if(multi.isEmpty() || multi.contains(QRegExp("^[01]$"))) { + if(multi.isEmpty() || multi.contains(TQRegExp("^[01]$"))) { d << m_indentation << fieldClassName << " "; if (hasAccessors) d << "m_"; @@ -548,7 +548,7 @@ void DWriter::writeAssociationRoleDecl(QString fieldClassName, writeBlankLine(d); } -void DWriter::writeAssociationMethods (UMLAssociationList associations, UMLClassifier *thisClass, QTextStream &d) { +void DWriter::writeAssociationMethods (UMLAssociationList associations, UMLClassifier *thisClass, TQTextStream &d) { if( forceSections() || !associations.isEmpty() ) { for(UMLAssociation *a = associations.first(); a; a = associations.next()) { // insert the methods to access the role of the other @@ -556,7 +556,7 @@ void DWriter::writeAssociationMethods (UMLAssociationList associations, UMLClass if (a->getObjectId(Uml::A) == thisClass->getID()) { // only write out IF there is a rolename given if(!a->getRoleName(Uml::B).isEmpty()) { - QString fieldClassName = getUMLObjectName(a->getObject(Uml::B)); + TQString fieldClassName = getUMLObjectName(a->getObject(Uml::B)); writeAssociationRoleMethod(fieldClassName, a->getRoleName(Uml::B), a->getMulti(Uml::B), a->getRoleDoc(Uml::B), @@ -568,7 +568,7 @@ void DWriter::writeAssociationMethods (UMLAssociationList associations, UMLClass if (a->getObjectId(Uml::B) == thisClass->getID()) { // only write out IF there is a rolename given if(!a->getRoleName(Uml::A).isEmpty()) { - QString fieldClassName = getUMLObjectName(a->getObject(Uml::A)); + TQString fieldClassName = getUMLObjectName(a->getObject(Uml::A)); writeAssociationRoleMethod(fieldClassName, a->getRoleName(Uml::A), a->getMulti(Uml::A), a->getRoleDoc(Uml::A), @@ -581,30 +581,30 @@ void DWriter::writeAssociationMethods (UMLAssociationList associations, UMLClass } } -void DWriter::writeAssociationRoleMethod (QString fieldClassName, QString roleName, QString multi, - QString description, Uml::Visibility visib, Uml::Changeability_Type change, - QTextStream &d) { - if(multi.isEmpty() || multi.contains(QRegExp("^[01]$"))) { - QString fieldVarName = "m_" + deCapitaliseFirstLetter(roleName); +void DWriter::writeAssociationRoleMethod (TQString fieldClassName, TQString roleName, TQString multi, + TQString description, Uml::Visibility visib, Uml::Changeability_Type change, + TQTextStream &d) { + if(multi.isEmpty() || multi.contains(TQRegExp("^[01]$"))) { + TQString fieldVarName = "m_" + deCapitaliseFirstLetter(roleName); writeSingleAttributeAccessorMethods( fieldClassName, fieldVarName, roleName, description, visib, change, false, d); } else { - QString fieldVarName = "m_" + pluralize(deCapitaliseFirstLetter(roleName)); + TQString fieldVarName = "m_" + pluralize(deCapitaliseFirstLetter(roleName)); writeVectorAttributeAccessorMethods( fieldClassName, fieldVarName, pluralize(roleName), description, visib, change, d); } } -void DWriter::writeVectorAttributeAccessorMethods (QString fieldClassName, QString fieldVarName, - QString fieldName, QString description, +void DWriter::writeVectorAttributeAccessorMethods (TQString fieldClassName, TQString fieldVarName, + TQString fieldName, TQString description, Uml::Visibility /*visibility*/, Uml::Changeability_Type changeType, - QTextStream &d) { + TQTextStream &d) { fieldClassName = fixTypeName(fieldClassName); - QString fieldNameUP = unPluralize(fieldName); - QString fieldNameUC = Codegen_Utils::capitalizeFirstLetter(fieldNameUP); + TQString fieldNameUP = unPluralize(fieldName); + TQString fieldNameUC = Codegen_Utils::capitalizeFirstLetter(fieldNameUP); // ONLY IF changeability is NOT Frozen if (changeType != Uml::chg_Frozen) { @@ -646,12 +646,12 @@ void DWriter::writeVectorAttributeAccessorMethods (QString fieldClassName, QStri } -void DWriter::writeSingleAttributeAccessorMethods(QString fieldClassName, - QString fieldVarName, QString fieldName, QString description, Uml::Visibility /*visibility*/, - Uml::Changeability_Type change, bool isFinal, QTextStream &d) { +void DWriter::writeSingleAttributeAccessorMethods(TQString fieldClassName, + TQString fieldVarName, TQString fieldName, TQString description, Uml::Visibility /*visibility*/, + Uml::Changeability_Type change, bool isFinal, TQTextStream &d) { fieldClassName = fixTypeName(fieldClassName); - QString fieldNameUC = Codegen_Utils::capitalizeFirstLetter(fieldName); + TQString fieldNameUC = Codegen_Utils::capitalizeFirstLetter(fieldName); if (fieldName.left(2) == "m_") fieldName = fieldName.right(fieldName.length()-2); // set method @@ -676,7 +676,7 @@ void DWriter::writeSingleAttributeAccessorMethods(QString fieldClassName, d << startline << "}" << m_endl << m_endl; } -void DWriter::writeConstructor(UMLClassifier *c, QTextStream &d) { +void DWriter::writeConstructor(UMLClassifier *c, TQTextStream &d) { if (forceDoc()) { @@ -688,7 +688,7 @@ void DWriter::writeConstructor(UMLClassifier *c, QTextStream &d) { } // write the first constructor - QString className = cleanName(c->getName()); + TQString className = cleanName(c->getName()); d << m_indentation << "public this("<<") { }"; } @@ -696,7 +696,7 @@ void DWriter::writeConstructor(UMLClassifier *c, QTextStream &d) { // IF the type is "string" we need to declare it as // the D Object "String" (there is no string primative in D). // Same thing again for "bool" to "boolean" -QString DWriter::fixTypeName(const QString& string) { +TQString DWriter::fixTypeName(const TQString& string) { if (string.isEmpty()) return "void"; if (string == "string") @@ -710,8 +710,8 @@ QString DWriter::fixTypeName(const QString& string) { return string; } -QStringList DWriter::defaultDatatypes() { - QStringList l; +TQStringList DWriter::defaultDatatypes() { + TQStringList l; l << "void" << "bool" << "byte" @@ -805,7 +805,7 @@ void DWriter::getInterfacesOperationsToBeImplemented(UMLClassifier *c, UMLOperat } } -void DWriter::writeOperations(UMLClassifier *c, QTextStream &d) { +void DWriter::writeOperations(UMLClassifier *c, TQTextStream &d) { UMLOperationList opl; UMLOperationList oppub,opprot,oppriv; oppub.setAutoDelete(false); @@ -862,16 +862,16 @@ void DWriter::writeOperations(UMLClassifier *c, QTextStream &d) { } -void DWriter::writeOperations(UMLOperationList &oplist, QTextStream &d) { +void DWriter::writeOperations(UMLOperationList &oplist, TQTextStream &d) { UMLAttributeList atl; - QString str; + TQString str; // generate method decl for each operation given for(UMLOperation *op=oplist.first(); op; op=oplist.next()) { - QString returnStr = ""; + TQString returnStr = ""; // write documentation - QString methodReturnType = fixTypeName(op->getTypeName()); + TQString methodReturnType = fixTypeName(op->getTypeName()); //TODO: return type comment if(methodReturnType != "void") { @@ -888,12 +888,12 @@ void DWriter::writeOperations(UMLOperationList &oplist, QTextStream &d) { int i = atl.count(); int j = 0; for (UMLAttribute *at = atl.first(); at; at = atl.next(), j++) { - QString typeName = fixTypeName(at->getTypeName()); - QString atName = cleanName(at->getName()); + TQString typeName = fixTypeName(at->getTypeName()); + TQString atName = cleanName(at->getName()); str += typeName + ' ' + atName + (!(at->getInitialValue().isEmpty()) ? - (QString(" = ")+at->getInitialValue()) : - QString("")) + (TQString(" = ")+at->getInitialValue()) : + TQString("")) + ((j < i-1)?", ":""); returnStr += "@param " + atName+' '+at->getDoc() + m_endl; } @@ -912,7 +912,7 @@ void DWriter::writeOperations(UMLOperationList &oplist, QTextStream &d) { } } -QString DWriter::fixInitialStringDeclValue(QString value, QString type) { +TQString DWriter::fixInitialStringDeclValue(TQString value, TQString type) { // check for strings only if (!value.isEmpty() && type == "String") { if (!value.startsWith("\"")) @@ -923,8 +923,8 @@ QString DWriter::fixInitialStringDeclValue(QString value, QString type) { return value; } -QString DWriter::scopeToDDecl(Uml::Visibility scope) { - QString scopeString; +TQString DWriter::scopeToDDecl(Uml::Visibility scope) { + TQString scopeString; switch(scope) { case Uml::Visibility::Public: scopeString = "public"; break; @@ -937,20 +937,20 @@ QString DWriter::scopeToDDecl(Uml::Visibility scope) { } // methods like this _shouldn't_ be needed IF we properly did things thruought the code. -QString DWriter::getUMLObjectName(UMLObject *obj) { - return(obj!=0)?obj->getName():QString("NULL"); +TQString DWriter::getUMLObjectName(UMLObject *obj) { + return(obj!=0)?obj->getName():TQString("NULL"); } -QString DWriter::deCapitaliseFirstLetter(QString string) { +TQString DWriter::deCapitaliseFirstLetter(TQString string) { string.replace( 0, 1, string[0].lower()); return string; } -QString DWriter::pluralize(QString string) { +TQString DWriter::pluralize(TQString string) { return string + (string.right(1) == "s" ? "es" : "s"); } -QString DWriter::unPluralize(QString string) { +TQString DWriter::unPluralize(TQString string) { // does not handle special cases liek datum -> data, etc. if (string.length() > 2 && string.right(3) == "ses") { @@ -964,7 +964,7 @@ QString DWriter::unPluralize(QString string) { return string; } -void DWriter::writeBlankLine(QTextStream &d) { +void DWriter::writeBlankLine(TQTextStream &d) { d << m_endl; } diff --git a/umbrello/umbrello/codegenerators/dwriter.h b/umbrello/umbrello/codegenerators/dwriter.h index 38828359..2a738d01 100644 --- a/umbrello/umbrello/codegenerators/dwriter.h +++ b/umbrello/umbrello/codegenerators/dwriter.h @@ -59,30 +59,30 @@ public: /** * Overrides method from class CodeGenerator */ - QStringList defaultDatatypes(); + TQStringList defaultDatatypes(); private: /** * Writes the module declaration. */ - void writeModuleDecl(UMLClassifier *c, QTextStream &d); + void writeModuleDecl(UMLClassifier *c, TQTextStream &d); /** * Writes the module imports. */ - void writeModuleImports(UMLClassifier *c, QTextStream &d); + void writeModuleImports(UMLClassifier *c, TQTextStream &d); /** * Writes class's documentation then the class header * public abstract class Foo extents { */ - void writeClassDecl(UMLClassifier *c, QTextStream &d); + void writeClassDecl(UMLClassifier *c, TQTextStream &d); /** * Writes the comment and class constructor */ - void writeConstructor(UMLClassifier *c, QTextStream &d); + void writeConstructor(UMLClassifier *c, TQTextStream &d); /** * return true if the two operations have the same name and the same parameters @@ -120,28 +120,28 @@ private: * @param c the class for which we are generating code * @param j the stream associated with the output file */ - void writeOperations(UMLClassifier *c, QTextStream &j); + void writeOperations(UMLClassifier *c, TQTextStream &j); /** * write a list of operations for a given class * @param list the list of operations you want to write * @param j the stream associated with the output file */ - void writeOperations(UMLOperationList &list, QTextStream &j); + void writeOperations(UMLOperationList &list, TQTextStream &j); /** * write all attributes for a given class * @param c the class for which we are generating code * @param j the stream associated with the output file */ - void writeAttributes(UMLClassifier *c, QTextStream &j); + void writeAttributes(UMLClassifier *c, TQTextStream &j); /** * Writes the protection modifier line. * @param visibility protection modifier * @param d text stream */ - void writeProtectionMod(Uml::Visibility visibility, QTextStream &d); + void writeProtectionMod(Uml::Visibility visibility, TQTextStream &d); /** * Writes attribute declarations with a specific @@ -150,7 +150,7 @@ private: * @param atlist attribute list * @param d text stream */ - void writeAttributeDecl(Uml::Visibility visibility, UMLAttributeList &atlist, QTextStream &d); + void writeAttributeDecl(Uml::Visibility visibility, UMLAttributeList &atlist, TQTextStream &d); /** * writes the Attribute declarations @@ -160,109 +160,109 @@ private: * @param d text stream */ void writeAttributeDecls(UMLAttributeList &atpub, UMLAttributeList &atprot, - UMLAttributeList &atpriv, QTextStream &d ); + UMLAttributeList &atpriv, TQTextStream &d ); /** * Searches a list of associations for appropriate ones to write out as attributes */ - void writeAssociationDecls(UMLAssociationList associations, Uml::IDType id, QTextStream &d); + void writeAssociationDecls(UMLAssociationList associations, Uml::IDType id, TQTextStream &d); /** * Writes out an association as an attribute using Vector */ - void writeAssociationRoleDecl(QString fieldClassName, QString roleName, QString multi, - QString doc, Uml::Visibility visib, QTextStream &d); + void writeAssociationRoleDecl(TQString fieldClassName, TQString roleName, TQString multi, + TQString doc, Uml::Visibility visib, TQTextStream &d); /** * calls @ref writeSingleAttributeAccessorMethods() on each of the attributes in atpub */ - void writeAttributeMethods(UMLAttributeList &atpub, Uml::Visibility visibility, QTextStream &d); + void writeAttributeMethods(UMLAttributeList &atpub, Uml::Visibility visibility, TQTextStream &d); /** * calls @ref writeAssociationRoleMethod() on each of the associations in the given list */ void writeAssociationMethods(UMLAssociationList associations, UMLClassifier *thisClass, - QTextStream &d); + TQTextStream &d); /** * calls @ref writeSingleAttributeAccessorMethods() or @ref * writeVectorAttributeAccessorMethods() on the assocaition * role */ - void writeAssociationRoleMethod(QString fieldClassName, QString roleName, QString multi, - QString description, Uml::Visibility visib, Uml::Changeability_Type change, - QTextStream &d); + void writeAssociationRoleMethod(TQString fieldClassName, TQString roleName, TQString multi, + TQString description, Uml::Visibility visib, Uml::Changeability_Type change, + TQTextStream &d); /** * Writes getFoo() and setFoo() accessor methods for the attribute */ - void writeSingleAttributeAccessorMethods(QString fieldClassName, QString fieldVarName, - QString fieldName, QString description, + void writeSingleAttributeAccessorMethods(TQString fieldClassName, TQString fieldVarName, + TQString fieldName, TQString description, Uml::Visibility visibility, Uml::Changeability_Type change, - bool isFinal, QTextStream &d); + bool isFinal, TQTextStream &d); /** * Writes addFoo() and removeFoo() accessor methods for the Vector attribute */ - void writeVectorAttributeAccessorMethods(QString fieldClassName, QString fieldVarName, - QString fieldName, QString description, + void writeVectorAttributeAccessorMethods(TQString fieldClassName, TQString fieldVarName, + TQString fieldName, TQString description, Uml::Visibility visibility, Uml::Changeability_Type change, - QTextStream &d); + TQTextStream &d); /** * Writes a // style comment */ - void writeComment(const QString &text, const QString &indent, QTextStream &d, bool dDocStyle=false); + void writeComment(const TQString &text, const TQString &indent, TQTextStream &d, bool dDocStyle=false); /** * Writes a documentation comment */ - void writeDocumentation(QString header, QString body, QString end, QString indent, QTextStream &d); + void writeDocumentation(TQString header, TQString body, TQString end, TQString indent, TQTextStream &d); /** * Returns the name of the given object (if it exists) */ - QString getUMLObjectName(UMLObject *obj); + TQString getUMLObjectName(UMLObject *obj); /** * Lowers the case of the first letter in the given string */ - QString deCapitaliseFirstLetter(QString string); + TQString deCapitaliseFirstLetter(TQString string); /** * Returns the plural form of a subject. */ - QString pluralize(QString string); + TQString pluralize(TQString string); /** * Returns the non-plural form of a subject. */ - QString unPluralize(QString string); + TQString unPluralize(TQString string); /** * Replaces `string' with `String' and `bool' with `boolean' */ - QString fixTypeName(const QString& string); + TQString fixTypeName(const TQString& string); /** * check that initial values of strings have quotes around them */ - QString fixInitialStringDeclValue(QString value, QString type); + TQString fixInitialStringDeclValue(TQString value, TQString type); /** * Write a blank line */ - void writeBlankLine(QTextStream& d); + void writeBlankLine(TQTextStream& d); /** * a little method for converting scope to string value */ - QString scopeToDDecl(Uml::Visibility scope); + TQString scopeToDDecl(Uml::Visibility scope); /** * A \n, used at the end of each line */ - QString startline; + TQString startline; /** * Whether or not this concept is an interface. diff --git a/umbrello/umbrello/codegenerators/idlwriter.cpp b/umbrello/umbrello/codegenerators/idlwriter.cpp index a893acc3..dc367f50 100644 --- a/umbrello/umbrello/codegenerators/idlwriter.cpp +++ b/umbrello/umbrello/codegenerators/idlwriter.cpp @@ -13,9 +13,9 @@ #include <kdebug.h> #include <kmessagebox.h> -#include <qfile.h> -#include <qregexp.h> -#include <qtextstream.h> +#include <tqfile.h> +#include <tqregexp.h> +#include <tqtextstream.h> #include "../umldoc.h" #include "../classifier.h" @@ -34,7 +34,7 @@ IDLWriter::IDLWriter() : SimpleCodeGenerator(false) { IDLWriter::~IDLWriter() {} bool IDLWriter::isOOClass(UMLClassifier *c) { - QString stype = c->getStereotype(); + TQString stype = c->getStereotype(); if (stype == "CORBAConstant" || stype == "CORBAEnum" || stype == "CORBAStruct" || stype == "CORBAUnion" || stype == "CORBASequence" || stype == "CORBAArray" || @@ -59,7 +59,7 @@ Uml::Programming_Language IDLWriter::getLanguage() { } void IDLWriter::computeAssocTypeAndRole -(UMLAssociation *a, UMLClassifier *c, QString& typeName, QString& roleName) +(UMLAssociation *a, UMLClassifier *c, TQString& typeName, TQString& roleName) { // Determine which is the "remote" end of the association: bool IAmRoleA = true; @@ -70,9 +70,9 @@ void IDLWriter::computeAssocTypeAndRole at == Uml::at_UniAssociation) { // Assuming unidirectional association, and we are // at the "wrong" side. - // Returning roleName = QString::null tells caller to + // Returning roleName = TQString::null tells caller to // skip this association at this side. - roleName = QString(); + roleName = TQString(); return; } IAmRoleA = false; @@ -80,7 +80,7 @@ void IDLWriter::computeAssocTypeAndRole } // Construct the type name: typeName = cleanName(other->getName()); - QString multiplicity; + TQString multiplicity; if (IAmRoleA) multiplicity = a->getMulti(Uml::B); else @@ -107,16 +107,16 @@ void IDLWriter::writeClass(UMLClassifier *c) { } const bool isClass = !c->isInterface(); - QString classname = cleanName(c->getName()); + TQString classname = cleanName(c->getName()); //find an appropriate name for our file - QString fileName = findFileName(c, ".idl"); + TQString fileName = findFileName(c, ".idl"); if (fileName.isEmpty()) { emit codeGenerated(c, false); return; } - QFile file; + TQFile file; if (!openFile(file, fileName)) { emit codeGenerated(c, false); return; @@ -124,13 +124,13 @@ void IDLWriter::writeClass(UMLClassifier *c) { // Start generating the code. - QTextStream idl(&file); + TQTextStream idl(&file); //try to find a heading file(license, comments, etc) - QString str; + TQString str; str = getHeadingFile(".idl"); if (!str.isEmpty()) { - str.replace(QRegExp("%filename%"), fileName); - str.replace(QRegExp("%filepath%"), file.name()); + str.replace(TQRegExp("%filename%"), fileName); + str.replace(TQRegExp("%filepath%"), file.name()); idl << str << m_endl; } @@ -141,7 +141,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { for (UMLPackage *conc = includes.first(); conc; conc = includes.next()) { if (conc->getBaseType() == Uml::ot_Datatype) continue; - QString incName = findFileName(conc, ".idl"); + TQString incName = findFileName(conc, ".idl"); if (!incName.isEmpty()) idl << "#include \"" << incName << "\"" << m_endl; } @@ -171,7 +171,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { idl << getIndent() << "enum " << classname << " {" << m_endl; m_indentLevel++; for (UMLClassifierListItem *lit = litList.first(); lit; lit = litList.next()) { - QString enumLiteral = cleanName(lit->getName()); + TQString enumLiteral = cleanName(lit->getName()); idl << getIndent() << enumLiteral; if (++i < litList.count()) idl << ","; @@ -187,7 +187,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { return; } if (! isOOClass(c)) { - QString stype = c->getStereotype(); + TQString stype = c->getStereotype(); if (stype == "CORBAConstant") { kError() << "The stereotype " << stype << " cannot be applied to " << c->getName() << ", but only to attributes." << endl; @@ -206,7 +206,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { m_indentLevel++; uint i = 0; for (at = atl.first(); at; at = atl.next()) { - QString enumLiteral = cleanName(at->getName()); + TQString enumLiteral = cleanName(at->getName()); idl << getIndent() << enumLiteral; if (++i < atl.count()) idl << ","; @@ -220,7 +220,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { idl << getIndent() << "struct " << classname << " {" << m_endl; m_indentLevel++; for (at = atl.first(); at; at = atl.next()) { - QString name = cleanName(at->getName()); + TQString name = cleanName(at->getName()); idl << getIndent() << at->getTypeName() << " " << name << ";" << m_endl; // Initial value not possible in IDL. } @@ -228,7 +228,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { if (!compositions.isEmpty()) { idl << getIndent() << "// Compositions." << m_endl; for (UMLAssociation *a = compositions.first(); a; a = compositions.next()) { - QString memberType, memberName; + TQString memberType, memberName; computeAssocTypeAndRole(a, c, memberType, memberName); idl << getIndent() << memberType << " " << memberName << ";" << m_endl; } @@ -237,7 +237,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { if (!aggregations.isEmpty()) { idl << getIndent() << "// Aggregations." << m_endl; for (UMLAssociation *a = aggregations.first(); a; a = aggregations.next()) { - QString memberType, memberName; + TQString memberType, memberName; computeAssocTypeAndRole(a, c, memberType, memberName); idl << getIndent() << memberType << " " << memberName << ";" << m_endl; } @@ -294,7 +294,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { for (a = assocs.first(); a; a = assocs.next()) { if (! assocTypeIsMappableToAttribute(a->getAssocType())) continue; - QString multiplicity = a->getMulti(Uml::A); + TQString multiplicity = a->getMulti(Uml::A); if (multiplicity.isEmpty() || multiplicity == "1") continue; if (!didComment) { @@ -302,7 +302,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { didComment = true; } UMLClassifier* other = (UMLClassifier*)a->getObject(Uml::A); - QString bareName = cleanName(other->getName()); + TQString bareName = cleanName(other->getName()); idl << getIndent() << "typedef sequence<" << other->getFullyQualifiedName("::") << "> " << bareName << "Vector;" << m_endl << m_endl; } @@ -313,7 +313,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { if (forceSections() || atl.count()) { idl << getIndent() << "// Attributes:" << m_endl << m_endl; for (UMLAttribute *at = atl.first(); at; at = atl.next()) { - QString attName = cleanName(at->getName()); + TQString attName = cleanName(at->getName()); Uml::Visibility scope = at->getVisibility(); idl << getIndent(); if (isValuetype) { @@ -358,7 +358,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { Uml::Association_Type at = a->getAssocType(); if (! assocTypeIsMappableToAttribute(at)) continue; - QString typeName, roleName; + TQString typeName, roleName; computeAssocTypeAndRole(a, c, typeName, roleName); if (roleName.isEmpty()) // presumably because we are at the "wrong" end continue; @@ -386,9 +386,9 @@ void IDLWriter::writeClass(UMLClassifier *c) { } -void IDLWriter::writeOperation(UMLOperation *op, QTextStream &idl, bool is_comment) { +void IDLWriter::writeOperation(UMLOperation *op, TQTextStream &idl, bool is_comment) { UMLAttributeList atl = op->getParmList(); - QString rettype = op->getTypeName(); + TQString rettype = op->getTypeName(); if (rettype.isEmpty()) rettype = "void"; @@ -420,8 +420,8 @@ void IDLWriter::writeOperation(UMLOperation *op, QTextStream &idl, bool is_comme idl << ");" << m_endl << m_endl; } -QStringList IDLWriter::defaultDatatypes() { - QStringList l; +TQStringList IDLWriter::defaultDatatypes() { + TQStringList l; l.append("boolean"); l.append("char"); l.append("octet"); @@ -436,9 +436,9 @@ QStringList IDLWriter::defaultDatatypes() { return l; } -const QStringList IDLWriter::reservedKeywords() const { +const TQStringList IDLWriter::reservedKeywords() const { - static QStringList keywords; + static TQStringList keywords; if (keywords.isEmpty()) { keywords << "any" diff --git a/umbrello/umbrello/codegenerators/idlwriter.h b/umbrello/umbrello/codegenerators/idlwriter.h index c44cabd6..25e427dd 100644 --- a/umbrello/umbrello/codegenerators/idlwriter.h +++ b/umbrello/umbrello/codegenerators/idlwriter.h @@ -46,12 +46,12 @@ public: */ virtual Uml::Programming_Language getLanguage(); - QStringList defaultDatatypes(); + TQStringList defaultDatatypes(); /** * get list of reserved keywords */ - virtual const QStringList reservedKeywords() const; + virtual const TQStringList reservedKeywords() const; private: @@ -60,10 +60,10 @@ private: * @param op the class for which we are generating code * @param idl the stream associated with the output file */ - void writeOperation(UMLOperation* op, QTextStream& idl, bool is_comment = false); + void writeOperation(UMLOperation* op, TQTextStream& idl, bool is_comment = false); void computeAssocTypeAndRole(UMLAssociation* a, UMLClassifier *c, - QString& typeName, QString& roleName); + TQString& typeName, TQString& roleName); static bool isOOClass(UMLClassifier* c); diff --git a/umbrello/umbrello/codegenerators/javaantcodedocument.cpp b/umbrello/umbrello/codegenerators/javaantcodedocument.cpp index a3a174a3..cc9e394b 100644 --- a/umbrello/umbrello/codegenerators/javaantcodedocument.cpp +++ b/umbrello/umbrello/codegenerators/javaantcodedocument.cpp @@ -18,7 +18,7 @@ #include "javaantcodedocument.h" // qt/kde includes -#include <qregexp.h> +#include <tqregexp.h> #include <kdebug.h> // local includes @@ -67,25 +67,25 @@ HierarchicalCodeBlock * JavaANTCodeDocument::newHierarchicalCodeBlock ( ) { // is so we can create the XMLNodes, if needed. // would be better if we could create a handler interface that each // codeblock used so all we have to do here is add the handler -void JavaANTCodeDocument::loadChildTextBlocksFromNode ( QDomElement & root) +void JavaANTCodeDocument::loadChildTextBlocksFromNode ( TQDomElement & root) { - QDomNode tnode = root.firstChild(); - QDomElement telement = tnode.toElement(); + TQDomNode tnode = root.firstChild(); + TQDomElement telement = tnode.toElement(); bool loadCheckForChildrenOK = false; while( !telement.isNull() ) { - QString nodeName = telement.tagName(); + TQString nodeName = telement.tagName(); if( nodeName == "textblocks" ) { - QDomNode node = telement.firstChild(); - QDomElement element = node.toElement(); + TQDomNode node = telement.firstChild(); + TQDomElement element = node.toElement(); // if there is nothing to begin with, then we don't worry about it loadCheckForChildrenOK = element.isNull() ? true : false; while( !element.isNull() ) { - QString name = element.tagName(); + TQString name = element.tagName(); if( name == "codecomment" ) { CodeComment * block = new XMLCodeComment(this); @@ -100,7 +100,7 @@ void JavaANTCodeDocument::loadChildTextBlocksFromNode ( QDomElement & root) if( name == "codeaccessormethod" || name == "ccfdeclarationcodeblock" ) { - QString acctag = element.attribute("tag",""); + TQString acctag = element.attribute("tag",""); // search for our method in the TextBlock * tb = findCodeClassFieldTextBlockByTag(acctag); if(!tb || !addTextBlock(tb)) @@ -146,7 +146,7 @@ void JavaANTCodeDocument::loadChildTextBlocksFromNode ( QDomElement & root) } else if( name == "codeoperation" ) { // find the code operation by id - QString id = element.attribute("parent_id","-1"); + TQString id = element.attribute("parent_id","-1"); UMLObject * obj = UMLApp::app()->getDocument()->findObjectById(STR2ID(id)); UMLOperation * op = dynamic_cast<UMLOperation*>(obj); if(op) { @@ -165,7 +165,7 @@ void JavaANTCodeDocument::loadChildTextBlocksFromNode ( QDomElement & root) kError()<<"Unable to find operation create codeoperation for:"<<this<<endl; } else if( name == "xmlelementblock" ) { - QString xmltag = element.attribute("nodeName","UNKNOWN"); + TQString xmltag = element.attribute("nodeName","UNKNOWN"); XMLElementCodeBlock * block = new XMLElementCodeBlock(this,xmltag); block->loadFromXMI(element); if(!addTextBlock(block)) @@ -211,7 +211,7 @@ void JavaANTCodeDocument::loadChildTextBlocksFromNode ( QDomElement & root) /** set the class attributes of this object from * the passed element node. */ -void JavaANTCodeDocument::setAttributesFromNode ( QDomElement & root) +void JavaANTCodeDocument::setAttributesFromNode ( TQDomElement & root) { // superclass save @@ -225,14 +225,14 @@ void JavaANTCodeDocument::setAttributesFromNode ( QDomElement & root) /** * load params from the appropriate XMI element node. */ -void JavaANTCodeDocument::loadFromXMI ( QDomElement & root ) { +void JavaANTCodeDocument::loadFromXMI ( TQDomElement & root ) { setAttributesFromNode(root); } /** set attributes of the node that represents this class * in the XMI document. */ -void JavaANTCodeDocument::setAttributesOnNode ( QDomDocument & doc, QDomElement & docElement) +void JavaANTCodeDocument::setAttributesOnNode ( TQDomDocument & doc, TQDomElement & docElement) { // superclass call @@ -245,8 +245,8 @@ void JavaANTCodeDocument::setAttributesOnNode ( QDomDocument & doc, QDomElement /** * Save the XMI representation of this object */ -void JavaANTCodeDocument::saveToXMI ( QDomDocument & doc, QDomElement & root ) { - QDomElement docElement = doc.createElement( "codedocument" ); +void JavaANTCodeDocument::saveToXMI ( TQDomDocument & doc, TQDomElement & root ) { + TQDomElement docElement = doc.createElement( "codedocument" ); setAttributesOnNode(doc, docElement); @@ -288,19 +288,19 @@ void JavaANTCodeDocument::updateContent( ) { } // We overwritten by Java language implementation to get lowercase path -QString JavaANTCodeDocument::getPath ( ) +TQString JavaANTCodeDocument::getPath ( ) { - QString path = getPackage(); + TQString path = getPackage(); // Replace all white spaces with blanks path.simplifyWhiteSpace(); // Replace all blanks with underscore - path.replace(QRegExp(" "), "_"); + path.replace(TQRegExp(" "), "_"); - path.replace(QRegExp("\\."),"/"); - path.replace(QRegExp("::"), "/"); + path.replace(TQRegExp("\\."),"/"); + path.replace(TQRegExp("::"), "/"); path.lower(); diff --git a/umbrello/umbrello/codegenerators/javaantcodedocument.h b/umbrello/umbrello/codegenerators/javaantcodedocument.h index 9d7372f3..97d19c50 100644 --- a/umbrello/umbrello/codegenerators/javaantcodedocument.h +++ b/umbrello/umbrello/codegenerators/javaantcodedocument.h @@ -19,8 +19,8 @@ #ifndef JAVAANTCODEDOCUMENT_H #define JAVAANTCODEDOCUMENT_H -#include <qstring.h> -#include <qdom.h> +#include <tqstring.h> +#include <tqdom.h> #include "../codedocument.h" @@ -47,19 +47,19 @@ public: */ virtual ~JavaANTCodeDocument ( ); - QString getPath ( ); + TQString getPath ( ); void updateContent(); /** * Save the XMI representation of this object */ - virtual void saveToXMI ( QDomDocument & doc, QDomElement & root ); + virtual void saveToXMI ( TQDomDocument & doc, TQDomElement & root ); /** * load params from the appropriate XMI element node. */ - virtual void loadFromXMI ( QDomElement & root ); + virtual void loadFromXMI ( TQDomElement & root ); /** * create a new HierarchicalCodeBlock object belonging to this CodeDocument. @@ -78,18 +78,18 @@ protected: /** set attributes of the node that represents this class * in the XMI document. */ - virtual void setAttributesOnNode ( QDomDocument & doc, QDomElement & blockElement); + virtual void setAttributesOnNode ( TQDomDocument & doc, TQDomElement & blockElement); /** set the class attributes of this object from * the passed element node. */ - virtual void setAttributesFromNode ( QDomElement & element); + virtual void setAttributesFromNode ( TQDomElement & element); /** * need to overwrite this for java since we need to pick up the * xml declaration blocks. */ - virtual void loadChildTextBlocksFromNode ( QDomElement & root); + virtual void loadChildTextBlocksFromNode ( TQDomElement & root); private: diff --git a/umbrello/umbrello/codegenerators/javaclassdeclarationblock.cpp b/umbrello/umbrello/codegenerators/javaclassdeclarationblock.cpp index 0e4ccdbf..e1966001 100644 --- a/umbrello/umbrello/codegenerators/javaclassdeclarationblock.cpp +++ b/umbrello/umbrello/codegenerators/javaclassdeclarationblock.cpp @@ -23,7 +23,7 @@ // JavaClassDeclarationBlock::JavaClassDeclarationBlock - ( JavaClassifierCodeDocument * parentDoc, const QString &startText, const QString &endText, const QString &comment) + ( JavaClassifierCodeDocument * parentDoc, const TQString &startText, const TQString &endText, const TQString &comment) : OwnedHierarchicalCodeBlock(parentDoc->getParentClassifier(), parentDoc, startText, endText, comment) { init(parentDoc, comment); @@ -38,8 +38,8 @@ JavaClassDeclarationBlock::~JavaClassDeclarationBlock ( ) { } /** * Save the XMI representation of this object */ -void JavaClassDeclarationBlock::saveToXMI ( QDomDocument & doc, QDomElement & root ) { - QDomElement blockElement = doc.createElement( "javaclassdeclarationblock" ); +void JavaClassDeclarationBlock::saveToXMI ( TQDomDocument & doc, TQDomElement & root ) { + TQDomElement blockElement = doc.createElement( "javaclassdeclarationblock" ); setAttributesOnNode(doc, blockElement); @@ -49,7 +49,7 @@ void JavaClassDeclarationBlock::saveToXMI ( QDomDocument & doc, QDomElement & ro /** * load params from the appropriate XMI element node. */ -void JavaClassDeclarationBlock::loadFromXMI ( QDomElement & root ) +void JavaClassDeclarationBlock::loadFromXMI ( TQDomElement & root ) { setAttributesFromNode(root); } @@ -69,9 +69,9 @@ void JavaClassDeclarationBlock::updateContent ( ) JavaClassifierCodeDocument *parentDoc = dynamic_cast<JavaClassifierCodeDocument*>(getParentDocument()); UMLClassifier *c = parentDoc->getParentClassifier(); CodeGenerationPolicy *commonPolicy = UMLApp::app()->getCommonPolicy(); - QString endLine = commonPolicy->getNewLineEndingChars(); + TQString endLine = commonPolicy->getNewLineEndingChars(); bool isInterface = parentDoc->parentIsInterface(); // a little shortcut - QString JavaClassName = parentDoc->getJavaClassName(c->getName()); + TQString JavaClassName = parentDoc->getJavaClassName(c->getName()); // COMMENT if(isInterface) @@ -87,7 +87,7 @@ void JavaClassDeclarationBlock::updateContent ( ) // Now set START/ENDING Text - QString startText = ""; + TQString startText = ""; // In Java, we need declare abstract only on classes if (c->getAbstract() && !isInterface) startText.append("abstract "); @@ -153,7 +153,7 @@ void JavaClassDeclarationBlock::updateContent ( ) } -void JavaClassDeclarationBlock::init (JavaClassifierCodeDocument *parentDoc, const QString &comment) +void JavaClassDeclarationBlock::init (JavaClassifierCodeDocument *parentDoc, const TQString &comment) { setComment(new JavaCodeDocumentation(parentDoc)); diff --git a/umbrello/umbrello/codegenerators/javaclassdeclarationblock.h b/umbrello/umbrello/codegenerators/javaclassdeclarationblock.h index 136df809..08e639c7 100644 --- a/umbrello/umbrello/codegenerators/javaclassdeclarationblock.h +++ b/umbrello/umbrello/codegenerators/javaclassdeclarationblock.h @@ -17,7 +17,7 @@ #ifndef JAVACLASSDECLARATIONBLOCK_H #define JAVACLASSDECLARATIONBLOCK_H -#include <qstring.h> +#include <tqstring.h> #include "javaclassifiercodedocument.h" #include "../ownedhierarchicalcodeblock.h" @@ -33,7 +33,7 @@ public: /** * Empty Constructor */ - explicit JavaClassDeclarationBlock ( JavaClassifierCodeDocument * parentDoc, const QString &start = "", const QString &endText = "}", const QString &comment = ""); + explicit JavaClassDeclarationBlock ( JavaClassifierCodeDocument * parentDoc, const TQString &start = "", const TQString &endText = "}", const TQString &comment = ""); /** * Empty Destructor @@ -43,12 +43,12 @@ public: /** * Save the XMI representation of this object */ - virtual void saveToXMI ( QDomDocument & doc, QDomElement & root ); + virtual void saveToXMI ( TQDomDocument & doc, TQDomElement & root ); /** * load params from the appropriate XMI element node. */ - virtual void loadFromXMI ( QDomElement & root ); + virtual void loadFromXMI ( TQDomElement & root ); protected: @@ -59,7 +59,7 @@ protected: private: - void init (JavaClassifierCodeDocument * parent, const QString &comment); + void init (JavaClassifierCodeDocument * parent, const TQString &comment); }; diff --git a/umbrello/umbrello/codegenerators/javaclassifiercodedocument.cpp b/umbrello/umbrello/codegenerators/javaclassifiercodedocument.cpp index 44e6f242..426c6d9a 100644 --- a/umbrello/umbrello/codegenerators/javaclassifiercodedocument.cpp +++ b/umbrello/umbrello/codegenerators/javaclassifiercodedocument.cpp @@ -29,7 +29,7 @@ // qt/kde includes #include <kdebug.h> -#include <qregexp.h> +#include <tqregexp.h> // local includes #include "javacodegenerator.h" @@ -80,19 +80,19 @@ bool JavaClassifierCodeDocument::forceDoc () { } // We overwritten by Java language implementation to get lowercase path -QString JavaClassifierCodeDocument::getPath ( ) +TQString JavaClassifierCodeDocument::getPath ( ) { - QString path = getPackage(); + TQString path = getPackage(); // Replace all white spaces with blanks path.simplifyWhiteSpace(); // Replace all blanks with underscore - path.replace(QRegExp(" "), "_"); + path.replace(TQRegExp(" "), "_"); - path.replace(QRegExp("\\."),"/"); - path.replace(QRegExp("::"), "/"); + path.replace(TQRegExp("\\."),"/"); + path.replace(TQRegExp("::"), "/"); path.lower(); @@ -104,7 +104,7 @@ QString JavaClassifierCodeDocument::getPath ( ) // Other methods // -QString JavaClassifierCodeDocument::getJavaClassName (const QString &name) { +TQString JavaClassifierCodeDocument::getJavaClassName (const TQString &name) { return Codegen_Utils::capitalizeFirstLetter(CodeGenerator::cleanName(name)); } @@ -143,25 +143,25 @@ bool JavaClassifierCodeDocument::addCodeOperation (CodeOperation * op ) { // would be better if we could create a handler interface that each // codeblock used so all we have to do here is add the handler // for "javaclassdeclarationblock" -void JavaClassifierCodeDocument::loadChildTextBlocksFromNode ( QDomElement & root) +void JavaClassifierCodeDocument::loadChildTextBlocksFromNode ( TQDomElement & root) { - QDomNode tnode = root.firstChild(); - QDomElement telement = tnode.toElement(); + TQDomNode tnode = root.firstChild(); + TQDomElement telement = tnode.toElement(); bool loadCheckForChildrenOK = false; while( !telement.isNull() ) { - QString nodeName = telement.tagName(); + TQString nodeName = telement.tagName(); if( nodeName == "textblocks" ) { - QDomNode node = telement.firstChild(); - QDomElement element = node.toElement(); + TQDomNode node = telement.firstChild(); + TQDomElement element = node.toElement(); // if there is nothing to begin with, then we don't worry about it loadCheckForChildrenOK = element.isNull() ? true : false; while( !element.isNull() ) { - QString name = element.tagName(); + TQString name = element.tagName(); if( name == "codecomment" ) { CodeComment * block = new JavaCodeComment(this); @@ -176,7 +176,7 @@ void JavaClassifierCodeDocument::loadChildTextBlocksFromNode ( QDomElement & roo if( name == "codeaccessormethod" || name == "ccfdeclarationcodeblock" ) { - QString acctag = element.attribute("tag",""); + TQString acctag = element.attribute("tag",""); // search for our method in the TextBlock * tb = findCodeClassFieldTextBlockByTag(acctag); if(!tb || !addTextBlock(tb)) @@ -222,7 +222,7 @@ void JavaClassifierCodeDocument::loadChildTextBlocksFromNode ( QDomElement & roo } else if( name == "codeoperation" ) { // find the code operation by id - QString id = element.attribute("parent_id","-1"); + TQString id = element.attribute("parent_id","-1"); UMLObject * obj = UMLApp::app()->getDocument()->findObjectById(STR2ID(id)); UMLOperation * op = dynamic_cast<UMLOperation*>(obj); if(op) { @@ -283,9 +283,9 @@ void JavaClassifierCodeDocument::loadChildTextBlocksFromNode ( QDomElement & roo } -QString JavaClassifierCodeDocument::scopeToJavaDecl(Uml::Visibility scope) +TQString JavaClassifierCodeDocument::scopeToJavaDecl(Uml::Visibility scope) { - QString scopeString; + TQString scopeString; switch(scope) { case Uml::Visibility::Public: @@ -361,7 +361,7 @@ void JavaClassifierCodeDocument::updateContent( ) bool isInterface = parentIsInterface(); bool hasOperationMethods = c->getOpList().last() ? true : false; - QString endLine = commonPolicy->getNewLineEndingChars(); // a shortcut..so we don't have to call this all the time + TQString endLine = commonPolicy->getNewLineEndingChars(); // a shortcut..so we don't have to call this all the time // // START GENERATING CODE/TEXT BLOCKS and COMMENTS FOR THE DOCUMENT @@ -370,9 +370,9 @@ void JavaClassifierCodeDocument::updateContent( ) // // PACKAGE CODE BLOCK // - QString pkgs = getPackage(); - pkgs.replace(QRegExp("::"), "."); - QString packageText = getPackage().isEmpty() ? "" : "package "+pkgs+';'+endLine; + TQString pkgs = getPackage(); + pkgs.replace(TQRegExp("::"), "."); + TQString packageText = getPackage().isEmpty() ? "" : "package "+pkgs+';'+endLine; CodeBlockWithComments * pblock = addOrUpdateTaggedCodeBlockWithComments("packages", packageText, "", 0, false); if(packageText.isEmpty() && pblock->getContentType() == CodeBlock::AutoGenerated) pblock->setWriteOutText(false); @@ -384,13 +384,13 @@ void JavaClassifierCodeDocument::updateContent( ) // Q: Why all utils? Isnt just List and Vector the only classes we are using? // A: doesn't matter at all; its more readable to just include '*' and java compilers // don't slow down or anything. (TZ) - QString importStatement = ""; + TQString importStatement = ""; if ( hasObjectVectorClassFields() ) importStatement.append("import java.util.*;"); //only import classes in a different package from this class UMLPackageList imports; - QMap<UMLPackage*, QString> packageMap; // so we don't repeat packages + TQMap<UMLPackage*, TQString> packageMap; // so we don't repeat packages CodeGenerator::findObjectsRelated(c,imports); for(UMLPackage *con = imports.first(); con ; con = imports.next()) @@ -526,8 +526,8 @@ void JavaClassifierCodeDocument::updateContent( ) constComment->setWriteOutText(true); // add/get the empty constructor - QString JavaClassName = getJavaClassName(c->getName()); - QString emptyConstStatement = "public "+JavaClassName+" ( ) { }"; + TQString JavaClassName = getJavaClassName(c->getName()); + TQString emptyConstStatement = "public "+JavaClassName+" ( ) { }"; CodeBlockWithComments * emptyConstBlock = constBlock->addOrUpdateTaggedCodeBlockWithComments("emptyconstructor", emptyConstStatement, "Empty Constructor", 1, false); // Now, as an additional condition we only show the empty constructor block diff --git a/umbrello/umbrello/codegenerators/javaclassifiercodedocument.h b/umbrello/umbrello/codegenerators/javaclassifiercodedocument.h index ddad6e1a..831e0555 100644 --- a/umbrello/umbrello/codegenerators/javaclassifiercodedocument.h +++ b/umbrello/umbrello/codegenerators/javaclassifiercodedocument.h @@ -19,7 +19,7 @@ #ifndef JAVACLASSIFIERCODEDOCUMENT_H #define JAVACLASSIFIERCODEDOCUMENT_H -#include <qstring.h> +#include <tqstring.h> #include "../codeclassfieldlist.h" #include "../classifiercodedocument.h" @@ -62,14 +62,14 @@ public: */ //CodeDocumentDialog getDialog ( ); - QString scopeToJavaDecl(Uml::Visibility scope); + TQString scopeToJavaDecl(Uml::Visibility scope); // Make it easier on ourselves JavaCodeGenerationPolicy * getJavaPolicy(); - QString getJavaClassName (const QString &name); + TQString getJavaClassName (const TQString &name); - QString getPath(); + TQString getPath(); /** add a code operation to this java classifier code document. * @return bool which is true IF the code operation was added successfully @@ -85,7 +85,7 @@ protected: * need to overwrite this for java since we need to pick up the * java class declaration block. */ - virtual void loadChildTextBlocksFromNode ( QDomElement & root); + virtual void loadChildTextBlocksFromNode ( TQDomElement & root); void addOrUpdateCodeClassFieldMethodsInCodeBlock(CodeClassFieldList &list, JavaClassDeclarationBlock * codeBlock); diff --git a/umbrello/umbrello/codegenerators/javacodeaccessormethod.cpp b/umbrello/umbrello/codegenerators/javacodeaccessormethod.cpp index 524e6a48..6c883952 100644 --- a/umbrello/umbrello/codegenerators/javacodeaccessormethod.cpp +++ b/umbrello/umbrello/codegenerators/javacodeaccessormethod.cpp @@ -52,7 +52,7 @@ JavaCodeAccessorMethod::~JavaCodeAccessorMethod ( ) { } // Other methods // -void JavaCodeAccessorMethod::setAttributesOnNode ( QDomDocument & doc, QDomElement & blockElement) +void JavaCodeAccessorMethod::setAttributesOnNode ( TQDomDocument & doc, TQDomElement & blockElement) { // set super-class attributes @@ -61,7 +61,7 @@ void JavaCodeAccessorMethod::setAttributesOnNode ( QDomDocument & doc, QDomEleme // set local attributes now } -void JavaCodeAccessorMethod::setAttributesFromNode( QDomElement & root) +void JavaCodeAccessorMethod::setAttributesFromNode( TQDomElement & root) { // set attributes from superclass method the XMI @@ -76,18 +76,18 @@ void JavaCodeAccessorMethod::updateContent( ) CodeClassField * parentField = getParentClassField(); JavaCodeClassField * javafield = dynamic_cast<JavaCodeClassField*>(parentField); - QString fieldName = javafield->getFieldName(); + TQString fieldName = javafield->getFieldName(); - QString text = ""; + TQString text = ""; switch(getType()) { case CodeAccessorMethod::ADD: { int maxOccurs = javafield->maximumListOccurances(); - QString fieldType = javafield->getTypeName(); - QString indent = getIndentation(); - QString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); + TQString fieldType = javafield->getTypeName(); + TQString indent = getIndentation(); + TQString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); if(maxOccurs > 0) - text += "if ("+fieldName+".size() < "+ QString::number(maxOccurs)+") {"+endLine+indent; + text += "if ("+fieldName+".size() < "+ TQString::number(maxOccurs)+") {"+endLine+indent; text += fieldName+".add(value);"; if(maxOccurs > 0) { @@ -105,12 +105,12 @@ void JavaCodeAccessorMethod::updateContent( ) case CodeAccessorMethod::REMOVE: { int minOccurs = javafield->minimumListOccurances(); - QString fieldType = javafield->getTypeName(); - QString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); - QString indent = getIndentation(); + TQString fieldType = javafield->getTypeName(); + TQString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); + TQString indent = getIndentation(); if(minOccurs > 0) - text += "if ("+fieldName+".size() >= "+ QString::number(minOccurs)+") {"+endLine+indent; + text += "if ("+fieldName+".size() >= "+ TQString::number(minOccurs)+") {"+endLine+indent; text += fieldName+".remove(value);"; if(minOccurs > 0) { @@ -140,13 +140,13 @@ void JavaCodeAccessorMethod::updateMethodDeclaration() // gather defs CodeGenerationPolicy::ScopePolicy scopePolicy = commonpolicy->getAttributeAccessorScope(); - QString strVis = javadoc->scopeToJavaDecl(javafield->getVisibility()); - QString fieldName = javafield->getFieldName(); - QString fieldType = javafield->getTypeName(); - QString objectType = javafield->getListObjectType(); + TQString strVis = javadoc->scopeToJavaDecl(javafield->getVisibility()); + TQString fieldName = javafield->getFieldName(); + TQString fieldType = javafield->getTypeName(); + TQString objectType = javafield->getListObjectType(); if(objectType.isEmpty()) objectType = fieldName; - QString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); + TQString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); // set scope of this accessor appropriately..if its an attribute, // we need to be more sophisticated @@ -164,10 +164,10 @@ void JavaCodeAccessorMethod::updateMethodDeclaration() } // some variables we will need to populate - QString headerText = ""; - QString methodReturnType = ""; - QString methodName = ""; - QString methodParams = ""; + TQString headerText = ""; + TQString methodReturnType = ""; + TQString methodName = ""; + TQString methodParams = ""; switch(getType()) { case CodeAccessorMethod::ADD: diff --git a/umbrello/umbrello/codegenerators/javacodeaccessormethod.h b/umbrello/umbrello/codegenerators/javacodeaccessormethod.h index 5a109b59..e26ef033 100644 --- a/umbrello/umbrello/codegenerators/javacodeaccessormethod.h +++ b/umbrello/umbrello/codegenerators/javacodeaccessormethod.h @@ -16,7 +16,7 @@ #ifndef JAVACODEACCESSORMETHOD_H #define JAVACODEACCESSORMETHOD_H -#include <qstring.h> +#include <tqstring.h> #include "../codeaccessormethod.h" @@ -50,12 +50,12 @@ protected: /** set attributes of the node that represents this class * in the XMI document. */ - virtual void setAttributesOnNode ( QDomDocument & doc, QDomElement & blockElement); + virtual void setAttributesOnNode ( TQDomDocument & doc, TQDomElement & blockElement); /** set the class attributes of this object from * the passed element node. */ - virtual void setAttributesFromNode ( QDomElement & element); + virtual void setAttributesFromNode ( TQDomElement & element); virtual void updateMethodDeclaration(); virtual void updateContent(); diff --git a/umbrello/umbrello/codegenerators/javacodeclassfield.cpp b/umbrello/umbrello/codegenerators/javacodeclassfield.cpp index 627b9b3e..0777cf1d 100644 --- a/umbrello/umbrello/codegenerators/javacodeclassfield.cpp +++ b/umbrello/umbrello/codegenerators/javacodeclassfield.cpp @@ -18,7 +18,7 @@ #include "javacodeclassfield.h" // qt/kde includes -#include <qregexp.h> +#include <tqregexp.h> #include <kdebug.h> // local includes @@ -57,7 +57,7 @@ JavaCodeClassField::~JavaCodeClassField ( ) { } // Other methods // -QString JavaCodeClassField::getFieldName() { +TQString JavaCodeClassField::getFieldName() { if (parentIsAttribute()) { UMLAttribute * at = (UMLAttribute*) getParentObject(); @@ -66,7 +66,7 @@ QString JavaCodeClassField::getFieldName() { else { UMLRole * role = (UMLRole*) getParentObject(); - QString roleName = role->getName(); + TQString roleName = role->getName(); if(fieldIsSingleValue()) { return roleName.replace(0, 1, roleName.left(1).lower()); } else { @@ -76,7 +76,7 @@ QString JavaCodeClassField::getFieldName() { } -QString JavaCodeClassField::getInitialValue() { +TQString JavaCodeClassField::getInitialValue() { if (parentIsAttribute()) { @@ -95,7 +95,7 @@ QString JavaCodeClassField::getInitialValue() { if(fieldIsSingleValue()) { // FIX : IF the multiplicity is "1" then we should init a new object here, if its 0 or 1, // then we can just return 'empty' string (minor problem). - return QString(""); + return TQString(""); } else { return " new "+JavaCodeGenerator::getListFieldClassName()+"( )"; } @@ -103,7 +103,7 @@ QString JavaCodeClassField::getInitialValue() { } -QString JavaCodeClassField::getTypeName ( ) +TQString JavaCodeClassField::getTypeName ( ) { return JavaCodeGenerator::fixTypeName(CodeClassField::getTypeName()); } diff --git a/umbrello/umbrello/codegenerators/javacodeclassfield.h b/umbrello/umbrello/codegenerators/javacodeclassfield.h index 5ed1cea4..b381796c 100644 --- a/umbrello/umbrello/codegenerators/javacodeclassfield.h +++ b/umbrello/umbrello/codegenerators/javacodeclassfield.h @@ -18,7 +18,7 @@ #ifndef JAVACODECLASSFIELD_H #define JAVACODECLASSFIELD_H -#include <qstring.h> +#include <tqstring.h> #include "../codeclassfield.h" @@ -43,11 +43,11 @@ public: */ virtual ~JavaCodeClassField ( ); - QString getFieldType(); - QString getFieldName(); - QString getInitialValue(); + TQString getFieldType(); + TQString getFieldName(); + TQString getInitialValue(); - QString getTypeName ( ); + TQString getTypeName ( ); protected: private: diff --git a/umbrello/umbrello/codegenerators/javacodeclassfielddeclarationblock.cpp b/umbrello/umbrello/codegenerators/javacodeclassfielddeclarationblock.cpp index 87ebf78a..5507c314 100644 --- a/umbrello/umbrello/codegenerators/javacodeclassfielddeclarationblock.cpp +++ b/umbrello/umbrello/codegenerators/javacodeclassfielddeclarationblock.cpp @@ -59,12 +59,12 @@ void JavaCodeClassFieldDeclarationBlock::updateContent( ) CodeGenerationPolicy::ScopePolicy scopePolicy = commonpolicy->getAssociationFieldScope(); // Set the comment - QString notes = getParentObject()->getDoc(); + TQString notes = getParentObject()->getDoc(); getComment()->setText(notes); // Set the body - QString staticValue = getParentObject()->getStatic() ? "static " : ""; - QString scopeStr = jdoc->scopeToJavaDecl(getParentObject()->getVisibility()); + TQString staticValue = getParentObject()->getStatic() ? "static " : ""; + TQString scopeStr = jdoc->scopeToJavaDecl(getParentObject()->getVisibility()); // IF this is from an association, then scope taken as appropriate to policy if(!jcf->parentIsAttribute()) @@ -82,14 +82,14 @@ void JavaCodeClassFieldDeclarationBlock::updateContent( ) } } - QString typeName = jcf->getTypeName(); - QString fieldName = jcf->getFieldName(); - QString initialV = jcf->getInitialValue(); + TQString typeName = jcf->getTypeName(); + TQString fieldName = jcf->getFieldName(); + TQString initialV = jcf->getInitialValue(); if (!cf->parentIsAttribute() && !cf->fieldIsSingleValue()) typeName = "List"; - QString body = staticValue+scopeStr+' '+typeName+' '+fieldName; + TQString body = staticValue+scopeStr+' '+typeName+' '+fieldName; if (!initialV.isEmpty()) body.append(" = " + initialV); else if (!cf->parentIsAttribute()) diff --git a/umbrello/umbrello/codegenerators/javacodeclassfielddeclarationblock.h b/umbrello/umbrello/codegenerators/javacodeclassfielddeclarationblock.h index 8166fced..1ed37a43 100644 --- a/umbrello/umbrello/codegenerators/javacodeclassfielddeclarationblock.h +++ b/umbrello/umbrello/codegenerators/javacodeclassfielddeclarationblock.h @@ -16,7 +16,7 @@ #ifndef JAVACODECLASSFIELDDECLARATIONBLOCK_H #define JAVACODECLASSFIELDDECLARATIONBLOCK_H -#include <qstring.h> +#include <tqstring.h> #include "../codeclassfielddeclarationblock.h" diff --git a/umbrello/umbrello/codegenerators/javacodecomment.cpp b/umbrello/umbrello/codegenerators/javacodecomment.cpp index bec0e87b..588a0acc 100644 --- a/umbrello/umbrello/codegenerators/javacodecomment.cpp +++ b/umbrello/umbrello/codegenerators/javacodecomment.cpp @@ -14,12 +14,12 @@ */ #include "javacodecomment.h" -#include <qregexp.h> +#include <tqregexp.h> // Constructors/Destructors // -JavaCodeComment::JavaCodeComment ( CodeDocument * doc, const QString & text ) +JavaCodeComment::JavaCodeComment ( CodeDocument * doc, const TQString & text ) : CodeComment (doc, text) { @@ -42,38 +42,38 @@ JavaCodeComment::~JavaCodeComment ( ) { } // Other methods // -QString JavaCodeComment::getNewEditorLine ( int amount ) { - QString line = getIndentationString(amount) + "// "; +TQString JavaCodeComment::getNewEditorLine ( int amount ) { + TQString line = getIndentationString(amount) + "// "; return line; } /** UnFormat a long text string. Typically, this means removing * the indentaion (linePrefix) and/or newline chars from each line. */ -QString JavaCodeComment::unformatText ( const QString & text , const QString & indent) +TQString JavaCodeComment::unformatText ( const TQString & text , const TQString & indent) { // remove leading or trailing comment stuff - QString mytext = TextBlock::unformatText(text, indent); + TQString mytext = TextBlock::unformatText(text, indent); // now leading slashes - mytext.remove(QRegExp("^\\/\\/\\s*")); + mytext.remove(TQRegExp("^\\/\\/\\s*")); return mytext; } /** * @return QString */ -QString JavaCodeComment::toString ( ) +TQString JavaCodeComment::toString ( ) { - QString output = ""; + TQString output = ""; // simple output method if(getWriteOutText()) { - QString indent = getIndentationString(); - QString endLine = getNewLineEndingChars(); + TQString indent = getIndentationString(); + TQString endLine = getNewLineEndingChars(); output.append(formatMultiLineText (getText(), indent +"// ", endLine)); } diff --git a/umbrello/umbrello/codegenerators/javacodecomment.h b/umbrello/umbrello/codegenerators/javacodecomment.h index 1f9b1d8d..468b2a7c 100644 --- a/umbrello/umbrello/codegenerators/javacodecomment.h +++ b/umbrello/umbrello/codegenerators/javacodecomment.h @@ -18,7 +18,7 @@ #ifndef JAVACODECOMMENT_H #define JAVACODECOMMENT_H -#include <qstring.h> +#include <tqstring.h> #include "../codecomment.h" /** @@ -40,7 +40,7 @@ public: /** * Constructors */ - explicit JavaCodeComment ( CodeDocument * doc, const QString & text = ""); + explicit JavaCodeComment ( CodeDocument * doc, const TQString & text = ""); /** * Empty Destructor @@ -56,17 +56,17 @@ public: /** * @return QString */ - QString toString ( ); + TQString toString ( ); /** UnFormat a long text string. Typically, this means removing * the indentaion (linePrefix) and/or newline chars from each line. */ - virtual QString unformatText ( const QString & text, const QString & indent = "" ); + virtual TQString unformatText ( const TQString & text, const TQString & indent = "" ); /** a special version here because we want to not only indent * the new line, but to add the "//" sequence as well. */ - virtual QString getNewEditorLine ( int amount ); + virtual TQString getNewEditorLine ( int amount ); protected: diff --git a/umbrello/umbrello/codegenerators/javacodedocumentation.cpp b/umbrello/umbrello/codegenerators/javacodedocumentation.cpp index e831d885..662b88c9 100644 --- a/umbrello/umbrello/codegenerators/javacodedocumentation.cpp +++ b/umbrello/umbrello/codegenerators/javacodedocumentation.cpp @@ -18,7 +18,7 @@ #include "javacodedocumentation.h" // qt/kde includes -#include <qregexp.h> +#include <tqregexp.h> #include <kdebug.h> // local includes @@ -29,7 +29,7 @@ // Constructors/Destructors // -JavaCodeDocumentation::JavaCodeDocumentation ( JavaClassifierCodeDocument * doc, const QString & text ) +JavaCodeDocumentation::JavaCodeDocumentation ( JavaClassifierCodeDocument * doc, const TQString & text ) : CodeComment(doc, text) { @@ -51,8 +51,8 @@ JavaCodeDocumentation::~JavaCodeDocumentation ( ) { } /** * Save the XMI representation of this object */ -void JavaCodeDocumentation::saveToXMI ( QDomDocument & doc, QDomElement & root ) { - QDomElement blockElement = doc.createElement( "javacodedocumentation" ); +void JavaCodeDocumentation::saveToXMI ( TQDomDocument & doc, TQDomElement & root ) { + TQDomElement blockElement = doc.createElement( "javacodedocumentation" ); setAttributesOnNode(doc, blockElement); // as we added no additional fields to this class we may // just use parent TextBlock method root.appendChild( blockElement ); @@ -61,10 +61,10 @@ void JavaCodeDocumentation::saveToXMI ( QDomDocument & doc, QDomElement & root ) /** * @return QString */ -QString JavaCodeDocumentation::toString ( ) +TQString JavaCodeDocumentation::toString ( ) { - QString output = ""; + TQString output = ""; // simple output method if(getWriteOutText()) @@ -76,9 +76,9 @@ QString JavaCodeDocumentation::toString ( ) if(p->getCommentStyle() == CodeGenerationPolicy::MultiLine) useDoubleDashOutput = false; - QString indent = getIndentationString(); - QString endLine = getNewLineEndingChars(); - QString body = getText(); + TQString indent = getIndentationString(); + TQString endLine = getNewLineEndingChars(); + TQString body = getText(); if(useDoubleDashOutput) { if(!body.isEmpty()) @@ -93,7 +93,7 @@ QString JavaCodeDocumentation::toString ( ) return output; } -QString JavaCodeDocumentation::getNewEditorLine ( int amount ) +TQString JavaCodeDocumentation::getNewEditorLine ( int amount ) { CodeGenerationPolicy *p = UMLApp::app()->getCommonPolicy(); if(p->getCommentStyle() == CodeGenerationPolicy::MultiLine) @@ -121,20 +121,20 @@ int JavaCodeDocumentation::lastEditableLine() { /** UnFormat a long text string. Typically, this means removing * the indentaion (linePrefix) and/or newline chars from each line. */ -QString JavaCodeDocumentation::unformatText ( const QString & text , const QString & indent) +TQString JavaCodeDocumentation::unformatText ( const TQString & text , const TQString & indent) { - QString mytext = TextBlock::unformatText(text, indent); + TQString mytext = TextBlock::unformatText(text, indent); CodeGenerationPolicy *p = UMLApp::app()->getCommonPolicy(); // remove leading or trailing comment stuff - mytext.remove(QRegExp('^'+indent)); + mytext.remove(TQRegExp('^'+indent)); if(p->getCommentStyle() == CodeGenerationPolicy::MultiLine) { - mytext.remove(QRegExp("^\\/\\*\\*\\s*\n?")); - mytext.remove(QRegExp("\\s*\\*\\/\\s*\n?$")); - mytext.remove(QRegExp("^\\s*\\*\\s*")); + mytext.remove(TQRegExp("^\\/\\*\\*\\s*\n?")); + mytext.remove(TQRegExp("\\s*\\*\\/\\s*\n?$")); + mytext.remove(TQRegExp("^\\s*\\*\\s*")); } else - mytext.remove(QRegExp("^\\/\\/\\s*")); + mytext.remove(TQRegExp("^\\/\\/\\s*")); return mytext; } diff --git a/umbrello/umbrello/codegenerators/javacodedocumentation.h b/umbrello/umbrello/codegenerators/javacodedocumentation.h index 246b87a6..acc386c1 100644 --- a/umbrello/umbrello/codegenerators/javacodedocumentation.h +++ b/umbrello/umbrello/codegenerators/javacodedocumentation.h @@ -18,7 +18,7 @@ #ifndef JAVACODEDOCUMENTATION_H #define JAVACODEDOCUMENTATION_H -#include <qstring.h> +#include <tqstring.h> #include "../codecomment.h" class JavaClassifierCodeDocument; @@ -42,7 +42,7 @@ public: /** * Constructors */ - explicit JavaCodeDocumentation ( JavaClassifierCodeDocument * doc, const QString & text = ""); + explicit JavaCodeDocumentation ( JavaClassifierCodeDocument * doc, const TQString & text = ""); /** * Empty Destructor @@ -58,22 +58,22 @@ public: /** * Save the XMI representation of this object */ - virtual void saveToXMI ( QDomDocument & doc, QDomElement & root ); + virtual void saveToXMI ( TQDomDocument & doc, TQDomElement & root ); /** * @return QString */ - QString toString ( ); + TQString toString ( ); /** UnFormat a long text string. Typically, this means removing * the indentaion (linePrefix) and/or newline chars from each line. */ - virtual QString unformatText ( const QString & text, const QString & indent = "" ); + virtual TQString unformatText ( const TQString & text, const TQString & indent = "" ); /** a special version here because we want to not only indent * the new line, but to add the " * " sequence as well. */ - virtual QString getNewEditorLine ( int amount ); + virtual TQString getNewEditorLine ( int amount ); /** Ush. These are terrifically bad and must one day go away. * Both methods indicate the range of lines in this textblock diff --git a/umbrello/umbrello/codegenerators/javacodegenerationpolicy.cpp b/umbrello/umbrello/codegenerators/javacodegenerationpolicy.cpp index 2dcc834e..6225485f 100644 --- a/umbrello/umbrello/codegenerators/javacodegenerationpolicy.cpp +++ b/umbrello/umbrello/codegenerators/javacodegenerationpolicy.cpp @@ -174,7 +174,7 @@ void JavaCodeGenerationPolicy::setDefaults( KConfig * config, bool emitUpdateSig * Create a new dialog interface for this object. * @return dialog object */ -CodeGenerationPolicyPage * JavaCodeGenerationPolicy::createPage ( QWidget *parent, const char *name ) { +CodeGenerationPolicyPage * JavaCodeGenerationPolicy::createPage ( TQWidget *parent, const char *name ) { return new JavaCodeGenerationPolicyPage ( parent, name, this ); } diff --git a/umbrello/umbrello/codegenerators/javacodegenerationpolicy.h b/umbrello/umbrello/codegenerators/javacodegenerationpolicy.h index 2a40cb57..e72c5161 100644 --- a/umbrello/umbrello/codegenerators/javacodegenerationpolicy.h +++ b/umbrello/umbrello/codegenerators/javacodegenerationpolicy.h @@ -17,7 +17,7 @@ #ifndef JAVACODEGENERATIONPOLICY_H #define JAVACODEGENERATIONPOLICY_H -#include <qstring.h> +#include <tqstring.h> #include "codegenpolicyext.h" #include "../codegenerationpolicy.h" @@ -96,7 +96,7 @@ public: * Create a new dialog interface for this object. * @return dialog object */ - CodeGenerationPolicyPage * createPage ( QWidget *parent = 0, const char * name = 0); + CodeGenerationPolicyPage * createPage ( TQWidget *parent = 0, const char * name = 0); protected: diff --git a/umbrello/umbrello/codegenerators/javacodegenerationpolicypage.cpp b/umbrello/umbrello/codegenerators/javacodegenerationpolicypage.cpp index fd6d2ae3..c7bfbf0b 100644 --- a/umbrello/umbrello/codegenerators/javacodegenerationpolicypage.cpp +++ b/umbrello/umbrello/codegenerators/javacodegenerationpolicypage.cpp @@ -17,16 +17,16 @@ // own header #include "javacodegenerationpolicypage.h" // qt/kde includes -#include <qlabel.h> -#include <qcombobox.h> -#include <qcheckbox.h> +#include <tqlabel.h> +#include <tqcombobox.h> +#include <tqcheckbox.h> #include <kdebug.h> #include <klocale.h> // app includes #include "javacodegenerationformbase.h" #include "../uml.h" -JavaCodeGenerationPolicyPage::JavaCodeGenerationPolicyPage( QWidget *parent, const char *name, JavaCodeGenerationPolicy * policy ) +JavaCodeGenerationPolicyPage::JavaCodeGenerationPolicyPage( TQWidget *parent, const char *name, JavaCodeGenerationPolicy * policy ) : CodeGenerationPolicyPage(parent, name, policy) { CodeGenerationPolicy *commonPolicy = UMLApp::app()->getCommonPolicy(); diff --git a/umbrello/umbrello/codegenerators/javacodegenerationpolicypage.h b/umbrello/umbrello/codegenerators/javacodegenerationpolicypage.h index 3b6f85e0..01b739b9 100644 --- a/umbrello/umbrello/codegenerators/javacodegenerationpolicypage.h +++ b/umbrello/umbrello/codegenerators/javacodegenerationpolicypage.h @@ -30,7 +30,7 @@ class JavaCodeGenerationPolicyPage : public CodeGenerationPolicyPage { Q_OBJECT public: - explicit JavaCodeGenerationPolicyPage (QWidget *parent=0, const char *name=0, JavaCodeGenerationPolicy * policy = 0); + explicit JavaCodeGenerationPolicyPage (TQWidget *parent=0, const char *name=0, JavaCodeGenerationPolicy * policy = 0); virtual ~JavaCodeGenerationPolicyPage(); diff --git a/umbrello/umbrello/codegenerators/javacodegenerator.cpp b/umbrello/umbrello/codegenerators/javacodegenerator.cpp index 167804af..0f78a0fb 100644 --- a/umbrello/umbrello/codegenerators/javacodegenerator.cpp +++ b/umbrello/umbrello/codegenerators/javacodegenerator.cpp @@ -18,7 +18,7 @@ #include "javacodegenerator.h" // qt/kde includes -#include <qregexp.h> +#include <tqregexp.h> #include <kconfig.h> #include <kdebug.h> #include <klocale.h> @@ -34,7 +34,7 @@ const bool JavaCodeGenerator::DEFAULT_BUILD_ANT_DOC = false; // Constructors/Destructors // -JavaCodeGenerator::JavaCodeGenerator (QDomElement & elem) +JavaCodeGenerator::JavaCodeGenerator (TQDomElement & elem) : CodeGenerator(elem) { init(); @@ -79,7 +79,7 @@ bool JavaCodeGenerator::getCreateANTBuildFile ( ) { } // In the Java version, we make the ANT build file also available. -CodeViewerDialog * JavaCodeGenerator::getCodeViewerDialog ( QWidget* parent, CodeDocument *doc, +CodeViewerDialog * JavaCodeGenerator::getCodeViewerDialog ( TQWidget* parent, CodeDocument *doc, Settings::CodeViewerState state) { CodeViewerDialog *dialog = new CodeViewerDialog(parent, doc, state); @@ -103,8 +103,8 @@ bool JavaCodeGenerator::getAutoGenerateAssocAccessors ( ) return getJavaPolicy()->getAutoGenerateAssocAccessors (); } -QString JavaCodeGenerator::getListFieldClassName () { - return QString("Vector"); +TQString JavaCodeGenerator::getListFieldClassName () { + return TQString("Vector"); } // Other methods @@ -113,9 +113,9 @@ QString JavaCodeGenerator::getListFieldClassName () { // IF the type is "string" we need to declare it as // the Java Object "String" (there is no string primative in Java). // Same thing again for "bool" to "boolean" -QString JavaCodeGenerator::fixTypeName(const QString &string) +TQString JavaCodeGenerator::fixTypeName(const TQString &string) { - if (string.isEmpty() || string.contains(QRegExp("^\\s+$"))) + if (string.isEmpty() || string.contains(TQRegExp("^\\s+$"))) return "void"; if (string == "string") return "String"; @@ -154,8 +154,8 @@ void JavaCodeGenerator::init() { setCreateANTBuildFile(DEFAULT_BUILD_ANT_DOC); } -QStringList JavaCodeGenerator::defaultDatatypes() { - QStringList l; +TQStringList JavaCodeGenerator::defaultDatatypes() { + TQStringList l; l.append("int"); l.append("char"); l.append("boolean"); @@ -168,9 +168,9 @@ QStringList JavaCodeGenerator::defaultDatatypes() { return l; } -const QStringList JavaCodeGenerator::reservedKeywords() const { +const TQStringList JavaCodeGenerator::reservedKeywords() const { - static QStringList keywords; + static TQStringList keywords; if (keywords.isEmpty()) { keywords << "abstract" diff --git a/umbrello/umbrello/codegenerators/javacodegenerator.h b/umbrello/umbrello/codegenerators/javacodegenerator.h index 29edb16f..3d94ad5f 100644 --- a/umbrello/umbrello/codegenerators/javacodegenerator.h +++ b/umbrello/umbrello/codegenerators/javacodegenerator.h @@ -19,7 +19,7 @@ #ifndef JAVACODEGENERATOR_H #define JAVACODEGENERATOR_H -#include <qstring.h> +#include <tqstring.h> #include "../codeviewerstate.h" #include "../codegenerator.h" #include "../codeblockwithcomments.h" @@ -47,7 +47,7 @@ public: * Empty Constructor */ JavaCodeGenerator (); - JavaCodeGenerator (QDomElement & element); + JavaCodeGenerator (TQDomElement & element); /** * Empty Destructor @@ -87,11 +87,11 @@ public: /** * Get the list variable class name to use. For Java, we have set this to "Vector". */ - static QString getListFieldClassName(); + static TQString getListFieldClassName(); /** Get the editing dialog for this code document */ - virtual CodeViewerDialog * getCodeViewerDialog( QWidget* parent, CodeDocument * doc, + virtual CodeViewerDialog * getCodeViewerDialog( TQWidget* parent, CodeDocument * doc, Settings::CodeViewerState state); // Other methods @@ -114,19 +114,19 @@ public: /** * Adds Java's primitives as datatypes */ - virtual QStringList defaultDatatypes(); + virtual TQStringList defaultDatatypes(); /** * IF the type is "string" we need to declare it as * the Java Object "String" (there is no string primative in Java). * Same thing again for "bool" to "boolean". */ - static QString fixTypeName(const QString &string); + static TQString fixTypeName(const TQString &string); /** * get list of reserved keywords */ - virtual const QStringList reservedKeywords() const; + virtual const TQStringList reservedKeywords() const; protected: diff --git a/umbrello/umbrello/codegenerators/javacodeoperation.cpp b/umbrello/umbrello/codegenerators/javacodeoperation.cpp index 84ce0331..c7e7d162 100644 --- a/umbrello/umbrello/codegenerators/javacodeoperation.cpp +++ b/umbrello/umbrello/codegenerators/javacodeoperation.cpp @@ -25,7 +25,7 @@ // JavaCodeOperation::JavaCodeOperation - ( JavaClassifierCodeDocument * doc, UMLOperation *parent, const QString & body, const QString & comment ) + ( JavaClassifierCodeDocument * doc, UMLOperation *parent, const TQString & body, const TQString & comment ) : CodeOperation (doc, parent, body, comment) { // lets not go with the default comment and instead use @@ -52,15 +52,15 @@ void JavaCodeOperation::updateMethodDeclaration() JavaClassifierCodeDocument * javadoc = dynamic_cast<JavaClassifierCodeDocument*>(doc); UMLOperation * o = getParentOperation(); bool isInterface = javadoc->getParentClassifier()->isInterface(); - QString endLine = getNewLineEndingChars(); + TQString endLine = getNewLineEndingChars(); // now, the starting text. - QString strVis = javadoc->scopeToJavaDecl(o->getVisibility()); + TQString strVis = javadoc->scopeToJavaDecl(o->getVisibility()); // no return type for constructors - QString fixedReturn = JavaCodeGenerator::fixTypeName(o->getTypeName()); - QString returnType = o->isConstructorOperation() ? QString("") : (fixedReturn + QString(" ")); - QString methodName = o->getName(); - QString paramStr = QString(""); + TQString fixedReturn = JavaCodeGenerator::fixTypeName(o->getTypeName()); + TQString returnType = o->isConstructorOperation() ? TQString("") : (fixedReturn + TQString(" ")); + TQString methodName = o->getName(); + TQString paramStr = TQString(""); // assemble parameters UMLAttributeList list = getParentOperation()->getParmList(); @@ -68,18 +68,18 @@ void JavaCodeOperation::updateMethodDeclaration() int paramNum = 0; for(UMLAttribute* parm = list.first(); parm; parm=list.next()) { - QString rType = parm->getTypeName(); - QString paramName = parm->getName(); + TQString rType = parm->getTypeName(); + TQString paramName = parm->getName(); paramStr += rType + ' ' + paramName; paramNum++; if (paramNum != nrofParam ) paramStr += ", "; } - QString maybeStatic; + TQString maybeStatic; if (o->getStatic()) maybeStatic = "static "; - QString startText = strVis + ' ' + maybeStatic + returnType + methodName + " (" + paramStr + ')'; + TQString startText = strVis + ' ' + maybeStatic + returnType + methodName + " (" + paramStr + ')'; // IF the parent is an interface, our operations look different // e.g. they have no body @@ -95,7 +95,7 @@ void JavaCodeOperation::updateMethodDeclaration() // Lastly, for text content generation, we fix the comment on the // operation, IF the codeop is autogenerated & currently empty - QString comment = o->getDoc(); + TQString comment = o->getDoc(); if(comment.isEmpty() && getContentType() == CodeBlock::AutoGenerated) { UMLAttributeList parameters = o->getParmList(); diff --git a/umbrello/umbrello/codegenerators/javacodeoperation.h b/umbrello/umbrello/codegenerators/javacodeoperation.h index 08a555d8..50087fd7 100644 --- a/umbrello/umbrello/codegenerators/javacodeoperation.h +++ b/umbrello/umbrello/codegenerators/javacodeoperation.h @@ -18,7 +18,7 @@ #ifndef JAVACODEOPERATION_H #define JAVACODEOPERATION_H -#include <qstring.h> +#include <tqstring.h> #include "../codeoperation.h" class JavaClassifierCodeDocument; @@ -34,7 +34,7 @@ public: /** * Empty Constructor */ - JavaCodeOperation ( JavaClassifierCodeDocument * doc, UMLOperation * op, const QString & body = "", const QString & comment = ""); + JavaCodeOperation ( JavaClassifierCodeDocument * doc, UMLOperation * op, const TQString & body = "", const TQString & comment = ""); /** * Empty Destructor diff --git a/umbrello/umbrello/codegenerators/javawriter.cpp b/umbrello/umbrello/codegenerators/javawriter.cpp index 3e945c60..db6d6515 100644 --- a/umbrello/umbrello/codegenerators/javawriter.cpp +++ b/umbrello/umbrello/codegenerators/javawriter.cpp @@ -20,9 +20,9 @@ // own header #include "javawriter.h" // qt includes -#include <qfile.h> -#include <qtextstream.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqregexp.h> // kde includes #include <kdebug.h> // app includes @@ -55,7 +55,7 @@ void JavaWriter::writeClass(UMLClassifier *c) isInterface = c->isInterface(); - QString fileName = cleanName(c->getName().lower()); + TQString fileName = cleanName(c->getName().lower()); //find an appropriate name for our file fileName = findFileName(c,".java"); @@ -65,7 +65,7 @@ void JavaWriter::writeClass(UMLClassifier *c) } // check that we may open that file for writing - QFile file; + TQFile file; if ( !openFile(file, fileName) ) { emit codeGenerated(c, false); return; @@ -131,14 +131,14 @@ void JavaWriter::writeClass(UMLClassifier *c) bool hasVectorFields = hasAssociations ? true : false; // open text stream to file - QTextStream java(&file); + TQTextStream java(&file); //try to find a heading file (license, coments, etc) - QString str; + TQString str; str = getHeadingFile(".java"); if(!str.isEmpty()) { - str.replace(QRegExp("%filename%"),fileName); - str.replace(QRegExp("%filepath%"),file.name()); + str.replace(TQRegExp("%filename%"),fileName); + str.replace(TQRegExp("%filepath%"),file.name()); java<<str<<m_endl; } @@ -161,7 +161,7 @@ void JavaWriter::writeClass(UMLClassifier *c) for (UMLPackage *con = imports.first(); con; con = imports.next()) { if (con->getBaseType() == Uml::ot_Datatype) continue; - QString pkg = con->getPackage(); + TQString pkg = con->getPackage(); if (!pkg.isEmpty() && pkg != c->getPackage()) java << "import " << pkg << "." << cleanName(con->getName()) << ";" << m_endl; @@ -260,10 +260,10 @@ void JavaWriter::writeClass(UMLClassifier *c) emit codeGenerated(c, true); } -void JavaWriter::writeClassDecl(UMLClassifier *c, QTextStream &java) +void JavaWriter::writeClassDecl(UMLClassifier *c, TQTextStream &java) { - QString classname = cleanName(c->getName()); // our class name + TQString classname = cleanName(c->getName()); // our class name // write documentation for class, if any, first if(forceDoc() || !c->getDoc().isEmpty()) @@ -277,7 +277,7 @@ void JavaWriter::writeClassDecl(UMLClassifier *c, QTextStream &java) } // Now write the actual class declaration - QString scope = ""; // = scopeToJavaDecl(c->getVisibility()); + TQString scope = ""; // = scopeToJavaDecl(c->getVisibility()); if (c->getVisibility() != Uml::Visibility::Public) { // We should emit a warning in here .. java doesn't like to allow // private/protected classes. The best we can do (I believe) @@ -287,7 +287,7 @@ void JavaWriter::writeClassDecl(UMLClassifier *c, QTextStream &java) } else scope = "public "; - java<<((c->getAbstract() && !isInterface) ? QString("abstract ") : QString(""))<<scope; + java<<((c->getAbstract() && !isInterface) ? TQString("abstract ") : TQString(""))<<scope; if(isInterface) java<<"interface "; else @@ -300,9 +300,9 @@ void JavaWriter::writeClassDecl(UMLClassifier *c, QTextStream &java) if (template_params.count()) { java << "<"; for (UMLTemplate *t = template_params.first(); t; ) { - QString formalName = t->getName(); + TQString formalName = t->getName(); java << formalName; - QString typeName = t->getTypeName(); + TQString typeName = t->getTypeName(); if (typeName != "class") { java << " extends " << typeName; } @@ -355,55 +355,55 @@ void JavaWriter::writeClassDecl(UMLClassifier *c, QTextStream &java) } void JavaWriter::writeAttributeDecls(UMLAttributeList &atpub, UMLAttributeList &atprot, - UMLAttributeList &atpriv, QTextStream &java ) + UMLAttributeList &atpriv, TQTextStream &java ) { UMLAttribute *at; for(at=atpub.first(); at; at=atpub.next()) { - QString documentation = at->getDoc(); - QString staticValue = at->getStatic() ? "static " : ""; - QString typeName = fixTypeName(at->getTypeName()); - QString initialValue = fixInitialStringDeclValue(at->getInitialValue(), typeName); + TQString documentation = at->getDoc(); + TQString staticValue = at->getStatic() ? "static " : ""; + TQString typeName = fixTypeName(at->getTypeName()); + TQString initialValue = fixInitialStringDeclValue(at->getInitialValue(), typeName); if(!documentation.isEmpty()) writeComment(documentation, m_indentation, java, true); java<<startline<<staticValue<<"public "<<typeName<<" "<<cleanName(at->getName()) - <<(initialValue.isEmpty()?QString(""):QString(" = ") + initialValue)<<";"; + <<(initialValue.isEmpty()?TQString(""):TQString(" = ") + initialValue)<<";"; } for(at=atprot.first();at;at=atprot.next()) { - QString documentation = at->getDoc(); - QString typeName = fixTypeName(at->getTypeName()); - QString staticValue = at->getStatic() ? "static " : ""; - QString initialValue = fixInitialStringDeclValue(at->getInitialValue(), typeName); + TQString documentation = at->getDoc(); + TQString typeName = fixTypeName(at->getTypeName()); + TQString staticValue = at->getStatic() ? "static " : ""; + TQString initialValue = fixInitialStringDeclValue(at->getInitialValue(), typeName); if(!documentation.isEmpty()) writeComment(documentation, m_indentation, java, true); java<<startline<<staticValue<<"protected "<<typeName<<" "<<cleanName(at->getName()) - <<(initialValue.isEmpty()?QString(""):QString(" = ") + initialValue)<<";"; + <<(initialValue.isEmpty()?TQString(""):TQString(" = ") + initialValue)<<";"; } for(at=atpriv.first();at;at=atpriv.next()) { - QString documentation = at->getDoc(); - QString typeName = fixTypeName(at->getTypeName()); - QString staticValue = at->getStatic() ? "static " : ""; - QString initialValue = fixInitialStringDeclValue(at->getInitialValue(), typeName); + TQString documentation = at->getDoc(); + TQString typeName = fixTypeName(at->getTypeName()); + TQString staticValue = at->getStatic() ? "static " : ""; + TQString initialValue = fixInitialStringDeclValue(at->getInitialValue(), typeName); if(!documentation.isEmpty()) writeComment(documentation, m_indentation, java, true); java<<startline<<staticValue<<"private "<<typeName<<" "<<cleanName(at->getName()) - <<(initialValue.isEmpty()?QString(""):QString(" = ") + initialValue)<<";"; + <<(initialValue.isEmpty()?TQString(""):TQString(" = ") + initialValue)<<";"; } } -void JavaWriter::writeAttributeMethods(UMLAttributeList &atpub, Uml::Visibility visibility, QTextStream &java) +void JavaWriter::writeAttributeMethods(UMLAttributeList &atpub, Uml::Visibility visibility, TQTextStream &java) { UMLAttribute *at; for(at=atpub.first(); at; at=atpub.next()) { - QString fieldName = cleanName(at->getName()); + TQString fieldName = cleanName(at->getName()); // force capitalizing the field name, this is silly, // from what I can tell, this IS the default behavior for // cleanName. I dunno why its not working -b.t. @@ -419,17 +419,17 @@ void JavaWriter::writeAttributeMethods(UMLAttributeList &atpub, Uml::Visibility } -void JavaWriter::writeComment(const QString &comment, const QString &myIndent, - QTextStream &java, bool javaDocStyle) +void JavaWriter::writeComment(const TQString &comment, const TQString &myIndent, + TQTextStream &java, bool javaDocStyle) { // in the case we have several line comment.. // NOTE: this part of the method has the problem of adopting UNIX newline, // need to resolve for using with MAC/WinDoze eventually I assume - if (comment.contains(QRegExp("\n"))) { + if (comment.contains(TQRegExp("\n"))) { if(javaDocStyle) java << myIndent << "/**" << m_endl; - QStringList lines = QStringList::split( "\n", comment); + TQStringList lines = TQStringList::split( "\n", comment); for(uint i= 0; i < lines.count(); i++) { writeBlankLine(java); @@ -456,7 +456,7 @@ void JavaWriter::writeComment(const QString &comment, const QString &myIndent, } } -void JavaWriter::writeDocumentation(QString header, QString body, QString end, QString indent, QTextStream &java) +void JavaWriter::writeDocumentation(TQString header, TQString body, TQString end, TQString indent, TQTextStream &java) { writeBlankLine(java); java<<indent<<"/**"<<m_endl; @@ -466,14 +466,14 @@ void JavaWriter::writeDocumentation(QString header, QString body, QString end, Q java<<formatDoc(body, indent+" * "); if (!end.isEmpty()) { - QStringList lines = QStringList::split( "\n", end); + TQStringList lines = TQStringList::split( "\n", end); for(uint i= 0; i < lines.count(); i++) java<<formatDoc(lines[i], indent+" * "); } java<<indent<<" */"; } -void JavaWriter::writeAssociationDecls(UMLAssociationList associations, Uml::IDType id, QTextStream &java) +void JavaWriter::writeAssociationDecls(UMLAssociationList associations, Uml::IDType id, TQTextStream &java) { if( forceSections() || !associations.isEmpty() ) @@ -496,30 +496,30 @@ void JavaWriter::writeAssociationDecls(UMLAssociationList associations, Uml::IDT // print RoleB decl if (printRoleB) { - QString fieldClassName = cleanName(getUMLObjectName(a->getObject(Uml::B))); + TQString fieldClassName = cleanName(getUMLObjectName(a->getObject(Uml::B))); writeAssociationRoleDecl(fieldClassName, a->getRoleName(Uml::B), a->getMulti(Uml::B), a->getRoleDoc(Uml::B), a->getVisibility(Uml::B), java); } // print RoleA decl if (printRoleA) { - QString fieldClassName = cleanName(getUMLObjectName(a->getObject(Uml::A))); + TQString fieldClassName = cleanName(getUMLObjectName(a->getObject(Uml::A))); writeAssociationRoleDecl(fieldClassName, a->getRoleName(Uml::A), a->getMulti(Uml::A), a->getRoleDoc(Uml::A), a->getVisibility(Uml::A), java); } } } } -void JavaWriter::writeAssociationRoleDecl(QString fieldClassName, - QString roleName, QString multi, - QString doc, Uml::Visibility visib, QTextStream &java) +void JavaWriter::writeAssociationRoleDecl(TQString fieldClassName, + TQString roleName, TQString multi, + TQString doc, Uml::Visibility visib, TQTextStream &java) { // ONLY write out IF there is a rolename given // otherwise its not meant to be declared in the code if (roleName.isEmpty()) return; - QString scope = scopeToJavaDecl(visib); + TQString scope = scopeToJavaDecl(visib); // always put space between this and prior decl, if any writeBlankLine(java); @@ -530,14 +530,14 @@ void JavaWriter::writeAssociationRoleDecl(QString fieldClassName, // declare the association based on whether it is this a single variable // or a List (Vector). One day this will be done correctly with special // multiplicity object that we don't have to figure out what it means via regex. - if(multi.isEmpty() || multi.contains(QRegExp("^[01]$"))) + if(multi.isEmpty() || multi.contains(TQRegExp("^[01]$"))) { - QString fieldVarName = "m_" + roleName.replace(0, 1, roleName.left(1).lower()); + TQString fieldVarName = "m_" + roleName.replace(0, 1, roleName.left(1).lower()); java<<startline<<scope<<" "<<fieldClassName<<" "<<fieldVarName<<";"; } else { - QString fieldVarName = roleName.lower() + "Vector"; + TQString fieldVarName = roleName.lower() + "Vector"; java<<startline<<scope<<" Vector "<<fieldVarName<<" = new Vector();"; // from here we could initialize default values, or put in an init() section // of the constructors @@ -545,7 +545,7 @@ void JavaWriter::writeAssociationRoleDecl(QString fieldClassName, } -void JavaWriter::writeAssociationMethods (UMLAssociationList associations, UMLClassifier *thisClass, QTextStream &java) +void JavaWriter::writeAssociationMethods (UMLAssociationList associations, UMLClassifier *thisClass, TQTextStream &java) { if( forceSections() || !associations.isEmpty() ) { @@ -558,7 +558,7 @@ void JavaWriter::writeAssociationMethods (UMLAssociationList associations, UMLCl { // only write out IF there is a rolename given if(!a->getRoleName(Uml::B).isEmpty()) { - QString fieldClassName = getUMLObjectName(a->getObject(Uml::B)); + TQString fieldClassName = getUMLObjectName(a->getObject(Uml::B)); writeAssociationRoleMethod(fieldClassName, a->getRoleName(Uml::B), a->getMulti(Uml::B), a->getRoleDoc(Uml::B), @@ -571,7 +571,7 @@ void JavaWriter::writeAssociationMethods (UMLAssociationList associations, UMLCl { // only write out IF there is a rolename given if(!a->getRoleName(Uml::A).isEmpty()) { - QString fieldClassName = getUMLObjectName(a->getObject(Uml::A)); + TQString fieldClassName = getUMLObjectName(a->getObject(Uml::A)); writeAssociationRoleMethod(fieldClassName, a->getRoleName(Uml::A), a->getMulti(Uml::A), a->getRoleDoc(Uml::A), @@ -585,33 +585,33 @@ void JavaWriter::writeAssociationMethods (UMLAssociationList associations, UMLCl } } -void JavaWriter::writeAssociationRoleMethod (QString fieldClassName, QString roleName, QString multi, - QString description, Uml::Visibility visib, Uml::Changeability_Type change, - QTextStream &java) +void JavaWriter::writeAssociationRoleMethod (TQString fieldClassName, TQString roleName, TQString multi, + TQString description, Uml::Visibility visib, Uml::Changeability_Type change, + TQTextStream &java) { - if(multi.isEmpty() || multi.contains(QRegExp("^[01]$"))) + if(multi.isEmpty() || multi.contains(TQRegExp("^[01]$"))) { - QString fieldVarName = "m_" + roleName.replace(0, 1, roleName.left(1).lower()); + TQString fieldVarName = "m_" + roleName.replace(0, 1, roleName.left(1).lower()); writeSingleAttributeAccessorMethods(fieldClassName, fieldVarName, roleName, description, visib, change, false, java); } else { - QString fieldVarName = roleName.lower() + "Vector"; + TQString fieldVarName = roleName.lower() + "Vector"; writeVectorAttributeAccessorMethods(fieldClassName, fieldVarName, roleName, description, visib, change, java); } } -void JavaWriter::writeVectorAttributeAccessorMethods (QString fieldClassName, QString fieldVarName, - QString fieldName, QString description, +void JavaWriter::writeVectorAttributeAccessorMethods (TQString fieldClassName, TQString fieldVarName, + TQString fieldName, TQString description, Uml::Visibility visibility, Uml::Changeability_Type changeType, - QTextStream &java) + TQTextStream &java) { fieldClassName = fixTypeName(fieldClassName); fieldName = Codegen_Utils::capitalizeFirstLetter(fieldName); - QString strVis = scopeToJavaDecl(visibility); + TQString strVis = scopeToJavaDecl(visibility); // ONLY IF changeability is NOT Frozen if (changeType != Uml::chg_Frozen) @@ -641,13 +641,13 @@ void JavaWriter::writeVectorAttributeAccessorMethods (QString fieldClassName, QS } -void JavaWriter::writeSingleAttributeAccessorMethods(QString fieldClassName, QString fieldVarName, - QString fieldName, QString description, +void JavaWriter::writeSingleAttributeAccessorMethods(TQString fieldClassName, TQString fieldVarName, + TQString fieldName, TQString description, Uml::Visibility visibility, Uml::Changeability_Type change, - bool isFinal, QTextStream &java) + bool isFinal, TQTextStream &java) { - QString strVis = scopeToJavaDecl(visibility); + TQString strVis = scopeToJavaDecl(visibility); fieldClassName = fixTypeName(fieldClassName); fieldName = Codegen_Utils::capitalizeFirstLetter(fieldName); @@ -667,7 +667,7 @@ void JavaWriter::writeSingleAttributeAccessorMethods(QString fieldClassName, QSt writeBlankLine(java); } -void JavaWriter::writeConstructor(UMLClassifier *c, QTextStream &java) +void JavaWriter::writeConstructor(UMLClassifier *c, TQTextStream &java) { if (forceDoc()) @@ -680,7 +680,7 @@ void JavaWriter::writeConstructor(UMLClassifier *c, QTextStream &java) } // write the first constructor - QString className = cleanName(c->getName()); + TQString className = cleanName(c->getName()); java<<m_indentation<<"public "<<className<<" () { };"; } @@ -688,7 +688,7 @@ void JavaWriter::writeConstructor(UMLClassifier *c, QTextStream &java) // IF the type is "string" we need to declare it as // the Java Object "String" (there is no string primative in Java). // Same thing again for "bool" to "boolean" -QString JavaWriter::fixTypeName(const QString& string) +TQString JavaWriter::fixTypeName(const TQString& string) { if (string.isEmpty()) return "void"; @@ -699,8 +699,8 @@ QString JavaWriter::fixTypeName(const QString& string) return string; } -QStringList JavaWriter::defaultDatatypes() { - QStringList l; +TQStringList JavaWriter::defaultDatatypes() { + TQStringList l; l.append("int"); l.append("char"); l.append("boolean"); @@ -783,7 +783,7 @@ void JavaWriter::getInterfacesOperationsToBeImplemented(UMLClassifier *c, UMLOpe } } -void JavaWriter::writeOperations(UMLClassifier *c, QTextStream &java) { +void JavaWriter::writeOperations(UMLClassifier *c, TQTextStream &java) { UMLOperationList opl; UMLOperationList oppub,opprot,oppriv; oppub.setAutoDelete(false); @@ -841,21 +841,21 @@ void JavaWriter::writeOperations(UMLClassifier *c, QTextStream &java) { } -void JavaWriter::writeOperations(UMLOperationList &oplist, QTextStream &java) { +void JavaWriter::writeOperations(UMLOperationList &oplist, TQTextStream &java) { UMLOperation *op; UMLAttributeList atl; UMLAttribute *at; int i,j; - QString str; + TQString str; // generate method decl for each operation given for( op=oplist.first(); op ;op=oplist.next()) { - QString returnStr = ""; + TQString returnStr = ""; // write documentation - QString methodReturnType = fixTypeName(op->getTypeName()); + TQString methodReturnType = fixTypeName(op->getTypeName()); if(methodReturnType != "void") returnStr += "@return "+methodReturnType+"\n"; @@ -869,12 +869,12 @@ void JavaWriter::writeOperations(UMLOperationList &oplist, QTextStream &java) { i= atl.count(); j=0; for (at = atl.first(); at; at = atl.next(), j++) { - QString typeName = fixTypeName(at->getTypeName()); - QString atName = cleanName(at->getName()); + TQString typeName = fixTypeName(at->getTypeName()); + TQString atName = cleanName(at->getName()); str += typeName + ' ' + atName + (!(at->getInitialValue().isEmpty()) ? - (QString(" = ")+at->getInitialValue()) : - QString("")) + (TQString(" = ")+at->getInitialValue()) : + TQString("")) + ((j < i-1)?", ":""); returnStr += "@param "+atName+' '+at->getDoc()+"\n"; } @@ -892,7 +892,7 @@ void JavaWriter::writeOperations(UMLOperationList &oplist, QTextStream &java) { } } -QString JavaWriter::fixInitialStringDeclValue(QString value, QString type) +TQString JavaWriter::fixInitialStringDeclValue(TQString value, TQString type) { // check for strings only if (!value.isEmpty() && type == "String") { @@ -904,9 +904,9 @@ QString JavaWriter::fixInitialStringDeclValue(QString value, QString type) return value; } -QString JavaWriter::scopeToJavaDecl(Uml::Visibility scope) +TQString JavaWriter::scopeToJavaDecl(Uml::Visibility scope) { - QString scopeString; + TQString scopeString; switch(scope) { case Uml::Visibility::Public: @@ -924,12 +924,12 @@ QString JavaWriter::scopeToJavaDecl(Uml::Visibility scope) } // methods like this _shouldn't_ be needed IF we properly did things thruought the code. -QString JavaWriter::getUMLObjectName(UMLObject *obj) +TQString JavaWriter::getUMLObjectName(UMLObject *obj) { - return(obj!=0)?obj->getName():QString("NULL"); + return(obj!=0)?obj->getName():TQString("NULL"); } -void JavaWriter::writeBlankLine(QTextStream &java) +void JavaWriter::writeBlankLine(TQTextStream &java) { java<<m_endl; } diff --git a/umbrello/umbrello/codegenerators/javawriter.h b/umbrello/umbrello/codegenerators/javawriter.h index 2469f6d0..69dada17 100644 --- a/umbrello/umbrello/codegenerators/javawriter.h +++ b/umbrello/umbrello/codegenerators/javawriter.h @@ -60,7 +60,7 @@ public: /** * Overrides method from class CodeGenerator */ - QStringList defaultDatatypes(); + TQStringList defaultDatatypes(); private: @@ -68,12 +68,12 @@ private: * Writes class's documentation then the class header * public abstract class Foo extents { */ - void writeClassDecl(UMLClassifier *c, QTextStream &java); + void writeClassDecl(UMLClassifier *c, TQTextStream &java); /** * Writes the comment and class constructor */ - void writeConstructor(UMLClassifier *c, QTextStream &java); + void writeConstructor(UMLClassifier *c, TQTextStream &java); /** * return true if the two operations have the same name and the same parameters @@ -111,21 +111,21 @@ private: * @param c the class for which we are generating code * @param j the stream associated with the output file */ - void writeOperations(UMLClassifier *c, QTextStream &j); + void writeOperations(UMLClassifier *c, TQTextStream &j); /** * write a list of operations for a given class * @param list the list of operations you want to write * @param j the stream associated with the output file */ - void writeOperations(UMLOperationList &list, QTextStream &j); + void writeOperations(UMLOperationList &list, TQTextStream &j); /** * write all attributes for a given class * @param c the class for which we are generating code * @param j the stream associated with the output file */ - void writeAttributes(UMLClassifier *c, QTextStream &j); + void writeAttributes(UMLClassifier *c, TQTextStream &j); /** * writes the Attribute declarations @@ -135,94 +135,94 @@ private: * @param java text stream */ void writeAttributeDecls(UMLAttributeList &atpub, UMLAttributeList &atprot, - UMLAttributeList &atpriv, QTextStream &java ); + UMLAttributeList &atpriv, TQTextStream &java ); /** * Searches a list of associations for appropriate ones to write out as attributes */ - void writeAssociationDecls(UMLAssociationList associations, Uml::IDType id, QTextStream &java); + void writeAssociationDecls(UMLAssociationList associations, Uml::IDType id, TQTextStream &java); /** * Writes out an association as an attribute using Vector */ - void writeAssociationRoleDecl(QString fieldClassName, QString roleName, QString multi, - QString doc, Uml::Visibility visib, QTextStream &java); + void writeAssociationRoleDecl(TQString fieldClassName, TQString roleName, TQString multi, + TQString doc, Uml::Visibility visib, TQTextStream &java); /** * calls @ref writeSingleAttributeAccessorMethods() on each of the attributes in atpub */ - void writeAttributeMethods(UMLAttributeList &atpub, Uml::Visibility visibility, QTextStream &java); + void writeAttributeMethods(UMLAttributeList &atpub, Uml::Visibility visibility, TQTextStream &java); /** * calls @ref writeAssociationRoleMethod() on each of the associations in the given list */ void writeAssociationMethods(UMLAssociationList associations, UMLClassifier *thisClass, - QTextStream &java); + TQTextStream &java); /** * calls @ref writeSingleAttributeAccessorMethods() or @ref * writeVectorAttributeAccessorMethods() on the assocaition * role */ - void writeAssociationRoleMethod(QString fieldClassName, QString roleName, QString multi, - QString description, Uml::Visibility visib, Uml::Changeability_Type change, - QTextStream &java); + void writeAssociationRoleMethod(TQString fieldClassName, TQString roleName, TQString multi, + TQString description, Uml::Visibility visib, Uml::Changeability_Type change, + TQTextStream &java); /** * Writes getFoo() and setFoo() accessor methods for the attribute */ - void writeSingleAttributeAccessorMethods(QString fieldClassName, QString fieldVarName, - QString fieldName, QString description, + void writeSingleAttributeAccessorMethods(TQString fieldClassName, TQString fieldVarName, + TQString fieldName, TQString description, Uml::Visibility visibility, Uml::Changeability_Type change, - bool isFinal, QTextStream &java); + bool isFinal, TQTextStream &java); /** * Writes addFoo() and removeFoo() accessor methods for the Vector attribute */ - void writeVectorAttributeAccessorMethods(QString fieldClassName, QString fieldVarName, - QString fieldName, QString description, + void writeVectorAttributeAccessorMethods(TQString fieldClassName, TQString fieldVarName, + TQString fieldName, TQString description, Uml::Visibility visibility, Uml::Changeability_Type change, - QTextStream &java); + TQTextStream &java); /** * Writes a // style comment */ - void writeComment(const QString &text, const QString &indent, QTextStream &java, bool javaDocStyle=false); + void writeComment(const TQString &text, const TQString &indent, TQTextStream &java, bool javaDocStyle=false); /** * Writes a documentation comment */ - void writeDocumentation(QString header, QString body, QString end, QString indent, QTextStream &java); + void writeDocumentation(TQString header, TQString body, TQString end, TQString indent, TQTextStream &java); /** * Returns the name of the given object (if it exists) */ - QString getUMLObjectName(UMLObject *obj); + TQString getUMLObjectName(UMLObject *obj); /** * Replaces `string' with `String' and `bool' with `boolean' */ - QString fixTypeName(const QString& string); + TQString fixTypeName(const TQString& string); /** * check that initial values of strings have quotes around them */ - QString fixInitialStringDeclValue(QString value, QString type); + TQString fixInitialStringDeclValue(TQString value, TQString type); /** * Write a blank line */ - void writeBlankLine(QTextStream& java); + void writeBlankLine(TQTextStream& java); /** * a little method for converting scope to string value */ - QString scopeToJavaDecl(Uml::Visibility scope); + TQString scopeToJavaDecl(Uml::Visibility scope); /** * A \n, used at the end of each line */ - QString startline; + TQString startline; /** * Whether or not this concept is an interface. diff --git a/umbrello/umbrello/codegenerators/jswriter.cpp b/umbrello/umbrello/codegenerators/jswriter.cpp index 1dbb45d6..ea4cc2e1 100644 --- a/umbrello/umbrello/codegenerators/jswriter.cpp +++ b/umbrello/umbrello/codegenerators/jswriter.cpp @@ -22,8 +22,8 @@ #include <kdebug.h> -#include <qregexp.h> -#include <qtextstream.h> +#include <tqregexp.h> +#include <tqtextstream.h> JSWriter::JSWriter() { } @@ -39,8 +39,8 @@ void JSWriter::writeClass(UMLClassifier *c) return; } - QString classname = cleanName(c->getName()); - QString fileName = c->getName().lower(); + TQString classname = cleanName(c->getName()); + TQString fileName = c->getName().lower(); //find an appropriate name for our file fileName = findFileName(c,".js"); @@ -50,13 +50,13 @@ void JSWriter::writeClass(UMLClassifier *c) return; } - QFile filejs; + TQFile filejs; if(!openFile(filejs, fileName)) { emit codeGenerated(c, false); return; } - QTextStream js(&filejs); + TQTextStream js(&filejs); ////////////////////////////// //Start generating the code!! @@ -64,12 +64,12 @@ void JSWriter::writeClass(UMLClassifier *c) //try to find a heading file (license, coments, etc) - QString str; + TQString str; str = getHeadingFile(".js"); if(!str.isEmpty()) { - str.replace(QRegExp("%filename%"),fileName); - str.replace(QRegExp("%filepath%"),filejs.name()); + str.replace(TQRegExp("%filename%"),fileName); + str.replace(TQRegExp("%filepath%"),filejs.name()); js << str << m_endl; } @@ -79,7 +79,7 @@ void JSWriter::writeClass(UMLClassifier *c) findObjectsRelated(c,includes); for (UMLPackage *conc = includes.first(); conc; conc = includes.next()) { - QString headerName = findFileName(conc, ".js"); + TQString headerName = findFileName(conc, ".js"); if ( !headerName.isEmpty() ) { js << "#include \"" << headerName << "\"" << m_endl; @@ -123,7 +123,7 @@ void JSWriter::writeClass(UMLClassifier *c) UMLAttributeList atl = c->getAttributeList(); js << "/**" << m_endl; - QString temp = "_init sets all " + classname + " attributes to their default value." + TQString temp = "_init sets all " + classname + " attributes to their default value." " Make sure to call this method within your class constructor"; js << formatDoc(temp, " * "); js << " */" << m_endl; @@ -183,13 +183,13 @@ void JSWriter::writeClass(UMLClassifier *c) //////////////////////////////////////////////////////////////////////////////////// // Helper Methods -void JSWriter::writeAssociation(QString& classname, UMLAssociationList& assocList , QTextStream &js) +void JSWriter::writeAssociation(TQString& classname, UMLAssociationList& assocList , TQTextStream &js) { for (UMLAssociation *a = assocList.first(); a; a = assocList.next()) { // association side Uml::Role_Type role = (a->getObject(Uml::A)->getName() == classname ? Uml::B : Uml::A); - QString roleName(cleanName(a->getRoleName(role))); + TQString roleName(cleanName(a->getRoleName(role))); if (!roleName.isEmpty()) { @@ -213,7 +213,7 @@ void JSWriter::writeAssociation(QString& classname, UMLAssociationList& assocLis int nMulti = a->getMulti(role).toInt(&okCvt,10); bool isNotMulti = a->getMulti(role).isEmpty() || (okCvt && nMulti == 1); - QString typeName(cleanName(a->getObject(role)->getName())); + TQString typeName(cleanName(a->getObject(role)->getName())); if (isNotMulti) js << m_indentation << "this.m_" << roleName << " = new " << typeName << "();" << m_endl; @@ -225,7 +225,7 @@ void JSWriter::writeAssociation(QString& classname, UMLAssociationList& assocLis } } -void JSWriter::writeOperations(QString classname, UMLOperationList *opList, QTextStream &js) +void JSWriter::writeOperations(TQString classname, UMLOperationList *opList, TQTextStream &js) { UMLOperation *op; UMLAttribute *at; @@ -260,7 +260,7 @@ void JSWriter::writeOperations(QString classname, UMLOperationList *opList, QTex for (at = atl.first(); at ;at = atl.next(),j++) { js << cleanName(at->getName()) - << (!(at->getInitialValue().isEmpty()) ? (QString(" = ")+at->getInitialValue()) : QString("")) + << (!(at->getInitialValue().isEmpty()) ? (TQString(" = ")+at->getInitialValue()) : TQString("")) << ((j < i-1)?", ":""); } js << ")" << m_endl << "{" << m_endl << @@ -276,9 +276,9 @@ Uml::Programming_Language JSWriter::getLanguage() { return Uml::pl_JavaScript; } -const QStringList JSWriter::reservedKeywords() const { +const TQStringList JSWriter::reservedKeywords() const { - static QStringList keywords; + static TQStringList keywords; if (keywords.isEmpty()) { keywords << "break" diff --git a/umbrello/umbrello/codegenerators/jswriter.h b/umbrello/umbrello/codegenerators/jswriter.h index a9c5ebde..679222b3 100644 --- a/umbrello/umbrello/codegenerators/jswriter.h +++ b/umbrello/umbrello/codegenerators/jswriter.h @@ -47,7 +47,7 @@ public: /** * get list of reserved keywords */ - virtual const QStringList reservedKeywords() const; + virtual const TQStringList reservedKeywords() const; private: @@ -63,7 +63,7 @@ private: * @param opList the list of operations * @param js output stream for the JS file */ - void writeOperations(QString classname, UMLOperationList *opList, QTextStream &js); + void writeOperations(TQString classname, UMLOperationList *opList, TQTextStream &js); /** * write a list of associations @@ -72,7 +72,7 @@ private: * @param assocList the list of associations * @param as output stream for the AS file */ - void writeAssociation(QString& classname, UMLAssociationList& assoclist , QTextStream &js); + void writeAssociation(TQString& classname, UMLAssociationList& assoclist , TQTextStream &js); }; #endif //JSWRITER diff --git a/umbrello/umbrello/codegenerators/pascalwriter.cpp b/umbrello/umbrello/codegenerators/pascalwriter.cpp index 92a45bd2..766ea6df 100644 --- a/umbrello/umbrello/codegenerators/pascalwriter.cpp +++ b/umbrello/umbrello/codegenerators/pascalwriter.cpp @@ -14,9 +14,9 @@ #include <kdebug.h> #include <klocale.h> #include <kmessagebox.h> -#include <qfile.h> -#include <qregexp.h> -#include <qtextstream.h> +#include <tqfile.h> +#include <tqregexp.h> +#include <tqtextstream.h> #include "../umldoc.h" #include "../uml.h" @@ -33,7 +33,7 @@ #include "../umlnamespace.h" #include "classifierinfo.h" -const QString PascalWriter::defaultPackageSuffix = "_Holder"; +const TQString PascalWriter::defaultPackageSuffix = "_Holder"; PascalWriter::PascalWriter() { } @@ -58,7 +58,7 @@ bool PascalWriter::isOOClass(UMLClassifier *c) { kDebug() << "PascalWriter::isOOClass: unknown object type " << ot << endl; return false; } - QString stype = c->getStereotype(); + TQString stype = c->getStereotype(); if (stype == "CORBAConstant" || stype == "CORBATypedef" || stype == "CORBAStruct" || stype == "CORBAUnion") return false; @@ -67,10 +67,10 @@ bool PascalWriter::isOOClass(UMLClassifier *c) { return true; } -QString PascalWriter::qualifiedName(UMLPackage *p, bool withType, bool byValue) { +TQString PascalWriter::qualifiedName(UMLPackage *p, bool withType, bool byValue) { UMLPackage *umlPkg = p->getUMLPackage(); - QString className = cleanName(p->getName()); - QString retval; + TQString className = cleanName(p->getName()); + TQString retval; if (umlPkg == UMLApp::app()->getDocument()->getRootFolder(Uml::mt_Logical)) umlPkg = NULL; @@ -101,7 +101,7 @@ QString PascalWriter::qualifiedName(UMLPackage *p, bool withType, bool byValue) } void PascalWriter::computeAssocTypeAndRole -(UMLAssociation *a, QString& typeName, QString& roleName) { +(UMLAssociation *a, TQString& typeName, TQString& roleName) { roleName = a->getRoleName(Uml::A); if (roleName.isEmpty()) { if (a->getMulti(Uml::A).isEmpty()) { @@ -127,8 +127,8 @@ void PascalWriter::writeClass(UMLClassifier *c) { } const bool isClass = !c->isInterface(); - QString classname = cleanName(c->getName()); - QString fileName = qualifiedName(c).lower(); + TQString classname = cleanName(c->getName()); + TQString fileName = qualifiedName(c).lower(); fileName.replace('.', '-'); //find an appropriate name for our file @@ -138,7 +138,7 @@ void PascalWriter::writeClass(UMLClassifier *c) { return; } - QFile file; + TQFile file; if (!openFile(file, fileName)) { emit codeGenerated(c, false); return; @@ -146,17 +146,17 @@ void PascalWriter::writeClass(UMLClassifier *c) { // Start generating the code. - QTextStream pas(&file); + TQTextStream pas(&file); //try to find a heading file(license, comments, etc) - QString str; + TQString str; str = getHeadingFile(".pas"); if (!str.isEmpty()) { - str.replace(QRegExp("%filename%"), fileName); - str.replace(QRegExp("%filepath%"), file.name()); + str.replace(TQRegExp("%filename%"), fileName); + str.replace(TQRegExp("%filepath%"), file.name()); pas << str << endl; } - QString unit = qualifiedName(c); + TQString unit = qualifiedName(c); pas << "unit " << unit << ";" << m_endl << m_endl; pas << "INTERFACE" << m_endl << m_endl; // Use referenced classes. @@ -186,7 +186,7 @@ void PascalWriter::writeClass(UMLClassifier *c) { pas << getIndent() << classname << " = (" << m_endl; m_indentLevel++; for (UMLClassifierListItem *lit = litList.first(); lit; lit = litList.next()) { - QString enumLiteral = cleanName(lit->getName()); + TQString enumLiteral = cleanName(lit->getName()); pas << getIndent() << enumLiteral; if (++i < litList.count()) pas << "," << m_endl; @@ -199,7 +199,7 @@ void PascalWriter::writeClass(UMLClassifier *c) { } UMLAttributeList atl = c->getAttributeList(); if (! isOOClass(c)) { - QString stype = c->getStereotype(); + TQString stype = c->getStereotype(); if (stype == "CORBAConstant") { pas << getIndent() << "// " << stype << " is Not Yet Implemented" << m_endl << m_endl; } else if(stype == "CORBAStruct") { @@ -208,10 +208,10 @@ void PascalWriter::writeClass(UMLClassifier *c) { pas << getIndent() << classname << " = record" << m_endl; m_indentLevel++; for (at = atl.first(); at; at = atl.next()) { - QString name = cleanName(at->getName()); - QString typeName = at->getTypeName(); + TQString name = cleanName(at->getName()); + TQString typeName = at->getTypeName(); pas << getIndent() << name << " : " << typeName; - QString initialVal = at->getInitialValue(); + TQString initialVal = at->getInitialValue(); if (initialVal.latin1() && ! initialVal.isEmpty()) pas << " := " << initialVal; pas << ";" << m_endl; @@ -321,13 +321,13 @@ void PascalWriter::writeClass(UMLClassifier *c) { } -void PascalWriter::writeOperation(UMLOperation *op, QTextStream &pas, bool is_comment) { +void PascalWriter::writeOperation(UMLOperation *op, TQTextStream &pas, bool is_comment) { if (op->getStatic()) { pas << "// TODO: generate status method " << op->getName() << m_endl; return; } UMLAttributeList atl = op->getParmList(); - QString rettype = op->getTypeName(); + TQString rettype = op->getTypeName(); bool use_procedure = (rettype.isEmpty() || rettype == "void"); pas << getIndent(); @@ -366,8 +366,8 @@ void PascalWriter::writeOperation(UMLOperation *op, QTextStream &pas, bool is_co // for generating meaningful implementations. } -QStringList PascalWriter::defaultDatatypes() { - QStringList l; +TQStringList PascalWriter::defaultDatatypes() { + TQStringList l; l.append("AnsiString"); l.append("Boolean"); l.append("Byte"); @@ -400,11 +400,11 @@ QStringList PascalWriter::defaultDatatypes() { * * @param rPossiblyReservedKeyword The string to check. */ -bool PascalWriter::isReservedKeyword(const QString & rPossiblyReservedKeyword) { +bool PascalWriter::isReservedKeyword(const TQString & rPossiblyReservedKeyword) { - const QStringList keywords = reservedKeywords(); + const TQStringList keywords = reservedKeywords(); - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = keywords.begin(); it != keywords.end(); ++it) if ((*it).lower() == rPossiblyReservedKeyword.lower()) return true; @@ -415,9 +415,9 @@ bool PascalWriter::isReservedKeyword(const QString & rPossiblyReservedKeyword) { /** * get list of reserved keywords */ -const QStringList PascalWriter::reservedKeywords() const { +const TQStringList PascalWriter::reservedKeywords() const { - static QStringList keywords; + static TQStringList keywords; if ( keywords.isEmpty() ) { keywords.append( "absolute" ); diff --git a/umbrello/umbrello/codegenerators/pascalwriter.h b/umbrello/umbrello/codegenerators/pascalwriter.h index bc34d762..0e1f93ca 100644 --- a/umbrello/umbrello/codegenerators/pascalwriter.h +++ b/umbrello/umbrello/codegenerators/pascalwriter.h @@ -47,7 +47,7 @@ public: */ virtual Uml::Programming_Language getLanguage(); - QStringList defaultDatatypes(); + TQStringList defaultDatatypes(); /** * Check whether the given string is a reserved word for the @@ -55,12 +55,12 @@ public: * * @param rPossiblyReservedKeyword The string to check. */ - virtual bool isReservedKeyword(const QString & rPossiblyReservedKeyword); + virtual bool isReservedKeyword(const TQString & rPossiblyReservedKeyword); /** * get list of reserved keywords */ - virtual const QStringList reservedKeywords() const; + virtual const TQStringList reservedKeywords() const; private: @@ -69,16 +69,16 @@ private: * @param op the class for which we are generating code * @param ada the stream associated with the output file */ - void writeOperation (UMLOperation *op, QTextStream &ada, bool is_comment = false); + void writeOperation (UMLOperation *op, TQTextStream &ada, bool is_comment = false); - void computeAssocTypeAndRole (UMLAssociation *a, QString& typeName, QString& roleName); + void computeAssocTypeAndRole (UMLAssociation *a, TQString& typeName, TQString& roleName); bool isOOClass (UMLClassifier *c); - QString qualifiedName + TQString qualifiedName (UMLPackage *p, bool withType = false, bool byValue = false); - static const QString defaultPackageSuffix; + static const TQString defaultPackageSuffix; }; diff --git a/umbrello/umbrello/codegenerators/perlwriter.cpp b/umbrello/umbrello/codegenerators/perlwriter.cpp index 7c8360fa..42563ec4 100644 --- a/umbrello/umbrello/codegenerators/perlwriter.cpp +++ b/umbrello/umbrello/codegenerators/perlwriter.cpp @@ -23,11 +23,11 @@ #include "../uml.h" #include <kdebug.h> -#include <qregexp.h> -#include <qstring.h> -#include <qdir.h> -#include <qdatetime.h> -#include <qtextstream.h> +#include <tqregexp.h> +#include <tqstring.h> +#include <tqdir.h> +#include <tqdatetime.h> +#include <tqtextstream.h> PerlWriter::PerlWriter() { @@ -35,8 +35,8 @@ PerlWriter::PerlWriter() PerlWriter::~PerlWriter() {} -bool PerlWriter::GetUseStatements(UMLClassifier *c, QString &Ret, - QString &ThisPkgName){ +bool PerlWriter::GetUseStatements(UMLClassifier *c, TQString &Ret, + TQString &ThisPkgName){ if(!c){ return(false); @@ -45,17 +45,17 @@ bool PerlWriter::GetUseStatements(UMLClassifier *c, QString &Ret, UMLPackageList includes; findObjectsRelated(c,includes); UMLPackage *conc; - QString AV = "@"; - QString SV = "$"; - QString HV = "%"; + TQString AV = "@"; + TQString SV = "$"; + TQString HV = "%"; for(conc = includes.first(); conc ;conc = includes.next()) { if (conc->getBaseType() == Uml::ot_Datatype) continue; - QString neatName = cleanName(conc->getName()); + TQString neatName = cleanName(conc->getName()); if (neatName != AV && neatName != SV && neatName != HV) { - QString OtherPkgName = conc->getPackage("."); - OtherPkgName.replace(QRegExp("\\."),"::"); - QString OtherName = OtherPkgName + "::" + cleanName(conc->getName()); + TQString OtherPkgName = conc->getPackage("."); + OtherPkgName.replace(TQRegExp("\\."),"::"); + TQString OtherName = OtherPkgName + "::" + cleanName(conc->getName()); // Only print out the use statement if the other package isn't the // same as the one we are working on. (This happens for the @@ -74,8 +74,8 @@ bool PerlWriter::GetUseStatements(UMLClassifier *c, QString &Ret, Ret += "use base qw( "; for (UMLClassifier *obj = superclasses.first(); obj; obj = superclasses.next()) { - QString packageName = obj->getPackage("."); - packageName.replace(QRegExp("\\."),"::"); + TQString packageName = obj->getPackage("."); + packageName.replace(TQRegExp("\\."),"::"); Ret += packageName + "::" + cleanName(obj->getName()) + ' '; } @@ -92,22 +92,22 @@ void PerlWriter::writeClass(UMLClassifier *c) { return; } */ - QString classname = cleanName(c->getName());// this is fine: cleanName is "::-clean" - QString packageName = c->getPackage("."); - QString fileName; + TQString classname = cleanName(c->getName());// this is fine: cleanName is "::-clean" + TQString packageName = c->getPackage("."); + TQString fileName; // Replace all white spaces with blanks packageName.simplifyWhiteSpace(); // Replace all blanks with underscore - packageName.replace(QRegExp(" "), "_"); + packageName.replace(TQRegExp(" "), "_"); // Replace all dots (".") with double colon scope resolution operators // ("::") - packageName.replace(QRegExp("\\."),"::"); + packageName.replace(TQRegExp("\\."),"::"); // Store complete package name - QString ThisPkgName = packageName + "::" + classname; + TQString ThisPkgName = packageName + "::" + classname; fileName = findFileName(c, ".pm"); // the above lower-cases my nice class names. That is bad. @@ -117,14 +117,14 @@ void PerlWriter::writeClass(UMLClassifier *c) { // actual solution: shameful ".pm" hack in codegenerator CodeGenerationPolicy *pol = UMLApp::app()->getCommonPolicy(); - QString curDir = pol->getOutputDirectory().absPath(); + TQString curDir = pol->getOutputDirectory().absPath(); if (fileName.contains("::")) { // create new directories for each level - QString newDir; + TQString newDir; newDir = curDir; - QString fragment = fileName; - QDir* existing = new QDir (curDir); - QRegExp regEx("(.*)(::)"); + TQString fragment = fileName; + TQDir* existing = new TQDir (curDir); + TQRegExp regEx("(.*)(::)"); regEx.setMinimal(true); while (regEx.search(fragment) > -1) { newDir = regEx.cap(1); @@ -145,14 +145,14 @@ void PerlWriter::writeClass(UMLClassifier *c) { emit codeGenerated(c, false); return; } - QString oldDir = pol->getOutputDirectory().absPath(); + TQString oldDir = pol->getOutputDirectory().absPath(); pol->setOutputDirectory(curDir); - QFile fileperl; + TQFile fileperl; if(!openFile(fileperl, fileName)) { emit codeGenerated(c, false); return; } - QTextStream perl(&fileperl); + TQTextStream perl(&fileperl); pol->setOutputDirectory(oldDir); //====================================================================== @@ -160,20 +160,20 @@ void PerlWriter::writeClass(UMLClassifier *c) { //====================================================================== // try to find a heading file (license, comments, etc) - QString str; + TQString str; bool bPackageDeclared = false; bool bUseStmsWritten = false; str = getHeadingFile(".pm"); // what this mean? if(!str.isEmpty()) { - str.replace(QRegExp("%filename%"),fileName); - str.replace(QRegExp("%filepath%"),fileperl.name()); - str.replace(QRegExp("%year%"),QDate::currentDate().toString("yyyy")); - str.replace(QRegExp("%date%"),QDate::currentDate().toString()); - str.replace(QRegExp("%time%"),QTime::currentTime().toString()); - str.replace(QRegExp("%package-name%"),ThisPkgName); - if(str.find(QRegExp("%PACKAGE-DECLARE%"))){ - str.replace(QRegExp("%PACKAGE-DECLARE%"), + str.replace(TQRegExp("%filename%"),fileName); + str.replace(TQRegExp("%filepath%"),fileperl.name()); + str.replace(TQRegExp("%year%"),TQDate::currentDate().toString("yyyy")); + str.replace(TQRegExp("%date%"),TQDate::currentDate().toString()); + str.replace(TQRegExp("%time%"),TQTime::currentTime().toString()); + str.replace(TQRegExp("%package-name%"),ThisPkgName); + if(str.find(TQRegExp("%PACKAGE-DECLARE%"))){ + str.replace(TQRegExp("%PACKAGE-DECLARE%"), "package " + ThisPkgName + ';' + m_endl + m_endl + "#UML_MODELER_BEGIN_PERSONAL_VARS_" + classname @@ -184,10 +184,10 @@ void PerlWriter::writeClass(UMLClassifier *c) { bPackageDeclared = true; } - if(str.find(QRegExp("%USE-STATEMENTS%"))){ - QString UseStms; + if(str.find(TQRegExp("%USE-STATEMENTS%"))){ + TQString UseStms; if(GetUseStatements(c,UseStms,ThisPkgName)){ - str.replace(QRegExp("%USE-STATEMENTS%"), UseStms); + str.replace(TQRegExp("%USE-STATEMENTS%"), UseStms); bUseStmsWritten = true; } } @@ -208,7 +208,7 @@ void PerlWriter::writeClass(UMLClassifier *c) { } if(! bUseStmsWritten){ - QString UseStms; + TQString UseStms; if(GetUseStatements(c,UseStms,ThisPkgName)){ perl<<UseStms<<m_endl; } @@ -260,7 +260,7 @@ Uml::Programming_Language PerlWriter::getLanguage() { //////////////////////////////////////////////////////////////////////////////////// // Helper Methods -void PerlWriter::writeOperations(UMLClassifier *c, QTextStream &perl) { +void PerlWriter::writeOperations(UMLClassifier *c, TQTextStream &perl) { //Lists to store operations sorted by scope UMLOperationList oppub,opprot,oppriv; @@ -288,7 +288,7 @@ void PerlWriter::writeOperations(UMLClassifier *c, QTextStream &perl) { } } - QString classname(cleanName(c->getName())); + TQString classname(cleanName(c->getName())); //write operations to file if(forceSections() || !oppub.isEmpty()) { @@ -333,7 +333,7 @@ void PerlWriter::writeOperations(UMLClassifier *c, QTextStream &perl) { perl << m_endl << m_endl; } -void PerlWriter::writeOperations(const QString &/* classname */, UMLOperationList &opList, QTextStream &perl) { +void PerlWriter::writeOperations(const TQString &/* classname */, UMLOperationList &opList, TQTextStream &perl) { UMLOperation *op; UMLAttribute *at; @@ -395,7 +395,7 @@ void PerlWriter::writeOperations(const QString &/* classname */, UMLOperationLis } -void PerlWriter::writeAttributes(UMLClassifier *c, QTextStream &perl) { +void PerlWriter::writeAttributes(UMLClassifier *c, TQTextStream &perl) { UMLAttributeList atpub, atprot, atpriv, atdefval; atpub.setAutoDelete(false); atprot.setAutoDelete(false); @@ -439,7 +439,7 @@ void PerlWriter::writeAttributes(UMLClassifier *c, QTextStream &perl) { } -void PerlWriter::writeAttributes(UMLAttributeList &atList, QTextStream &perl) +void PerlWriter::writeAttributes(UMLAttributeList &atList, TQTextStream &perl) { perl << m_endl << "=head1 PUBLIC ATTRIBUTES" << m_endl << m_endl; perl << "=pod " << m_endl << m_endl ; @@ -455,17 +455,17 @@ void PerlWriter::writeAttributes(UMLAttributeList &atList, QTextStream &perl) return; } -QStringList PerlWriter::defaultDatatypes() { - QStringList l; +TQStringList PerlWriter::defaultDatatypes() { + TQStringList l; l.append("$"); l.append("@"); l.append("%"); return l; } -const QStringList PerlWriter::reservedKeywords() const { +const TQStringList PerlWriter::reservedKeywords() const { - static QStringList keywords; + static TQStringList keywords; if (keywords.isEmpty()) { keywords << "abs" diff --git a/umbrello/umbrello/codegenerators/perlwriter.h b/umbrello/umbrello/codegenerators/perlwriter.h index 9dac4e56..4d5fdabd 100644 --- a/umbrello/umbrello/codegenerators/perlwriter.h +++ b/umbrello/umbrello/codegenerators/perlwriter.h @@ -51,9 +51,9 @@ public: /** * get list of reserved keywords */ - virtual const QStringList reservedKeywords() const; + virtual const TQStringList reservedKeywords() const; - QStringList defaultDatatypes(); + TQStringList defaultDatatypes(); private: @@ -69,7 +69,7 @@ private: * @param c the concept we are generating code for * @param perl output stream for the Perl file */ - void writeOperations(UMLClassifier *c, QTextStream &perl); + void writeOperations(UMLClassifier *c, TQTextStream &perl); /** * write a list of class operations @@ -78,23 +78,23 @@ private: * @param opList the list of operations * @param perl output stream for the Perl file */ - void writeOperations(const QString &classname, UMLOperationList &opList, - QTextStream &perl); + void writeOperations(const TQString &classname, UMLOperationList &opList, + TQTextStream &perl); /** write all the attributes of a class * @param c the class we are generating code for * @param perl output stream for the Perl file */ - void writeAttributes(UMLClassifier *c, QTextStream &perl); + void writeAttributes(UMLClassifier *c, TQTextStream &perl); /** write a list of class attributes * @param atList the list of attributes * @param perl output stream for the Perl file */ - void writeAttributes(UMLAttributeList &atList, QTextStream &perl); + void writeAttributes(UMLAttributeList &atList, TQTextStream &perl); - bool GetUseStatements(UMLClassifier *c, QString &Ret, - QString &ThisPkgName); + bool GetUseStatements(UMLClassifier *c, TQString &Ret, + TQString &ThisPkgName); }; diff --git a/umbrello/umbrello/codegenerators/php5writer.cpp b/umbrello/umbrello/codegenerators/php5writer.cpp index 044d3afe..64a01b47 100644 --- a/umbrello/umbrello/codegenerators/php5writer.cpp +++ b/umbrello/umbrello/codegenerators/php5writer.cpp @@ -18,8 +18,8 @@ #include "php5writer.h" #include <kdebug.h> -#include <qregexp.h> -#include <qtextstream.h> +#include <tqregexp.h> +#include <tqtextstream.h> #include "../umldoc.h" #include "../classifier.h" @@ -3000,20 +3000,20 @@ void Php5Writer::writeClass(UMLClassifier *c) { return; } - QString classname = cleanName(c->getName()); + TQString classname = cleanName(c->getName()); //find an appropriate name for our file - QString fileName = findFileName(c, ".php"); + TQString fileName = findFileName(c, ".php"); if (fileName.isEmpty()) { emit codeGenerated(c, false); return; } - QFile filephp; + TQFile filephp; if(!openFile(filephp, fileName)) { emit codeGenerated(c, false); return; } - QTextStream php(&filephp); + TQTextStream php(&filephp); ////////////////////////////// //Start generating the code!! @@ -3021,11 +3021,11 @@ void Php5Writer::writeClass(UMLClassifier *c) { //try to find a heading file (license, coments, etc) - QString str; + TQString str; str = getHeadingFile(".php"); if(!str.isEmpty()) { - str.replace(QRegExp("%filename%"),fileName); - str.replace(QRegExp("%filepath%"),filephp.name()); + str.replace(TQRegExp("%filename%"),fileName); + str.replace(TQRegExp("%filepath%"),filephp.name()); php<<str<<m_endl; } @@ -3035,7 +3035,7 @@ void Php5Writer::writeClass(UMLClassifier *c) { findObjectsRelated(c,includes); UMLPackage *conc; for(conc = includes.first(); conc ;conc = includes.next()) { - QString headerName = findFileName(conc, ".php"); + TQString headerName = findFileName(conc, ".php"); if (!headerName.isEmpty()) { php << "require_once '" << headerName << "';" << m_endl; } @@ -3078,7 +3078,7 @@ void Php5Writer::writeClass(UMLClassifier *c) { int ri = rc; for (a = realizations.first(); a; a = realizations.next()) { UMLObject *o = a->getObject(Uml::B); - QString typeName = cleanName(o->getName()); + TQString typeName = cleanName(o->getName()); if(ri == rc) php << m_endl << m_indentation << m_indentation << m_indentation << "implements "; php << typeName << (--rc == 0 ? "" : ", "); @@ -3099,7 +3099,7 @@ void Php5Writer::writeClass(UMLClassifier *c) { kError() << "aggregation role A object is NULL" << endl; continue; } - QString typeName = cleanName(o->getName()); + TQString typeName = cleanName(o->getName()); if (a->getMulti(Uml::A).isEmpty()) { php << m_indentation << "var $m_" << ';' << m_endl; } else { @@ -3117,7 +3117,7 @@ void Php5Writer::writeClass(UMLClassifier *c) { kError() << "composition role A object is NULL" << endl; continue; } - QString typeName = cleanName(o->getName()); + TQString typeName = cleanName(o->getName()); if (a->getMulti(Uml::A).isEmpty()) { php << m_indentation << "var $m_" << ';' << m_endl; } else { @@ -3147,7 +3147,7 @@ void Php5Writer::writeClass(UMLClassifier *c) { //////////////////////////////////////////////////////////////////////////////////// // Helper Methods -void Php5Writer::writeOperations(UMLClassifier *c, QTextStream &php) { +void Php5Writer::writeOperations(UMLClassifier *c, TQTextStream &php) { //Lists to store operations sorted by scope UMLOperationList oppub,opprot,oppriv; @@ -3177,7 +3177,7 @@ void Php5Writer::writeOperations(UMLClassifier *c, QTextStream &php) { } } - QString classname(cleanName(c->getName())); + TQString classname(cleanName(c->getName())); //write operations to file if(forceSections() || !oppub.isEmpty()) { @@ -3222,8 +3222,8 @@ void Php5Writer::writeOperations(UMLClassifier *c, QTextStream &php) { } -void Php5Writer::writeOperations(const QString &/* classname */, UMLOperationList &opList, - QTextStream &php, bool isInterface /* = false */, +void Php5Writer::writeOperations(const TQString &/* classname */, UMLOperationList &opList, + TQTextStream &php, bool isInterface /* = false */, bool generateErrorStub /* = false */) { for (UMLOperation *op=opList.first(); op ; op=opList.next()) { UMLAttributeList atl = op->getParmList(); @@ -3287,8 +3287,8 @@ void Php5Writer::writeOperations(const QString &/* classname */, UMLOperationLis for (at = atl.first(); at; at = atl.next(), j++) { php << " $" << cleanName(at->getName()) << (!(at->getInitialValue().isEmpty()) ? - (QString(" = ")+at->getInitialValue()) : - QString("")) + (TQString(" = ")+at->getInitialValue()) : + TQString("")) << ((j < i-1)?", ":""); } php <<" )"; @@ -3306,7 +3306,7 @@ void Php5Writer::writeOperations(const QString &/* classname */, UMLOperationLis }//end for } -void Php5Writer::writeAttributes(UMLClassifier *c, QTextStream &php) { +void Php5Writer::writeAttributes(UMLClassifier *c, TQTextStream &php) { UMLAttributeList atpub, atprot, atpriv, atdefval; atpub.setAutoDelete(false); atprot.setAutoDelete(false); @@ -3351,7 +3351,7 @@ void Php5Writer::writeAttributes(UMLClassifier *c, QTextStream &php) { } -void Php5Writer::writeAttributes(UMLAttributeList &atList, QTextStream &php) { +void Php5Writer::writeAttributes(UMLAttributeList &atList, TQTextStream &php) { for (UMLAttribute *at = atList.first(); at ; at = atList.next()) { bool isStatic = at->getStatic(); if (forceDoc() || !at->getDoc().isEmpty()) { @@ -3402,9 +3402,9 @@ Uml::Programming_Language Php5Writer::getLanguage() { return Uml::pl_PHP5; } -const QStringList Php5Writer::reservedKeywords() const { +const TQStringList Php5Writer::reservedKeywords() const { - static QStringList keywords; + static TQStringList keywords; if (keywords.isEmpty()) { for (int i = 0; php5words[i]; i++) diff --git a/umbrello/umbrello/codegenerators/php5writer.h b/umbrello/umbrello/codegenerators/php5writer.h index 3adc983c..ea2a7862 100644 --- a/umbrello/umbrello/codegenerators/php5writer.h +++ b/umbrello/umbrello/codegenerators/php5writer.h @@ -49,7 +49,7 @@ public: /** * get list of reserved keywords */ - virtual const QStringList reservedKeywords() const; + virtual const TQStringList reservedKeywords() const; private: @@ -64,7 +64,7 @@ private: * @param c the concept we are generating code for * @param php output stream for the PHP file */ - void writeOperations(UMLClassifier *c, QTextStream &php); + void writeOperations(UMLClassifier *c, TQTextStream &php); /** * write a list of class operations @@ -74,21 +74,21 @@ private: * @param php output stream for the PHP file * @param interface indicates if the operation is an interface member */ - void writeOperations(const QString &classname, UMLOperationList &opList, - QTextStream &php, + void writeOperations(const TQString &classname, UMLOperationList &opList, + TQTextStream &php, bool interface = false, bool generateErrorStub = false); /** write all the attributes of a class * @param c the class we are generating code for * @param php output stream for the PHP file */ - void writeAttributes(UMLClassifier *c, QTextStream &php); + void writeAttributes(UMLClassifier *c, TQTextStream &php); /** write a list of class attributes * @param atList the list of attributes * @param php output stream for the PHP file */ - void writeAttributes(UMLAttributeList &atList, QTextStream &php); + void writeAttributes(UMLAttributeList &atList, TQTextStream &php); }; #endif //PHP5WRITER diff --git a/umbrello/umbrello/codegenerators/phpwriter.cpp b/umbrello/umbrello/codegenerators/phpwriter.cpp index 6d71c102..e9dba103 100644 --- a/umbrello/umbrello/codegenerators/phpwriter.cpp +++ b/umbrello/umbrello/codegenerators/phpwriter.cpp @@ -17,8 +17,8 @@ #include "phpwriter.h" #include <kdebug.h> -#include <qregexp.h> -#include <qtextstream.h> +#include <tqregexp.h> +#include <tqtextstream.h> #include "../umldoc.h" #include "../classifier.h" @@ -2996,20 +2996,20 @@ void PhpWriter::writeClass(UMLClassifier *c) { return; } - QString classname = cleanName(c->getName()); + TQString classname = cleanName(c->getName()); //find an appropriate name for our file - QString fileName = findFileName(c, ".php"); + TQString fileName = findFileName(c, ".php"); if (fileName.isEmpty()) { emit codeGenerated(c, false); return; } - QFile filephp; + TQFile filephp; if(!openFile(filephp, fileName)) { emit codeGenerated(c, false); return; } - QTextStream php(&filephp); + TQTextStream php(&filephp); ////////////////////////////// //Start generating the code!! @@ -3017,11 +3017,11 @@ void PhpWriter::writeClass(UMLClassifier *c) { //try to find a heading file (license, coments, etc) - QString str; + TQString str; str = getHeadingFile(".php"); if(!str.isEmpty()) { - str.replace(QRegExp("%filename%"),fileName); - str.replace(QRegExp("%filepath%"),filephp.name()); + str.replace(TQRegExp("%filename%"),fileName); + str.replace(TQRegExp("%filepath%"),filephp.name()); php<<str<<m_endl; } @@ -3031,7 +3031,7 @@ void PhpWriter::writeClass(UMLClassifier *c) { findObjectsRelated(c,includes); UMLPackage *conc; for(conc = includes.first(); conc ;conc = includes.next()) { - QString headerName = findFileName(conc, ".php"); + TQString headerName = findFileName(conc, ".php"); if (headerName.isEmpty()) { php << "include '" << headerName << "';" << m_endl; } @@ -3075,7 +3075,7 @@ void PhpWriter::writeClass(UMLClassifier *c) { //maybe we should parse the string here and take multiplicity into account to decide //which container to use. UMLObject *o = a->getObject(Uml::A); - QString typeName = cleanName(o->getName()); + TQString typeName = cleanName(o->getName()); if (a->getMulti(Uml::A).isEmpty()) { php << m_indentation << "var $m_" << ";" << m_endl; } else { @@ -3089,7 +3089,7 @@ void PhpWriter::writeClass(UMLClassifier *c) { for (a = compositions.first(); a ; a = compositions.next()) { // see comment on Aggregation about multiplicity... UMLObject *o = a->getObject(Uml::A); - QString typeName = cleanName(o->getName()); + TQString typeName = cleanName(o->getName()); if (a->getMulti(Uml::A).isEmpty()) { php << m_indentation << "var $m_" << ";" << m_endl; } else { @@ -3112,7 +3112,7 @@ void PhpWriter::writeClass(UMLClassifier *c) { php << m_endl; php << m_indentation << "/**" << m_endl; - QString temp = "initAttributes sets all " + classname + " attributes to its default value." + TQString temp = "initAttributes sets all " + classname + " attributes to its default value." " Make sure to call this method within your class constructor"; php << formatDoc(temp,m_indentation + " * "); php << m_indentation << " */" << m_endl; @@ -3141,7 +3141,7 @@ void PhpWriter::writeClass(UMLClassifier *c) { //////////////////////////////////////////////////////////////////////////////////// // Helper Methods -void PhpWriter::writeOperations(UMLClassifier *c, QTextStream &php) { +void PhpWriter::writeOperations(UMLClassifier *c, TQTextStream &php) { //Lists to store operations sorted by scope UMLOperationList oppub,opprot,oppriv; @@ -3168,7 +3168,7 @@ void PhpWriter::writeOperations(UMLClassifier *c, QTextStream &php) { } } - QString classname(cleanName(c->getName())); + TQString classname(cleanName(c->getName())); //write operations to file if(forceSections() || !oppub.isEmpty()) { @@ -3187,7 +3187,7 @@ void PhpWriter::writeOperations(UMLClassifier *c, QTextStream &php) { } } -void PhpWriter::writeOperations(QString /* classname */, UMLOperationList &opList, QTextStream &php) { +void PhpWriter::writeOperations(TQString /* classname */, UMLOperationList &opList, TQTextStream &php) { UMLOperation *op; UMLAttribute *at; @@ -3236,8 +3236,8 @@ void PhpWriter::writeOperations(QString /* classname */, UMLOperationList &opLis for (at = atl.first(); at; at = atl.next(), j++) { php << " $" << cleanName(at->getName()) << (!(at->getInitialValue().isEmpty()) ? - (QString(" = ")+at->getInitialValue()) : - QString("")) + (TQString(" = ")+at->getInitialValue()) : + TQString("")) << ((j < i-1)?", ":""); } php <<" )" << m_endl << m_indentation << "{" << m_endl << m_indentation << m_indentation << m_endl << m_indentation << "} // end of member function " + cleanName(op->getName()) + m_endl; @@ -3245,7 +3245,7 @@ void PhpWriter::writeOperations(QString /* classname */, UMLOperationList &opLis }//end for } -void PhpWriter::writeAttributes(UMLClassifier *c, QTextStream &php) { +void PhpWriter::writeAttributes(UMLClassifier *c, TQTextStream &php) { UMLAttributeList atpub, atprot, atpriv, atdefval; atpub.setAutoDelete(false); atprot.setAutoDelete(false); @@ -3290,7 +3290,7 @@ void PhpWriter::writeAttributes(UMLClassifier *c, QTextStream &php) { } -void PhpWriter::writeAttributes(UMLAttributeList &atList, QTextStream &php) { +void PhpWriter::writeAttributes(UMLAttributeList &atList, TQTextStream &php) { for (UMLAttribute *at = atList.first(); at ; at = atList.next()) { if (forceDoc() || !at->getDoc().isEmpty()) { php << m_indentation << "/**" << m_endl << formatDoc(at->getDoc(), m_indentation + " * "); @@ -3323,9 +3323,9 @@ Uml::Programming_Language PhpWriter::getLanguage() { return Uml::pl_PHP; } -const QStringList PhpWriter::reservedKeywords() const { +const TQStringList PhpWriter::reservedKeywords() const { - static QStringList keywords; + static TQStringList keywords; if (keywords.isEmpty()) { for (int i = 0; words[i]; i++) diff --git a/umbrello/umbrello/codegenerators/phpwriter.h b/umbrello/umbrello/codegenerators/phpwriter.h index a3acb68b..e03699f1 100644 --- a/umbrello/umbrello/codegenerators/phpwriter.h +++ b/umbrello/umbrello/codegenerators/phpwriter.h @@ -47,7 +47,7 @@ public: /** * get list of reserved keywords */ - virtual const QStringList reservedKeywords() const; + virtual const TQStringList reservedKeywords() const; private: @@ -62,7 +62,7 @@ private: * @param c the concept we are generating code for * @param php output stream for the PHP file */ - void writeOperations(UMLClassifier *c, QTextStream &php); + void writeOperations(UMLClassifier *c, TQTextStream &php); /** * write a list of class operations @@ -71,20 +71,20 @@ private: * @param opList the list of operations * @param php output stream for the PHP file */ - void writeOperations(QString classname, UMLOperationList &opList, - QTextStream &php); + void writeOperations(TQString classname, UMLOperationList &opList, + TQTextStream &php); /** write all the attributes of a class * @param c the class we are generating code for * @param php output stream for the PHP file */ - void writeAttributes(UMLClassifier *c, QTextStream &php); + void writeAttributes(UMLClassifier *c, TQTextStream &php); /** write a list of class attributes * @param atList the list of attributes * @param php output stream for the PHP file */ - void writeAttributes(UMLAttributeList &atList, QTextStream &php); + void writeAttributes(UMLAttributeList &atList, TQTextStream &php); }; #endif //PHPWRITER diff --git a/umbrello/umbrello/codegenerators/pythonwriter.cpp b/umbrello/umbrello/codegenerators/pythonwriter.cpp index a5ac2b28..f243ab2c 100644 --- a/umbrello/umbrello/codegenerators/pythonwriter.cpp +++ b/umbrello/umbrello/codegenerators/pythonwriter.cpp @@ -21,9 +21,9 @@ #include <kdebug.h> #include <klocale.h> #include <kmessagebox.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqregexp.h> #include "../umldoc.h" #include "../umlattributelist.h" @@ -45,7 +45,7 @@ void PythonWriter::writeClass(UMLClassifier *c) { return; } - QString classname = cleanName(c->getName()); + TQString classname = cleanName(c->getName()); UMLClassifierList superclasses = c->getSuperClasses(); UMLAssociationList aggregations = c->getAggregations(); @@ -54,24 +54,24 @@ void PythonWriter::writeClass(UMLClassifier *c) { m_bNeedPass = true; //find an appropriate name for our file - QString fileName = findFileName(c, ".py"); + TQString fileName = findFileName(c, ".py"); if (fileName.isEmpty()) { emit codeGenerated(c, false); return; } - QChar first = fileName.at(0); + TQChar first = fileName.at(0); //Replace the first letter of the filename because //python class begin with an upper caracter (convention) first = first.upper(); fileName = fileName.replace(0, 1, first); - QFile fileh; + TQFile fileh; if( !openFile(fileh, fileName) ) { emit codeGenerated(c, false); return; } - QTextStream h(&fileh); + TQTextStream h(&fileh); ////////////////////////////// //Start generating the code!! @@ -79,21 +79,21 @@ void PythonWriter::writeClass(UMLClassifier *c) { //try to find a heading file (license, coments, etc) - QString str; + TQString str; str = getHeadingFile(".py"); if(!str.isEmpty()) { - str.replace(QRegExp("%filename%"), fileName); - str.replace(QRegExp("%filepath%"), fileh.name()); + str.replace(TQRegExp("%filename%"), fileName); + str.replace(TQRegExp("%filepath%"), fileh.name()); h<<str<<m_endl; } // generate import statement for superclasses and take packages into account str = cleanName(c->getName()); - QString pkg = cleanName(c->getPackage()); + TQString pkg = cleanName(c->getPackage()); if (!pkg.isEmpty()) str.prepend(pkg + '.'); - QStringList includesList = QStringList(str); //save imported classes + TQStringList includesList = TQStringList(str); //save imported classes int i = superclasses.count(); for (UMLClassifier *classifier = superclasses.first(); classifier && i; classifier = superclasses.next(), i--) { @@ -110,13 +110,13 @@ void PythonWriter::writeClass(UMLClassifier *c) { findObjectsRelated(c,includes); UMLPackage* conc; for(conc = includes.first(); conc ;conc = includes.next()) { - QString headerName = findFileName(conc, ".py"); + TQString headerName = findFileName(conc, ".py"); if ( !headerName.isEmpty() ) { - headerName.remove(QRegExp(".py$")); + headerName.remove(TQRegExp(".py$")); first = headerName.at(0); first = first.upper(); headerName = headerName.replace(0, 1, first); - str = headerName.replace(QChar('/'),QChar('.')); + str = headerName.replace(TQChar('/'),TQChar('.')); if (includesList.findIndex(str) < 0) // not yet imported h << "from " << str << " import *" << m_endl; } @@ -165,7 +165,7 @@ void PythonWriter::writeClass(UMLClassifier *c) { //////////////////////////////////////////////////////////////////////////////////// // Helper Methods -void PythonWriter::writeAttributes(UMLAttributeList atList, QTextStream &py) { +void PythonWriter::writeAttributes(UMLAttributeList atList, TQTextStream &py) { if (!forceDoc() || atList.count() == 0) return; py << m_indentation << "\"\"\" ATTRIBUTES" << m_endl << m_endl; @@ -178,7 +178,7 @@ void PythonWriter::writeAttributes(UMLAttributeList atList, QTextStream &py) { py << m_indentation << "\"\"\"" << m_endl << m_endl; } -void PythonWriter::writeOperations(UMLClassifier *c, QTextStream &h) { +void PythonWriter::writeOperations(UMLClassifier *c, TQTextStream &h) { //Lists to store operations sorted by scope UMLOperationList oppub,opprot,oppriv; @@ -205,7 +205,7 @@ void PythonWriter::writeOperations(UMLClassifier *c, QTextStream &h) { } } - QString classname(cleanName(c->getName())); + TQString classname(cleanName(c->getName())); //write operations to file if(forceSections() || !oppub.isEmpty()) { @@ -222,23 +222,23 @@ void PythonWriter::writeOperations(UMLClassifier *c, QTextStream &h) { } -void PythonWriter::writeOperations(const QString& /*classname*/, UMLOperationList &opList, - QTextStream &h, Access access) { +void PythonWriter::writeOperations(const TQString& /*classname*/, UMLOperationList &opList, + TQTextStream &h, Access access) { UMLOperation *op; UMLAttribute *at; - QString sAccess; + TQString sAccess; switch (access) { case PUBLIC: - sAccess = QString(""); + sAccess = TQString(""); break; case PRIVATE: - sAccess = QString("__"); + sAccess = TQString("__"); break; case PROTECTED: - sAccess = QString("_"); + sAccess = TQString("_"); break; } @@ -256,8 +256,8 @@ void PythonWriter::writeOperations(const QString& /*classname*/, UMLOperationLis for (at = atl.first(); at; at = atl.next(), j++) { h << ", " << cleanName(at->getName()) << (!(at->getInitialValue().isEmpty()) ? - (QString(" = ")+at->getInitialValue()) : - QString("")); + (TQString(" = ")+at->getInitialValue()) : + TQString("")); } h<<"):"<<m_endl; @@ -291,9 +291,9 @@ Uml::Programming_Language PythonWriter::getLanguage() { return Uml::pl_Python; } -const QStringList PythonWriter::reservedKeywords() const { +const TQStringList PythonWriter::reservedKeywords() const { - static QStringList keywords; + static TQStringList keywords; if (keywords.isEmpty()) { keywords << "abs" diff --git a/umbrello/umbrello/codegenerators/pythonwriter.h b/umbrello/umbrello/codegenerators/pythonwriter.h index f9e5b31a..c9dddc23 100644 --- a/umbrello/umbrello/codegenerators/pythonwriter.h +++ b/umbrello/umbrello/codegenerators/pythonwriter.h @@ -50,7 +50,7 @@ public: /** * get list of reserved keywords */ - virtual const QStringList reservedKeywords() const; + virtual const TQStringList reservedKeywords() const; private: @@ -60,7 +60,7 @@ private: * @param c the concept we are generating code for * @param py output stream for the header file */ - void writeAttributes(UMLAttributeList atList, QTextStream &py); + void writeAttributes(UMLAttributeList atList, TQTextStream &py); /** * write all operations for a given class @@ -68,7 +68,7 @@ private: * @param c the concept we are generating code for * @param h output stream for the header file */ - void writeOperations(UMLClassifier *c, QTextStream &h); + void writeOperations(UMLClassifier *c, TQTextStream &h); /** * write a list of class operations @@ -77,8 +77,8 @@ private: * @param opList the list of operations * @param h output stream for the header file */ - void writeOperations(const QString& classname, UMLOperationList &opList, - QTextStream &h, Access access); + void writeOperations(const TQString& classname, UMLOperationList &opList, + TQTextStream &h, Access access); bool m_bNeedPass; ///< True as long as no "pass" has been written }; diff --git a/umbrello/umbrello/codegenerators/rubyclassdeclarationblock.cpp b/umbrello/umbrello/codegenerators/rubyclassdeclarationblock.cpp index cae5d322..f75ff165 100644 --- a/umbrello/umbrello/codegenerators/rubyclassdeclarationblock.cpp +++ b/umbrello/umbrello/codegenerators/rubyclassdeclarationblock.cpp @@ -26,7 +26,7 @@ // RubyClassDeclarationBlock::RubyClassDeclarationBlock - ( RubyClassifierCodeDocument * parentDoc, const QString &startText, const QString &endText, const QString &comment) + ( RubyClassifierCodeDocument * parentDoc, const TQString &startText, const TQString &endText, const TQString &comment) : OwnedHierarchicalCodeBlock(parentDoc->getParentClassifier(), parentDoc, startText, endText, comment) { init(parentDoc, comment); @@ -41,8 +41,8 @@ RubyClassDeclarationBlock::~RubyClassDeclarationBlock ( ) { } /** * Save the XMI representation of this object */ -void RubyClassDeclarationBlock::saveToXMI ( QDomDocument & doc, QDomElement & root ) { - QDomElement blockElement = doc.createElement( "rubyclassdeclarationblock" ); +void RubyClassDeclarationBlock::saveToXMI ( TQDomDocument & doc, TQDomElement & root ) { + TQDomElement blockElement = doc.createElement( "rubyclassdeclarationblock" ); setAttributesOnNode(doc, blockElement); @@ -52,7 +52,7 @@ void RubyClassDeclarationBlock::saveToXMI ( QDomDocument & doc, QDomElement & ro /** * load params from the appropriate XMI element node. */ -void RubyClassDeclarationBlock::loadFromXMI ( QDomElement & root ) +void RubyClassDeclarationBlock::loadFromXMI ( TQDomElement & root ) { setAttributesFromNode(root); } @@ -72,13 +72,13 @@ void RubyClassDeclarationBlock::updateContent ( ) RubyClassifierCodeDocument *parentDoc = dynamic_cast<RubyClassifierCodeDocument*>(getParentDocument()); UMLClassifier *c = parentDoc->getParentClassifier(); CodeGenerationPolicy * p = UMLApp::app()->getCommonPolicy(); - QString endLine = p->getNewLineEndingChars(); + TQString endLine = p->getNewLineEndingChars(); bool isInterface = parentDoc->parentIsInterface(); // a little shortcut - QString RubyClassName = parentDoc->getRubyClassName(c->getName()); + TQString RubyClassName = parentDoc->getRubyClassName(c->getName()); bool forceDoc = p->getCodeVerboseDocumentComments(); // COMMENT - QString comment = c->getDoc(); + TQString comment = c->getDoc(); comment.replace("@ref ", ""); comment.replace("@see", "_See_"); comment.replace("@short", "_Summary_"); @@ -96,7 +96,7 @@ void RubyClassDeclarationBlock::updateContent ( ) // Now set START/ENDING Text - QString startText = ""; + TQString startText = ""; if (parentDoc->parentIsInterface()) { startText.append("module "); @@ -113,7 +113,7 @@ void RubyClassDeclarationBlock::updateContent ( ) int i = 0; for (UMLClassifier * concept= superclasses.first(); concept; concept = superclasses.next()) { if (i == 0) { - startText.append(QString(" < ") + RubyCodeGenerator::cppToRubyType(concept->getName()) + endLine); + startText.append(TQString(" < ") + RubyCodeGenerator::cppToRubyType(concept->getName()) + endLine); } else { // After the first superclass name in the list, assume the classes // are ruby modules that can be mixed in, @@ -124,14 +124,14 @@ void RubyClassDeclarationBlock::updateContent ( ) // Write out the interfaces we 'implement'. Are these modules to be mixed in, in Ruby? for (UMLClassifier * concept= superinterfaces.first(); concept; concept = superinterfaces.next()) { - startText.append(QString("include ") + RubyCodeGenerator::cppToRubyType(concept->getName()) + endLine); + startText.append(TQString("include ") + RubyCodeGenerator::cppToRubyType(concept->getName()) + endLine); } // Set the header and end text for the hier.codeblock setStartText(startText); } -void RubyClassDeclarationBlock::init (RubyClassifierCodeDocument *parentDoc, const QString &comment) +void RubyClassDeclarationBlock::init (RubyClassifierCodeDocument *parentDoc, const TQString &comment) { setComment(new RubyCodeDocumentation(parentDoc)); diff --git a/umbrello/umbrello/codegenerators/rubyclassdeclarationblock.h b/umbrello/umbrello/codegenerators/rubyclassdeclarationblock.h index a7732662..63e43702 100644 --- a/umbrello/umbrello/codegenerators/rubyclassdeclarationblock.h +++ b/umbrello/umbrello/codegenerators/rubyclassdeclarationblock.h @@ -17,7 +17,7 @@ #ifndef RUBYCLASSDECLARATIONBLOCK_H #define RUBYCLASSDECLARATIONBLOCK_H -#include <qstring.h> +#include <tqstring.h> /*************************************************************************** rubyclassdeclarationblock.h @@ -41,7 +41,7 @@ public: /** * Empty Constructor */ - explicit RubyClassDeclarationBlock ( RubyClassifierCodeDocument * parentDoc, const QString &start = "", const QString &endText = "end", const QString &comment = ""); + explicit RubyClassDeclarationBlock ( RubyClassifierCodeDocument * parentDoc, const TQString &start = "", const TQString &endText = "end", const TQString &comment = ""); /** * Empty Destructor @@ -51,12 +51,12 @@ public: /** * Save the XMI representation of this object */ - virtual void saveToXMI ( QDomDocument & doc, QDomElement & root ); + virtual void saveToXMI ( TQDomDocument & doc, TQDomElement & root ); /** * load params from the appropriate XMI element node. */ - virtual void loadFromXMI ( QDomElement & root ); + virtual void loadFromXMI ( TQDomElement & root ); protected: @@ -67,7 +67,7 @@ protected: private: - void init (RubyClassifierCodeDocument * parent, const QString &comment); + void init (RubyClassifierCodeDocument * parent, const TQString &comment); }; diff --git a/umbrello/umbrello/codegenerators/rubyclassifiercodedocument.cpp b/umbrello/umbrello/codegenerators/rubyclassifiercodedocument.cpp index 1c136df8..ada4b0bb 100644 --- a/umbrello/umbrello/codegenerators/rubyclassifiercodedocument.cpp +++ b/umbrello/umbrello/codegenerators/rubyclassifiercodedocument.cpp @@ -29,7 +29,7 @@ #include "rubyclassifiercodedocument.h" // qt/kde includes -#include <qregexp.h> +#include <tqregexp.h> #include <kdebug.h> // local includes @@ -77,19 +77,19 @@ CodeDocumentDialog RubyClassifierCodeDocument::getDialog ( ) { */ // We overwritten by Ruby language implementation to get lowercase path -QString RubyClassifierCodeDocument::getPath ( ) +TQString RubyClassifierCodeDocument::getPath ( ) { - QString path = getPackage(); + TQString path = getPackage(); // Replace all white spaces with blanks path.simplifyWhiteSpace(); // Replace all blanks with underscore - path.replace(QRegExp(" "), "_"); + path.replace(TQRegExp(" "), "_"); - path.replace(QRegExp("\\."),"/"); - path.replace(QRegExp("::"), "/"); + path.replace(TQRegExp("\\."),"/"); + path.replace(TQRegExp("::"), "/"); path.lower(); @@ -101,7 +101,7 @@ QString RubyClassifierCodeDocument::getPath ( ) // Other methods // -QString RubyClassifierCodeDocument::getRubyClassName (const QString &name) { +TQString RubyClassifierCodeDocument::getRubyClassName (const TQString &name) { CodeGenerator *g = UMLApp::app()->getGenerator(); return Codegen_Utils::capitalizeFirstLetter(g->cleanName(name)); } @@ -173,25 +173,25 @@ bool RubyClassifierCodeDocument::addCodeOperation (CodeOperation * op ) // would be better if we could create a handler interface that each // codeblock used so all we have to do here is add the handler // for "rubyclassdeclarationblock" -void RubyClassifierCodeDocument::loadChildTextBlocksFromNode ( QDomElement & root) +void RubyClassifierCodeDocument::loadChildTextBlocksFromNode ( TQDomElement & root) { - QDomNode tnode = root.firstChild(); - QDomElement telement = tnode.toElement(); + TQDomNode tnode = root.firstChild(); + TQDomElement telement = tnode.toElement(); bool loadCheckForChildrenOK = false; while( !telement.isNull() ) { - QString nodeName = telement.tagName(); + TQString nodeName = telement.tagName(); if( nodeName == "textblocks" ) { - QDomNode node = telement.firstChild(); - QDomElement element = node.toElement(); + TQDomNode node = telement.firstChild(); + TQDomElement element = node.toElement(); // if there is nothing to begin with, then we don't worry about it loadCheckForChildrenOK = element.isNull() ? true : false; while( !element.isNull() ) { - QString name = element.tagName(); + TQString name = element.tagName(); if( name == "codecomment" ) { CodeComment * block = new RubyCodeComment(this); @@ -206,7 +206,7 @@ void RubyClassifierCodeDocument::loadChildTextBlocksFromNode ( QDomElement & roo if( name == "codeaccessormethod" || name == "ccfdeclarationcodeblock" ) { - QString acctag = element.attribute("tag",""); + TQString acctag = element.attribute("tag",""); // search for our method in the TextBlock * tb = findCodeClassFieldTextBlockByTag(acctag); if(!tb || !addTextBlock(tb)) @@ -252,7 +252,7 @@ void RubyClassifierCodeDocument::loadChildTextBlocksFromNode ( QDomElement & roo } else if( name == "codeoperation" ) { // find the code operation by id - QString id = element.attribute("parent_id","-1"); + TQString id = element.attribute("parent_id","-1"); UMLObject * obj = UMLApp::app()->getDocument()->findObjectById(STR2ID(id)); UMLOperation * op = dynamic_cast<UMLOperation*>(obj); if(op) { @@ -313,9 +313,9 @@ void RubyClassifierCodeDocument::loadChildTextBlocksFromNode ( QDomElement & roo } -QString RubyClassifierCodeDocument::scopeToRubyDecl(Uml::Visibility scope) +TQString RubyClassifierCodeDocument::scopeToRubyDecl(Uml::Visibility scope) { - QString scopeString; + TQString scopeString; switch(scope) { case Uml::Visibility::Public: @@ -402,7 +402,7 @@ void RubyClassifierCodeDocument::updateContent( ) bool isInterface = parentIsInterface(); bool hasOperationMethods = c->getOpList().last() ? true : false; CodeGenerationPolicy *pol = UMLApp::app()->getCommonPolicy(); - QString endLine = pol->getNewLineEndingChars(); // a shortcut..so we don't have to call this all the time + TQString endLine = pol->getNewLineEndingChars(); // a shortcut..so we don't have to call this all the time // // START GENERATING CODE/TEXT BLOCKS and COMMENTS FOR THE DOCUMENT diff --git a/umbrello/umbrello/codegenerators/rubyclassifiercodedocument.h b/umbrello/umbrello/codegenerators/rubyclassifiercodedocument.h index c5f89d07..cfaa66fe 100644 --- a/umbrello/umbrello/codegenerators/rubyclassifiercodedocument.h +++ b/umbrello/umbrello/codegenerators/rubyclassifiercodedocument.h @@ -21,7 +21,7 @@ #ifndef RUBYCLASSIFIERCODEDOCUMENT_H #define RUBYCLASSIFIERCODEDOCUMENT_H -#include <qstring.h> +#include <tqstring.h> #include "../codeclassfieldlist.h" #include "../classifiercodedocument.h" @@ -64,14 +64,14 @@ public: */ //CodeDocumentDialog getDialog ( ); - QString scopeToRubyDecl(Uml::Visibility scope); + TQString scopeToRubyDecl(Uml::Visibility scope); // Make it easier on ourselves RubyCodeGenerationPolicy * getRubyPolicy(); - QString getRubyClassName (const QString &name); + TQString getRubyClassName (const TQString &name); - QString getPath(); + TQString getPath(); /** add a code operation to this ruby classifier code document. * @return bool which is true IF the code operation was added successfully @@ -87,7 +87,7 @@ protected: * need to overwrite this for ruby since we need to pick up the * ruby class declaration block. */ - virtual void loadChildTextBlocksFromNode ( QDomElement & root); + virtual void loadChildTextBlocksFromNode ( TQDomElement & root); void addOrUpdateCodeClassFieldMethodsInCodeBlock(CodeClassFieldList &list, RubyClassDeclarationBlock * codeBlock); diff --git a/umbrello/umbrello/codegenerators/rubycodeaccessormethod.cpp b/umbrello/umbrello/codegenerators/rubycodeaccessormethod.cpp index a3f55c44..43986061 100644 --- a/umbrello/umbrello/codegenerators/rubycodeaccessormethod.cpp +++ b/umbrello/umbrello/codegenerators/rubycodeaccessormethod.cpp @@ -21,7 +21,7 @@ #include "rubycodeaccessormethod.h" // qt/kde includes -#include <qregexp.h> +#include <tqregexp.h> #include <kdebug.h> // local includes @@ -56,7 +56,7 @@ RubyCodeAccessorMethod::~RubyCodeAccessorMethod ( ) { } // Other methods // -void RubyCodeAccessorMethod::setAttributesOnNode ( QDomDocument & doc, QDomElement & blockElement) +void RubyCodeAccessorMethod::setAttributesOnNode ( TQDomDocument & doc, TQDomElement & blockElement) { // set super-class attributes @@ -65,7 +65,7 @@ void RubyCodeAccessorMethod::setAttributesOnNode ( QDomDocument & doc, QDomEleme // set local attributes now } -void RubyCodeAccessorMethod::setAttributesFromNode( QDomElement & root) +void RubyCodeAccessorMethod::setAttributesFromNode( TQDomElement & root) { // set attributes from superclass method the XMI @@ -80,18 +80,18 @@ void RubyCodeAccessorMethod::updateContent( ) CodeClassField * parentField = getParentClassField(); RubyCodeClassField * rubyfield = dynamic_cast<RubyCodeClassField*>(parentField); - QString fieldName = rubyfield->getFieldName(); - QString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); + TQString fieldName = rubyfield->getFieldName(); + TQString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); - QString text = ""; + TQString text = ""; switch(getType()) { case CodeAccessorMethod::ADD: { int maxOccurs = rubyfield->maximumListOccurances(); - QString fieldType = rubyfield->getTypeName(); - QString indent = getIndentation(); + TQString fieldType = rubyfield->getTypeName(); + TQString indent = getIndentation(); if(maxOccurs > 0) - text += "if "+fieldName+".size() < "+ QString::number(maxOccurs)+' '+endLine+indent; + text += "if "+fieldName+".size() < "+ TQString::number(maxOccurs)+' '+endLine+indent; text += fieldName+".push(value)"; if(maxOccurs > 0) { @@ -110,11 +110,11 @@ void RubyCodeAccessorMethod::updateContent( ) { int minOccurs = rubyfield->minimumListOccurances(); RubyClassifierCodeDocument * rubydoc = dynamic_cast<RubyClassifierCodeDocument*>(rubyfield->getParentDocument()); - QString fieldType = rubyfield->getTypeName(); - QString indent = getIndentation(); + TQString fieldType = rubyfield->getTypeName(); + TQString indent = getIndentation(); if(minOccurs > 0) - text += "if "+fieldName+".size() >= "+ QString::number(minOccurs)+endLine+indent; + text += "if "+fieldName+".size() >= "+ TQString::number(minOccurs)+endLine+indent; text += fieldName+".delete(value)"; if(minOccurs > 0) { @@ -144,18 +144,18 @@ void RubyCodeAccessorMethod::updateMethodDeclaration() // gather defs CodeGenerationPolicy *p = UMLApp::app()->getCommonPolicy(); CodeGenerationPolicy::ScopePolicy scopePolicy = p->getAttributeAccessorScope(); - QString strVis = rubydoc->scopeToRubyDecl(rubyfield->getVisibility()); - QString fieldName = RubyCodeGenerator::cppToRubyName(rubyfield->getFieldName()); - QString fieldType = RubyCodeGenerator::cppToRubyType(rubyfield->getTypeName()); - QString objectType = rubyfield->getListObjectType(); + TQString strVis = rubydoc->scopeToRubyDecl(rubyfield->getVisibility()); + TQString fieldName = RubyCodeGenerator::cppToRubyName(rubyfield->getFieldName()); + TQString fieldType = RubyCodeGenerator::cppToRubyType(rubyfield->getTypeName()); + TQString objectType = rubyfield->getListObjectType(); if(objectType.isEmpty()) objectType = fieldName; - QString endLine = p->getNewLineEndingChars(); + TQString endLine = p->getNewLineEndingChars(); - QString description = getParentObject()->getDoc(); - description.replace(QRegExp("m_[npb](?=[A-Z])"), ""); + TQString description = getParentObject()->getDoc(); + description.replace(TQRegExp("m_[npb](?=[A-Z])"), ""); description.replace("m_", ""); - description.replace(QRegExp("[\\n\\r]+[\\t ]*"), endLine); + description.replace(TQRegExp("[\\n\\r]+[\\t ]*"), endLine); // set scope of this accessor appropriately..if its an attribute, // we need to be more sophisticated @@ -173,10 +173,10 @@ void RubyCodeAccessorMethod::updateMethodDeclaration() } // some variables we will need to populate - QString headerText = ""; - QString methodReturnType = ""; - QString methodName = ""; - QString methodParams = ""; + TQString headerText = ""; + TQString methodReturnType = ""; + TQString methodName = ""; + TQString methodParams = ""; switch(getType()) { case CodeAccessorMethod::ADD: @@ -189,7 +189,7 @@ void RubyCodeAccessorMethod::updateMethodDeclaration() break; case CodeAccessorMethod::GET: headerText = "Get the value of " + fieldName + endLine + description; - setStartMethodText(QString("attr_reader :") + fieldName); + setStartMethodText(TQString("attr_reader :") + fieldName); setEndMethodText(""); break; case CodeAccessorMethod::LIST: @@ -209,7 +209,7 @@ void RubyCodeAccessorMethod::updateMethodDeclaration() break; case CodeAccessorMethod::SET: headerText = "Set the value of " + fieldName + endLine + description; - setStartMethodText(QString("attr_writer :") + fieldName); + setStartMethodText(TQString("attr_writer :") + fieldName); setEndMethodText(""); break; default: diff --git a/umbrello/umbrello/codegenerators/rubycodeaccessormethod.h b/umbrello/umbrello/codegenerators/rubycodeaccessormethod.h index 7eb9c892..0e61a978 100644 --- a/umbrello/umbrello/codegenerators/rubycodeaccessormethod.h +++ b/umbrello/umbrello/codegenerators/rubycodeaccessormethod.h @@ -23,7 +23,7 @@ #ifndef RUBYCODEACCESSORMETHOD_H #define RUBYCODEACCESSORMETHOD_H -#include <qstring.h> +#include <tqstring.h> #include "../codeaccessormethod.h" #include "rubycodeclassfield.h" @@ -56,12 +56,12 @@ protected: /** set attributes of the node that represents this class * in the XMI document. */ - virtual void setAttributesOnNode ( QDomDocument & doc, QDomElement & blockElement); + virtual void setAttributesOnNode ( TQDomDocument & doc, TQDomElement & blockElement); /** set the class attributes of this object from * the passed element node. */ - virtual void setAttributesFromNode ( QDomElement & element); + virtual void setAttributesFromNode ( TQDomElement & element); virtual void updateMethodDeclaration(); virtual void updateContent(); diff --git a/umbrello/umbrello/codegenerators/rubycodeclassfield.cpp b/umbrello/umbrello/codegenerators/rubycodeclassfield.cpp index 35438abd..b3b723b9 100644 --- a/umbrello/umbrello/codegenerators/rubycodeclassfield.cpp +++ b/umbrello/umbrello/codegenerators/rubycodeclassfield.cpp @@ -21,7 +21,7 @@ #include "rubycodeclassfield.h" // qt/kde includes -#include <qregexp.h> +#include <tqregexp.h> #include <kdebug.h> // local includes @@ -59,7 +59,7 @@ RubyCodeClassField::~RubyCodeClassField ( ) { } // Other methods // -QString RubyCodeClassField::getFieldName() { +TQString RubyCodeClassField::getFieldName() { if (parentIsAttribute()) { UMLAttribute * at = (UMLAttribute*) getParentObject(); @@ -68,7 +68,7 @@ QString RubyCodeClassField::getFieldName() { else { UMLRole * role = (UMLRole*) getParentObject(); - QString roleName = role->getName(); + TQString roleName = role->getName(); if(fieldIsSingleValue()) { return roleName.replace(0, 1, roleName.left(1).lower()); } else { @@ -78,7 +78,7 @@ QString RubyCodeClassField::getFieldName() { } -QString RubyCodeClassField::getInitialValue() { +TQString RubyCodeClassField::getInitialValue() { if (parentIsAttribute()) { @@ -97,7 +97,7 @@ QString RubyCodeClassField::getInitialValue() { if(fieldIsSingleValue()) { // FIX : IF the multiplicity is "1" then we should init a new object here, if its 0 or 1, // then we can just return 'empty' string (minor problem). - return QString(""); + return TQString(""); } else { return RubyCodeGenerator::getListFieldClassName()+".new()"; } @@ -105,7 +105,7 @@ QString RubyCodeClassField::getInitialValue() { } -QString RubyCodeClassField::getTypeName ( ) +TQString RubyCodeClassField::getTypeName ( ) { return RubyCodeGenerator::cppToRubyType(CodeClassField::getTypeName()); } diff --git a/umbrello/umbrello/codegenerators/rubycodeclassfield.h b/umbrello/umbrello/codegenerators/rubycodeclassfield.h index 384f0b5d..50269729 100644 --- a/umbrello/umbrello/codegenerators/rubycodeclassfield.h +++ b/umbrello/umbrello/codegenerators/rubycodeclassfield.h @@ -20,7 +20,7 @@ #ifndef RUBYCODECLASSFIELD_H #define RUBYCODECLASSFIELD_H -#include <qstring.h> +#include <tqstring.h> #include "../codeclassfield.h" @@ -45,11 +45,11 @@ public: */ virtual ~RubyCodeClassField ( ); - QString getFieldType(); - QString getFieldName(); - QString getInitialValue(); + TQString getFieldType(); + TQString getFieldName(); + TQString getInitialValue(); - QString getTypeName ( ); + TQString getTypeName ( ); protected: private: diff --git a/umbrello/umbrello/codegenerators/rubycodeclassfielddeclarationblock.cpp b/umbrello/umbrello/codegenerators/rubycodeclassfielddeclarationblock.cpp index 380c05e0..e99ca774 100644 --- a/umbrello/umbrello/codegenerators/rubycodeclassfielddeclarationblock.cpp +++ b/umbrello/umbrello/codegenerators/rubycodeclassfielddeclarationblock.cpp @@ -53,12 +53,12 @@ void RubyCodeClassFieldDeclarationBlock::updateContent( ) CodeGenerationPolicy::ScopePolicy scopePolicy = p->getAssociationFieldScope(); // Set the comment - QString notes = getParentObject()->getDoc(); + TQString notes = getParentObject()->getDoc(); getComment()->setText(notes); // Set the body - QString staticValue = getParentObject()->getStatic() ? "static " : ""; - QString scopeStr = rdoc->scopeToRubyDecl(getParentObject()->getVisibility()); + TQString staticValue = getParentObject()->getStatic() ? "static " : ""; + TQString scopeStr = rdoc->scopeToRubyDecl(getParentObject()->getVisibility()); // IF this is from an association, then scope taken as appropriate to policy if(!rcf->parentIsAttribute()) @@ -76,14 +76,14 @@ void RubyCodeClassFieldDeclarationBlock::updateContent( ) } } - QString typeName = rcf->getTypeName(); - QString fieldName = rcf->getFieldName(); - QString initialV = rcf->getInitialValue(); + TQString typeName = rcf->getTypeName(); + TQString fieldName = rcf->getFieldName(); + TQString initialV = rcf->getInitialValue(); if (!cf->parentIsAttribute() && !cf->fieldIsSingleValue()) typeName = "Array"; - QString body = staticValue+scopeStr+' '+typeName+' '+fieldName; + TQString body = staticValue+scopeStr+' '+typeName+' '+fieldName; if (!initialV.isEmpty()) body.append(" = " + initialV); else if (!cf->parentIsAttribute()) diff --git a/umbrello/umbrello/codegenerators/rubycodeclassfielddeclarationblock.h b/umbrello/umbrello/codegenerators/rubycodeclassfielddeclarationblock.h index c3e18a68..beba96c2 100644 --- a/umbrello/umbrello/codegenerators/rubycodeclassfielddeclarationblock.h +++ b/umbrello/umbrello/codegenerators/rubycodeclassfielddeclarationblock.h @@ -20,7 +20,7 @@ #ifndef RUBYCODECLASSFIELDDECLARATIONBLOCK_H #define RUBYCODECLASSFIELDDECLARATIONBLOCK_H -#include <qstring.h> +#include <tqstring.h> #include "../codeclassfielddeclarationblock.h" diff --git a/umbrello/umbrello/codegenerators/rubycodecomment.cpp b/umbrello/umbrello/codegenerators/rubycodecomment.cpp index 46374128..89508b63 100644 --- a/umbrello/umbrello/codegenerators/rubycodecomment.cpp +++ b/umbrello/umbrello/codegenerators/rubycodecomment.cpp @@ -18,12 +18,12 @@ ***************************************************************************/ #include "rubycodecomment.h" -#include <qregexp.h> +#include <tqregexp.h> // Constructors/Destructors // -RubyCodeComment::RubyCodeComment(CodeDocument * doc, const QString & text) +RubyCodeComment::RubyCodeComment(CodeDocument * doc, const TQString & text) : CodeComment(doc, text) { @@ -46,35 +46,35 @@ RubyCodeComment::~RubyCodeComment( ) { } // Other methods // -QString RubyCodeComment::getNewEditorLine( int amount ) { - QString line = getIndentationString(amount) + "# "; +TQString RubyCodeComment::getNewEditorLine( int amount ) { + TQString line = getIndentationString(amount) + "# "; return line; } /** UnFormat a long text string. Typically, this means removing * the indentaion (linePrefix) and/or newline chars from each line. */ -QString RubyCodeComment::unformatText(const QString & text, const QString & indent) +TQString RubyCodeComment::unformatText(const TQString & text, const TQString & indent) { // remove leading or trailing comment stuff - QString mytext = TextBlock::unformatText(text, indent); + TQString mytext = TextBlock::unformatText(text, indent); // now leading hash - mytext.remove(QRegExp("^#\\s*")); + mytext.remove(TQRegExp("^#\\s*")); return mytext; } /** * @return QString */ -QString RubyCodeComment::toString( ) +TQString RubyCodeComment::toString( ) { - QString output = ""; + TQString output = ""; // simple output method if (getWriteOutText()) { - QString indent = getIndentationString(); - QString endLine = getNewLineEndingChars(); + TQString indent = getIndentationString(); + TQString endLine = getNewLineEndingChars(); output.append(formatMultiLineText(getText(), indent + "# ", endLine + endLine)); } diff --git a/umbrello/umbrello/codegenerators/rubycodecomment.h b/umbrello/umbrello/codegenerators/rubycodecomment.h index 35fb87a8..0646cd33 100644 --- a/umbrello/umbrello/codegenerators/rubycodecomment.h +++ b/umbrello/umbrello/codegenerators/rubycodecomment.h @@ -20,7 +20,7 @@ #ifndef RUBYCODECOMMENT_H #define RUBYCODECOMMENT_H -#include <qstring.h> +#include <tqstring.h> #include "../codecomment.h" /** @@ -38,7 +38,7 @@ public: /** * Constructors */ - explicit RubyCodeComment ( CodeDocument * doc, const QString & text = ""); + explicit RubyCodeComment ( CodeDocument * doc, const TQString & text = ""); /** * Empty Destructor @@ -48,17 +48,17 @@ public: /** * @return QString */ - QString toString ( ); + TQString toString ( ); /** UnFormat a long text string. Typically, this means removing * the indentaion (linePrefix) and/or newline chars from each line. */ - virtual QString unformatText ( const QString & text, const QString & indent = "" ); + virtual TQString unformatText ( const TQString & text, const TQString & indent = "" ); /** a special version here because we want to not only indent * the new line, but to add the "#" as well. */ - virtual QString getNewEditorLine ( int amount ); + virtual TQString getNewEditorLine ( int amount ); protected: diff --git a/umbrello/umbrello/codegenerators/rubycodedocumentation.cpp b/umbrello/umbrello/codegenerators/rubycodedocumentation.cpp index 6c69530a..e19f4daa 100644 --- a/umbrello/umbrello/codegenerators/rubycodedocumentation.cpp +++ b/umbrello/umbrello/codegenerators/rubycodedocumentation.cpp @@ -21,7 +21,7 @@ #include "rubycodedocumentation.h" // qt/kde includes -#include <qregexp.h> +#include <tqregexp.h> #include <kdebug.h> // local includes @@ -32,7 +32,7 @@ // Constructors/Destructors // -RubyCodeDocumentation::RubyCodeDocumentation ( RubyClassifierCodeDocument * doc, const QString & text ) +RubyCodeDocumentation::RubyCodeDocumentation ( RubyClassifierCodeDocument * doc, const TQString & text ) : CodeComment ((CodeDocument*) doc, text) { @@ -54,8 +54,8 @@ RubyCodeDocumentation::~RubyCodeDocumentation ( ) { } /** * Save the XMI representation of this object */ -void RubyCodeDocumentation::saveToXMI ( QDomDocument & doc, QDomElement & root ) { - QDomElement blockElement = doc.createElement( "rubycodedocumentation" ); +void RubyCodeDocumentation::saveToXMI ( TQDomDocument & doc, TQDomElement & root ) { + TQDomElement blockElement = doc.createElement( "rubycodedocumentation" ); setAttributesOnNode(doc, blockElement); // as we added no additional fields to this class we may // just use parent TextBlock method root.appendChild( blockElement ); @@ -64,10 +64,10 @@ void RubyCodeDocumentation::saveToXMI ( QDomDocument & doc, QDomElement & root ) /** * @return QString */ -QString RubyCodeDocumentation::toString ( ) +TQString RubyCodeDocumentation::toString ( ) { - QString output = ""; + TQString output = ""; // simple output method if(getWriteOutText()) @@ -79,9 +79,9 @@ QString RubyCodeDocumentation::toString ( ) if(p->getCommentStyle() == CodeGenerationPolicy::MultiLine) useHashOutput = false; - QString indent = getIndentationString(); - QString endLine = getNewLineEndingChars(); - QString body = getText(); + TQString indent = getIndentationString(); + TQString endLine = getNewLineEndingChars(); + TQString body = getText(); if( useHashOutput) { if(!body.isEmpty()) @@ -96,7 +96,7 @@ QString RubyCodeDocumentation::toString ( ) return output; } -QString RubyCodeDocumentation::getNewEditorLine ( int amount ) +TQString RubyCodeDocumentation::getNewEditorLine ( int amount ) { CodeGenerationPolicy *p = UMLApp::app()->getCommonPolicy(); if(p->getCommentStyle() == CodeGenerationPolicy::MultiLine) @@ -124,19 +124,19 @@ int RubyCodeDocumentation::lastEditableLine() { /** UnFormat a long text string. Typically, this means removing * the indentaion (linePrefix) and/or newline chars from each line. */ -QString RubyCodeDocumentation::unformatText ( const QString & text , const QString & indent) +TQString RubyCodeDocumentation::unformatText ( const TQString & text , const TQString & indent) { - QString mytext = TextBlock::unformatText(text, indent); + TQString mytext = TextBlock::unformatText(text, indent); CodeGenerationPolicy *p = UMLApp::app()->getCommonPolicy(); // remove leading or trailing comment stuff - mytext.remove(QRegExp('^'+indent)); + mytext.remove(TQRegExp('^'+indent)); if(p->getCommentStyle() == CodeGenerationPolicy::MultiLine) { - mytext.remove(QRegExp("^=begin\\s*(rdoc)?\\s*\n?")); - mytext.remove(QRegExp("^=end\\s*\n?$")); + mytext.remove(TQRegExp("^=begin\\s*(rdoc)?\\s*\n?")); + mytext.remove(TQRegExp("^=end\\s*\n?$")); } else - mytext.remove(QRegExp("^#\\s*")); + mytext.remove(TQRegExp("^#\\s*")); return mytext; } diff --git a/umbrello/umbrello/codegenerators/rubycodedocumentation.h b/umbrello/umbrello/codegenerators/rubycodedocumentation.h index 72908f78..0d210419 100644 --- a/umbrello/umbrello/codegenerators/rubycodedocumentation.h +++ b/umbrello/umbrello/codegenerators/rubycodedocumentation.h @@ -20,7 +20,7 @@ #ifndef RUBYCODEDOCUMENTATION_H #define RUBYCODEDOCUMENTATION_H -#include <qstring.h> +#include <tqstring.h> #include "../codecomment.h" class RubyClassifierCodeDocument; @@ -44,7 +44,7 @@ public: /** * Constructors */ - explicit RubyCodeDocumentation ( RubyClassifierCodeDocument * doc, const QString & text = ""); + explicit RubyCodeDocumentation ( RubyClassifierCodeDocument * doc, const TQString & text = ""); /** * Empty Destructor @@ -60,22 +60,22 @@ public: /** * Save the XMI representation of this object */ - virtual void saveToXMI ( QDomDocument & doc, QDomElement & root ); + virtual void saveToXMI ( TQDomDocument & doc, TQDomElement & root ); /** * @return QString */ - QString toString ( ); + TQString toString ( ); /** UnFormat a long text string. Typically, this means removing * the indentaion (linePrefix) and/or newline chars from each line. */ - virtual QString unformatText ( const QString & text, const QString & indent = "" ); + virtual TQString unformatText ( const TQString & text, const TQString & indent = "" ); /** a special version here because we want to not only indent * the new line, but to add the "# " sequence as well. */ - virtual QString getNewEditorLine ( int amount ); + virtual TQString getNewEditorLine ( int amount ); /** Ush. These are terrifically bad and must one day go away. * Both methods indicate the range of lines in this textblock diff --git a/umbrello/umbrello/codegenerators/rubycodegenerationpolicy.cpp b/umbrello/umbrello/codegenerators/rubycodegenerationpolicy.cpp index 1a01421a..8e58fdf0 100644 --- a/umbrello/umbrello/codegenerators/rubycodegenerationpolicy.cpp +++ b/umbrello/umbrello/codegenerators/rubycodegenerationpolicy.cpp @@ -156,7 +156,7 @@ void RubyCodeGenerationPolicy::setDefaults( KConfig * config, bool emitUpdateSig * Create a new dialog interface for this object. * @return dialog object */ -CodeGenerationPolicyPage * RubyCodeGenerationPolicy::createPage ( QWidget *parent, const char *name ) { +CodeGenerationPolicyPage * RubyCodeGenerationPolicy::createPage ( TQWidget *parent, const char *name ) { return new RubyCodeGenerationPolicyPage ( parent, name, this ); } diff --git a/umbrello/umbrello/codegenerators/rubycodegenerationpolicy.h b/umbrello/umbrello/codegenerators/rubycodegenerationpolicy.h index aa1a7146..56c051e2 100644 --- a/umbrello/umbrello/codegenerators/rubycodegenerationpolicy.h +++ b/umbrello/umbrello/codegenerators/rubycodegenerationpolicy.h @@ -20,7 +20,7 @@ #ifndef RUBYCODEGENERATIONPOLICY_H #define RUBYCODEGENERATIONPOLICY_H -#include <qstring.h> +#include <tqstring.h> #include "codegenpolicyext.h" #include "../codegenerationpolicy.h" @@ -98,7 +98,7 @@ public: * Create a new dialog interface for this object. * @return dialog object */ - CodeGenerationPolicyPage * createPage ( QWidget *parent = 0, const char * name = 0); + CodeGenerationPolicyPage * createPage ( TQWidget *parent = 0, const char * name = 0); protected: diff --git a/umbrello/umbrello/codegenerators/rubycodegenerationpolicypage.cpp b/umbrello/umbrello/codegenerators/rubycodegenerationpolicypage.cpp index 1e9080c9..5c890b4f 100644 --- a/umbrello/umbrello/codegenerators/rubycodegenerationpolicypage.cpp +++ b/umbrello/umbrello/codegenerators/rubycodegenerationpolicypage.cpp @@ -20,9 +20,9 @@ // own header #include "rubycodegenerationpolicypage.h" // qt/kde includes -#include <qlabel.h> -#include <qcombobox.h> -#include <qcheckbox.h> +#include <tqlabel.h> +#include <tqcombobox.h> +#include <tqcheckbox.h> #include <kdebug.h> #include <klocale.h> // app includes @@ -30,7 +30,7 @@ #include "../codegenerationpolicy.h" #include "../uml.h" -RubyCodeGenerationPolicyPage::RubyCodeGenerationPolicyPage( QWidget *parent, const char *name, RubyCodeGenerationPolicy * policy ) +RubyCodeGenerationPolicyPage::RubyCodeGenerationPolicyPage( TQWidget *parent, const char *name, RubyCodeGenerationPolicy * policy ) : CodeGenerationPolicyPage(parent, name, policy) { CodeGenerationPolicy *common = UMLApp::app()->getCommonPolicy(); diff --git a/umbrello/umbrello/codegenerators/rubycodegenerationpolicypage.h b/umbrello/umbrello/codegenerators/rubycodegenerationpolicypage.h index 6fc06aed..1637843b 100644 --- a/umbrello/umbrello/codegenerators/rubycodegenerationpolicypage.h +++ b/umbrello/umbrello/codegenerators/rubycodegenerationpolicypage.h @@ -33,7 +33,7 @@ class RubyCodeGenerationPolicyPage : public CodeGenerationPolicyPage { Q_OBJECT public: - explicit RubyCodeGenerationPolicyPage (QWidget *parent=0, const char *name=0, RubyCodeGenerationPolicy * policy = 0); + explicit RubyCodeGenerationPolicyPage (TQWidget *parent=0, const char *name=0, RubyCodeGenerationPolicy * policy = 0); virtual ~RubyCodeGenerationPolicyPage(); diff --git a/umbrello/umbrello/codegenerators/rubycodegenerator.cpp b/umbrello/umbrello/codegenerators/rubycodegenerator.cpp index 3e20ce50..4acfd65a 100644 --- a/umbrello/umbrello/codegenerators/rubycodegenerator.cpp +++ b/umbrello/umbrello/codegenerators/rubycodegenerator.cpp @@ -21,7 +21,7 @@ #include "rubycodegenerator.h" // qt/kde includes -#include <qregexp.h> +#include <tqregexp.h> #include <kconfig.h> #include <kdebug.h> #include <klocale.h> @@ -35,7 +35,7 @@ // Constructors/Destructors // -RubyCodeGenerator::RubyCodeGenerator (QDomElement & elem ) +RubyCodeGenerator::RubyCodeGenerator (TQDomElement & elem ) : CodeGenerator(elem) { } @@ -59,7 +59,7 @@ Uml::Programming_Language RubyCodeGenerator::getLanguage() { } // In the Java version, we make the ANT build file also available. -CodeViewerDialog * RubyCodeGenerator::getCodeViewerDialog ( QWidget* parent, CodeDocument *doc, +CodeViewerDialog * RubyCodeGenerator::getCodeViewerDialog ( TQWidget* parent, CodeDocument *doc, Settings::CodeViewerState state) { CodeViewerDialog *dialog = new CodeViewerDialog(parent, doc, state); @@ -81,34 +81,34 @@ bool RubyCodeGenerator::getAutoGenerateAssocAccessors ( ) return getRubyPolicy()->getAutoGenerateAssocAccessors (); } -QString RubyCodeGenerator::getListFieldClassName () { - return QString("Array"); +TQString RubyCodeGenerator::getListFieldClassName () { + return TQString("Array"); } // Other methods // -QString RubyCodeGenerator::cppToRubyType(const QString &typeStr) { - QString type = cleanName(typeStr); +TQString RubyCodeGenerator::cppToRubyType(const TQString &typeStr) { + TQString type = cleanName(typeStr); type.replace("const ", ""); - type.replace(QRegExp("[*&\\s]"), ""); - type.replace(QRegExp("[<>]"), "_"); - type.replace("QStringList", "Array"); - type.replace(QRegExp("^string$"),"String"); - type.replace("QString", "String"); + type.replace(TQRegExp("[*&\\s]"), ""); + type.replace(TQRegExp("[<>]"), "_"); + type.replace("TQStringList", "Array"); + type.replace(TQRegExp("^string$"),"String"); + type.replace("TQString", "String"); type.replace("bool", "true|false"); - type.replace(QRegExp("^(uint|int|ushort|short|ulong|long)$"), "Integer"); - type.replace(QRegExp("^(float|double)$"), "Float"); - type.replace(QRegExp("^Q(?=[A-Z])"), "Qt::"); - type.replace(QRegExp("^K(?!(DE|Parts|IO)"), "KDE::"); + type.replace(TQRegExp("^(uint|int|ushort|short|ulong|long)$"), "Integer"); + type.replace(TQRegExp("^(float|double)$"), "Float"); + type.replace(TQRegExp("^Q(?=[A-Z])"), "Qt::"); + type.replace(TQRegExp("^K(?!(DE|Parts|IO)"), "KDE::"); return type; } -QString RubyCodeGenerator::cppToRubyName(const QString &nameStr) { - QString name = cleanName(nameStr); - name.replace(QRegExp("^m_"), ""); - name.replace(QRegExp("^[pbn](?=[A-Z])"), ""); +TQString RubyCodeGenerator::cppToRubyName(const TQString &nameStr) { + TQString name = cleanName(nameStr); + name.replace(TQRegExp("^m_"), ""); + name.replace(TQRegExp("^[pbn](?=[A-Z])"), ""); name = name.mid(0, 1).lower() + name.mid(1); return name; } @@ -132,9 +132,9 @@ void RubyCodeGenerator::initFields() { } */ -const QStringList RubyCodeGenerator::reservedKeywords() const { +const TQStringList RubyCodeGenerator::reservedKeywords() const { - static QStringList keywords; + static TQStringList keywords; if (keywords.isEmpty()) { keywords << "__FILE__" diff --git a/umbrello/umbrello/codegenerators/rubycodegenerator.h b/umbrello/umbrello/codegenerators/rubycodegenerator.h index 9cc878f0..611338ca 100644 --- a/umbrello/umbrello/codegenerators/rubycodegenerator.h +++ b/umbrello/umbrello/codegenerators/rubycodegenerator.h @@ -20,7 +20,7 @@ #ifndef RUBYCODEGENERATOR_H #define RUBYCODEGENERATOR_H -#include <qstring.h> +#include <tqstring.h> #include "../codeviewerstate.h" #include "../codegenerator.h" #include "../codeblockwithcomments.h" @@ -45,7 +45,7 @@ public: * Empty Constructor */ RubyCodeGenerator (); - RubyCodeGenerator (QDomElement & element); + RubyCodeGenerator (TQDomElement & element); /** * Empty Destructor @@ -72,11 +72,11 @@ public: /** * Get the list variable class name to use. For Ruby, we have set this to "Array". */ - static QString getListFieldClassName(); + static TQString getListFieldClassName(); /** Get the editing dialog for this code document */ - virtual CodeViewerDialog * getCodeViewerDialog( QWidget* parent, CodeDocument * doc, + virtual CodeViewerDialog * getCodeViewerDialog( TQWidget* parent, CodeDocument * doc, Settings::CodeViewerState state); // Other methods @@ -102,7 +102,7 @@ public: * * @param cppType the C++ type to be converted */ - static QString cppToRubyType(const QString &cppType); + static TQString cppToRubyType(const TQString &cppType); /** * Convert C++ names such as 'm_foobar' or pFoobar to @@ -110,12 +110,12 @@ public: * * @param cppName the C++ name to be converted */ - static QString cppToRubyName(const QString &cppName); + static TQString cppToRubyName(const TQString &cppName); /** * get list of reserved keywords */ - virtual const QStringList reservedKeywords() const; + virtual const TQStringList reservedKeywords() const; protected: diff --git a/umbrello/umbrello/codegenerators/rubycodeoperation.cpp b/umbrello/umbrello/codegenerators/rubycodeoperation.cpp index 6f16fb96..7354281b 100644 --- a/umbrello/umbrello/codegenerators/rubycodeoperation.cpp +++ b/umbrello/umbrello/codegenerators/rubycodeoperation.cpp @@ -21,7 +21,7 @@ #include "rubycodeoperation.h" // qt/kde includes -#include <qregexp.h> +#include <tqregexp.h> // local includes #include "rubyclassifiercodedocument.h" @@ -32,7 +32,7 @@ // Constructors/Destructors // -RubyCodeOperation::RubyCodeOperation ( RubyClassifierCodeDocument * doc, UMLOperation *parent, const QString & body, const QString & comment ) +RubyCodeOperation::RubyCodeOperation ( RubyClassifierCodeDocument * doc, UMLOperation *parent, const TQString & body, const TQString & comment ) : CodeOperation (doc, parent, body, comment) { // lets not go with the default comment and instead use @@ -61,21 +61,21 @@ void RubyCodeOperation::updateMethodDeclaration() UMLClassifier *c = rubydoc->getParentClassifier(); UMLOperation * o = getParentOperation(); bool isInterface = rubydoc->getParentClassifier()->isInterface(); - QString endLine = getNewLineEndingChars(); + TQString endLine = getNewLineEndingChars(); // now, the starting text. - QString strVis = rubydoc->scopeToRubyDecl(o->getVisibility()); + TQString strVis = rubydoc->scopeToRubyDecl(o->getVisibility()); // no return type for constructors - QString fixedReturn = RubyCodeGenerator::cppToRubyType(o->getTypeName()); - QString returnType = o->isConstructorOperation() ? QString("") : (fixedReturn + QString(" ")); - QString methodName = o->getName(); + TQString fixedReturn = RubyCodeGenerator::cppToRubyType(o->getTypeName()); + TQString returnType = o->isConstructorOperation() ? TQString("") : (fixedReturn + TQString(" ")); + TQString methodName = o->getName(); - QString RubyClassName = rubydoc->getRubyClassName(c->getName()); + TQString RubyClassName = rubydoc->getRubyClassName(c->getName()); // Skip destructors, and operator methods which // can't be defined in ruby if ( methodName.startsWith("~") - || QRegExp("operator\\s*(=|--|\\+\\+|!=)$").exactMatch(methodName) ) + || TQRegExp("operator\\s*(=|--|\\+\\+|!=)$").exactMatch(methodName) ) { getComment()->setText(""); return; @@ -85,11 +85,11 @@ void RubyCodeOperation::updateMethodDeclaration() methodName = "initialize"; } - methodName.replace(QRegExp("operator\\s*"), ""); + methodName.replace(TQRegExp("operator\\s*"), ""); methodName = methodName.mid(0, 1).lower() + methodName.mid(1); - QString paramStr = QString(""); - QStringList commentedParams; + TQString paramStr = TQString(""); + TQStringList commentedParams; // assemble parameters UMLAttributeList list = getParentOperation()->getParmList(); @@ -97,10 +97,10 @@ void RubyCodeOperation::updateMethodDeclaration() int paramNum = 0; for(UMLAttribute* parm = list.first(); parm; parm = list.next()) { - QString paramName = RubyCodeGenerator::cppToRubyName(parm->getName()); + TQString paramName = RubyCodeGenerator::cppToRubyName(parm->getName()); paramStr += paramName; if (! parm->getInitialValue().isEmpty()) { - paramStr += QString(" = ") + RubyCodeGenerator::cppToRubyType(parm->getInitialValue()); + paramStr += TQString(" = ") + RubyCodeGenerator::cppToRubyType(parm->getInitialValue()); } paramNum++; @@ -108,7 +108,7 @@ void RubyCodeOperation::updateMethodDeclaration() paramStr += ", "; } - QString startText; + TQString startText; if (isInterface) { // Assume 'isInterface' means a module in Ruby, so // generate module methods @@ -124,32 +124,32 @@ void RubyCodeOperation::updateMethodDeclaration() // Lastly, for text content generation, we fix the comment on the // operation, IF the codeop is autogenerated & currently empty - QString comment = o->getDoc(); + TQString comment = o->getDoc(); if (comment.isEmpty()) { if (getContentType() == CodeBlock::AutoGenerated) { UMLAttributeList parameters = o->getParmList(); for(UMLAttributeListIt iterator(parameters); iterator.current(); ++iterator) { comment += endLine + "* _" + iterator.current()->getName() + "_ "; - comment += (' ' + iterator.current()->getDoc().replace( QRegExp("[\\n\\r]+[\\t ]*"), + comment += (' ' + iterator.current()->getDoc().replace( TQRegExp("[\\n\\r]+[\\t ]*"), endLine + " " ) ); } // add a returns statement too - if(!returnType.isEmpty() && !QRegExp("^void\\s*$").exactMatch(returnType)) + if(!returnType.isEmpty() && !TQRegExp("^void\\s*$").exactMatch(returnType)) comment += endLine + "* _returns_ " + returnType + ' '; getComment()->setText(comment); } } else { - comment.replace(QRegExp("[\\n\\r]+ *"), endLine); - comment.replace(QRegExp("[\\n\\r]+\\t*"), endLine); + comment.replace(TQRegExp("[\\n\\r]+ *"), endLine); + comment.replace(TQRegExp("[\\n\\r]+\\t*"), endLine); comment.replace(" m_", " "); - comment.replace(QRegExp("\\s[npb](?=[A-Z])"), " "); - QRegExp re_params("@param (\\w)(\\w*)"); + comment.replace(TQRegExp("\\s[npb](?=[A-Z])"), " "); + TQRegExp re_params("@param (\\w)(\\w*)"); int pos = re_params.search(comment); while (pos != -1) { comment.replace( re_params.cap(0), - QString("@param _") + re_params.cap(1).lower() + re_params.cap(2) + '_' ); + TQString("@param _") + re_params.cap(1).lower() + re_params.cap(2) + '_' ); commentedParams.append(re_params.cap(1).lower() + re_params.cap(2)); pos += re_params.matchedLength() + 3; @@ -165,7 +165,7 @@ void RubyCodeOperation::updateMethodDeclaration() if (iterator.current()->getDoc().isEmpty()) { comment += (' ' + RubyCodeGenerator::cppToRubyType(iterator.current()->getTypeName())); } else { - comment += (' ' + iterator.current()->getDoc().replace(QRegExp("[\\n\\r]+[\\t ]*"), endLine + " ")); + comment += (' ' + iterator.current()->getDoc().replace(TQRegExp("[\\n\\r]+[\\t ]*"), endLine + " ")); } } } @@ -194,9 +194,9 @@ void RubyCodeOperation::updateMethodDeclaration() pos = comment.find(endLine, pos); } - QString typeStr = RubyCodeGenerator::cppToRubyType(o->getTypeName()); + TQString typeStr = RubyCodeGenerator::cppToRubyType(o->getTypeName()); if ( !typeStr.isEmpty() - && !QRegExp("^void\\s*$").exactMatch(typeStr) + && !TQRegExp("^void\\s*$").exactMatch(typeStr) && comment.contains("_returns_") == 0 ) { comment += endLine + "* _returns_ " + typeStr; diff --git a/umbrello/umbrello/codegenerators/rubycodeoperation.h b/umbrello/umbrello/codegenerators/rubycodeoperation.h index c8e8cea4..fab1d239 100644 --- a/umbrello/umbrello/codegenerators/rubycodeoperation.h +++ b/umbrello/umbrello/codegenerators/rubycodeoperation.h @@ -20,7 +20,7 @@ #ifndef RUBYCODEOPERATION_H #define RUBYCODEOPERATION_H -#include <qstring.h> +#include <tqstring.h> #include "../codeoperation.h" class RubyClassifierCodeDocument; @@ -36,7 +36,7 @@ public: /** * Empty Constructor */ - RubyCodeOperation ( RubyClassifierCodeDocument * doc, UMLOperation * op, const QString & body = "", const QString & comment = ""); + RubyCodeOperation ( RubyClassifierCodeDocument * doc, UMLOperation * op, const TQString & body = "", const TQString & comment = ""); /** * Empty Destructor diff --git a/umbrello/umbrello/codegenerators/rubywriter.cpp b/umbrello/umbrello/codegenerators/rubywriter.cpp index aa9a5271..571634a5 100644 --- a/umbrello/umbrello/codegenerators/rubywriter.cpp +++ b/umbrello/umbrello/codegenerators/rubywriter.cpp @@ -21,9 +21,9 @@ #include <kdebug.h> #include <klocale.h> #include <kmessagebox.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqregexp.h> #include "classifierinfo.h" #include "../umldoc.h" @@ -45,25 +45,25 @@ void RubyWriter::writeClass(UMLClassifier *c) { return; } - QString classname = cleanName(c->getName()); + TQString classname = cleanName(c->getName()); UMLClassifierList superclasses = c->getSuperClasses(); UMLAssociationList aggregations = c->getAggregations(); UMLAssociationList compositions = c->getCompositions(); //find an appropriate name for our file - QString fileName = findFileName(c, ".rb"); + TQString fileName = findFileName(c, ".rb"); if (fileName.isEmpty()) { emit codeGenerated(c, false); return; } - QFile fileh; + TQFile fileh; if( !openFile(fileh, fileName) ) { emit codeGenerated(c, false); return; } - QTextStream h(&fileh); + TQTextStream h(&fileh); // preparations classifierInfo = new ClassifierInfo(c); @@ -76,18 +76,18 @@ void RubyWriter::writeClass(UMLClassifier *c) { //try to find a heading file (license, coments, etc) - QString str; + TQString str; str = getHeadingFile(".rb"); if(!str.isEmpty()) { - str.replace(QRegExp("%filename%"), fileName); - str.replace(QRegExp("%filepath%"), fileh.name()); + str.replace(TQRegExp("%filename%"), fileName); + str.replace(TQRegExp("%filepath%"), fileh.name()); h<<str<<m_endl; } if(forceDoc() || !c->getDoc().isEmpty()) { - QString docStr = c->getDoc(); - docStr.replace(QRegExp("\\n"), "\n# "); + TQString docStr = c->getDoc(); + docStr.replace(TQRegExp("\\n"), "\n# "); docStr.replace("@ref ", ""); docStr.replace("@see", "_See_"); docStr.replace("@short", "_Summary_"); @@ -144,31 +144,31 @@ void RubyWriter::writeClass(UMLClassifier *c) { //////////////////////////////////////////////////////////////////////////////////// // Helper Methods -QString RubyWriter::cppToRubyType(const QString &typeStr) { - QString type = cleanName(typeStr); +TQString RubyWriter::cppToRubyType(const TQString &typeStr) { + TQString type = cleanName(typeStr); type.replace("const ", ""); - type.replace(QRegExp("[*&\\s]"), ""); - type.replace(QRegExp("[<>]"), "_"); - type.replace("QStringList", "Array"); - type.replace("QString", "String"); + type.replace(TQRegExp("[*&\\s]"), ""); + type.replace(TQRegExp("[<>]"), "_"); + type.replace("TQStringList", "Array"); + type.replace("TQString", "String"); type.replace("bool", "true|false"); - type.replace(QRegExp("^(uint|int|ushort|short|ulong|long)$"), "Integer"); - type.replace(QRegExp("^(float|double)$"), "Float"); - type.replace(QRegExp("^Q(?=[A-Z])"), "Qt::"); - type.replace(QRegExp("^K(?!(DE|Parts|IO)"), "KDE::"); + type.replace(TQRegExp("^(uint|int|ushort|short|ulong|long)$"), "Integer"); + type.replace(TQRegExp("^(float|double)$"), "Float"); + type.replace(TQRegExp("^Q(?=[A-Z])"), "Qt::"); + type.replace(TQRegExp("^K(?!(DE|Parts|IO)"), "KDE::"); return type; } -QString RubyWriter::cppToRubyName(const QString &nameStr) { - QString name = cleanName(nameStr); - name.replace(QRegExp("^m_"), ""); - name.replace(QRegExp("^[pbn](?=[A-Z])"), ""); +TQString RubyWriter::cppToRubyName(const TQString &nameStr) { + TQString name = cleanName(nameStr); + name.replace(TQRegExp("^m_"), ""); + name.replace(TQRegExp("^[pbn](?=[A-Z])"), ""); name = name.mid(0, 1).lower() + name.mid(1); return name; } -void RubyWriter::writeOperations(UMLClassifier *c,QTextStream &h) { +void RubyWriter::writeOperations(UMLClassifier *c,TQTextStream &h) { //Lists to store operations sorted by scope UMLOperationList oppub,opprot,oppriv; @@ -195,7 +195,7 @@ void RubyWriter::writeOperations(UMLClassifier *c,QTextStream &h) { } } - QString classname(cleanName(c->getName())); + TQString classname(cleanName(c->getName())); //write operations to file if(forceSections() || !oppub.isEmpty()) { @@ -212,8 +212,8 @@ void RubyWriter::writeOperations(UMLClassifier *c,QTextStream &h) { } -void RubyWriter::writeOperations(const QString &classname, UMLOperationList &opList, - Uml::Visibility permitScope, QTextStream &h) +void RubyWriter::writeOperations(const TQString &classname, UMLOperationList &opList, + Uml::Visibility permitScope, TQTextStream &h) { UMLOperation *op; UMLAttribute *at; @@ -233,8 +233,8 @@ void RubyWriter::writeOperations(const QString &classname, UMLOperationList &opL } for (op=opList.first(); op ; op=opList.next()) { - QString methodName = cleanName(op->getName()); - QStringList commentedParams; + TQString methodName = cleanName(op->getName()); + TQStringList commentedParams; // Skip destructors, and operator methods which // can't be defined in ruby @@ -265,25 +265,25 @@ void RubyWriter::writeOperations(const QString &classname, UMLOperationList &opL if (writeDoc) { h << m_indentation << "#" << m_endl; - QString docStr = op->getDoc(); + TQString docStr = op->getDoc(); - docStr.replace(QRegExp("[\\n\\r]+ *"), m_endl); - docStr.replace(QRegExp("[\\n\\r]+\\t*"), m_endl); + docStr.replace(TQRegExp("[\\n\\r]+ *"), m_endl); + docStr.replace(TQRegExp("[\\n\\r]+\\t*"), m_endl); docStr.replace(" m_", " "); - docStr.replace(QRegExp("\\s[npb](?=[A-Z])"), " "); - QRegExp re_params("@param (\\w)(\\w*)"); + docStr.replace(TQRegExp("\\s[npb](?=[A-Z])"), " "); + TQRegExp re_params("@param (\\w)(\\w*)"); int pos = re_params.search(docStr); while (pos != -1) { docStr.replace( re_params.cap(0), - QString("@param _") + re_params.cap(1).lower() + re_params.cap(2) + '_' ); + TQString("@param _") + re_params.cap(1).lower() + re_params.cap(2) + '_' ); commentedParams.append(re_params.cap(1).lower() + re_params.cap(2)); pos += re_params.matchedLength() + 3; pos = re_params.search(docStr, pos); } - docStr.replace("\n", QString("\n") + m_indentation + "# "); + docStr.replace("\n", TQString("\n") + m_indentation + "# "); // Write parameter documentation for (at = atl.first(); at ; at = atl.next()) { @@ -294,7 +294,7 @@ void RubyWriter::writeOperations(const QString &classname, UMLOperationList &opL if (at->getDoc().isEmpty()) { docStr += (' ' + cppToRubyType(at->getTypeName())); } else { - docStr += (' ' + at->getDoc().replace(QRegExp("[\\n\\r]+[\\t ]*"), m_endl + " ")); + docStr += (' ' + at->getDoc().replace(TQRegExp("[\\n\\r]+[\\t ]*"), m_endl + " ")); } } } @@ -308,7 +308,7 @@ void RubyWriter::writeOperations(const QString &classname, UMLOperationList &opL // item starting with '# *', then indent the text with // three spaces, '# ', to line up with the list item. pos = docStr.find("# *"); - QRegExp re_linestart("# (?!\\*)"); + TQRegExp re_linestart("# (?!\\*)"); pos = re_linestart.search(docStr, pos); while (pos > 0) { docStr.insert(pos + 1, " "); @@ -319,7 +319,7 @@ void RubyWriter::writeOperations(const QString &classname, UMLOperationList &opL h << m_indentation << "# "<< docStr << m_endl; - QString typeStr = cppToRubyType(op->getTypeName()); + TQString typeStr = cppToRubyType(op->getTypeName()); if (!typeStr.isEmpty() && typeStr != "void" && docStr.contains("_returns_") == 0) { h << m_indentation << "# * _returns_ " << typeStr << m_endl; } @@ -329,15 +329,15 @@ void RubyWriter::writeOperations(const QString &classname, UMLOperationList &opL int j=0; for (at = atl.first(); at; at = atl.next(), j++) { - QString nameStr = cppToRubyName(at->getName()); + TQString nameStr = cppToRubyName(at->getName()); if (j > 0) { h << ", " << nameStr; } else { h << nameStr; } h << (!(at->getInitialValue().isEmpty()) ? - (QString(" = ") + cppToRubyType(at->getInitialValue())) : - QString("")); + (TQString(" = ") + cppToRubyType(at->getInitialValue())) : + TQString("")); } h <<")" << m_endl; @@ -353,7 +353,7 @@ void RubyWriter::writeOperations(const QString &classname, UMLOperationList &opL // this is for writing file attribute methods // void RubyWriter::writeAttributeMethods(UMLAttributeList *attribs, - Uml::Visibility visibility, QTextStream &stream) + Uml::Visibility visibility, TQTextStream &stream) { // return now if NO attributes to work on if (attribs->count() == 0 || visibility == Uml::Visibility::Private) @@ -362,7 +362,7 @@ void RubyWriter::writeAttributeMethods(UMLAttributeList *attribs, UMLAttribute *at; for(at=attribs->first(); at; at=attribs->next()) { - QString varName = cppToRubyName(cleanName(at->getName())); + TQString varName = cppToRubyName(cleanName(at->getName())); writeSingleAttributeAccessorMethods(varName, at->getDoc(), stream); } @@ -370,14 +370,14 @@ void RubyWriter::writeAttributeMethods(UMLAttributeList *attribs, } void RubyWriter::writeSingleAttributeAccessorMethods( - const QString &fieldName, - const QString &descr, - QTextStream &h) + const TQString &fieldName, + const TQString &descr, + TQTextStream &h) { - QString description = descr; - description.replace(QRegExp("m_[npb](?=[A-Z])"), ""); + TQString description = descr; + description.replace(TQRegExp("m_[npb](?=[A-Z])"), ""); description.replace("m_", ""); - description.replace("\n", QString("\n") + m_indentation + "# "); + description.replace("\n", TQString("\n") + m_indentation + "# "); if (!description.isEmpty()) { h << m_indentation << "# " << description << m_endl; @@ -395,9 +395,9 @@ Uml::Programming_Language RubyWriter::getLanguage() { return Uml::pl_Ruby; } -const QStringList RubyWriter::reservedKeywords() const { +const TQStringList RubyWriter::reservedKeywords() const { - static QStringList keywords; + static TQStringList keywords; if (keywords.isEmpty()) { keywords << "__FILE__" diff --git a/umbrello/umbrello/codegenerators/rubywriter.h b/umbrello/umbrello/codegenerators/rubywriter.h index 8f1547ad..c1a69775 100644 --- a/umbrello/umbrello/codegenerators/rubywriter.h +++ b/umbrello/umbrello/codegenerators/rubywriter.h @@ -23,7 +23,7 @@ #include "../umloperationlist.h" #include "../umlattributelist.h" -#include <qstringlist.h> +#include <tqstringlist.h> class ClassifierInfo; @@ -52,7 +52,7 @@ public: /** * get list of reserved keywords */ - virtual const QStringList reservedKeywords() const; + virtual const TQStringList reservedKeywords() const; private: /** @@ -61,7 +61,7 @@ private: * * @param cppType the C++ type to be converted */ - QString cppToRubyType(const QString &cppType); + TQString cppToRubyType(const TQString &cppType); /** * Convert C++ names such as 'm_foobar' or pFoobar to @@ -69,22 +69,22 @@ private: * * @param cppName the C++ name to be converted */ - QString cppToRubyName(const QString &cppName); + TQString cppToRubyName(const TQString &cppName); /** * calls @ref writeSingleAttributeAccessorMethods() on each of the attributes in attribs list. */ void writeAttributeMethods(UMLAttributeList *attribs, - Uml::Visibility visibility, QTextStream &stream); + Uml::Visibility visibility, TQTextStream &stream); /** * write all method declarations, for attributes and associations * for the given permitted scope. */ - void writeSingleAttributeAccessorMethods(const QString &fieldName, - const QString &description, - QTextStream &h); + void writeSingleAttributeAccessorMethods(const TQString &fieldName, + const TQString &description, + TQTextStream &h); /** * write all operations for a given class @@ -92,7 +92,7 @@ private: * @param c the concept we are generating code for * @param h output stream for the header file */ - void writeOperations(UMLClassifier *c, QTextStream &h); + void writeOperations(UMLClassifier *c, TQTextStream &h); /** * write a list of class operations @@ -101,8 +101,8 @@ private: * @param opList the list of operations * @param h output stream for the header file */ - void writeOperations(const QString &classname, UMLOperationList &opList, - Uml::Visibility permitScope, QTextStream &h); + void writeOperations(const TQString &classname, UMLOperationList &opList, + Uml::Visibility permitScope, TQTextStream &h); /** * Summary information about current classifier. diff --git a/umbrello/umbrello/codegenerators/simplecodegenerator.cpp b/umbrello/umbrello/codegenerators/simplecodegenerator.cpp index 98477f15..6b7ac992 100644 --- a/umbrello/umbrello/codegenerators/simplecodegenerator.cpp +++ b/umbrello/umbrello/codegenerators/simplecodegenerator.cpp @@ -19,9 +19,9 @@ // system includes #include <cstdlib> //to get the user name // qt includes -#include <qdatetime.h> -#include <qregexp.h> -#include <qdir.h> +#include <tqdatetime.h> +#include <tqregexp.h> +#include <tqdir.h> // kde includes #include <klocale.h> #include <kdebug.h> @@ -66,39 +66,39 @@ SimpleCodeGenerator::~SimpleCodeGenerator ( ) { } // Other methods // -QString SimpleCodeGenerator::getIndent () +TQString SimpleCodeGenerator::getIndent () { - QString myIndent; + TQString myIndent; for (int i = 0 ; i < m_indentLevel ; i++) myIndent.append(m_indentation); return myIndent; } -QString SimpleCodeGenerator::findFileName(UMLPackage* concept, const QString &ext) { +TQString SimpleCodeGenerator::findFileName(UMLPackage* concept, const TQString &ext) { //if we already know to which file this class was written/should be written, just return it. if (m_fileMap.contains(concept)) return m_fileMap[concept]; //else, determine the "natural" file name - QString name; + TQString name; // Get the package name - QString package = concept->getPackage("."); + TQString package = concept->getPackage("."); // Replace all white spaces with blanks package.simplifyWhiteSpace(); // Replace all blanks with underscore - package.replace(QRegExp(" "), "_"); + package.replace(TQRegExp(" "), "_"); // Convert all "::" to "/" : Platform-specific path separator - // package.replace(QRegExp("::"), "/"); + // package.replace(TQRegExp("::"), "/"); // if package is given add this as a directory to the file name if (!package.isEmpty() && m_createDirHierarchyForPackages) { name = package + '.' + concept->getName(); - name.replace(QRegExp("\\."),"/"); - package.replace(QRegExp("\\."), "/"); + name.replace(TQRegExp("\\."),"/"); + package.replace(TQRegExp("\\."), "/"); package = '/' + package; } else { name = concept->getFullyQualifiedName("-"); @@ -111,15 +111,15 @@ QString SimpleCodeGenerator::findFileName(UMLPackage* concept, const QString &ex // if a package name exists check the existence of the package directory if (!package.isEmpty() && m_createDirHierarchyForPackages) { - QDir pathDir(UMLApp::app()->getCommonPolicy()->getOutputDirectory().absPath() + package); + TQDir pathDir(UMLApp::app()->getCommonPolicy()->getOutputDirectory().absPath() + package); // does our complete output directory exist yet? if not, try to create it if (!pathDir.exists()) { - QStringList dirs = QStringList::split("/",pathDir.absPath()); - QString currentDir = ""; + TQStringList dirs = TQStringList::split("/",pathDir.absPath()); + TQString currentDir = ""; - QStringList::iterator end(dirs.end()); - for (QStringList::iterator dir(dirs.begin()); dir != end; ++dir) + TQStringList::iterator end(dirs.end()); + for (TQStringList::iterator dir(dirs.begin()); dir != end; ++dir) { currentDir += '/' + *dir; if (! (pathDir.exists(currentDir) @@ -136,19 +136,19 @@ QString SimpleCodeGenerator::findFileName(UMLPackage* concept, const QString &ex name.simplifyWhiteSpace(); - name.replace(QRegExp(" "),"_"); + name.replace(TQRegExp(" "),"_"); - QString extension = ext.simplifyWhiteSpace(); + TQString extension = ext.simplifyWhiteSpace(); extension.replace(' ', '_'); return overwritableName(concept, name, extension); } -QString SimpleCodeGenerator::overwritableName(UMLPackage* concept, const QString &name, const QString &ext) { +TQString SimpleCodeGenerator::overwritableName(UMLPackage* concept, const TQString &name, const TQString &ext) { //check if a file named "name" with extension "ext" already exists CodeGenerationPolicy *commonPolicy = UMLApp::app()->getCommonPolicy(); - QDir outputDir = commonPolicy->getOutputDirectory(); - QString filename = name + ext; + TQDir outputDir = commonPolicy->getOutputDirectory(); + TQString filename = name + ext; if(!outputDir.exists(filename)) { m_fileMap.insert(concept,filename); return filename; //if not, "name" is OK and we have not much to to @@ -172,7 +172,7 @@ QString SimpleCodeGenerator::overwritableName(UMLPackage* concept, const QString case KDialogBase::No: //generate similar name suffix = 1; while (1) { - filename = name + "__" + QString::number(suffix) + ext; + filename = name + "__" + TQString::number(suffix) + ext; if (!outputDir.exists(filename)) break; suffix++; @@ -197,7 +197,7 @@ QString SimpleCodeGenerator::overwritableName(UMLPackage* concept, const QString case CodeGenerationPolicy::Never: //generate similar name suffix = 1; while (1) { - filename = name + "__" + QString::number(suffix) + ext; + filename = name + "__" + TQString::number(suffix) + ext; if (!outputDir.exists(filename)) break; suffix++; diff --git a/umbrello/umbrello/codegenerators/simplecodegenerator.h b/umbrello/umbrello/codegenerators/simplecodegenerator.h index d75a0660..c9d4a32d 100644 --- a/umbrello/umbrello/codegenerators/simplecodegenerator.h +++ b/umbrello/umbrello/codegenerators/simplecodegenerator.h @@ -19,9 +19,9 @@ #ifndef SIMPLECODEGENERATOR_H #define SIMPLECODEGENERATOR_H -#include <qstringlist.h> -#include <qstring.h> -#include <qmap.h> +#include <tqstringlist.h> +#include <tqstring.h> +#include <tqmap.h> #include "../codegenerator.h" #include "../umlnamespace.h" @@ -72,21 +72,21 @@ public: protected: // compatability methods.. - QString findFileName(UMLPackage* concept, const QString &ext); - QString overwritableName(UMLPackage* concept, const QString &name, const QString &ext); + TQString findFileName(UMLPackage* concept, const TQString &ext); + TQString overwritableName(UMLPackage* concept, const TQString &name, const TQString &ext); bool hasDefaultValueAttr(UMLClassifier *c); bool hasAbstractOps(UMLClassifier *c); /** * Returns the current indent string based on m_indentLevel and m_indentation. */ - QString getIndent (); + TQString getIndent (); /** * Maps UMLObjects to filenames. Used for finding out which file * each class was written to. */ - QMap<UMLPackage*,QString> m_fileMap; + TQMap<UMLPackage*,TQString> m_fileMap; // the parent document UMLDoc *m_doc; @@ -100,9 +100,9 @@ protected: bool m_createDirHierarchyForPackages; /* Old Attributes writers will look for */ - QString m_indentation; + TQString m_indentation; int m_indentLevel; - QString m_endl; + TQString m_endl; // override parent method..we need special handling void initFromParentDocument( ); diff --git a/umbrello/umbrello/codegenerators/sqlwriter.cpp b/umbrello/umbrello/codegenerators/sqlwriter.cpp index f01e8bbe..8582ec93 100644 --- a/umbrello/umbrello/codegenerators/sqlwriter.cpp +++ b/umbrello/umbrello/codegenerators/sqlwriter.cpp @@ -20,9 +20,9 @@ #include <klocale.h> #include <kmessagebox.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqregexp.h> #include "../classifier.h" #include "../operation.h" @@ -43,16 +43,16 @@ void SQLWriter::writeClass(UMLClassifier *c) { } const bool isClass = !c->isInterface(); - QString classname = cleanName(c->getName()); + TQString classname = cleanName(c->getName()); //find an appropriate name for our file - QString fileName = findFileName(c, ".sql"); + TQString fileName = findFileName(c, ".sql"); if (fileName.isEmpty()) { emit codeGenerated(c, false); return; } - QFile file; + TQFile file; if( !openFile(file, fileName) ) { emit codeGenerated(c, false); return; @@ -60,13 +60,13 @@ void SQLWriter::writeClass(UMLClassifier *c) { //Start generating the code!! - QTextStream sql(&file); + TQTextStream sql(&file); //try to find a heading file (license, coments, etc) - QString str; + TQString str; str = getHeadingFile(".sql"); if(!str.isEmpty()) { - str.replace(QRegExp("%filename%"),fileName); - str.replace(QRegExp("%filepath%"),file.name()); + str.replace(TQRegExp("%filename%"),fileName); + str.replace(TQRegExp("%filepath%"),file.name()); sql<<str<<m_endl; } @@ -85,7 +85,7 @@ void SQLWriter::writeClass(UMLClassifier *c) { sql << m_endl << ");" << m_endl; - QMap<UMLAssociation*,UMLAssociation*> constraintMap; // so we don't repeat constraint + TQMap<UMLAssociation*,UMLAssociation*> constraintMap; // so we don't repeat constraint UMLAssociationList aggregations = c->getAggregations(); if( forceSections() || !aggregations.isEmpty() ) { for(UMLAssociation* a = aggregations.first(); a; a = aggregations.next()) { @@ -97,7 +97,7 @@ void SQLWriter::writeClass(UMLClassifier *c) { } } - QMap<UMLAssociation*,UMLAssociation*>::Iterator itor = constraintMap.begin(); + TQMap<UMLAssociation*,UMLAssociation*>::Iterator itor = constraintMap.begin(); for (;itor != constraintMap.end();itor++) { UMLAssociation* a = itor.data(); sql << "ALTER TABLE "<< classname @@ -113,7 +113,7 @@ void SQLWriter::writeClass(UMLClassifier *c) { } -void SQLWriter::writeAttributes(UMLClassifier *c, QTextStream &sql) { +void SQLWriter::writeAttributes(UMLClassifier *c, TQTextStream &sql) { UMLAttributeList atpub, atprot, atpriv, atimp; atpub.setAutoDelete(false); atprot.setAutoDelete(false); @@ -171,8 +171,8 @@ void SQLWriter::writeAttributes(UMLClassifier *c, QTextStream &sql) { return; } -void SQLWriter::printAttributes(QTextStream& sql, UMLAttributeList attributeList, bool first) { - QString attrDoc = ""; +void SQLWriter::printAttributes(TQTextStream& sql, UMLAttributeList attributeList, bool first) { + TQString attrDoc = ""; UMLAttribute* at; for (at=attributeList.first();at;at=attributeList.next()) @@ -194,7 +194,7 @@ void SQLWriter::printAttributes(QTextStream& sql, UMLAttributeList attributeList // write the attribute sql << m_indentation << cleanName(at->getName()) << " " << at->getTypeName() << " " - << (at->getInitialValue().isEmpty()?QString(""):QString(" DEFAULT ")+at->getInitialValue()); + << (at->getInitialValue().isEmpty()?TQString(""):TQString(" DEFAULT ")+at->getInitialValue()); // now get documentation/comment of current attribute attrDoc = at->getDoc(); @@ -215,8 +215,8 @@ Uml::Programming_Language SQLWriter::getLanguage() { return Uml::pl_SQL; } -QStringList SQLWriter::defaultDatatypes() { - QStringList l; +TQStringList SQLWriter::defaultDatatypes() { + TQStringList l; l.append("varchar"); l.append("tinyint"); l.append("smallint"); @@ -244,9 +244,9 @@ QStringList SQLWriter::defaultDatatypes() { return l; } -const QStringList SQLWriter::reservedKeywords() const { +const TQStringList SQLWriter::reservedKeywords() const { - static QStringList keywords; + static TQStringList keywords; if (keywords.isEmpty()) { keywords << "access" diff --git a/umbrello/umbrello/codegenerators/sqlwriter.h b/umbrello/umbrello/codegenerators/sqlwriter.h index c500e2e7..42271af0 100644 --- a/umbrello/umbrello/codegenerators/sqlwriter.h +++ b/umbrello/umbrello/codegenerators/sqlwriter.h @@ -48,12 +48,12 @@ public: /** * Reimplement method from CodeGenerator. */ - virtual QStringList defaultDatatypes(); + virtual TQStringList defaultDatatypes(); /** * get list of reserved keywords */ - virtual const QStringList reservedKeywords() const; + virtual const TQStringList reservedKeywords() const; private: @@ -62,7 +62,7 @@ private: * @param c the class for which we are generating code * @param j the stream associated with the output file */ - void writeAttributes(UMLClassifier *c, QTextStream &j); + void writeAttributes(UMLClassifier *c, TQTextStream &j); /** * Prints out attributes as columns in the table @@ -71,7 +71,7 @@ private: * @param attributeList the attributes to be printed * @param first if the attributes are the first one */ - void printAttributes(QTextStream& sql, UMLAttributeList attributeList, bool first); + void printAttributes(TQTextStream& sql, UMLAttributeList attributeList, bool first); }; #endif // SQLWRITER_H diff --git a/umbrello/umbrello/codegenerators/tclwriter.cpp b/umbrello/umbrello/codegenerators/tclwriter.cpp index d8607aa7..f443e8f1 100644 --- a/umbrello/umbrello/codegenerators/tclwriter.cpp +++ b/umbrello/umbrello/codegenerators/tclwriter.cpp @@ -17,9 +17,9 @@ // own header #include "tclwriter.h" // qt/kde includes -#include <qfile.h> -#include <qtextstream.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqregexp.h> #include <kdebug.h> // app includes #include "classifierinfo.h" @@ -99,10 +99,10 @@ TclWriter::writeClass(UMLClassifier * c) kDebug() << "Cannot write class of NULL concept!\n"; return; } - QFile fileh, filetcl; + TQFile fileh, filetcl; // find an appropriate name for our file - QString fileName = findFileName(c, ".tcl"); + TQString fileName = findFileName(c, ".tcl"); if (fileName.isEmpty()) { emit codeGenerated(c, false); return; @@ -153,20 +153,20 @@ TclWriter::writeClass(UMLClassifier * c) } void -TclWriter::writeHeaderFile(UMLClassifier * c, QFile & fileh) +TclWriter::writeHeaderFile(UMLClassifier * c, TQFile & fileh) { // open stream for writing - QTextStream stream(&fileh); + TQTextStream stream(&fileh); mStream = &stream; // reset the indent level m_indentLevel = 0; // write header blurb - QString str = getHeadingFile(".tcl"); + TQString str = getHeadingFile(".tcl"); if (!str.isEmpty()) { - str.replace(QRegExp("%filename%"), classifierInfo->fileName); - str.replace(QRegExp("%filepath%"), fileh.name()); + str.replace(TQRegExp("%filename%"), classifierInfo->fileName); + str.replace(TQRegExp("%filepath%"), fileh.name()); writeCode(str); } // set current namespace @@ -216,7 +216,7 @@ TclWriter::writeHeaderFile(UMLClassifier * c, QFile & fileh) m_indentLevel++; for (UMLClassifierListItem * lit = litList.first(); lit; lit = litList.next()) { - QString enumLiteral = cleanName(lit->getName()); + TQString enumLiteral = cleanName(lit->getName()); writeCode(enumLiteral + "\\"); } m_indentLevel--; @@ -232,8 +232,8 @@ TclWriter::writeHeaderFile(UMLClassifier * c, QFile & fileh) writeCode("#TODO template<"); for (UMLTemplate * t = template_params.first(); t; t = template_params.next()) { - QString formalName = t->getName(); - QString typeName = t->getTypeName(); + TQString formalName = t->getName(); + TQString typeName = t->getTypeName(); writeCode(typeName + "# " + formalName); } } @@ -241,7 +241,7 @@ TclWriter::writeHeaderFile(UMLClassifier * c, QFile & fileh) writeCode("class " + mClass + " {"); m_indentLevel++; if (classifierInfo->superclasses.count() > 0) { - QString code = "inherit"; + TQString code = "inherit"; for (UMLClassifier * superClass = classifierInfo->superclasses.first(); superClass; superClass = classifierInfo->superclasses.next()) { /* @@ -324,21 +324,21 @@ TclWriter::writeHeaderFile(UMLClassifier * c, QFile & fileh) } void -TclWriter::writeSourceFile(UMLClassifier * c, QFile & filetcl) +TclWriter::writeSourceFile(UMLClassifier * c, TQFile & filetcl) { // open stream for writing - QTextStream stream(&filetcl); + TQTextStream stream(&filetcl); mStream = &stream; // set the starting indentation at zero m_indentLevel = 0; //try to find a heading file (license, coments, etc) - QString str; + TQString str; str = getHeadingFile(".tclbody"); if (!str.isEmpty()) { - str.replace(QRegExp("%filename%"), classifierInfo->fileName + "body"); - str.replace(QRegExp("%filepath%"), filetcl.name()); + str.replace(TQRegExp("%filename%"), classifierInfo->fileName + "body"); + str.replace(TQRegExp("%filepath%"), filetcl.name()); writeCode(str); } // Start body of class @@ -363,24 +363,24 @@ TclWriter::writeSourceFile(UMLClassifier * c, QFile & filetcl) } void -TclWriter::writeCode(const QString &text) +TclWriter::writeCode(const TQString &text) { *mStream << getIndent() << text << m_endl; } void -TclWriter::writeComm(const QString &text) +TclWriter::writeComm(const TQString &text) { - QStringList lines = QStringList::split("\n", text, true); + TQStringList lines = TQStringList::split("\n", text, true); for (uint i = 0; i < lines.count(); i++) { *mStream << getIndent() << "# " << lines[i] << m_endl; } } void -TclWriter::writeDocu(const QString &text) +TclWriter::writeDocu(const TQString &text) { - QStringList lines = QStringList::split("\n", text, true); + TQStringList lines = TQStringList::split("\n", text, true); for (uint i = 0; i < lines.count(); i++) { *mStream << getIndent() << "## " << lines[i] << m_endl; } @@ -392,7 +392,7 @@ TclWriter::writeDocu(const QString &text) // in self-association relationship). void TclWriter::writeAssociationIncl(UMLAssociationList list, Uml::IDType myId, - const QString &type) + const TQString &type) { for (UMLAssociation * a = list.first(); a; a = list.next()) { UMLClassifier *classifier = NULL; @@ -422,7 +422,7 @@ TclWriter::writeAssociationIncl(UMLAssociationList list, Uml::IDType myId, void TclWriter::writeUse(UMLClassifier * c) { - QString myNs; + TQString myNs; if (!c->getPackage().isEmpty()) { myNs = cleanName(c->getPackage()); @@ -492,8 +492,8 @@ TclWriter::writeAttributeDecl(Uml::Visibility visibility, bool writeStatic) if (classifierInfo->isInterface) return; - QString scope = visibility.toString(); - QString type; + TQString scope = visibility.toString(); + TQString type; if (writeStatic) { type = "common"; } else { @@ -531,11 +531,11 @@ TclWriter::writeAttributeDecl(Uml::Visibility visibility, bool writeStatic) if (list && list->count() > 0) { writeComm(m_endl + scope + ' ' + type + " attributes" + m_endl); // write attrib declarations now - QString documentation; + TQString documentation; for (UMLAttribute * at = list->first(); at; at = list->next()) { documentation = at->getDoc(); - QString varName = cleanName(at->getName()); - QString typeName = fixTypeName(at->getTypeName()); + TQString varName = cleanName(at->getName()); + TQString typeName = fixTypeName(at->getTypeName()); writeDocu(m_endl + "@var " + scope + ' ' + type + ' ' + typeName + ' ' + varName + m_endl + documentation); writeCode(scope + ' ' + type + ' ' + varName + m_endl); @@ -546,7 +546,7 @@ TclWriter::writeAttributeDecl(Uml::Visibility visibility, bool writeStatic) void TclWriter::writeAssociationDecl(UMLAssociationList associations, Uml::Visibility permitScope, Uml::IDType id, - const QString &/*type*/) + const TQString &/*type*/) { if (forceSections() || !associations.isEmpty()) { bool printRoleA = false, printRoleB = false; @@ -565,7 +565,7 @@ TclWriter::writeAssociationDecl(UMLAssociationList associations, // print RoleB decl if (printRoleB && a->getVisibility(Uml::B) == permitScope) { - QString fieldClassName = + TQString fieldClassName = cleanName(getUMLObjectName(a->getObject(Uml::B))); writeAssociationRoleDecl(fieldClassName, a->getRoleName(Uml::B), a->getMulti(Uml::B), a->getRoleDoc(Uml::B), @@ -573,7 +573,7 @@ TclWriter::writeAssociationDecl(UMLAssociationList associations, } // print RoleA decl if (printRoleA && a->getVisibility(Uml::A) == permitScope) { - QString fieldClassName = + TQString fieldClassName = cleanName(getUMLObjectName(a->getObject(Uml::A))); writeAssociationRoleDecl(fieldClassName, a->getRoleName(Uml::A), a->getMulti(Uml::A), a->getRoleDoc(Uml::A), @@ -587,8 +587,8 @@ TclWriter::writeAssociationDecl(UMLAssociationList associations, } void -TclWriter::writeAssociationRoleDecl(const QString &fieldClassName, const QString &roleName, - const QString &multi, const QString &doc, const QString &scope) +TclWriter::writeAssociationRoleDecl(const TQString &fieldClassName, const TQString &roleName, + const TQString &multi, const TQString &doc, const TQString &scope) { // ONLY write out IF there is a rolename given // otherwise its not meant to be declared in the code @@ -599,13 +599,13 @@ TclWriter::writeAssociationRoleDecl(const QString &fieldClassName, const QString // declare the association based on whether it is this a single variable // or a List (Vector). One day this will be done correctly with special // multiplicity object that we don't have to figure out what it means via regex. - if (multi.isEmpty() || multi.contains(QRegExp("^[01]$"))) { - QString fieldVarName = roleName.lower(); + if (multi.isEmpty() || multi.contains(TQRegExp("^[01]$"))) { + TQString fieldVarName = roleName.lower(); // record this for later consideration of initialization IF the // multi value requires 1 of these objects if (ObjectFieldVariables.findIndex(fieldVarName) == -1 && - multi.contains(QRegExp("^1$")) + multi.contains(TQRegExp("^1$")) ) { // ugh. UGLY. Storing variable name and its class in pairs. ObjectFieldVariables.append(fieldVarName); @@ -615,7 +615,7 @@ TclWriter::writeAssociationRoleDecl(const QString &fieldClassName, const QString "> " + fieldVarName + m_endl + doc); writeCode(scope + " variable " + fieldVarName + m_endl); } else { - QString fieldVarName = roleName.lower(); + TQString fieldVarName = roleName.lower(); // record unique occurrences for later when we want to check // for initialization of this vector @@ -642,7 +642,7 @@ TclWriter::writeInitAttributeSource() { // only need to do this under certain conditions if (classifierInfo->hasAttributes) { - QString varName; + TQString varName; writeComm(mClassGlobal + "::initAttributes"); writeCode("body " + mClassGlobal + "::initAttributes {} {"); @@ -657,7 +657,7 @@ TclWriter::writeInitAttributeSource() } } // Now initialize the association related fields (e.g. vectors) - QStringList::Iterator it; + TQStringList::Iterator it; for (it = VectorFieldVariables.begin(); it != VectorFieldVariables.end(); ++it) { varName = *it; @@ -668,7 +668,7 @@ TclWriter::writeInitAttributeSource() it != ObjectFieldVariables.end(); ++it) { varName = *it; it++; - QString fieldClassName = *it; + TQString fieldClassName = *it; writeCode("set " + varName + " [list]"); } // clean up @@ -715,11 +715,11 @@ TclWriter::writeOperationHeader(UMLClassifier * c, Uml::Visibility permitScope) writeComm("Operations"); } for (op = oplist.first(); op; op = oplist.next()) { - QString doc = ""; - QString code = ""; - QString methodReturnType = fixTypeName(op->getTypeName()); - QString name = cleanName(op->getName()); - QString scope = permitScope.toString(); + TQString doc = ""; + TQString code = ""; + TQString methodReturnType = fixTypeName(op->getTypeName()); + TQString name = cleanName(op->getName()); + TQString scope = permitScope.toString(); if (op->getAbstract() || classifierInfo->isInterface) { //TODO declare abstract method as 'virtual' // str += "virtual "; @@ -736,8 +736,8 @@ TclWriter::writeOperationHeader(UMLClassifier * c, Uml::Visibility permitScope) UMLAttributeList atl = op->getParmList(); j = 0; for (at = atl.first(); at; at = atl.next(), j++) { - QString typeName = fixTypeName(at->getTypeName()); - QString atName = cleanName(at->getName()); + TQString typeName = fixTypeName(at->getTypeName()); + TQString atName = cleanName(at->getName()); if (at->getInitialValue().isEmpty()) { doc += "@param " + typeName + ' ' + atName + m_endl + at->getDoc() + @@ -790,9 +790,9 @@ TclWriter::writeOperationSource(UMLClassifier * c, Uml::Visibility permitScope) // generate source for each operation given for (op = oplist.first(); op; op = oplist.next()) { - QString code = ""; - QString methodReturnType = fixTypeName(op->getTypeName()); - QString name; + TQString code = ""; + TQString methodReturnType = fixTypeName(op->getTypeName()); + TQString name; // no code needed if (op->getAbstract() || classifierInfo->isInterface) { continue; @@ -804,7 +804,7 @@ TclWriter::writeOperationSource(UMLClassifier * c, Uml::Visibility permitScope) UMLAttributeList atl = op->getParmList(); j = 0; for (at = atl.first(); at; at = atl.next(), j++) { - QString atName = cleanName(at->getName()); + TQString atName = cleanName(at->getName()); if (at->getInitialValue().isEmpty()) { code += ' ' + atName; } else { @@ -829,7 +829,7 @@ TclWriter::writeAttributeSource() UMLAttributeList *list = &(classifierInfo->atpub); UMLAttribute *at; for (at = list->first(); at; at = list->next()) { - QString name = mClassGlobal + "::" + cleanName(at->getName()); + TQString name = mClassGlobal + "::" + cleanName(at->getName()); writeComm(name); writeCode("configbody " + name + " {} {" + m_endl + '}' + m_endl); @@ -858,14 +858,14 @@ TclWriter::writeAssociationSource(UMLAssociationList associations, // print RoleB source if (printRoleB && a->getVisibility(Uml::B) == Uml::Visibility::Public) { - QString fieldClassName = + TQString fieldClassName = cleanName(getUMLObjectName(a->getObject(Uml::B))); writeAssociationRoleSource(fieldClassName, a->getRoleName(Uml::B), a->getMulti(Uml::B)); } // print RoleA source if (printRoleA && a->getVisibility(Uml::A) == Uml::Visibility::Public) { - QString fieldClassName = + TQString fieldClassName = cleanName(getUMLObjectName(a->getObject(Uml::A))); writeAssociationRoleSource(fieldClassName, a->getRoleName(Uml::A), a->getMulti(Uml::A)); @@ -877,8 +877,8 @@ TclWriter::writeAssociationSource(UMLAssociationList associations, } void -TclWriter::writeAssociationRoleSource(const QString &fieldClassName, - const QString &roleName, const QString &multi) +TclWriter::writeAssociationRoleSource(const TQString &fieldClassName, + const TQString &roleName, const TQString &multi) { // ONLY write out IF there is a rolename given // otherwise its not meant to be declared in the code @@ -888,8 +888,8 @@ TclWriter::writeAssociationRoleSource(const QString &fieldClassName, // declare the association based on whether it is this a single variable // or a List (Vector). One day this will be done correctly with special // multiplicity object that we don't have to figure out what it means via regex. - if (multi.isEmpty() || multi.contains(QRegExp("^[01]$"))) { - QString fieldVarName = roleName.lower(); + if (multi.isEmpty() || multi.contains(TQRegExp("^[01]$"))) { + TQString fieldVarName = roleName.lower(); writeCode("configbody " + mClassGlobal + "::" + fieldVarName + " {} {"); m_indentLevel++; @@ -902,7 +902,7 @@ TclWriter::writeAssociationRoleSource(const QString &fieldClassName, m_indentLevel--; } else { - QString fieldVarName = roleName.lower(); + TQString fieldVarName = roleName.lower(); writeCode("configbody " + mClassGlobal + "::" + fieldVarName + " {} {"); m_indentLevel++; @@ -922,7 +922,7 @@ TclWriter::writeAssociationRoleSource(const QString &fieldClassName, } QString -TclWriter::fixTypeName(const QString &string) +TclWriter::fixTypeName(const TQString &string) { if (string.isEmpty()) return "void"; @@ -933,13 +933,13 @@ TclWriter::fixTypeName(const QString &string) QString TclWriter::getUMLObjectName(UMLObject * obj) { - return (obj != 0) ? obj->getName() : QString("NULL"); + return (obj != 0) ? obj->getName() : TQString("NULL"); } const QStringList TclWriter::reservedKeywords() const { - static QStringList keywords; + static TQStringList keywords; if (keywords.isEmpty()) { diff --git a/umbrello/umbrello/codegenerators/tclwriter.h b/umbrello/umbrello/codegenerators/tclwriter.h index 0c4d71c5..eac918bb 100644 --- a/umbrello/umbrello/codegenerators/tclwriter.h +++ b/umbrello/umbrello/codegenerators/tclwriter.h @@ -19,7 +19,7 @@ #ifndef TCLWRITER_H #define TCLWRITER_H -#include <qstringlist.h> +#include <tqstringlist.h> #include "simplecodegenerator.h" #include "../umloperationlist.h" #include "../umlattributelist.h" @@ -63,37 +63,37 @@ public: /** * get list of reserved keywords */ - virtual const QStringList reservedKeywords() const; + virtual const TQStringList reservedKeywords() const; private: /** * Current output stream. */ - QTextStream * mStream; + TQTextStream * mStream; /** * write the header file for this classifier. */ - void writeHeaderFile(UMLClassifier * c, QFile & file); + void writeHeaderFile(UMLClassifier * c, TQFile & file); /** * write the source code body file for this classifier. */ - void writeSourceFile(UMLClassifier * c, QFile & file); + void writeSourceFile(UMLClassifier * c, TQFile & file); /** * write the source codei text. */ - void writeCode(const QString &text); + void writeCode(const TQString &text); /** * write comment text. */ - void writeComm(const QString &text); + void writeComm(const TQString &text); /** * write documentation text. */ - void writeDocu(const QString &text); + void writeDocu(const TQString &text); void writeConstructorDecl(); @@ -103,9 +103,9 @@ private: * Summary information about current classifier. */ ClassifierInfo *classifierInfo; - QString mNamespace; - QString mClass; - QString mClassGlobal; + TQString mNamespace; + TQString mClass; + TQString mClassGlobal; /** * writes the Attribute declarations @@ -116,19 +116,19 @@ private: void writeAttributeDecl(Uml::Visibility visibility, bool writeStatic); void writeAssociationIncl(UMLAssociationList list, - Uml::IDType myId, const QString &type); + Uml::IDType myId, const TQString &type); /** * Searches a list of associations for appropriate ones to write out as attributes */ void writeAssociationDecl(UMLAssociationList associations, Uml::Visibility permit, Uml::IDType id, - const QString &type); + const TQString &type); /** * Writes out an association as an attribute using Vector */ - void writeAssociationRoleDecl(const QString &fieldClassName, - const QString &roleName, const QString &multi, const QString &doc, const QString &docname); + void writeAssociationRoleDecl(const TQString &fieldClassName, + const TQString &roleName, const TQString &multi, const TQString &doc, const TQString &docname); /** * If needed, write out the declaration for the method to initialize attributes of our class. @@ -147,9 +147,9 @@ private: void writeAttributeSource(); void writeAssociationSource(UMLAssociationList associations, Uml::IDType id); - void writeAssociationRoleSource(const QString &fieldClassName, - const QString &roleName, - const QString &multi); + void writeAssociationRoleSource(const TQString &fieldClassName, + const TQString &roleName, + const TQString &multi); void writeUse(UMLClassifier * c); @@ -157,15 +157,15 @@ private: /** * Returns the name of the given object (if it exists) */ - QString getUMLObjectName(UMLObject * obj); + TQString getUMLObjectName(UMLObject * obj); /** * Replaces `string' with STRING_TYPENAME. */ - QString fixTypeName(const QString &string); + TQString fixTypeName(const TQString &string); - QStringList ObjectFieldVariables; - QStringList VectorFieldVariables; + TQStringList ObjectFieldVariables; + TQStringList VectorFieldVariables; }; diff --git a/umbrello/umbrello/codegenerators/xmlcodecomment.cpp b/umbrello/umbrello/codegenerators/xmlcodecomment.cpp index 5f44620b..8d3a6893 100644 --- a/umbrello/umbrello/codegenerators/xmlcodecomment.cpp +++ b/umbrello/umbrello/codegenerators/xmlcodecomment.cpp @@ -21,7 +21,7 @@ // Constructors/Destructors // -XMLCodeComment::XMLCodeComment ( CodeDocument * doc, const QString & text ) +XMLCodeComment::XMLCodeComment ( CodeDocument * doc, const TQString & text ) : CodeComment (doc, text) { @@ -43,17 +43,17 @@ XMLCodeComment::~XMLCodeComment ( ) { } /** * @return QString */ -QString XMLCodeComment::toString ( ) +TQString XMLCodeComment::toString ( ) { - QString output = ""; + TQString output = ""; // simple output method if(getWriteOutText()) { - QString indent = getIndentationString(); - QString endLine = getNewLineEndingChars(); - QString body = getText(); + TQString indent = getIndentationString(); + TQString endLine = getNewLineEndingChars(); + TQString body = getText(); output.append(indent+"<!-- "); if(!body.isEmpty()) output.append(formatMultiLineText (body, indent, endLine)); diff --git a/umbrello/umbrello/codegenerators/xmlcodecomment.h b/umbrello/umbrello/codegenerators/xmlcodecomment.h index a30bcbab..e3f55ccc 100644 --- a/umbrello/umbrello/codegenerators/xmlcodecomment.h +++ b/umbrello/umbrello/codegenerators/xmlcodecomment.h @@ -18,7 +18,7 @@ #ifndef XMLCODECOMMENT_H #define XMLCODECOMMENT_H -#include <qstring.h> +#include <tqstring.h> #include "../codecomment.h" class CodeDocument; @@ -40,7 +40,7 @@ public: /** * Constructors */ - explicit XMLCodeComment ( CodeDocument * doc, const QString & text = "" ); + explicit XMLCodeComment ( CodeDocument * doc, const TQString & text = "" ); /** * Empty Destructor @@ -56,7 +56,7 @@ public: /** * @return QString */ - QString toString ( ); + TQString toString ( ); protected: diff --git a/umbrello/umbrello/codegenerators/xmlelementcodeblock.cpp b/umbrello/umbrello/codegenerators/xmlelementcodeblock.cpp index 7e702619..6a068113 100644 --- a/umbrello/umbrello/codegenerators/xmlelementcodeblock.cpp +++ b/umbrello/umbrello/codegenerators/xmlelementcodeblock.cpp @@ -29,7 +29,7 @@ // Constructors/Destructors // -XMLElementCodeBlock::XMLElementCodeBlock ( CodeDocument * parentDoc, const QString & nodeName, const QString & comment) +XMLElementCodeBlock::XMLElementCodeBlock ( CodeDocument * parentDoc, const TQString & nodeName, const TQString & comment) : HierarchicalCodeBlock(parentDoc) { init(parentDoc, nodeName, comment); @@ -44,8 +44,8 @@ XMLElementCodeBlock::~XMLElementCodeBlock ( ) { } /** * Save the XMI representation of this object */ -void XMLElementCodeBlock::saveToXMI ( QDomDocument & doc, QDomElement & root ) { - QDomElement blockElement = doc.createElement( "xmlelementblock" ); +void XMLElementCodeBlock::saveToXMI ( TQDomDocument & doc, TQDomElement & root ) { + TQDomElement blockElement = doc.createElement( "xmlelementblock" ); setAttributesOnNode(doc, blockElement); @@ -55,7 +55,7 @@ void XMLElementCodeBlock::saveToXMI ( QDomDocument & doc, QDomElement & root ) { /** * load params from the appropriate XMI element node. */ -void XMLElementCodeBlock::loadFromXMI ( QDomElement & root ) +void XMLElementCodeBlock::loadFromXMI ( TQDomElement & root ) { setAttributesFromNode(root); } @@ -63,7 +63,7 @@ void XMLElementCodeBlock::loadFromXMI ( QDomElement & root ) /** set attributes of the node that represents this class * in the XMI document. */ -void XMLElementCodeBlock::setAttributesOnNode ( QDomDocument & doc, QDomElement & docElement) +void XMLElementCodeBlock::setAttributesOnNode ( TQDomDocument & doc, TQDomElement & docElement) { // superclass call @@ -77,7 +77,7 @@ void XMLElementCodeBlock::setAttributesOnNode ( QDomDocument & doc, QDomElement /** set the class attributes of this object from * the passed element node. */ -void XMLElementCodeBlock::setAttributesFromNode ( QDomElement & root) { +void XMLElementCodeBlock::setAttributesFromNode ( TQDomElement & root) { // superclass call HierarchicalCodeBlock::setAttributesFromNode(root); @@ -90,11 +90,11 @@ void XMLElementCodeBlock::setAttributesFromNode ( QDomElement & root) { // Accessor methods // -void XMLElementCodeBlock::setNodeName (const QString &name) { +void XMLElementCodeBlock::setNodeName (const TQString &name) { m_nodeName = name; } -QString XMLElementCodeBlock::getNodeName () { +TQString XMLElementCodeBlock::getNodeName () { return m_nodeName; } @@ -116,13 +116,13 @@ UMLAttributeList * XMLElementCodeBlock::getAttributeList() { void XMLElementCodeBlock::updateContent ( ) { - QString endLine = getNewLineEndingChars(); + TQString endLine = getNewLineEndingChars(); - QString nodeName = getNodeName(); + TQString nodeName = getNodeName(); // Now update START/ENDING Text - QString startText = '<' + nodeName; - QString endText = ""; + TQString startText = '<' + nodeName; + TQString endText = ""; UMLAttributeList * alist = getAttributeList(); for (UMLAttribute *at = alist->first(); at; at=alist->next()) @@ -150,7 +150,7 @@ void XMLElementCodeBlock::updateContent ( ) } -void XMLElementCodeBlock::init (CodeDocument *parentDoc, const QString &nodeName, const QString &comment) +void XMLElementCodeBlock::init (CodeDocument *parentDoc, const TQString &nodeName, const TQString &comment) { setComment(new XMLCodeComment(parentDoc)); diff --git a/umbrello/umbrello/codegenerators/xmlelementcodeblock.h b/umbrello/umbrello/codegenerators/xmlelementcodeblock.h index b0acd277..334cac17 100644 --- a/umbrello/umbrello/codegenerators/xmlelementcodeblock.h +++ b/umbrello/umbrello/codegenerators/xmlelementcodeblock.h @@ -17,7 +17,7 @@ #ifndef XMLELEMENTCODEBLOCK_H #define XMLELEMENTCODEBLOCK_H -#include <qstring.h> +#include <tqstring.h> #include "../umlattributelist.h" #include "../hierarchicalcodeblock.h" @@ -36,7 +36,7 @@ public: /** * Empty Constructor */ - XMLElementCodeBlock ( CodeDocument * parentDoc, const QString & nodeName, const QString & comment = ""); + XMLElementCodeBlock ( CodeDocument * parentDoc, const TQString & nodeName, const TQString & comment = ""); /** * Empty Destructor @@ -46,17 +46,17 @@ public: /** * Save the XMI representation of this object */ - virtual void saveToXMI ( QDomDocument & doc, QDomElement & root ); + virtual void saveToXMI ( TQDomDocument & doc, TQDomElement & root ); /** * load params from the appropriate XMI element node. */ - virtual void loadFromXMI ( QDomElement & root ); + virtual void loadFromXMI ( TQDomElement & root ); virtual UMLAttributeList * getAttributeList(); - virtual void setNodeName (const QString &name); - virtual QString getNodeName (); + virtual void setNodeName (const TQString &name); + virtual TQString getNodeName (); void addAttribute (UMLAttribute * at); @@ -65,12 +65,12 @@ protected: /** set attributes of the node that represents this class * in the XMI document. */ - virtual void setAttributesOnNode ( QDomDocument & doc, QDomElement & blockElement); + virtual void setAttributesOnNode ( TQDomDocument & doc, TQDomElement & blockElement); /** set the class attributes of this object from * the passed element node. */ - virtual void setAttributesFromNode ( QDomElement & element); + virtual void setAttributesFromNode ( TQDomElement & element); /** * Update the start/end text of this codeblock. @@ -80,8 +80,8 @@ protected: private: UMLAttributeList m_attList; - QString m_nodeName; - void init (CodeDocument * parent, const QString &nodeName, const QString &comment); + TQString m_nodeName; + void init (CodeDocument * parent, const TQString &nodeName, const TQString &comment); }; diff --git a/umbrello/umbrello/codegenerators/xmlschemawriter.cpp b/umbrello/umbrello/codegenerators/xmlschemawriter.cpp index 303d3230..8c043a3e 100644 --- a/umbrello/umbrello/codegenerators/xmlschemawriter.cpp +++ b/umbrello/umbrello/codegenerators/xmlschemawriter.cpp @@ -18,9 +18,9 @@ #include <klocale.h> #include <kmessagebox.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqregexp.h> #include "../umldoc.h" #include "../classifier.h" @@ -58,7 +58,7 @@ void XMLSchemaWriter::writeClass(UMLClassifier *c) } // find an appropriate name for our file - QString fileName = findFileName(c,".xsd"); + TQString fileName = findFileName(c,".xsd"); if (fileName.isEmpty()) { emit codeGenerated(c, false); @@ -66,13 +66,13 @@ void XMLSchemaWriter::writeClass(UMLClassifier *c) } // check that we may open that file for writing - QFile file; + TQFile file; if ( !openFile(file, fileName) ) { emit codeGenerated(c, false); return; } - QTextStream XMLschema(&file); + TQTextStream XMLschema(&file); // set package namespace tag appropriately if(!c->getPackage().isEmpty()) @@ -85,10 +85,10 @@ void XMLSchemaWriter::writeClass(UMLClassifier *c) XMLschema<<"<?xml version=\"1.0\"?>"<<m_endl; // 1. create the header - QString headerText = getHeadingFile(".xsd"); + TQString headerText = getHeadingFile(".xsd"); if(!headerText.isEmpty()) { - headerText.replace(QRegExp("%filename%"),fileName); - headerText.replace(QRegExp("%filepath%"),file.name()); + headerText.replace(TQRegExp("%filename%"),fileName); + headerText.replace(TQRegExp("%filepath%"),file.name()); } if(!headerText.isEmpty()) XMLschema<<headerText<<m_endl; @@ -141,7 +141,7 @@ void XMLSchemaWriter::writeClass(UMLClassifier *c) writtenClassifiers.clear(); } -void XMLSchemaWriter::writeElementDecl( const QString &elementName, const QString &elementTypeName, QTextStream &XMLschema) +void XMLSchemaWriter::writeElementDecl( const TQString &elementName, const TQString &elementTypeName, TQTextStream &XMLschema) { if(forceDoc()) writeComment(elementName+" is the root element, declared here.", XMLschema); @@ -153,7 +153,7 @@ void XMLSchemaWriter::writeElementDecl( const QString &elementName, const QStrin } -void XMLSchemaWriter::writeClassifier (UMLClassifier *c, QTextStream &XMLschema) +void XMLSchemaWriter::writeClassifier (UMLClassifier *c, TQTextStream &XMLschema) { // NO doing this 2 or more times. @@ -209,7 +209,7 @@ UMLAttributeList XMLSchemaWriter::findAttributes (UMLClassifier *c) // element use the interface in element aggregation) // -void XMLSchemaWriter::writeAbstractClassifier (UMLClassifier *c, QTextStream &XMLschema) +void XMLSchemaWriter::writeAbstractClassifier (UMLClassifier *c, TQTextStream &XMLschema) { // preparations @@ -226,9 +226,9 @@ void XMLSchemaWriter::writeAbstractClassifier (UMLClassifier *c, QTextStream &XM if(subclasses.count() > 0) { - QString elementName = getElementName(c); + TQString elementName = getElementName(c); UMLAttributeList attribs = findAttributes(c); - QStringList attribGroups = findAttributeGroups(c); + TQStringList attribGroups = findAttributeGroups(c); writeAttributeGroupDecl(elementName, attribs, XMLschema); @@ -245,11 +245,11 @@ void XMLSchemaWriter::writeAbstractClassifier (UMLClassifier *c, QTextStream &XM void XMLSchemaWriter::writeGroupClassifierDecl (UMLClassifier *c, UMLClassifierList subclasses, - QTextStream &XMLschema) + TQTextStream &XMLschema) { // name of class, subclassing classifiers - QString elementTypeName = getElementGroupTypeName(c); + TQString elementTypeName = getElementGroupTypeName(c); // start Writing node but only if it has subclasses? Nah..right now put in empty group XMLschema<<getIndent()<<"<"<<makeSchemaTag("group")<<" name=\""<<elementTypeName<<"\">"<<m_endl; @@ -277,7 +277,7 @@ void XMLSchemaWriter::writeComplexTypeClassifierDecl (UMLClassifier *c, UMLAssociationList aggregations, UMLAssociationList compositions, UMLClassifierList superclasses, - QTextStream &XMLschema) + TQTextStream &XMLschema) { // Preparations @@ -285,7 +285,7 @@ void XMLSchemaWriter::writeComplexTypeClassifierDecl (UMLClassifier *c, // sort attributes by Scope UMLAttributeList attribs = findAttributes(c); - QStringList attribGroups = findAttributeGroups(c); + TQStringList attribGroups = findAttributeGroups(c); // test for relevant associations bool hasAssociations = determineIfHasChildNodes(c); @@ -295,7 +295,7 @@ void XMLSchemaWriter::writeComplexTypeClassifierDecl (UMLClassifier *c, // START WRITING // start body of element - QString elementTypeName = getElementTypeName(c); + TQString elementTypeName = getElementTypeName(c); XMLschema<<getIndent()<<"<"<<makeSchemaTag("complexType")<<" name=\""<<elementTypeName<<"\""; @@ -308,7 +308,7 @@ void XMLSchemaWriter::writeComplexTypeClassifierDecl (UMLClassifier *c, if(hasSuperclass) { - QString superClassName = getElementTypeName(superclasses.first()); + TQString superClassName = getElementTypeName(superclasses.first()); XMLschema<<getIndent()<<"<"<<makeSchemaTag("complexContent")<<">"<<m_endl; //PROBLEM: we only treat ONE superclass for inheritence.. bah. @@ -368,7 +368,7 @@ void XMLSchemaWriter::writeComplexTypeClassifierDecl (UMLClassifier *c, } -void XMLSchemaWriter::writeConcreteClassifier (UMLClassifier *c, QTextStream &XMLschema) +void XMLSchemaWriter::writeConcreteClassifier (UMLClassifier *c, TQTextStream &XMLschema) { // preparations.. gather information about this classifier @@ -400,11 +400,11 @@ void XMLSchemaWriter::writeConcreteClassifier (UMLClassifier *c, QTextStream &XM } // these exist for abstract classes only (which become xs:group nodes) -QStringList XMLSchemaWriter::findAttributeGroups (UMLClassifier *c) +TQStringList XMLSchemaWriter::findAttributeGroups (UMLClassifier *c) { // we need to look for any class we inherit from. IF these // have attributes, then we need to notice - QStringList list; + TQStringList list; UMLClassifierList superclasses = c->findSuperClassConcepts(); // list of what inherits from us for(UMLClassifier *classifier = superclasses.first(); classifier; classifier = superclasses.next()) { @@ -432,7 +432,7 @@ bool XMLSchemaWriter::determineIfHasChildNodes( UMLClassifier *c) void XMLSchemaWriter::writeChildObjsInAssociation (UMLClassifier *c, UMLAssociationList assoc, - QTextStream &XMLschema) + TQTextStream &XMLschema) { UMLObjectList list = findChildObjsInAssociations (c, assoc); @@ -455,7 +455,7 @@ void XMLSchemaWriter::markAsWritten(UMLClassifier *c) { writtenClassifiers.append(c); } -void XMLSchemaWriter::writeAttributeDecls(UMLAttributeList &attribs, QTextStream &XMLschema ) +void XMLSchemaWriter::writeAttributeDecls(UMLAttributeList &attribs, TQTextStream &XMLschema ) { UMLAttribute *at; @@ -466,13 +466,13 @@ void XMLSchemaWriter::writeAttributeDecls(UMLAttributeList &attribs, QTextStream } -void XMLSchemaWriter::writeAttributeDecl(UMLAttribute *attrib, QTextStream &XMLschema ) +void XMLSchemaWriter::writeAttributeDecl(UMLAttribute *attrib, TQTextStream &XMLschema ) { - QString documentation = attrib->getDoc(); - QString typeName = fixTypeName(attrib->getTypeName()); + TQString documentation = attrib->getDoc(); + TQString typeName = fixTypeName(attrib->getTypeName()); bool isStatic = attrib->getStatic(); - QString initialValue = fixInitialStringDeclValue(attrib->getInitialValue(), typeName); + TQString initialValue = fixInitialStringDeclValue(attrib->getInitialValue(), typeName); if(!documentation.isEmpty()) writeComment(documentation, XMLschema); @@ -497,7 +497,7 @@ void XMLSchemaWriter::writeAttributeDecl(UMLAttribute *attrib, QTextStream &XMLs } -void XMLSchemaWriter::writeAttributeGroupDecl (const QString &elementName, UMLAttributeList &attribs, QTextStream &XMLschema ) +void XMLSchemaWriter::writeAttributeGroupDecl (const TQString &elementName, UMLAttributeList &attribs, TQTextStream &XMLschema ) { if (attribs.count()> 0) { @@ -522,16 +522,16 @@ void XMLSchemaWriter::writeAttributeGroupDecl (const QString &elementName, UMLAt } } -void XMLSchemaWriter::writeComment( const QString &comment, QTextStream &XMLschema ) +void XMLSchemaWriter::writeComment( const TQString &comment, TQTextStream &XMLschema ) { // in the case we have several line comment.. // NOTE: this part of the method has the problem of adopting UNIX newline, // need to resolve for using with MAC/WinDoze eventually I assume - QString indent = getIndent(); + TQString indent = getIndent(); XMLschema<<indent<<"<!-- "; - if (comment.contains(QRegExp("\n"))) { + if (comment.contains(TQRegExp("\n"))) { XMLschema<<m_endl; - QStringList lines = QStringList::split( "\n", comment); + TQStringList lines = TQStringList::split( "\n", comment); for(uint i= 0; i < lines.count(); i++) XMLschema<<indent<<" "<<lines[i]<<m_endl; @@ -550,7 +550,7 @@ void XMLSchemaWriter::writeComment( const QString &comment, QTextStream &XMLsche // badly for someone using a plain association between 2 different classes. THAT should // be done, but isnt yet (this is why I have left role b code in for now). -b.t. bool XMLSchemaWriter::writeAssociationDecls(UMLAssociationList associations, - bool noRoleNameOK, bool didFirstOne, Uml::IDType id, QTextStream &XMLschema) + bool noRoleNameOK, bool didFirstOne, Uml::IDType id, TQTextStream &XMLschema) { if( !associations.isEmpty() ) @@ -637,14 +637,14 @@ UMLObjectList XMLSchemaWriter::findChildObjsInAssociations (UMLClassifier *c, UM return list; } -void XMLSchemaWriter::writeAssociationRoleDecl( UMLClassifier *c, const QString &multi, QTextStream &XMLschema) +void XMLSchemaWriter::writeAssociationRoleDecl( UMLClassifier *c, const TQString &multi, TQTextStream &XMLschema) { bool isAbstract = c->getAbstract(); bool isInterface = c->isInterface(); - QString elementName = getElementName(c); - QString doc = c->getDoc(); + TQString elementName = getElementName(c); + TQString doc = c->getDoc(); if (!doc.isEmpty()) writeComment(doc, XMLschema); @@ -653,8 +653,8 @@ void XMLSchemaWriter::writeAssociationRoleDecl( UMLClassifier *c, const QString // Min/Max Occurs is based on whether it is this a single element // or a List (maxoccurs>1). One day this will be done correctly with special // multiplicity object that we don't have to figure out what it means via regex. - QString minOccurs = "0"; - QString maxOccurs = "unbounded"; + TQString minOccurs = "0"; + TQString maxOccurs = "unbounded"; if (multi.isEmpty()) { // in this case, association will only specify ONE element can exist @@ -664,7 +664,7 @@ void XMLSchemaWriter::writeAssociationRoleDecl( UMLClassifier *c, const QString } else { - QStringList values = QStringList::split( QRegExp("[^\\d{1,}|\\*]"), multi); + TQStringList values = TQStringList::split( TQRegExp("[^\\d{1,}|\\*]"), multi); // could use some improvement here.. for sequences like "0..1,3..5,10" we // don't capture the whole "richness" of the multi. Instead we translate it @@ -673,10 +673,10 @@ void XMLSchemaWriter::writeAssociationRoleDecl( UMLClassifier *c, const QString { // populate both with the actual value as long as our value isnt an asterix // In that case, use special value (from above) - if(values[0].contains(QRegExp("\\d{1,}"))) + if(values[0].contains(TQRegExp("\\d{1,}"))) minOccurs = values[0]; // use first number in sequence - if(values[values.count()-1].contains(QRegExp("\\d{1,}"))) + if(values[values.count()-1].contains(TQRegExp("\\d{1,}"))) maxOccurs = values[values.count()-1]; // use only last number in sequence } } @@ -734,14 +734,14 @@ void XMLSchemaWriter::writeAssociationRoleDecl( UMLClassifier *c, const QString // IF the type is "string" we need to declare it as // the XMLSchema Object "String" (there is no string primative in XMLSchema). // Same thing again for "bool" to "boolean" -QString XMLSchemaWriter::fixTypeName(const QString& string) +TQString XMLSchemaWriter::fixTypeName(const TQString& string) { - // string.replace(QRegExp("^string$"),schemaNamespaceTag+":string"); - // string.replace(QRegExp("^bool$"),schemaNamespaceTag+":boolean"); + // string.replace(TQRegExp("^string$"),schemaNamespaceTag+":string"); + // string.replace(TQRegExp("^bool$"),schemaNamespaceTag+":boolean"); return schemaNamespaceTag + ':' + string; } -QString XMLSchemaWriter::fixInitialStringDeclValue(QString value, const QString &type) +TQString XMLSchemaWriter::fixInitialStringDeclValue(TQString value, const TQString &type) { // check for strings only if (!value.isEmpty() && type == "xs:string") { @@ -753,36 +753,36 @@ QString XMLSchemaWriter::fixInitialStringDeclValue(QString value, const QString return value; } -QString XMLSchemaWriter::getElementName(UMLClassifier *c) +TQString XMLSchemaWriter::getElementName(UMLClassifier *c) { return cleanName(c->getName()); } -QString XMLSchemaWriter::getElementTypeName(UMLClassifier *c) +TQString XMLSchemaWriter::getElementTypeName(UMLClassifier *c) { - QString elementName = getElementName(c); + TQString elementName = getElementName(c); return elementName + "ComplexType"; } -QString XMLSchemaWriter::getElementGroupTypeName(UMLClassifier *c) +TQString XMLSchemaWriter::getElementGroupTypeName(UMLClassifier *c) { - QString elementName = getElementName(c); + TQString elementName = getElementName(c); return elementName + "GroupType"; } -QString XMLSchemaWriter::makePackageTag (QString tagName) { +TQString XMLSchemaWriter::makePackageTag (TQString tagName) { tagName.prepend( packageNamespaceTag + ':'); return tagName; } -QString XMLSchemaWriter::makeSchemaTag (QString tagName) { +TQString XMLSchemaWriter::makeSchemaTag (TQString tagName) { tagName.prepend( schemaNamespaceTag + ':'); return tagName; } -const QStringList XMLSchemaWriter::reservedKeywords() const { +const TQStringList XMLSchemaWriter::reservedKeywords() const { - static QStringList keywords; + static TQStringList keywords; if (keywords.isEmpty()) { keywords << "ATTLIST" diff --git a/umbrello/umbrello/codegenerators/xmlschemawriter.h b/umbrello/umbrello/codegenerators/xmlschemawriter.h index caf9f906..95210078 100644 --- a/umbrello/umbrello/codegenerators/xmlschemawriter.h +++ b/umbrello/umbrello/codegenerators/xmlschemawriter.h @@ -64,16 +64,16 @@ public: /** * get list of reserved keywords */ - virtual const QStringList reservedKeywords() const; + virtual const TQStringList reservedKeywords() const; private: /** * Writes concept's documentation then guts */ - void writeClassifier(UMLClassifier *c, QTextStream &XMLSchema); - void writeAbstractClassifier(UMLClassifier *c, QTextStream &XMLSchema); - void writeConcreteClassifier(UMLClassifier *c, QTextStream &XMLSchema); + void writeClassifier(UMLClassifier *c, TQTextStream &XMLSchema); + void writeAbstractClassifier(UMLClassifier *c, TQTextStream &XMLSchema); + void writeConcreteClassifier(UMLClassifier *c, TQTextStream &XMLSchema); /** * write a <complexType> declaration for this classifier @@ -83,7 +83,7 @@ private: UMLAssociationList aggregations, UMLAssociationList compositions, UMLClassifierList superclassifiers, - QTextStream &XMLSchema); + TQTextStream &XMLSchema); /** * write a <group> declaration for this classifier. Used for interfaces to classes with @@ -91,7 +91,7 @@ private: */ void writeGroupClassifierDecl(UMLClassifier *c, UMLClassifierList superclassifiers, - QTextStream &XMLSchema); + TQTextStream &XMLSchema); /** * find if the classifier would have any Child elements. @@ -103,24 +103,24 @@ private: * @param c the class for which we are generating code * @param j the stream associated with the output file */ - void writeAttributes(UMLClassifier *c, QTextStream &j); + void writeAttributes(UMLClassifier *c, TQTextStream &j); /** * write an element declaration. */ - void writeElementDecl( const QString &elementName, const QString &elementTypeName, QTextStream &XMLschema); + void writeElementDecl( const TQString &elementName, const TQString &elementTypeName, TQTextStream &XMLschema); /** * writes the Attribute declarations * @param attribs List of attributes * @param XMLschema text stream */ - void writeAttributeDecls(UMLAttributeList &attribs, QTextStream &XMLschema ); + void writeAttributeDecls(UMLAttributeList &attribs, TQTextStream &XMLschema ); /** * write an element attribute. */ - void writeAttributeDecl(UMLAttribute *attrib, QTextStream &XMLschema ); + void writeAttributeDecl(UMLAttribute *attrib, TQTextStream &XMLschema ); /** * Find all attributes for this concept. @@ -131,7 +131,7 @@ private: * Discover the string name of all the attribute groups (which are child nodes) * of this concept (err.. element) */ - QStringList findAttributeGroups (UMLClassifier *c); + TQStringList findAttributeGroups (UMLClassifier *c); /** * Searches a list of associations for appropriate ones to write out as attributes. @@ -139,32 +139,32 @@ private: * not work right for plain associations between 2 different classes. */ bool writeAssociationDecls(UMLAssociationList associations, bool noRoleOK, bool didOne, - Uml::IDType id, QTextStream &XMLschema); + Uml::IDType id, TQTextStream &XMLschema); /** * Find all attributes that belong in group */ - void writeAttributeGroupDecl(const QString &elementName, UMLAttributeList &attribs, QTextStream &XMLschema ); + void writeAttributeGroupDecl(const TQString &elementName, UMLAttributeList &attribs, TQTextStream &XMLschema ); /** * Writes out an association as an attribute using Vector */ - void writeAssociationRoleDecl(UMLClassifier *c, const QString &multi, QTextStream &XMLschema); + void writeAssociationRoleDecl(UMLClassifier *c, const TQString &multi, TQTextStream &XMLschema); /** * Construct an element tag with the schema namespace */ - QString makeSchemaTag ( QString tagName ); + TQString makeSchemaTag ( TQString tagName ); /** * Construct an element tag with the package namespace */ - QString makePackageTag ( QString tagName ); + TQString makePackageTag ( TQString tagName ); /** * Writes a comment */ - void writeComment(const QString &text, QTextStream &XMLschema); + void writeComment(const TQString &text, TQTextStream &XMLschema); /** * Find and return a list of child UMLObjects pointed to by the associations @@ -175,35 +175,35 @@ private: /** * Replaces `string' with `String' and `bool' with `boolean' */ - QString fixTypeName(const QString& string); + TQString fixTypeName(const TQString& string); /** * check that initial values of strings DONT have quotes around them * (we get double quoting then!! */ - QString fixInitialStringDeclValue( QString value, const QString &type); + TQString fixInitialStringDeclValue( TQString value, const TQString &type); /** * Find the element node name for this concept. */ - QString getElementName(UMLClassifier *c); + TQString getElementName(UMLClassifier *c); /** * Find the element node "type" name. Used in the "complexType" which * might define that element node. */ - QString getElementTypeName(UMLClassifier *c); + TQString getElementTypeName(UMLClassifier *c); /** * Find the group node "type" name. Used for elements which define an interface/are abstract. */ - QString getElementGroupTypeName(UMLClassifier *c); + TQString getElementGroupTypeName(UMLClassifier *c); /** * Find all the child objects in this association and make sure they get * written out (if they havent already been) */ - void writeChildObjsInAssociation (UMLClassifier *c, UMLAssociationList assoc, QTextStream &s); + void writeChildObjsInAssociation (UMLClassifier *c, UMLAssociationList assoc, TQTextStream &s); /** * Quick check to see if we have written the declaration for this concept yet. @@ -218,27 +218,27 @@ private: /** * The basic schemaNamespace tag */ - QString schemaNamespaceTag; + TQString schemaNamespaceTag; /** * The basic schemaNamespace tag */ - QString packageNamespaceTag; + TQString packageNamespaceTag; /* * The basic schemaNamespace URI */ - QString schemaNamespaceURI; + TQString schemaNamespaceURI; /** * The basic schemaNamespace URI */ - QString packageNamespaceURI; + TQString packageNamespaceURI; /** * A \n, used at the end of each line */ - QString startline; + TQString startline; /** * a list of UMLClassifiers we have already written |