summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/classifier.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/classifier.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/classifier.cpp')
-rw-r--r--umbrello/umbrello/classifier.cpp108
1 files changed, 54 insertions, 54 deletions
diff --git a/umbrello/umbrello/classifier.cpp b/umbrello/umbrello/classifier.cpp
index 22deee10..4b8e0bc0 100644
--- a/umbrello/umbrello/classifier.cpp
+++ b/umbrello/umbrello/classifier.cpp
@@ -39,7 +39,7 @@
using namespace Uml;
-UMLClassifier::UMLClassifier(const QString & name, Uml::IDType id)
+UMLClassifier::UMLClassifier(const TQString & name, Uml::IDType id)
: UMLPackage(name, id)
{
init();
@@ -64,7 +64,7 @@ void UMLClassifier::setBaseType(Uml::Object_Type ot) {
newIcon = Uml::it_Interface;
break;
case ot_Class:
- UMLObject::setStereotype(QString());
+ UMLObject::setStereotype(TQString());
UMLObject::m_bAbstract = false;
newIcon = Uml::it_Class;
break;
@@ -93,7 +93,7 @@ bool UMLClassifier::isDatatype() const {
}
UMLOperation * UMLClassifier::checkOperationSignature(
- const QString& name,
+ const TQString& name,
UMLAttributeList opParams,
UMLOperation *exemptOp)
{
@@ -129,7 +129,7 @@ UMLOperation * UMLClassifier::checkOperationSignature(
return NULL;
}
-UMLOperation* UMLClassifier::findOperation(const QString& name,
+UMLOperation* UMLClassifier::findOperation(const TQString& name,
Model_Utils::NameAndType_List params) {
UMLOperationList list = findOperations(name);
if (list.count() == 0)
@@ -161,7 +161,7 @@ UMLOperation* UMLClassifier::findOperation(const QString& name,
return test;
}
-UMLOperation* UMLClassifier::createOperation(const QString &name /*=null*/,
+UMLOperation* UMLClassifier::createOperation(const TQString &name /*=null*/,
bool *isExistingOp /*=NULL*/,
Model_Utils::NameAndType_List *params /*=NULL*/)
{
@@ -193,7 +193,7 @@ UMLOperation* UMLClassifier::createOperation(const QString &name /*=null*/,
op->setName( uniqChildName(Uml::ot_Operation) );
do {
UMLOperationDialog operationDialogue(0, op);
- if( operationDialogue.exec() != QDialog::Accepted ) {
+ if( operationDialogue.exec() != TQDialog::Accepted ) {
delete op;
return NULL;
} else if (checkOperationSignature(op->getName(), op->getParmList())) {
@@ -236,7 +236,7 @@ bool UMLClassifier::addOperation(UMLOperation* op, int position )
m_List.insert(position,op);
UMLClassifierListItemList itemList = getFilteredList(Uml::ot_Operation);
UMLClassifierListItem* currentAtt;
- QString buf;
+ TQString buf;
for (UMLClassifierListItemListIt it0(itemList); (currentAtt = it0.current()); ++it0)
buf.append(' ' + currentAtt->getName());
kDebug() << " UMLClassifier::addOperation list after change: " << buf << endl;
@@ -244,7 +244,7 @@ bool UMLClassifier::addOperation(UMLOperation* op, int position )
m_List.append( op );
emit operationAdded(op);
UMLObject::emitModified();
- connect(op,SIGNAL(modified()),this,SIGNAL(modified()));
+ connect(op,TQT_SIGNAL(modified()),this,TQT_SIGNAL(modified()));
return true;
}
@@ -270,22 +270,22 @@ int UMLClassifier::removeOperation(UMLOperation *op) {
}
// disconnection needed.
// note that we don't delete the operation, just remove it from the Classifier
- disconnect(op,SIGNAL(modified()),this,SIGNAL(modified()));
+ disconnect(op,TQT_SIGNAL(modified()),this,TQT_SIGNAL(modified()));
emit operationRemoved(op);
UMLObject::emitModified();
return m_List.count();
}
-UMLObject* UMLClassifier::createTemplate(const QString& currentName /*= QString()*/) {
- QString name = currentName;
+UMLObject* UMLClassifier::createTemplate(const TQString& currentName /*= TQString()*/) {
+ TQString name = currentName;
bool goodName = !name.isEmpty();
if (!goodName)
name = uniqChildName(Uml::ot_Template);
UMLTemplate* newTemplate = new UMLTemplate(this, name);
- int button = QDialog::Accepted;
+ int button = TQDialog::Accepted;
- while (button==QDialog::Accepted && !goodName) {
+ while (button==TQDialog::Accepted && !goodName) {
UMLTemplateDialog templateDialogue(0, newTemplate);
button = templateDialogue.exec();
name = newTemplate->getName();
@@ -299,7 +299,7 @@ UMLObject* UMLClassifier::createTemplate(const QString& currentName /*= QString(
}
}
- if (button != QDialog::Accepted) {
+ if (button != TQDialog::Accepted) {
return NULL;
}
@@ -326,7 +326,7 @@ UMLAttributeList UMLClassifier::getAttributeList() const{
return attributeList;
}
-UMLOperationList UMLClassifier::findOperations(const QString &n) {
+UMLOperationList UMLClassifier::findOperations(const TQString &n) {
const bool caseSensitive = UMLApp::app()->activeLanguageIsCaseSensitive();
UMLOperationList list;
for (UMLObjectListIt lit(m_List); lit.current(); ++lit) {
@@ -495,12 +495,12 @@ bool UMLClassifier::acceptAssociationType(Uml::Association_Type type)
return false; //shutup compiler warning
}
-UMLAttribute* UMLClassifier::createAttribute(const QString &name,
+UMLAttribute* UMLClassifier::createAttribute(const TQString &name,
UMLObject *type,
Uml::Visibility vis,
- const QString &init) {
+ const TQString &init) {
Uml::IDType id = UniqueID::gen();
- QString currentName;
+ TQString currentName;
if (name.isNull()) {
currentName = uniqChildName(Uml::ot_Attribute);
} else {
@@ -508,15 +508,15 @@ UMLAttribute* UMLClassifier::createAttribute(const QString &name,
}
UMLAttribute* newAttribute = new UMLAttribute(this, currentName, id, vis, type, init);
- int button = QDialog::Accepted;
+ int button = TQDialog::Accepted;
bool goodName = false;
//check for name.isNull() stops dialog being shown
//when creating attribute via list view
- while (button == QDialog::Accepted && !goodName && name.isNull()) {
+ while (button == TQDialog::Accepted && !goodName && name.isNull()) {
UMLAttributeDialog attributeDialogue(0, newAttribute);
button = attributeDialogue.exec();
- QString name = newAttribute->getName();
+ TQString name = newAttribute->getName();
if(name.length() == 0) {
KMessageBox::error(0, i18n("That is an invalid name."), i18n("Invalid Name"));
@@ -527,7 +527,7 @@ UMLAttribute* UMLClassifier::createAttribute(const QString &name,
}
}
- if (button != QDialog::Accepted) {
+ if (button != TQDialog::Accepted) {
delete newAttribute;
return NULL;
}
@@ -539,7 +539,7 @@ UMLAttribute* UMLClassifier::createAttribute(const QString &name,
return newAttribute;
}
-UMLAttribute* UMLClassifier::addAttribute(const QString &name, Uml::IDType id /* = Uml::id_None */) {
+UMLAttribute* UMLClassifier::addAttribute(const TQString &name, Uml::IDType id /* = Uml::id_None */) {
for (UMLObjectListIt lit(m_List); lit.current(); ++lit) {
UMLObject *obj = lit.current();
if (obj->getBaseType() == Uml::ot_Attribute && obj->getName() == name)
@@ -550,11 +550,11 @@ UMLAttribute* UMLClassifier::addAttribute(const QString &name, Uml::IDType id /*
m_List.append(a);
emit attributeAdded(a);
UMLObject::emitModified();
- connect(a,SIGNAL(modified()),this,SIGNAL(modified()));
+ connect(a,TQT_SIGNAL(modified()),this,TQT_SIGNAL(modified()));
return a;
}
-UMLAttribute* UMLClassifier::addAttribute(const QString &name, UMLObject *type, Uml::Visibility scope) {
+UMLAttribute* UMLClassifier::addAttribute(const TQString &name, UMLObject *type, Uml::Visibility scope) {
UMLAttribute *a = new UMLAttribute(this);
a->setName(name);
a->setVisibility(scope);
@@ -564,7 +564,7 @@ UMLAttribute* UMLClassifier::addAttribute(const QString &name, UMLObject *type,
m_List.append(a);
emit attributeAdded(a);
UMLObject::emitModified();
- connect(a,SIGNAL(modified()),this,SIGNAL(modified()));
+ connect(a,TQT_SIGNAL(modified()),this,TQT_SIGNAL(modified()));
return a;
}
@@ -579,7 +579,7 @@ bool UMLClassifier::addAttribute(UMLAttribute* att, IDChangeLog* Log /* = 0 */,
m_List.append(att);
emit attributeAdded(att);
UMLObject::emitModified();
- connect(att, SIGNAL(modified()), this, SIGNAL(modified()));
+ connect(att, TQT_SIGNAL(modified()), this, TQT_SIGNAL(modified()));
return true;
} else if (Log) {
Log->removeChangeByNewID(att->getID());
@@ -596,8 +596,8 @@ int UMLClassifier::removeAttribute(UMLAttribute* a) {
emit attributeRemoved(a);
UMLObject::emitModified();
// If we are deleting the object, then we don't need to disconnect..this is done auto-magically
- // for us by QObject. -b.t.
- // disconnect(a,SIGNAL(modified()),this,SIGNAL(modified()));
+ // for us by TQObject. -b.t.
+ // disconnect(a,TQT_SIGNAL(modified()),this,TQT_SIGNAL(modified()));
delete a;
return m_List.count();
}
@@ -643,7 +643,7 @@ UMLOperationList UMLClassifier::getOpList(bool includeInherited) {
UMLOperationList pops = c->getOpList(true);
// add these operations to operation list, but only if unique.
for (UMLOperation *po = pops.first(); po; po = pops.next()) {
- QString po_as_string(po->toString(Uml::st_SigNoVis));
+ TQString po_as_string(po->toString(Uml::st_SigNoVis));
UMLOperation *o = NULL;
for (o = ops.first(); o; o = ops.next())
if (o->toString(Uml::st_SigNoVis) == po_as_string)
@@ -669,7 +669,7 @@ UMLClassifierListItemList UMLClassifier::getFilteredList(Uml::Object_Type ot) co
return resultList;
}
-UMLTemplate* UMLClassifier::addTemplate(const QString &name, Uml::IDType id) {
+UMLTemplate* UMLClassifier::addTemplate(const TQString &name, Uml::IDType id) {
UMLTemplate *t = findTemplate(name);
if (t)
return t;
@@ -677,19 +677,19 @@ UMLTemplate* UMLClassifier::addTemplate(const QString &name, Uml::IDType id) {
m_List.append(t);
emit templateAdded(t);
UMLObject::emitModified();
- connect(t, SIGNAL(modified()), this, SIGNAL(modified()));
+ connect(t, TQT_SIGNAL(modified()), this, TQT_SIGNAL(modified()));
return t;
}
bool UMLClassifier::addTemplate(UMLTemplate* newTemplate, IDChangeLog* log /* = 0*/) {
- QString name = newTemplate->getName();
+ TQString name = newTemplate->getName();
if (findChildObject(name) == NULL) {
newTemplate->parent()->removeChild(newTemplate);
this->insertChild(newTemplate);
m_List.append(newTemplate);
emit templateAdded(newTemplate);
UMLObject::emitModified();
- connect(newTemplate,SIGNAL(modified()),this,SIGNAL(modified()));
+ connect(newTemplate,TQT_SIGNAL(modified()),this,TQT_SIGNAL(modified()));
return true;
} else if (log) {
log->removeChangeByNewID( newTemplate->getID() );
@@ -700,7 +700,7 @@ bool UMLClassifier::addTemplate(UMLTemplate* newTemplate, IDChangeLog* log /* =
bool UMLClassifier::addTemplate(UMLTemplate* Template, int position)
{
- QString name = Template->getName();
+ TQString name = Template->getName();
if (findChildObject(name) == NULL) {
Template->parent()->removeChild(Template);
this->insertChild(Template);
@@ -710,7 +710,7 @@ bool UMLClassifier::addTemplate(UMLTemplate* Template, int position)
m_List.append(Template);
emit templateAdded(Template);
UMLObject::emitModified();
- connect(Template,SIGNAL(modified()),this,SIGNAL(modified()));
+ connect(Template,TQT_SIGNAL(modified()),this,TQT_SIGNAL(modified()));
return true;
}
//else
@@ -724,12 +724,12 @@ int UMLClassifier::removeTemplate(UMLTemplate* umltemplate) {
}
emit templateRemoved(umltemplate);
UMLObject::emitModified();
- disconnect(umltemplate,SIGNAL(modified()),this,SIGNAL(modified()));
+ disconnect(umltemplate,TQT_SIGNAL(modified()),this,TQT_SIGNAL(modified()));
return m_List.count();
}
-UMLTemplate *UMLClassifier::findTemplate(const QString& name) {
+UMLTemplate *UMLClassifier::findTemplate(const TQString& name) {
UMLTemplateList templParams = getTemplateList();
for (UMLTemplate *t = templParams.first(); t; t = templParams.next()) {
if (t->getName() == name)
@@ -756,12 +756,12 @@ UMLTemplateList UMLClassifier::getTemplateList() const {
int UMLClassifier::takeItem(UMLClassifierListItem *item) {
UMLObject* currentAtt;
- QString buf;
+ TQString buf;
for (UMLObjectListIt it0(m_List);
(currentAtt = it0.current()); ++it0) {
- QString txt = currentAtt->getName();
+ TQString txt = currentAtt->getName();
if (txt.isEmpty())
- txt = "Type-" + QString::number((int) currentAtt->getBaseType());
+ txt = "Type-" + TQString::number((int) currentAtt->getBaseType());
buf.append(' ' + currentAtt->getName());
}
kDebug() << " UMLClassifier::takeItem (before): m_List is " << buf << endl;
@@ -847,7 +847,7 @@ UMLAssociationList UMLClassifier::getUniAssociationToBeImplemented() {
if (a->getObjectId(Uml::B) == getID())
continue; // we need to be at the A side
- QString roleNameB = a->getRoleName(Uml::B);
+ TQString roleNameB = a->getRoleName(Uml::B);
if (!roleNameB.isEmpty()) {
UMLAttributeList atl = getAttributeList();
bool found = false;
@@ -866,8 +866,8 @@ UMLAssociationList UMLClassifier::getUniAssociationToBeImplemented() {
return uniAssocListToBeImplemented;
}
-void UMLClassifier::saveToXMI(QDomDocument & qDoc, QDomElement & qElement) {
- QString tag;
+void UMLClassifier::saveToXMI(TQDomDocument & qDoc, TQDomElement & qElement) {
+ TQString tag;
switch (m_BaseType) {
case Uml::ot_Class:
tag = "UML:Class";
@@ -883,7 +883,7 @@ void UMLClassifier::saveToXMI(QDomDocument & qDoc, QDomElement & qElement) {
<< m_BaseType << endl;
return;
}
- QDomElement classifierElement = UMLObject::save(tag, qDoc);
+ TQDomElement classifierElement = UMLObject::save(tag, qDoc);
if (m_BaseType == Uml::ot_Datatype && m_pSecondary != NULL)
classifierElement.setAttribute( "elementReference",
ID2STR(m_pSecondary->getID()) );
@@ -891,7 +891,7 @@ void UMLClassifier::saveToXMI(QDomDocument & qDoc, QDomElement & qElement) {
//save templates
UMLClassifierListItemList list = getFilteredList(Uml::ot_Template);
if (list.count()) {
- QDomElement tmplElement = qDoc.createElement( "UML:ModelElement.templateParameter" );
+ TQDomElement tmplElement = qDoc.createElement( "UML:ModelElement.templateParameter" );
for (UMLClassifierListItem *tmpl = list.first(); tmpl; tmpl = list.next() ) {
tmpl->saveToXMI(qDoc, tmplElement);
}
@@ -901,12 +901,12 @@ void UMLClassifier::saveToXMI(QDomDocument & qDoc, QDomElement & qElement) {
//save generalizations (we are the subclass, the other end is the superclass)
UMLAssociationList generalizations = getSpecificAssocs(Uml::at_Generalization);
if (generalizations.count()) {
- QDomElement genElement = qDoc.createElement("UML:GeneralizableElement.generalization");
+ TQDomElement genElement = qDoc.createElement("UML:GeneralizableElement.generalization");
for (UMLAssociation *a = generalizations.first(); a; a = generalizations.next()) {
// We are the subclass if we are at the role A end.
if (m_nId != a->getObjectId(Uml::A))
continue;
- QDomElement gElem = qDoc.createElement("UML:Generalization");
+ TQDomElement gElem = qDoc.createElement("UML:Generalization");
gElem.setAttribute( "xmi.idref", ID2STR(a->getID()) );
genElement.appendChild(gElem);
}
@@ -915,7 +915,7 @@ void UMLClassifier::saveToXMI(QDomDocument & qDoc, QDomElement & qElement) {
}
// save attributes
- QDomElement featureElement = qDoc.createElement( "UML:Classifier.feature" );
+ TQDomElement featureElement = qDoc.createElement( "UML:Classifier.feature" );
UMLClassifierListItemList attList = getFilteredList(Uml::ot_Attribute);
for (UMLClassifierListItem *pAtt = attList.first(); pAtt; pAtt = attList.next() )
pAtt -> saveToXMI( qDoc, featureElement );
@@ -929,7 +929,7 @@ void UMLClassifier::saveToXMI(QDomDocument & qDoc, QDomElement & qElement) {
// save contained objects
if (m_objects.count()) {
- QDomElement ownedElement = qDoc.createElement( "UML:Namespace.ownedElement" );
+ TQDomElement ownedElement = qDoc.createElement( "UML:Namespace.ownedElement" );
for (UMLObjectListIt oit(m_objects); oit.current(); ++oit) {
UMLObject *obj = oit.current();
obj->saveToXMI (qDoc, ownedElement);
@@ -939,7 +939,7 @@ void UMLClassifier::saveToXMI(QDomDocument & qDoc, QDomElement & qElement) {
qElement.appendChild( classifierElement );
}
-UMLClassifierListItem* UMLClassifier::makeChildObject(const QString& xmiTag) {
+UMLClassifierListItem* UMLClassifier::makeChildObject(const TQString& xmiTag) {
UMLClassifierListItem* pObject = NULL;
if (tagEq(xmiTag, "Operation")) {
pObject = new UMLOperation(this);
@@ -953,7 +953,7 @@ UMLClassifierListItem* UMLClassifier::makeChildObject(const QString& xmiTag) {
return pObject;
}
-bool UMLClassifier::load(QDomElement& element) {
+bool UMLClassifier::load(TQDomElement& element) {
UMLClassifierListItem *child = NULL;
m_SecondaryId = element.attribute( "elementReference", "" );
if (!m_SecondaryId.isEmpty()) {
@@ -961,12 +961,12 @@ bool UMLClassifier::load(QDomElement& element) {
m_isRef = true;
}
bool totalSuccess = true;
- for (QDomNode node = element.firstChild(); !node.isNull();
+ for (TQDomNode node = element.firstChild(); !node.isNull();
node = node.nextSibling()) {
if (node.isComment())
continue;
element = node.toElement();
- QString tag = element.tagName();
+ TQString tag = element.tagName();
if (tagEq(tag, "ModelElement.templateParameter") ||
tagEq(tag, "Classifier.feature") ||
tagEq(tag, "Namespace.ownedElement") ||