summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/umldoc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'umbrello/umbrello/umldoc.cpp')
-rw-r--r--umbrello/umbrello/umldoc.cpp330
1 files changed, 165 insertions, 165 deletions
diff --git a/umbrello/umbrello/umldoc.cpp b/umbrello/umbrello/umldoc.cpp
index 9783cfbd..4862193a 100644
--- a/umbrello/umbrello/umldoc.cpp
+++ b/umbrello/umbrello/umldoc.cpp
@@ -13,13 +13,13 @@
#include "umldoc.h"
// qt includes
-#include <qpainter.h>
-#include <qtimer.h>
-#include <qdatetime.h>
-#include <qbuffer.h>
-#include <qdir.h>
-#include <qregexp.h>
-#include <qlabel.h>
+#include <tqpainter.h>
+#include <tqtimer.h>
+#include <tqdatetime.h>
+#include <tqbuffer.h>
+#include <tqdir.h>
+#include <tqregexp.h>
+#include <tqlabel.h>
// kde includes
#include <kapplication.h>
@@ -95,14 +95,14 @@ UMLDoc::UMLDoc() {
void UMLDoc::init() {
// Initialize predefined folders.
- const QString nativeRootName[Uml::N_MODELTYPES] = {
+ const TQString nativeRootName[Uml::N_MODELTYPES] = {
"Logical View",
"Use Case View",
"Component View",
"Deployment View",
"Entity Relationship Model"
};
- const QString localizedRootName[Uml::N_MODELTYPES] = {
+ const TQString localizedRootName[Uml::N_MODELTYPES] = {
i18n("Logical View"),
i18n("Use Case View"),
i18n("Component View"),
@@ -120,10 +120,10 @@ void UMLDoc::init() {
// Connect signals.
UMLApp * pApp = UMLApp::app();
- connect(this, SIGNAL(sigDiagramCreated(Uml::IDType)), pApp, SLOT(slotUpdateViews()));
- connect(this, SIGNAL(sigDiagramRemoved(Uml::IDType)), pApp, SLOT(slotUpdateViews()));
- connect(this, SIGNAL(sigDiagramRenamed(Uml::IDType)), pApp, SLOT(slotUpdateViews()));
- connect(this, SIGNAL( sigCurrentViewChanged() ), pApp, SLOT( slotCurrentViewChanged() ) );
+ connect(this, TQT_SIGNAL(sigDiagramCreated(Uml::IDType)), pApp, TQT_SLOT(slotUpdateViews()));
+ connect(this, TQT_SIGNAL(sigDiagramRemoved(Uml::IDType)), pApp, TQT_SLOT(slotUpdateViews()));
+ connect(this, TQT_SIGNAL(sigDiagramRenamed(Uml::IDType)), pApp, TQT_SLOT(slotUpdateViews()));
+ connect(this, TQT_SIGNAL( sigCurrentViewChanged() ), pApp, TQT_SLOT( slotCurrentViewChanged() ) );
}
UMLDoc::~UMLDoc() {
@@ -145,7 +145,7 @@ void UMLDoc::addView(UMLView *view) {
UMLApp * pApp = UMLApp::app();
if ( pApp->getListView() )
- connect(this, SIGNAL(sigObjectRemoved(UMLObject *)), view, SLOT(slotObjectRemoved(UMLObject *)));
+ connect(this, TQT_SIGNAL(sigObjectRemoved(UMLObject *)), view, TQT_SLOT(slotObjectRemoved(UMLObject *)));
pApp->setCurrentView(view);
if ( ! m_bLoading ) {
@@ -176,7 +176,7 @@ void UMLDoc::removeView(UMLView *view , bool enforceCurrentView ) {
return;
}
if ( UMLApp::app()->getListView() ) {
- disconnect(this,SIGNAL(sigObjectRemoved(UMLObject *)), view,SLOT(slotObjectRemoved(UMLObject *)));
+ disconnect(this,TQT_SIGNAL(sigObjectRemoved(UMLObject *)), view,TQT_SLOT(slotObjectRemoved(UMLObject *)));
}
view->hide();
//remove all widgets before deleting view
@@ -341,16 +341,16 @@ bool UMLDoc::openDocument(const KURL& url, const char* /*format =0*/) {
}
m_doc_url = url;
- QDir d = url.path(1);
+ TQDir d = url.path(1);
closeDocument();
// IMPORTANT: set m_bLoading to true
// _AFTER_ the call of UMLDoc::closeDocument()
// as it sets m_bLoading to false afer it was temporarily
// changed to true to block recording of changes in redo-buffer
m_bLoading = true;
- QString tmpfile;
+ TQString tmpfile;
KIO::NetAccess::download( url, tmpfile, UMLApp::app() );
- QFile file( tmpfile );
+ TQFile file( tmpfile );
if ( !file.exists() ) {
KMessageBox::error(0, i18n("The file %1 does not exist.").arg(d.path()), i18n("Load Error"));
m_doc_url.setFileName(i18n("Untitled"));
@@ -363,12 +363,12 @@ bool UMLDoc::openDocument(const KURL& url, const char* /*format =0*/) {
bool status = false;
// check if the xmi file is a compressed archive like tar.bzip2 or tar.gz
- QString filetype = m_doc_url.fileName(true);
- QString mimetype = "";
- if (filetype.find(QRegExp("\\.tgz$")) != -1)
+ TQString filetype = m_doc_url.fileName(true);
+ TQString mimetype = "";
+ if (filetype.find(TQRegExp("\\.tgz$")) != -1)
{
mimetype = "application/x-gzip";
- } else if (filetype.find(QRegExp("\\.tar.bz2$")) != -1) {
+ } else if (filetype.find(TQRegExp("\\.tar.bz2$")) != -1) {
mimetype = "application/x-bzip2";
}
@@ -386,11 +386,11 @@ bool UMLDoc::openDocument(const KURL& url, const char* /*format =0*/) {
// get the root directory and all entries in
const KArchiveDirectory * rootDir = archive.directory();
- QStringList entries = rootDir->entries();
- QString entryMimeType;
+ TQStringList entries = rootDir->entries();
+ TQString entryMimeType;
bool foundXMI = false;
- QStringList::Iterator it;
- QStringList::Iterator end(entries.end());
+ TQStringList::Iterator it;
+ TQStringList::Iterator end(entries.end());
// now go through all entries till we find an xmi file
for (it = entries.begin(); it != end; ++it)
@@ -442,7 +442,7 @@ bool UMLDoc::openDocument(const KURL& url, const char* /*format =0*/) {
fileEntry->copyTo(tmp_dir.name());
// now open the extracted file for reading
- QFile xmi_file(tmp_dir.name() + *it);
+ TQFile xmi_file(tmp_dir.name() + *it);
if( !xmi_file.open( IO_ReadOnly ) )
{
KMessageBox::error(0, i18n("There was a problem loading the extracted file: %1").arg(d.path()), i18n("Load Error"));
@@ -505,15 +505,15 @@ bool UMLDoc::openDocument(const KURL& url, const char* /*format =0*/) {
bool UMLDoc::saveDocument(const KURL& url, const char * /* format */) {
m_doc_url = url;
- QDir d = m_doc_url.path(1);
- QFile file;
+ TQDir d = m_doc_url.path(1);
+ TQFile file;
bool uploaded = true;
// first, we have to find out which format to use
- QString strFileName = url.path(-1);
- QFileInfo fileInfo(strFileName);
- QString fileExt = fileInfo.extension();
- QString fileFormat = "xmi";
+ TQString strFileName = url.path(-1);
+ TQFileInfo fileInfo(strFileName);
+ TQString fileExt = fileInfo.extension();
+ TQString fileFormat = "xmi";
if (fileExt == "xmi" || fileExt == "bak.xmi")
{
fileFormat = "xmi";
@@ -569,12 +569,12 @@ bool UMLDoc::saveDocument(const KURL& url, const char * /* format */) {
file.close(); // ...and close it
// now add this file to the archive, but without the extension
- QString tmpQString = url.fileName();
+ TQString tmpQString = url.fileName();
if (fileFormat == "tgz")
{
- tmpQString.replace(QRegExp("\\.tgz$"), "");
+ tmpQString.replace(TQRegExp("\\.tgz$"), "");
} else {
- tmpQString.replace(QRegExp("\\.tar\\.bz2$"), "");
+ tmpQString.replace(TQRegExp("\\.tar\\.bz2$"), "");
}
archive->addLocalFile(tmp_xmi_file.name(), tmpQString);
archive->close();
@@ -649,7 +649,7 @@ void UMLDoc::setupSignals() {
WorkToolBar *tb = UMLApp::app() -> getWorkToolBar();
- connect(this, SIGNAL(sigDiagramChanged(Uml::Diagram_Type)), tb, SLOT(slotCheckToolBar(Uml::Diagram_Type)));
+ connect(this, TQT_SIGNAL(sigDiagramChanged(Uml::Diagram_Type)), tb, TQT_SLOT(slotCheckToolBar(Uml::Diagram_Type)));
//new signals below
return;
@@ -665,7 +665,7 @@ UMLView * UMLDoc::findView(Uml::IDType id) {
return v;
}
-UMLView * UMLDoc::findView(Uml::Diagram_Type type, const QString &name,
+UMLView * UMLDoc::findView(Uml::Diagram_Type type, const TQString &name,
bool searchAllScopes /* =false */) {
Uml::Model_Type mt = Model_Utils::convert_DT_MT(type);
return m_root[mt]->findView(type, name, searchAllScopes);
@@ -692,7 +692,7 @@ UMLStereotype * UMLDoc::findStereotypeById(Uml::IDType id) {
return NULL;
}
-UMLObject* UMLDoc::findUMLObject(const QString &name,
+UMLObject* UMLDoc::findUMLObject(const TQString &name,
Uml::Object_Type type /* = ot_UMLObject */,
UMLObject *currentObj /* = NULL */) {
UMLObject *o = m_datatypeRoot->findObject(name);
@@ -710,7 +710,7 @@ UMLObject* UMLDoc::findUMLObject(const QString &name,
return NULL;
}
-UMLClassifier* UMLDoc::findUMLClassifier(const QString &name) {
+UMLClassifier* UMLDoc::findUMLClassifier(const TQString &name) {
//this is used only by code generator so we don't need to look at Datatypes
UMLObject * obj = findUMLObject(name);
return dynamic_cast<UMLClassifier*>(obj);
@@ -749,7 +749,7 @@ void UMLDoc::removeStereotype(const UMLStereotype *s) {
m_stereoList.remove(s);
}
-void UMLDoc::writeToStatusBar(const QString &text) {
+void UMLDoc::writeToStatusBar(const TQString &text) {
emit sigWriteToStatusBar(text);
}
@@ -765,7 +765,7 @@ void UMLDoc::slotRemoveUMLObject(UMLObject* object) {
pkg->removeObject(object);
}
-bool UMLDoc::isUnique(const QString &name)
+bool UMLDoc::isUnique(const TQString &name)
{
UMLListView *listView = UMLApp::app()->getListView();
UMLListViewItem *currentItem = (UMLListViewItem*)listView->currentItem();
@@ -801,7 +801,7 @@ bool UMLDoc::isUnique(const QString &name)
return true;
}
-bool UMLDoc::isUnique(const QString &name, UMLPackage *package)
+bool UMLDoc::isUnique(const TQString &name, UMLPackage *package)
{
// if a package, then only do check in that
if (package)
@@ -820,7 +820,7 @@ bool UMLDoc::isUnique(const QString &name, UMLPackage *package)
return true;
}
-UMLStereotype* UMLDoc::findStereotype(const QString &name) {
+UMLStereotype* UMLDoc::findStereotype(const TQString &name) {
UMLStereotype *s;
for (UMLStereotypeListIt it(m_stereoList); (s = it.current()) != NULL; ++it) {
if (s->getName() == name)
@@ -829,7 +829,7 @@ UMLStereotype* UMLDoc::findStereotype(const QString &name) {
return NULL;
}
-UMLStereotype* UMLDoc::findOrCreateStereotype(const QString &name) {
+UMLStereotype* UMLDoc::findOrCreateStereotype(const TQString &name) {
UMLStereotype *s = findStereotype(name);
if (s != NULL) {
return s;
@@ -928,8 +928,8 @@ void UMLDoc::addAssociation(UMLAssociation *Assoc)
setModified(true);
}
-QString UMLDoc::uniqViewName(const Uml::Diagram_Type type) {
- QString dname;
+TQString UMLDoc::uniqViewName(const Uml::Diagram_Type type) {
+ TQString dname;
if(type == dt_UseCase)
dname = i18n("use case diagram");
else if(type == dt_Class)
@@ -951,9 +951,9 @@ QString UMLDoc::uniqViewName(const Uml::Diagram_Type type) {
else {
kWarning() << "uniqViewName() called with unknown diagram type" << endl;
}
- QString name = dname;
+ TQString name = dname;
for (int number = 0; findView(type, name, true); ++number,
- name = dname + '_' + QString::number(number))
+ name = dname + '_' + TQString::number(number))
;
return name;
}
@@ -968,12 +968,12 @@ void UMLDoc::setLoading(bool state /* = true */) {
UMLView* UMLDoc::createDiagram(UMLFolder *folder, Uml::Diagram_Type type, bool askForName /*= true */) {
bool ok = true;
- QString name,
+ TQString name,
dname = uniqViewName(type);
while(true) {
if (askForName) {
- name = KInputDialog::getText(i18n("Name"), i18n("Enter name:"), dname, &ok, (QWidget*)UMLApp::app());
+ name = KInputDialog::getText(i18n("Name"), i18n("Enter name:"), dname, &ok, (TQWidget*)UMLApp::app());
} else {
name = dname;
}
@@ -1007,9 +1007,9 @@ void UMLDoc::renameDiagram(Uml::IDType id) {
UMLView *temp = findView(id);
Diagram_Type type = temp->getType();
- QString oldName= temp->getName();
+ TQString oldName= temp->getName();
while(true) {
- QString name = KInputDialog::getText(i18n("Name"), i18n("Enter name:"), oldName, &ok, (QWidget*)UMLApp::app());
+ TQString name = KInputDialog::getText(i18n("Name"), i18n("Enter name:"), oldName, &ok, (TQWidget*)UMLApp::app());
if(!ok)
break;
@@ -1028,9 +1028,9 @@ void UMLDoc::renameDiagram(Uml::IDType id) {
void UMLDoc::renameUMLObject(UMLObject *o) {
bool ok = false;
- QString oldName= o->getName();
+ TQString oldName= o->getName();
while(true) {
- QString name = KInputDialog::getText(i18n("Name"), i18n("Enter name:"), oldName, &ok, (QWidget*)UMLApp::app());
+ TQString name = KInputDialog::getText(i18n("Name"), i18n("Enter name:"), oldName, &ok, (TQWidget*)UMLApp::app());
if(!ok)
break;
if(name.length() == 0)
@@ -1054,9 +1054,9 @@ void UMLDoc::renameChildUMLObject(UMLObject *o) {
return;
}
- QString oldName= o->getName();
+ TQString oldName= o->getName();
while(true) {
- QString name = KInputDialog::getText(i18n("Name"), i18n("Enter name:"), oldName, &ok, (QWidget*)UMLApp::app());
+ TQString name = KInputDialog::getText(i18n("Name"), i18n("Enter name:"), oldName, &ok, (TQWidget*)UMLApp::app());
if(!ok)
break;
if(name.length() == 0)
@@ -1192,11 +1192,11 @@ void UMLDoc::signalUMLObjectCreated(UMLObject * o) {
*/
}
-void UMLDoc::setName(const QString& name) {
+void UMLDoc::setName(const TQString& name) {
m_Name = name;
}
-QString UMLDoc::getName() const {
+TQString UMLDoc::getName() const {
return m_Name;
}
@@ -1204,23 +1204,23 @@ Uml::IDType UMLDoc::getModelID() const {
return m_modelID;
}
-void UMLDoc::saveToXMI(QIODevice& file) {
- QDomDocument doc;
+void UMLDoc::saveToXMI(TQIODevice& file) {
+ TQDomDocument doc;
- QDomProcessingInstruction xmlHeading =
+ TQDomProcessingInstruction xmlHeading =
doc.createProcessingInstruction("xml", "version=\"1.0\" encoding=\"UTF-8\"");
doc.appendChild(xmlHeading);
- QDomElement root = doc.createElement( "XMI" );
+ TQDomElement root = doc.createElement( "XMI" );
root.setAttribute( "xmi.version", "1.2" );
- QDateTime now = QDateTime::currentDateTime();
+ TQDateTime now = TQDateTime::currentDateTime();
root.setAttribute( "timestamp", now.toString(Qt::ISODate));
root.setAttribute( "verified", "false");
root.setAttribute( "xmlns:UML", "http://schema.omg.org/spec/UML/1.3");
doc.appendChild( root );
- QDomElement header = doc.createElement( "XMI.header" );
- QDomElement meta = doc.createElement( "XMI.metamodel" );
+ TQDomElement header = doc.createElement( "XMI.header" );
+ TQDomElement meta = doc.createElement( "XMI.metamodel" );
meta.setAttribute( "xmi.name", "UML" );
meta.setAttribute( "xmi.version", "1.3" );
meta.setAttribute( "href", "UML.xml" );
@@ -1230,10 +1230,10 @@ void UMLDoc::saveToXMI(QIODevice& file) {
* bugs.kde.org/56184 comment by M. Alanen 2004-12-19:
* " XMI.model requires xmi.version. (or leave the whole XMI.model out,
* it's not required) "
- QDomElement model = doc.createElement( "XMI.model" );
- QFile* qfile = dynamic_cast<QFile*>(&file);
+ TQDomElement model = doc.createElement( "XMI.model" );
+ TQFile* qfile = dynamic_cast<TQFile*>(&file);
if (qfile) {
- QString modelName = qfile->name();
+ TQString modelName = qfile->name();
modelName = modelName.section('/', -1 );
modelName = modelName.section('.', 0, 0);
model.setAttribute( "xmi.name", modelName );
@@ -1241,28 +1241,28 @@ void UMLDoc::saveToXMI(QIODevice& file) {
}
*/
- QDomElement documentation = doc.createElement( "XMI.documentation" );
+ TQDomElement documentation = doc.createElement( "XMI.documentation" );
// If we consider it useful we might add user and contact details
- // QDomElement owner = doc.createElement( "XMI.owner" );
+ // TQDomElement owner = doc.createElement( "XMI.owner" );
// owner.appendChild( doc.createTextNode( "Jens Kruger" ) ); // Add a User
// documentation.appendChild( owner );
- // QDomElement contact = doc.createElement( "XMI.contact" );
+ // TQDomElement contact = doc.createElement( "XMI.contact" );
// contact.appendChild( doc.createTextNode( "je.krueger@web.de" ) ); // add a contact
// documentation.appendChild( contact );
- QDomElement exporter = doc.createElement( "XMI.exporter" );
+ TQDomElement exporter = doc.createElement( "XMI.exporter" );
exporter.appendChild( doc.createTextNode( "umbrello uml modeller http://uml.sf.net" ) );
documentation.appendChild( exporter );
- QDomElement exporterVersion = doc.createElement( "XMI.exporterVersion" );
+ TQDomElement exporterVersion = doc.createElement( "XMI.exporterVersion" );
exporterVersion.appendChild( doc.createTextNode( XMI_FILE_VERSION ) );
documentation.appendChild( exporterVersion );
// all files are now saved with correct Unicode encoding, we add this
// information to the header, so that the file will be loaded correctly
- QDomElement exporterEncoding = doc.createElement( "XMI.exporterEncoding" );
+ TQDomElement exporterEncoding = doc.createElement( "XMI.exporterEncoding" );
exporterEncoding.appendChild( doc.createTextNode( "UnicodeUTF8" ) );
documentation.appendChild( exporterEncoding );
@@ -1275,11 +1275,11 @@ void UMLDoc::saveToXMI(QIODevice& file) {
header.appendChild( meta );
root.appendChild( header );
- QDomElement content = doc.createElement( "XMI.content" );
+ TQDomElement content = doc.createElement( "XMI.content" );
- QDomElement contentNS = doc.createElement( "UML:Namespace.contents" );
+ TQDomElement contentNS = doc.createElement( "UML:Namespace.contents" );
- QDomElement objectsElement = doc.createElement( "UML:Model" );
+ TQDomElement objectsElement = doc.createElement( "UML:Model" );
objectsElement.setAttribute( "xmi.id", ID2STR(m_modelID) );
objectsElement.setAttribute( "name", m_Name );
objectsElement.setAttribute( "isSpecification", "false" );
@@ -1287,16 +1287,16 @@ void UMLDoc::saveToXMI(QIODevice& file) {
objectsElement.setAttribute( "isRoot", "false" );
objectsElement.setAttribute( "isLeaf", "false" );
- QDomElement ownedNS = doc.createElement( "UML:Namespace.ownedElement" );
+ TQDomElement ownedNS = doc.createElement( "UML:Namespace.ownedElement" );
// Save stereotypes and toplevel datatypes first so that upon loading
// they are known first.
// There is a bug causing duplication of the same stereotype in m_stereoList.
// As a workaround, we use a string list to memorize which stereotype has been saved.
- QStringList stereoNames;
- QValueList<Uml::IDType> stereoIDs;
+ TQStringList stereoNames;
+ TQValueList<Uml::IDType> stereoIDs;
for (UMLStereotype *s = m_stereoList.first(); s; s = m_stereoList.next() ) {
- QString stName = s->getName();
+ TQString stName = s->getName();
Uml::IDType stID = s->getID();
if (!stereoNames.contains(stName) && !stereoIDs.contains(stID)) {
s->saveToXMI(doc, ownedNS);
@@ -1318,10 +1318,10 @@ void UMLDoc::saveToXMI(QIODevice& file) {
root.appendChild( content );
// Save the XMI extensions: docsettings, diagrams, listview, and codegeneration.
- QDomElement extensions = doc.createElement( "XMI.extensions" );
+ TQDomElement extensions = doc.createElement( "XMI.extensions" );
extensions.setAttribute( "xmi.extender", "umbrello" );
- QDomElement docElement = doc.createElement( "docsettings" );
+ TQDomElement docElement = doc.createElement( "docsettings" );
Uml::IDType viewID = Uml::id_None;
UMLView *currentView = UMLApp::app()->getCurrentView();
if (currentView)
@@ -1337,26 +1337,26 @@ void UMLDoc::saveToXMI(QIODevice& file) {
// save code generator
CodeGenerator *codegen = UMLApp::app()->getGenerator();
if (codegen) {
- QDomElement codeGenElement = doc.createElement( "codegeneration" );
+ TQDomElement codeGenElement = doc.createElement( "codegeneration" );
codegen->saveToXMI( doc, codeGenElement );
extensions.appendChild( codeGenElement );
}
root.appendChild( extensions );
- QTextStream stream( &file );
- stream.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream stream( &file );
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
stream << doc.toString();
}
-short UMLDoc::getEncoding(QIODevice & file)
+short UMLDoc::getEncoding(TQIODevice & file)
{
- QTextStream stream( &file );
- stream.setEncoding(QTextStream::UnicodeUTF8);
- QString data = stream.read();
- QString error;
+ TQTextStream stream( &file );
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
+ TQString data = stream.read();
+ TQString error;
int line;
- QDomDocument doc;
+ TQDomDocument doc;
if( !doc.setContent( data, false, &error, &line ) )
{
kWarning()<<"Can't set content: "<<error<<" Line: "<<line<<endl;
@@ -1365,12 +1365,12 @@ short UMLDoc::getEncoding(QIODevice & file)
// we start at the beginning and go to the point in the header where we can
// find out if the file was saved using Unicode
- QDomNode node = doc.firstChild();
+ TQDomNode node = doc.firstChild();
while (node.isComment() || node.isProcessingInstruction())
{
node = node.nextSibling();
}
- QDomElement root = node.toElement();
+ TQDomElement root = node.toElement();
if( root.isNull() )
{
return ENC_UNKNOWN;
@@ -1385,15 +1385,15 @@ short UMLDoc::getEncoding(QIODevice & file)
if ( node.isNull() )
return ENC_UNKNOWN;
- QDomElement element = node.toElement();
+ TQDomElement element = node.toElement();
// check header
if( element.isNull() || element.tagName() != "XMI.header" )
return ENC_UNKNOWN;
- QDomNode headerNode = node.firstChild();
+ TQDomNode headerNode = node.firstChild();
while ( !headerNode.isNull() )
{
- QDomElement headerElement = headerNode.toElement();
+ TQDomElement headerElement = headerNode.toElement();
// the information if Unicode was used is now stored in the
// XMI.documentation section of the header
if (headerElement.isNull() ||
@@ -1401,10 +1401,10 @@ short UMLDoc::getEncoding(QIODevice & file)
headerNode = headerNode.nextSibling();
continue;
}
- QDomNode docuNode = headerNode.firstChild();
+ TQDomNode docuNode = headerNode.firstChild();
while ( !docuNode.isNull() )
{
- QDomElement docuElement = docuNode.toElement();
+ TQDomElement docuElement = docuNode.toElement();
// a tag XMI.exporterEncoding was added since version 1.2 to
// mark a file as saved with Unicode
if (! docuElement.isNull() &&
@@ -1412,7 +1412,7 @@ short UMLDoc::getEncoding(QIODevice & file)
{
// at the moment this if isn't really necessary, but maybe
// later we will have other encoding standards
- if (docuElement.text() == QString("UnicodeUTF8"))
+ if (docuElement.text() == TQString("UnicodeUTF8"))
{
return ENC_UNICODE; // stop here
}
@@ -1424,7 +1424,7 @@ short UMLDoc::getEncoding(QIODevice & file)
return ENC_OLD_ENC;
}
-bool UMLDoc::loadFromXMI( QIODevice & file, short encode )
+bool UMLDoc::loadFromXMI( TQIODevice & file, short encode )
{
// old Umbrello versions (version < 1.2) didn't save the XMI in Unicode
// this wasn't correct, because non Latin1 chars where lost
@@ -1436,30 +1436,30 @@ bool UMLDoc::loadFromXMI( QIODevice & file, short encode )
return false;
file.reset();
}
- QTextStream stream( &file );
+ TQTextStream stream( &file );
if (encode == ENC_UNICODE)
{
- stream.setEncoding(QTextStream::UnicodeUTF8);
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
}
- QString data = stream.read();
+ TQString data = stream.read();
kapp->processEvents(); // give UI events a chance
- QString error;
+ TQString error;
int line;
- QDomDocument doc;
+ TQDomDocument doc;
if( !doc.setContent( data, false, &error, &line ) ) {
kWarning()<<"Can't set content:"<<error<<" Line:"<<line<<endl;
return false;
}
kapp->processEvents(); // give UI events a chance
- QDomNode node = doc.firstChild();
+ TQDomNode node = doc.firstChild();
//Before Umbrello 1.1-rc1 we didn't add a <?xml heading
//so we allow the option of this being missing
while (node.isComment() || node.isProcessingInstruction()) {
node = node.nextSibling();
}
- QDomElement root = node.toElement();
+ TQDomElement root = node.toElement();
if( root.isNull() ) {
return false;
}
@@ -1472,22 +1472,22 @@ bool UMLDoc::loadFromXMI( QIODevice & file, short encode )
for (node = node.firstChild(); !node.isNull(); node = node.nextSibling()) {
if (node.isComment())
continue;
- QDomElement element = node.toElement();
+ TQDomElement element = node.toElement();
if (element.isNull()) {
kDebug() << "loadFromXMI: skip empty elem" << endl;
continue;
}
bool recognized = false;
- QString outerTag = element.tagName();
+ TQString outerTag = element.tagName();
//check header
if (outerTag == "XMI.header") {
- QDomNode headerNode = node.firstChild();
+ TQDomNode headerNode = node.firstChild();
if ( !validateXMIHeader(headerNode) ) {
return false;
}
recognized = true;
} else if (outerTag == "XMI.extensions") {
- QDomNode extensionsNode = node.firstChild();
+ TQDomNode extensionsNode = node.firstChild();
while (! extensionsNode.isNull()) {
loadExtensionsFromXMI(extensionsNode);
extensionsNode = extensionsNode.nextSibling();
@@ -1502,12 +1502,12 @@ bool UMLDoc::loadFromXMI( QIODevice & file, short encode )
}
bool seen_UMLObjects = false;
//process content
- for (QDomNode child = node.firstChild(); !child.isNull();
+ for (TQDomNode child = node.firstChild(); !child.isNull();
child = child.nextSibling()) {
if (child.isComment())
continue;
element = child.toElement();
- QString tag = element.tagName();
+ TQString tag = element.tagName();
if (tag == "umlobjects" // for bkwd compat.
|| tagEq(tag, "Subsystem")
|| tagEq(tag, "Model") ) {
@@ -1524,7 +1524,7 @@ bool UMLDoc::loadFromXMI( QIODevice & file, short encode )
tagEq(tag, "Interface")) {
// These tests are only for foreign XMI files that
// are missing the <Model> tag (e.g. NSUML)
- QDomElement parentElem = node.toElement();
+ TQDomElement parentElem = node.toElement();
if( !loadUMLObjectsFromXMI( parentElem ) ) {
kWarning() << "failed load on model objects" << endl;
return false;
@@ -1542,7 +1542,7 @@ bool UMLDoc::loadFromXMI( QIODevice & file, short encode )
if (tag != "documentation") {
continue;
}
- QString modelElement = element.attribute("modelElement", "");
+ TQString modelElement = element.attribute("modelElement", "");
if (modelElement.isEmpty()) {
kDebug() << "skipping TaggedValue(documentation) because "
<< "modelElement.isEmpty()" << endl;
@@ -1554,7 +1554,7 @@ bool UMLDoc::loadFromXMI( QIODevice & file, short encode )
<< " for modelElement " << modelElement << endl;
continue;
}
- QString value = element.attribute("value", "");
+ TQString value = element.attribute("value", "");
if (! value.isEmpty())
o->setDoc(value);
} else {
@@ -1609,8 +1609,8 @@ void UMLDoc::resolveTypes() {
kapp->processEvents(); // give UI events a chance
}
-bool UMLDoc::validateXMIHeader(QDomNode& headerNode) {
- QDomElement headerElement = headerNode.toElement();
+bool UMLDoc::validateXMIHeader(TQDomNode& headerNode) {
+ TQDomElement headerElement = headerNode.toElement();
while ( !headerNode.isNull() ) {
/* //Seems older Umbrello files used a different metamodel, so don't validate it for now
if( !headerElement.isNull() && headerElement.tagName() == "XMI.metamodel" ) {
@@ -1626,7 +1626,7 @@ bool UMLDoc::validateXMIHeader(QDomNode& headerNode) {
return true;
}
-bool UMLDoc::loadUMLObjectsFromXMI(QDomElement& element) {
+bool UMLDoc::loadUMLObjectsFromXMI(TQDomElement& element) {
/* FIXME need a way to make status bar actually reflect
how much of the file has been loaded rather than just
counting to 10 (an arbitrary number)
@@ -1637,15 +1637,15 @@ bool UMLDoc::loadUMLObjectsFromXMI(QDomElement& element) {
*/
emit sigWriteToStatusBar( i18n("Loading UML elements...") );
- for (QDomNode node = element.firstChild(); !node.isNull();
+ for (TQDomNode node = element.firstChild(); !node.isNull();
node = node.nextSibling()) {
if (node.isComment())
continue;
- QDomElement tempElement = node.toElement();
- QString type = tempElement.tagName();
+ TQDomElement tempElement = node.toElement();
+ TQString type = tempElement.tagName();
if (tagEq(type, "Model")) {
bool foundUmbrelloRootFolder = false;
- QString name = tempElement.attribute("name");
+ TQString name = tempElement.attribute("name");
for (int i = 0; i < Uml::N_MODELTYPES; i++) {
if (name == m_root[i]->getName()) {
m_pCurrentRoot = m_root[i];
@@ -1674,7 +1674,7 @@ bool UMLDoc::loadUMLObjectsFromXMI(QDomElement& element) {
if (Model_Utils::isCommonXMIAttribute(type))
continue;
if (! tempElement.hasAttribute("xmi.id")) {
- QString idref = tempElement.attribute("xmi.idref", "");
+ TQString idref = tempElement.attribute("xmi.idref", "");
if (! idref.isEmpty()) {
kDebug() << "resolution of xmi.idref " << idref
<< " is not yet implemented" << endl;
@@ -1684,7 +1684,7 @@ bool UMLDoc::loadUMLObjectsFromXMI(QDomElement& element) {
}
continue;
}
- QString stID = tempElement.attribute("stereotype", "");
+ TQString stID = tempElement.attribute("stereotype", "");
UMLObject *pObject = Object_Factory::makeObjectFromXMI(type, stID);
if( !pObject ) {
kWarning() << "Unknown type of umlobject to create: " << type << endl;
@@ -1750,14 +1750,14 @@ void UMLDoc::setMainViewID(Uml::IDType viewID) {
m_nViewID = viewID;
}
-void UMLDoc::loadExtensionsFromXMI(QDomNode& node) {
- QDomElement element = node.toElement();
- QString tag = element.tagName();
+void UMLDoc::loadExtensionsFromXMI(TQDomNode& node) {
+ TQDomElement element = node.toElement();
+ TQString tag = element.tagName();
if (tag == "docsettings") {
- QString viewID = element.attribute( "viewid", "-1" );
+ TQString viewID = element.attribute( "viewid", "-1" );
m_Doc = element.attribute( "documentation", "" );
- QString uniqueid = element.attribute( "uniqueid", "0" );
+ TQString uniqueid = element.attribute( "uniqueid", "0" );
m_nViewID = STR2ID(viewID);
UniqueID::set(STR2ID(uniqueid));
@@ -1766,7 +1766,7 @@ void UMLDoc::loadExtensionsFromXMI(QDomNode& node) {
} else if (tag == "diagrams" || tag == "UISModelElement") {
// For backward compatibility only:
// Since version 1.5.5 diagrams are saved as part of the UMLFolder.
- QDomNode diagramNode = node.firstChild();
+ TQDomNode diagramNode = node.firstChild();
if (tag == "UISModelElement") { // Unisys.IntegratePlus.2
element = diagramNode.toElement();
tag = element.tagName();
@@ -1789,11 +1789,11 @@ void UMLDoc::loadExtensionsFromXMI(QDomNode& node) {
}
} else if (tag == "codegeneration") {
- QDomNode cgnode = node.firstChild();
- QDomElement cgelement = cgnode.toElement();
+ TQDomNode cgnode = node.firstChild();
+ TQDomElement cgelement = cgnode.toElement();
while( !cgelement.isNull() ) {
- QString nodeName = cgelement.tagName();
- QString lang = cgelement.attribute("language","UNKNOWN");
+ TQString nodeName = cgelement.tagName();
+ TQString lang = cgelement.attribute("language","UNKNOWN");
Uml::Programming_Language pl = Model_Utils::stringToProgLang(lang);
CodeGenerator *g = UMLApp::app()->setGenerator(pl);
g->loadFromXMI(cgelement);
@@ -1807,19 +1807,19 @@ void UMLDoc::loadExtensionsFromXMI(QDomNode& node) {
// For backward compatibility only:
// Since version 1.5.5 diagrams are saved as part of the UMLFolder.
-bool UMLDoc::loadDiagramsFromXMI( QDomNode & node ) {
+bool UMLDoc::loadDiagramsFromXMI( TQDomNode & node ) {
emit sigWriteToStatusBar( i18n("Loading diagrams...") );
emit sigResetStatusbarProgress();
emit sigSetStatusbarProgress( 0 );
emit sigSetStatusbarProgressSteps( 10 ); //FIX ME
- QDomElement element = node.toElement();
+ TQDomElement element = node.toElement();
if( element.isNull() )
return true;//return ok as it means there is no umlobjects
const Settings::OptionState state = Settings::getOptionState();
UMLView * pView = 0;
int count = 0;
while( !element.isNull() ) {
- QString tag = element.tagName();
+ TQString tag = element.tagName();
if (tag == "diagram" || tag == "UISDiagram") {
pView = new UMLView(NULL);
// IMPORTANT: Set OptionState of new UMLView _BEFORE_
@@ -1910,13 +1910,13 @@ UMLAssociationList UMLDoc::getAssociations() {
void UMLDoc::print(KPrinter * pPrinter) {
UMLView * printView = 0;
- int count = QString(pPrinter -> option("kde-uml-count")).toInt();
- QPainter painter(pPrinter);
+ int count = TQString(pPrinter -> option("kde-uml-count")).toInt();
+ TQPainter painter(pPrinter);
for(int i = 0;i < count;i++) {
if(i>0)
pPrinter -> newPage();
- QString diagram = i18n("kde-uml-Diagram") + QString("%1").arg(i);
- QString sID = pPrinter -> option(diagram);
+ TQString diagram = i18n("kde-uml-Diagram") + TQString("%1").arg(i);
+ TQString sID = pPrinter -> option(diagram);
Uml::IDType id = STR2ID(sID);
printView = findView(id);
@@ -2044,10 +2044,10 @@ bool UMLDoc::addUMLView(UMLView * pView ) {
return false;
int i = 0;
- QString viewName = (QString)pView->getName();
- QString name = viewName;
+ TQString viewName = (TQString)pView->getName();
+ TQString name = viewName;
while( findView(pView->getType(), name) != NULL) {
- name = viewName + '_' + QString::number(++i);
+ name = viewName + '_' + TQString::number(++i);
}
if(i) //If name was modified
pView->setName(name);
@@ -2081,14 +2081,14 @@ void UMLDoc::settingsChanged(Settings::OptionState optionState) {
void UMLDoc::initSaveTimer() {
if( m_pAutoSaveTimer ) {
m_pAutoSaveTimer -> stop();
- disconnect( m_pAutoSaveTimer, SIGNAL( timeout() ), this, SLOT( slotAutoSave() ) );
+ disconnect( m_pAutoSaveTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotAutoSave() ) );
delete m_pAutoSaveTimer;
m_pAutoSaveTimer = 0;
}
Settings::OptionState optionState = Settings::getOptionState();
if( optionState.generalState.autosave ) {
- m_pAutoSaveTimer = new QTimer(this, "_AUTOSAVETIMER_" );
- connect( m_pAutoSaveTimer, SIGNAL( timeout() ), this, SLOT( slotAutoSave() ) );
+ m_pAutoSaveTimer = new TQTimer(this, "_AUTOSAVETIMER_" );
+ connect( m_pAutoSaveTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotAutoSave() ) );
m_pAutoSaveTimer->start( optionState.generalState.autosavetime * 60000, false );
}
return;
@@ -2101,7 +2101,7 @@ void UMLDoc::slotAutoSave() {
}
KURL tempURL = m_doc_url;
if( tempURL.fileName() == i18n("Untitled") ) {
- tempURL.setPath( QDir::homeDirPath() + i18n("/autosave%1").arg(".xmi") );
+ tempURL.setPath( TQDir::homeDirPath() + i18n("/autosave%1").arg(".xmi") );
saveDocument( tempURL );
m_doc_url.setFileName( i18n("Untitled") );
m_modified = true;
@@ -2109,9 +2109,9 @@ void UMLDoc::slotAutoSave() {
} else {
// 2004-05-17 Achim Spangler
KURL orgDocUrl = m_doc_url;
- QString orgFileName = m_doc_url.fileName();
+ TQString orgFileName = m_doc_url.fileName();
// don't overwrite manually saved file with autosave content
- QString fileName = tempURL.fileName();
+ TQString fileName = tempURL.fileName();
Settings::OptionState optionState = Settings::getOptionState();
fileName.replace( ".xmi", optionState.generalState.autosavesuffix );
tempURL.setFileName( fileName );
@@ -2144,9 +2144,9 @@ void UMLDoc::signalDiagramRenamed(UMLView* pView ) {
void UMLDoc::addToUndoStack() {
Settings::OptionState optionState = Settings::getOptionState();
if (!m_bLoading && optionState.generalState.undo) {
- QBuffer* buffer = new QBuffer();
+ TQBuffer* buffer = new TQBuffer();
buffer->open(IO_WriteOnly);
- QDataStream* undoData = new QDataStream();
+ TQDataStream* undoData = new TQDataStream();
undoData->setDevice(buffer);
saveToXMI(*buffer);
buffer->close();
@@ -2193,8 +2193,8 @@ void UMLDoc::loadUndoData() {
m_bLoading = true;
closeDocument();
redoStack.prepend( undoStack.take(0) );
- QDataStream* undoData = undoStack.getFirst();
- QBuffer* buffer = static_cast<QBuffer*>( undoData->device() );
+ TQDataStream* undoData = undoStack.getFirst();
+ TQBuffer* buffer = static_cast<TQBuffer*>( undoData->device() );
buffer->open(IO_ReadOnly);
loadFromXMI(*buffer);
buffer->close();
@@ -2231,9 +2231,9 @@ void UMLDoc::loadRedoData() {
m_bLoading = true;
closeDocument();
undoStack.prepend( redoStack.getFirst() );
- QDataStream* redoData = redoStack.getFirst();
+ TQDataStream* redoData = redoStack.getFirst();
redoStack.removeFirst();
- QBuffer* buffer = static_cast<QBuffer*>( redoData->device() );
+ TQBuffer* buffer = static_cast<TQBuffer*>( redoData->device() );
buffer->open(IO_ReadOnly);
loadFromXMI(*buffer);
buffer->close();
@@ -2266,13 +2266,13 @@ void UMLDoc::addDefaultDatatypes() {
<< endl;
return;
}
- QStringList entries = cg->defaultDatatypes();
- QStringList::Iterator end(entries.end());
- for (QStringList::Iterator it = entries.begin(); it != end; ++it)
+ TQStringList entries = cg->defaultDatatypes();
+ TQStringList::Iterator end(entries.end());
+ for (TQStringList::Iterator it = entries.begin(); it != end; ++it)
createDatatype(*it);
}
-void UMLDoc::createDatatype(const QString &name) {
+void UMLDoc::createDatatype(const TQString &name) {
UMLObjectList datatypes = m_datatypeRoot->containedObjects();
UMLObject* umlobject = Model_Utils::findUMLObject(datatypes, name,
ot_Datatype, m_datatypeRoot);
@@ -2282,7 +2282,7 @@ void UMLDoc::createDatatype(const QString &name) {
UMLApp::app()->getListView()->closeDatatypesFolder();
}
-void UMLDoc::slotDiagramPopupMenu(QWidget* umlview, const QPoint& point) {
+void UMLDoc::slotDiagramPopupMenu(TQWidget* umlview, const TQPoint& point) {
UMLView* view = (UMLView*) umlview;
if(m_pTabPopupMenu != 0) {
m_pTabPopupMenu->hide();
@@ -2338,7 +2338,7 @@ void UMLDoc::slotDiagramPopupMenu(QWidget* umlview, const QPoint& point) {
m_pTabPopupMenu = new ListPopupMenu(UMLApp::app()->getMainViewWidget(), type);
m_pTabPopupMenu->popup(point);
- connect(m_pTabPopupMenu, SIGNAL(activated(int)), view, SLOT(slotMenuSelection(int)));
+ connect(m_pTabPopupMenu, TQT_SIGNAL(activated(int)), view, TQT_SLOT(slotMenuSelection(int)));
}
void UMLDoc::addDefaultStereotypes() {