summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/codedocument.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:51:49 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:51:49 +0000
commit4ae0c208b66e0f7954e194384464fe2d0a2c56dd (patch)
treeb0a7cd1c184f0003c0292eb416ed27f674f9cc43 /umbrello/umbrello/codedocument.cpp
parent1964ea0fb4ab57493ca2ebb709c8d3b5395fd653 (diff)
downloadtdesdk-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/codedocument.cpp')
-rw-r--r--umbrello/umbrello/codedocument.cpp96
1 files changed, 48 insertions, 48 deletions
diff --git a/umbrello/umbrello/codedocument.cpp b/umbrello/umbrello/codedocument.cpp
index e0bf0e73..f6092f09 100644
--- a/umbrello/umbrello/codedocument.cpp
+++ b/umbrello/umbrello/codedocument.cpp
@@ -18,8 +18,8 @@
#include "codedocument.h"
// qt/kde includes
-#include <qregexp.h>
-#include <qdatetime.h>
+#include <tqregexp.h>
+#include <tqdatetime.h>
#include <kdebug.h>
// local includes
@@ -63,7 +63,7 @@ CodeDocument::~CodeDocument ( ) {
* Set the value of m_filename
* @param new_var the new value of m_filename
*/
-void CodeDocument::setFileName ( const QString &new_var ) {
+void CodeDocument::setFileName ( const TQString &new_var ) {
m_filename = new_var;
}
@@ -71,7 +71,7 @@ void CodeDocument::setFileName ( const QString &new_var ) {
* Get the value of m_filename
* @return the value of m_filename
*/
-QString CodeDocument::getFileName ( ) const {
+TQString CodeDocument::getFileName ( ) const {
return m_filename;
}
@@ -79,7 +79,7 @@ QString CodeDocument::getFileName ( ) const {
* Set the value of m_filename
* @param new_var the new value of m_filename
*/
-void CodeDocument::setFileExtension ( const QString &new_var ) {
+void CodeDocument::setFileExtension ( const TQString &new_var ) {
m_fileExtension = new_var;
updateHeader(); // because we are using new heading file
}
@@ -88,7 +88,7 @@ void CodeDocument::setFileExtension ( const QString &new_var ) {
* Get the value of m_filename
* @return the value of m_filename
*/
-QString CodeDocument::getFileExtension( ) const {
+TQString CodeDocument::getFileExtension( ) const {
return m_fileExtension;
}
@@ -104,19 +104,19 @@ void CodeDocument::setPackage ( UMLPackage *new_var ) {
* Get the value of path for this code document.
* @return the value of the path
*/
-QString CodeDocument::getPath ( ) {
+TQString CodeDocument::getPath ( ) {
- QString path = getPackage();
+ TQString path = getPackage();
// Replace all white spaces with blanks
path = path.simplifyWhiteSpace();
// Replace all blanks with underscore
- path.replace(QRegExp(" "), "_");
+ path.replace(TQRegExp(" "), "_");
// this allows multiple directory paths (ala Java, some other languages)
// in from the package specification
- path.replace(QRegExp("\\."),"/"); // Simple hack!.. but this is more or less language
+ path.replace(TQRegExp("\\."),"/"); // Simple hack!.. but this is more or less language
// dependant and should probably be commented out.
// Still, as a general default it may be useful -b.t.
return path;
@@ -126,17 +126,17 @@ QString CodeDocument::getPath ( ) {
* Get the value of package name.
* @return the value of m_package->getName()
*/
-QString CodeDocument::getPackage ( ) const {
+TQString CodeDocument::getPackage ( ) const {
if (m_package)
return m_package->getName();
- return QString();
+ return TQString();
}
/**
* Set the value of m_ID
* @param new_var the new value of m_ID
*/
-void CodeDocument::setID ( const QString &new_var ) {
+void CodeDocument::setID ( const TQString &new_var ) {
m_ID = new_var;
}
@@ -144,7 +144,7 @@ void CodeDocument::setID ( const QString &new_var ) {
* Get the value of m_ID
* @return the value of m_ID
*/
-QString CodeDocument::getID ( ) const {
+TQString CodeDocument::getID ( ) const {
return m_ID;
}
@@ -186,16 +186,16 @@ CodeComment * CodeDocument::getHeader ( ) {
// Other methods
//
-QString CodeDocument::getUniqueTag ( const QString& prefix )
+TQString CodeDocument::getUniqueTag ( const TQString& prefix )
{
- QString tag = prefix ;
+ TQString tag = prefix ;
if(tag.isEmpty())
tag += "tblock";
tag = tag + "_0";
int number = lastTagIndex;
for ( ; findTextBlockByTag(tag, true); number++) {
- tag = prefix + '_' + QString::number(number);
+ tag = prefix + '_' + TQString::number(number);
}
lastTagIndex = number;
return tag;
@@ -211,7 +211,7 @@ bool CodeDocument::insertTextBlock(TextBlock * newBlock, TextBlock * existingBlo
if(!newBlock || !existingBlock)
return false;
- QString tag = existingBlock->getTag();
+ TQString tag = existingBlock->getTag();
if(!findTextBlockByTag(tag, true))
return false;
@@ -233,7 +233,7 @@ bool CodeDocument::insertTextBlock(TextBlock * newBlock, TextBlock * existingBlo
// if we get here.. it was in this object so insert
// check for tag FIRST
- QString new_tag = newBlock->getTag();
+ TQString new_tag = newBlock->getTag();
// assign a tag if one doesn't already exist
if(new_tag.isEmpty())
@@ -268,7 +268,7 @@ CodeDocumentDialog * CodeDocument::getDialog ( ) {
// Other methods
//
-QString CodeDocument::cleanName ( const QString &name ) {
+TQString CodeDocument::cleanName ( const TQString &name ) {
return CodeGenerator::cleanName(name);
}
@@ -276,12 +276,12 @@ QString CodeDocument::cleanName ( const QString &name ) {
void CodeDocument::updateHeader () {
//try to find a heading file (license, coments, etc) then extract its text
- QString headingText = UMLApp::app()->getCommonPolicy()->getHeadingFile(getFileExtension());
+ TQString headingText = UMLApp::app()->getCommonPolicy()->getHeadingFile(getFileExtension());
- headingText.replace(QRegExp("%filename%"),getFileName()+getFileExtension());
- headingText.replace(QRegExp("%filepath%"),getPath());
- headingText.replace( QRegExp("%time%"), QTime::currentTime().toString());
- headingText.replace( QRegExp("%date%"), QDate::currentDate().toString());
+ headingText.replace(TQRegExp("%filename%"),getFileName()+getFileExtension());
+ headingText.replace(TQRegExp("%filepath%"),getPath());
+ headingText.replace( TQRegExp("%time%"), TQTime::currentTime().toString());
+ headingText.replace( TQRegExp("%date%"), TQDate::currentDate().toString());
getHeader()->setText(headingText);
@@ -297,14 +297,14 @@ void CodeDocument::updateHeader () {
* create the string representation of this object.
* @return QString
*/
-QString CodeDocument::toString ( ) {
+TQString CodeDocument::toString ( ) {
// IF the whole document is turned "Off" then don't bother
// checking individual code blocks, just send back empty string
if(!getWriteOutCode())
- return QString("");
+ return TQString("");
- QString content = getHeader()->toString();
+ TQString content = getHeader()->toString();
// update the time/date
@@ -313,7 +313,7 @@ QString CodeDocument::toString ( ) {
for (TextBlock *c = items->first(); c; c = items->next())
{
if(c->getWriteOutText()) {
- QString str = c->toString();
+ TQString str = c->toString();
if(!str.isEmpty())
content.append(str);
}
@@ -334,14 +334,14 @@ void CodeDocument::resetTextBlocks() {
/**
* load params from the appropriate XMI element node.
*/
-void CodeDocument::loadFromXMI ( QDomElement & root ) {
+void CodeDocument::loadFromXMI ( TQDomElement & root ) {
setAttributesFromNode(root);
}
/** set attributes of the node that represents this class
* in the XMI document.
*/
-void CodeDocument::setAttributesOnNode ( QDomDocument & doc, QDomElement & docElement)
+void CodeDocument::setAttributesOnNode ( TQDomDocument & doc, TQDomElement & docElement)
{
// superclass call
@@ -359,7 +359,7 @@ void CodeDocument::setAttributesOnNode ( QDomDocument & doc, QDomElement & docEl
// set the a header
// which we will store in its own separate child node block
- QDomElement commElement = doc.createElement( "header" );
+ TQDomElement commElement = doc.createElement( "header" );
getHeader()->saveToXMI(doc, commElement); // comment
docElement.appendChild( commElement);
@@ -372,15 +372,15 @@ void CodeDocument::setAttributesOnNode ( QDomDocument & doc, QDomElement & docEl
/** set the class attributes of this object from
* the passed element node.
*/
-void CodeDocument::setAttributesFromNode ( QDomElement & root) {
+void CodeDocument::setAttributesFromNode ( TQDomElement & root) {
// now set local attributes
setFileName(root.attribute("fileName",""));
setFileExtension(root.attribute("fileExt",""));
- QString pkgStr = root.attribute("package","");
+ TQString pkgStr = root.attribute("package","");
if (!pkgStr.isEmpty() && pkgStr != "-1") {
UMLDoc *umldoc = UMLApp::app()->getDocument();
- if (pkgStr.contains( QRegExp("\\D") )) {
+ if (pkgStr.contains( TQRegExp("\\D") )) {
// suspecting pre-1.5.3 file format where the package name was
// saved instead of the package ID.
UMLObject *o = umldoc->findUMLObject(pkgStr);
@@ -396,13 +396,13 @@ void CodeDocument::setAttributesFromNode ( QDomElement & root) {
// load comment now
// by looking for our particular child element
- QDomNode node = root.firstChild();
- QDomElement element = node.toElement();
+ TQDomNode node = root.firstChild();
+ TQDomElement element = node.toElement();
while( !element.isNull() ) {
- QString tag = element.tagName();
+ TQString tag = element.tagName();
if( tag == "header" ) {
- QDomNode cnode = element.firstChild();
- QDomElement celem = cnode.toElement();
+ TQDomNode cnode = element.firstChild();
+ TQDomElement celem = cnode.toElement();
getHeader()->loadFromXMI(celem);
break;
}
@@ -417,8 +417,8 @@ void CodeDocument::setAttributesFromNode ( QDomElement & root) {
/**
* Save the XMI representation of this object
*/
-void CodeDocument::saveToXMI ( QDomDocument & doc, QDomElement & root ) {
- QDomElement docElement = doc.createElement( "codedocument" );
+void CodeDocument::saveToXMI ( TQDomDocument & doc, TQDomElement & root ) {
+ TQDomElement docElement = doc.createElement( "codedocument" );
setAttributesOnNode(doc, docElement);
@@ -454,17 +454,17 @@ HierarchicalCodeBlock * CodeDocument::newHierarchicalCodeBlock ( ) {
return hb;
}
-void CodeDocument::removeChildTagFromMap ( const QString &tag )
+void CodeDocument::removeChildTagFromMap ( const TQString &tag )
{
m_childTextBlockTagMap.erase(tag);
}
-void CodeDocument::addChildTagToMap ( const QString &tag, TextBlock * tb)
+void CodeDocument::addChildTagToMap ( const TQString &tag, TextBlock * tb)
{
m_childTextBlockTagMap.insert(tag, tb);
}
-TextBlock * CodeDocument::findTextBlockByTag( const QString &tag , bool descendIntoChildren)
+TextBlock * CodeDocument::findTextBlockByTag( const TQString &tag , bool descendIntoChildren)
{
//if we already know to which file this class was written/should be written, just return it.
if(m_textBlockTagMap.contains(tag))
@@ -481,8 +481,8 @@ void CodeDocument::initDoc () {
m_writeOutCode = true;
m_package = NULL;
- m_fileExtension = QString("");
- m_ID = QString(""); // leave with NO ID as a default
+ m_fileExtension = TQString("");
+ m_ID = TQString(""); // leave with NO ID as a default
//m_textblockVector.setAutoDelete(false);
@@ -494,7 +494,7 @@ void CodeDocument::initDoc () {
}
-TextBlock * CodeDocument::findCodeClassFieldTextBlockByTag ( const QString &tag ) {
+TextBlock * CodeDocument::findCodeClassFieldTextBlockByTag ( const TQString &tag ) {
kWarning()<<"Called findCodeClassFieldMethodByTag("<<tag<<") for a regular CodeDocument"<<endl;
return (TextBlock *) NULL;
}