diff options
Diffstat (limited to 'umbrello/umbrello/codegenerators/rubycodeoperation.cpp')
-rw-r--r-- | umbrello/umbrello/codegenerators/rubycodeoperation.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
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; |