summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/clipboard/umldrag.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'umbrello/umbrello/clipboard/umldrag.cpp')
-rw-r--r--umbrello/umbrello/clipboard/umldrag.cpp258
1 files changed, 129 insertions, 129 deletions
diff --git a/umbrello/umbrello/clipboard/umldrag.cpp b/umbrello/umbrello/clipboard/umldrag.cpp
index f9fa6629..27f8dde2 100644
--- a/umbrello/umbrello/clipboard/umldrag.cpp
+++ b/umbrello/umbrello/clipboard/umldrag.cpp
@@ -13,7 +13,7 @@
#include "umldrag.h"
// qt/kde includes
-#include <qdom.h>
+#include <tqdom.h>
#include <kdebug.h>
// local includes
@@ -34,21 +34,21 @@
#define nfmt 4
class UMLDragPrivate {
public:
- QCString fmt[nfmt];
- QCString subtype;
- QByteArray enc[nfmt];
+ TQCString fmt[nfmt];
+ TQCString subtype;
+ TQByteArray enc[nfmt];
UMLDragPrivate() {
setSubType("clip1", 0);
}
- void setType(const QCString& st, int index) {
+ void setType(const TQCString& st, int index) {
if (index < nfmt) {
fmt[index] = st.lower();
}
}
- void setSubType(const QCString& st, int index) {
+ void setSubType(const TQCString& st, int index) {
if (index < nfmt) {
subtype = st.lower();
fmt[index] = "application/x-uml-";
@@ -64,39 +64,39 @@ public:
}
};
-UMLDrag::UMLDrag(UMLObjectList& objects, QWidget* dragSource /*= 0*/, const char* name /*= 0*/)
- : QDragObject(dragSource, name) {
+UMLDrag::UMLDrag(UMLObjectList& objects, TQWidget* dragSource /*= 0*/, const char* name /*= 0*/)
+ : TQDragObject(dragSource, name) {
data = new UMLDragPrivate;
setUMLDataClip1(objects);
}
UMLDrag::UMLDrag(UMLObjectList& objects, UMLListViewItemList& umlListViewItems, UMLViewList& diagrams,
- QWidget* dragSource /*= 0*/, const char* name /*= 0*/ ): QDragObject(dragSource, name) {
+ TQWidget* dragSource /*= 0*/, const char* name /*= 0*/ ): TQDragObject(dragSource, name) {
data = new UMLDragPrivate;
setUMLDataClip2(objects, umlListViewItems, diagrams);
}
-UMLDrag::UMLDrag(UMLListViewItemList& umlListViewItems, QWidget* dragSource /*= 0*/,
- const char* name /*= 0*/ ): QDragObject(dragSource, name) {
+UMLDrag::UMLDrag(UMLListViewItemList& umlListViewItems, TQWidget* dragSource /*= 0*/,
+ const char* name /*= 0*/ ): TQDragObject(dragSource, name) {
data = new UMLDragPrivate;
setUMLDataClip3(umlListViewItems);
}
UMLDrag::UMLDrag(UMLObjectList& objects,
UMLWidgetList& widgets, AssociationWidgetList& associationDatas,
- QPixmap& pngImage, Uml::Diagram_Type dType, QWidget * dragSource /*= 0*/,
- const char * name /*= 0*/ ): QDragObject(dragSource, name) {
+ TQPixmap& pngImage, Uml::Diagram_Type dType, TQWidget * dragSource /*= 0*/,
+ const char * name /*= 0*/ ): TQDragObject(dragSource, name) {
data = new UMLDragPrivate;
setUMLDataClip4(objects, widgets, associationDatas, pngImage, dType);
}
UMLDrag::UMLDrag(UMLObjectList& objects, int,
- QWidget* /*dragSource = 0*/, const char* /*name = 0*/ ) {
+ TQWidget* /*dragSource = 0*/, const char* /*name = 0*/ ) {
data = new UMLDragPrivate;
setUMLDataClip5(objects);
}
-UMLDrag::UMLDrag(QWidget* dragSource /*= 0*/, const char * name /*= 0*/ ): QDragObject(dragSource, name) {
+UMLDrag::UMLDrag(TQWidget* dragSource /*= 0*/, const char * name /*= 0*/ ): TQDragObject(dragSource, name) {
data = new UMLDragPrivate;
}
@@ -104,22 +104,22 @@ UMLDrag::~UMLDrag() {
delete data;
}
-void UMLDrag::setSubType(const QCString& string, int index) {
+void UMLDrag::setSubType(const TQCString& string, int index) {
data->setSubType(string, index);
}
-void UMLDrag::setEncodedData(const QByteArray& encodedData, int index) {
+void UMLDrag::setEncodedData(const TQByteArray& encodedData, int index) {
data->enc[index] = encodedData.copy();
}
-QByteArray UMLDrag::encodedData(const char* dataName) const {
- QString str(dataName);
+TQByteArray UMLDrag::encodedData(const char* dataName) const {
+ TQString str(dataName);
for (int i = 0; i < 4; i++) {
if ( !qstricmp(dataName,data->fmt[i]) ) {
return data->enc[i];
}
}
- return QByteArray();
+ return TQByteArray();
}
const char* UMLDrag::format(int index) const {
@@ -130,10 +130,10 @@ const char* UMLDrag::format(int index) const {
void UMLDrag::setUMLDataClip1(UMLObjectList& objects) {
setSubType("clip1", 0);
- QDomDocument domDoc;
- QDomElement xmiclip = domDoc.createElement("xmiclip");
+ TQDomDocument domDoc;
+ TQDomElement xmiclip = domDoc.createElement("xmiclip");
domDoc.appendChild(xmiclip);
- QDomElement objectsTag = domDoc.createElement("umlobjects");
+ TQDomElement objectsTag = domDoc.createElement("umlobjects");
xmiclip.appendChild(objectsTag);
UMLObjectListIt object_it(objects);
@@ -143,7 +143,7 @@ void UMLDrag::setUMLDataClip1(UMLObjectList& objects) {
obj->saveToXMI(domDoc, objectsTag);
}
- QDomElement itemsTag = domDoc.createElement("umllistviewitems");
+ TQDomElement itemsTag = domDoc.createElement("umllistviewitems");
xmiclip.appendChild(itemsTag);
setEncodedData(domDoc.toString().utf8(), 0);
@@ -153,10 +153,10 @@ void UMLDrag::setUMLDataClip2(UMLObjectList& objects, UMLListViewItemList& umlLi
UMLViewList& diagrams) {
setSubType("clip2", 0);
- QDomDocument domDoc;
- QDomElement xmiclip = domDoc.createElement("xmiclip");
+ TQDomDocument domDoc;
+ TQDomElement xmiclip = domDoc.createElement("xmiclip");
domDoc.appendChild(xmiclip);
- QDomElement objectsTag = domDoc.createElement("umlobjects");
+ TQDomElement objectsTag = domDoc.createElement("umlobjects");
xmiclip.appendChild(objectsTag);
UMLObjectListIt object_it(objects);
@@ -166,7 +166,7 @@ void UMLDrag::setUMLDataClip2(UMLObjectList& objects, UMLListViewItemList& umlLi
obj->saveToXMI(domDoc, objectsTag);
}
- QDomElement viewsTag = domDoc.createElement("umlviews");
+ TQDomElement viewsTag = domDoc.createElement("umlviews");
xmiclip.appendChild(viewsTag);
UMLViewListIt diagram_it(diagrams);
@@ -176,7 +176,7 @@ void UMLDrag::setUMLDataClip2(UMLObjectList& objects, UMLListViewItemList& umlLi
view->saveToXMI(domDoc, viewsTag);
}
- QDomElement itemsTag = domDoc.createElement("umllistviewitems");
+ TQDomElement itemsTag = domDoc.createElement("umllistviewitems");
xmiclip.appendChild(itemsTag);
UMLListViewItemListIt item_it2(umlListViewItems);
@@ -191,11 +191,11 @@ void UMLDrag::setUMLDataClip2(UMLObjectList& objects, UMLListViewItemList& umlLi
void UMLDrag::setUMLDataClip3(UMLListViewItemList& umlListViewItems) {
setSubType("clip3", 0);
- QDomDocument domDoc;
- QDomElement xmiclip = domDoc.createElement("xmiclip");
+ TQDomDocument domDoc;
+ TQDomElement xmiclip = domDoc.createElement("xmiclip");
domDoc.appendChild(xmiclip);
- QDomElement itemsTag = domDoc.createElement("umllistviewitems");
+ TQDomElement itemsTag = domDoc.createElement("umllistviewitems");
xmiclip.appendChild(itemsTag);
UMLListViewItemListIt item_it2(umlListViewItems);
@@ -208,14 +208,14 @@ void UMLDrag::setUMLDataClip3(UMLListViewItemList& umlListViewItems) {
}
void UMLDrag::setUMLDataClip4(UMLObjectList& objects, UMLWidgetList& widgets, AssociationWidgetList& associations,
- QPixmap& pngImage, Uml::Diagram_Type dType ) {
+ TQPixmap& pngImage, Uml::Diagram_Type dType ) {
setSubType("clip4", 0);
- QDomDocument domDoc;
- QDomElement xmiclip = domDoc.createElement("xmiclip");
+ TQDomDocument domDoc;
+ TQDomElement xmiclip = domDoc.createElement("xmiclip");
xmiclip.setAttribute("diagramtype", dType);
domDoc.appendChild(xmiclip);
- QDomElement objectsTag = domDoc.createElement("umlobjects");
+ TQDomElement objectsTag = domDoc.createElement("umlobjects");
xmiclip.appendChild(objectsTag);
UMLObjectListIt object_it(objects);
@@ -225,7 +225,7 @@ void UMLDrag::setUMLDataClip4(UMLObjectList& objects, UMLWidgetList& widgets, As
obj->saveToXMI(domDoc, objectsTag);
}
- QDomElement widgetsTag = domDoc.createElement("widgets");
+ TQDomElement widgetsTag = domDoc.createElement("widgets");
xmiclip.appendChild(widgetsTag);
UMLWidgetListIt widget_it(widgets);
@@ -235,7 +235,7 @@ void UMLDrag::setUMLDataClip4(UMLObjectList& objects, UMLWidgetList& widgets, As
widget->saveToXMI(domDoc, widgetsTag);
}
- QDomElement associationWidgetsTag = domDoc.createElement("associations");
+ TQDomElement associationWidgetsTag = domDoc.createElement("associations");
xmiclip.appendChild(associationWidgetsTag);
AssociationWidgetListIt associations_it(associations);
@@ -245,16 +245,16 @@ void UMLDrag::setUMLDataClip4(UMLObjectList& objects, UMLWidgetList& widgets, As
association->saveToXMI(domDoc, associationWidgetsTag);
}
- QDomElement itemsTag = domDoc.createElement("umllistviewitems");
+ TQDomElement itemsTag = domDoc.createElement("umllistviewitems");
xmiclip.appendChild(itemsTag);
setEncodedData(domDoc.toString().utf8(), 0);
data->setType("image/PNG", 1);
long l_size = (pngImage.convertToImage()).numBytes();
- QByteArray clipdata;
+ TQByteArray clipdata;
clipdata.resize(l_size);
- QDataStream clipstream(clipdata, IO_WriteOnly);
+ TQDataStream clipstream(clipdata, IO_WriteOnly);
clipstream << pngImage;
setEncodedData(clipdata, 1);
}
@@ -262,10 +262,10 @@ void UMLDrag::setUMLDataClip4(UMLObjectList& objects, UMLWidgetList& widgets, As
void UMLDrag::setUMLDataClip5(UMLObjectList& objects) {
setSubType("clip5", 0);
- QDomDocument domDoc;
- QDomElement xmiclip = domDoc.createElement("xmiclip");
+ TQDomDocument domDoc;
+ TQDomElement xmiclip = domDoc.createElement("xmiclip");
domDoc.appendChild(xmiclip);
- QDomElement objectsTag = domDoc.createElement("umlobjects");
+ TQDomElement objectsTag = domDoc.createElement("umlobjects");
xmiclip.appendChild(objectsTag);
UMLObjectListIt object_it(objects);
@@ -275,32 +275,32 @@ void UMLDrag::setUMLDataClip5(UMLObjectList& objects) {
obj->saveToXMI(domDoc, objectsTag);
}
- QDomElement itemsTag = domDoc.createElement("umllistviewitems");
+ TQDomElement itemsTag = domDoc.createElement("umllistviewitems");
xmiclip.appendChild(itemsTag);
setEncodedData(domDoc.toString().utf8(), 0);
}
-bool UMLDrag::decodeClip1(const QMimeSource* mimeSource, UMLObjectList& objects) {
+bool UMLDrag::decodeClip1(const TQMimeSource* mimeSource, UMLObjectList& objects) {
UMLDoc* doc = UMLApp::app()->getDocument();
if ( !mimeSource->provides("application/x-uml-clip1") ) {
return false;
}
- QByteArray payload = mimeSource->encodedData("application/x-uml-clip1");
+ TQByteArray payload = mimeSource->encodedData("application/x-uml-clip1");
if ( !payload.size() ) {
return false;
}
- QString xmiClip = QString::fromUtf8(payload);
+ TQString xmiClip = TQString::fromUtf8(payload);
- QString error;
+ TQString error;
int line;
- QDomDocument domDoc;
+ TQDomDocument domDoc;
if( !domDoc.setContent(xmiClip, false, &error, &line) ) {
kWarning() << "Can't set content:" << error << " Line:" << line << endl;
return false;
}
- QDomNode xmiClipNode = domDoc.firstChild();
- QDomElement root = xmiClipNode.toElement();
+ TQDomNode xmiClipNode = domDoc.firstChild();
+ TQDomElement root = xmiClipNode.toElement();
if ( root.isNull() ) {
return false;
}
@@ -312,16 +312,16 @@ bool UMLDrag::decodeClip1(const QMimeSource* mimeSource, UMLObjectList& objects)
UMLListView *listView = UMLApp::app()->getListView();
//UMLObjects
- QDomNode objectsNode = xmiClipNode.firstChild();
- QDomNode objectElement = objectsNode.firstChild();
- QDomElement element = objectElement.toElement();
+ TQDomNode objectsNode = xmiClipNode.firstChild();
+ TQDomNode objectElement = objectsNode.firstChild();
+ TQDomElement element = objectElement.toElement();
if ( element.isNull() ) {
return false;//return ok as it means there is no umlobjects
}
UMLObject* pObject = 0;
while ( !element.isNull() ) {
pObject = 0;
- QString type = element.tagName();
+ TQString type = element.tagName();
if (type == "UML:Association") {
objectElement = objectElement.nextSibling();
element = objectElement.toElement();
@@ -354,7 +354,7 @@ bool UMLDrag::decodeClip1(const QMimeSource* mimeSource, UMLObjectList& objects)
return false;
}
Uml::Object_Type type = pObject->getBaseType();
- QString newName = Model_Utils::uniqObjectName(type, pObject->getUMLPackage(),
+ TQString newName = Model_Utils::uniqObjectName(type, pObject->getUMLPackage(),
pObject->getName());
pObject->setName(newName);
/****************************************************************/
@@ -370,27 +370,27 @@ bool UMLDrag::decodeClip1(const QMimeSource* mimeSource, UMLObjectList& objects)
return true;
}
-bool UMLDrag::decodeClip2(const QMimeSource* mimeSource, UMLObjectList& objects,
+bool UMLDrag::decodeClip2(const TQMimeSource* mimeSource, UMLObjectList& objects,
UMLListViewItemList& umlListViewItems, UMLViewList& diagrams) {
if ( !mimeSource->provides("application/x-uml-clip2") ) {
return false;
}
- QByteArray payload = mimeSource->encodedData("application/x-uml-clip2");
+ TQByteArray payload = mimeSource->encodedData("application/x-uml-clip2");
if ( !payload.size() ) {
return false;
}
- QString xmiClip = QString::fromUtf8(payload);
+ TQString xmiClip = TQString::fromUtf8(payload);
- QString error;
+ TQString error;
int line;
- QDomDocument domDoc;
+ TQDomDocument domDoc;
if( !domDoc.setContent(xmiClip, false, &error, &line) ) {
kWarning() << "Can't set content:" << error << " Line:" << line << endl;
return false;
}
- QDomNode xmiClipNode = domDoc.firstChild();
- QDomElement root = xmiClipNode.toElement();
+ TQDomNode xmiClipNode = domDoc.firstChild();
+ TQDomElement root = xmiClipNode.toElement();
if ( root.isNull() ) {
return false;
}
@@ -400,16 +400,16 @@ bool UMLDrag::decodeClip2(const QMimeSource* mimeSource, UMLObjectList& objects,
}
//UMLObjects
- QDomNode objectsNode = xmiClipNode.firstChild();
- QDomNode objectElement = objectsNode.firstChild();
- QDomElement element = objectElement.toElement();
+ TQDomNode objectsNode = xmiClipNode.firstChild();
+ TQDomNode objectElement = objectsNode.firstChild();
+ TQDomElement element = objectElement.toElement();
if ( element.isNull() ) {
return false;//return ok as it means there is no umlobjects
}
UMLObject* pObject = 0;
while ( !element.isNull() ) {
pObject = 0;
- QString type = element.tagName();
+ TQString type = element.tagName();
if (type != "UML:Association") {
pObject = Object_Factory::makeObjectFromXMI(type);
@@ -428,16 +428,16 @@ bool UMLDrag::decodeClip2(const QMimeSource* mimeSource, UMLObjectList& objects,
}
//UMLViews (diagrams)
- QDomNode umlviewsNode = objectsNode.nextSibling();
- QDomNode diagramNode = umlviewsNode.firstChild();
- QDomElement diagramElement = diagramNode.toElement();
+ TQDomNode umlviewsNode = objectsNode.nextSibling();
+ TQDomNode diagramNode = umlviewsNode.firstChild();
+ TQDomElement diagramElement = diagramNode.toElement();
if ( diagramElement.isNull() ) {
kWarning() << "no diagrams in XMI clip" << endl;
return false;
}
UMLListView *listView = UMLApp::app()->getListView();
while ( !diagramElement.isNull() ) {
- QString type = diagramElement.attribute("type", "0");
+ TQString type = diagramElement.attribute("type", "0");
Uml::Diagram_Type dt = (Uml::Diagram_Type)type.toInt();
UMLListViewItem *parent = listView->findFolderForDiagram(dt);
if (parent == NULL)
@@ -456,9 +456,9 @@ bool UMLDrag::decodeClip2(const QMimeSource* mimeSource, UMLObjectList& objects,
}
//listviewitems
- QDomNode listItemNode = umlviewsNode.nextSibling();
- QDomNode listItems = listItemNode.firstChild();
- QDomElement listItemElement = listItems.toElement();
+ TQDomNode listItemNode = umlviewsNode.nextSibling();
+ TQDomNode listItems = listItemNode.firstChild();
+ TQDomElement listItemElement = listItems.toElement();
if ( listItemElement.isNull() ) {
kWarning() << "no listitems in XMI clip" << endl;
return false;
@@ -480,28 +480,28 @@ bool UMLDrag::decodeClip2(const QMimeSource* mimeSource, UMLObjectList& objects,
return true;
}
-bool UMLDrag::getClip3TypeAndID(const QMimeSource* mimeSource,
+bool UMLDrag::getClip3TypeAndID(const TQMimeSource* mimeSource,
LvTypeAndID_List& typeAndIdList)
{
if ( !mimeSource->provides("application/x-uml-clip3") ) {
return false;
}
- QByteArray payload = mimeSource->encodedData("application/x-uml-clip3");
+ TQByteArray payload = mimeSource->encodedData("application/x-uml-clip3");
if ( !payload.size() ) {
return false;
}
- QTextStream clipdata(payload, IO_ReadOnly);
- QString xmiClip = QString::fromUtf8(payload);
+ TQTextStream clipdata(payload, IO_ReadOnly);
+ TQString xmiClip = TQString::fromUtf8(payload);
- QString error;
+ TQString error;
int line;
- QDomDocument domDoc;
+ TQDomDocument domDoc;
if( !domDoc.setContent(xmiClip, false, &error, &line) ) {
kWarning() << "getClip3Type: Can't set content:" << error << " Line:" << line << endl;
return false;
}
- QDomNode xmiClipNode = domDoc.firstChild();
- QDomElement root = xmiClipNode.toElement();
+ TQDomNode xmiClipNode = domDoc.firstChild();
+ TQDomElement root = xmiClipNode.toElement();
if ( root.isNull() ) {
return false;
}
@@ -510,20 +510,20 @@ bool UMLDrag::getClip3TypeAndID(const QMimeSource* mimeSource,
return false;
}
- QDomNode listItemNode = xmiClipNode.firstChild();
- QDomNode listItems = listItemNode.firstChild();
- QDomElement listItemElement = listItems.toElement();
+ TQDomNode listItemNode = xmiClipNode.firstChild();
+ TQDomNode listItems = listItemNode.firstChild();
+ TQDomElement listItemElement = listItems.toElement();
if ( listItemElement.isNull() ) {
kWarning() << "getClip3Type: no listitems in XMI clip" << endl;
return false;
}
while ( !listItemElement.isNull() ) {
- QString typeStr = listItemElement.attribute( "type", "-1" );
+ TQString typeStr = listItemElement.attribute( "type", "-1" );
if (typeStr == "-1") {
kDebug() << "getClip3Type: bad type" << endl;
return false;
}
- QString idStr = listItemElement.attribute( "id", "-1" );
+ TQString idStr = listItemElement.attribute( "id", "-1" );
if (idStr == "-1") {
kDebug() << "getClip3Type: bad id" << endl;
return false;
@@ -538,27 +538,27 @@ bool UMLDrag::getClip3TypeAndID(const QMimeSource* mimeSource,
return true;
}
-bool UMLDrag::decodeClip3(const QMimeSource* mimeSource, UMLListViewItemList& umlListViewItems,
+bool UMLDrag::decodeClip3(const TQMimeSource* mimeSource, UMLListViewItemList& umlListViewItems,
const UMLListView* parentListView){
if ( !mimeSource->provides("application/x-uml-clip3") ) {
return false;
}
- QByteArray payload = mimeSource->encodedData("application/x-uml-clip3");
+ TQByteArray payload = mimeSource->encodedData("application/x-uml-clip3");
if ( !payload.size() ) {
return false;
}
- QTextStream clipdata(payload, IO_ReadOnly);
- QString xmiClip = QString::fromUtf8(payload);
+ TQTextStream clipdata(payload, IO_ReadOnly);
+ TQString xmiClip = TQString::fromUtf8(payload);
- QString error;
+ TQString error;
int line;
- QDomDocument domDoc;
+ TQDomDocument domDoc;
if( !domDoc.setContent(xmiClip, false, &error, &line) ) {
kWarning() << "Can't set content:" << error << " Line:" << line << endl;
return false;
}
- QDomNode xmiClipNode = domDoc.firstChild();
- QDomElement root = xmiClipNode.toElement();
+ TQDomNode xmiClipNode = domDoc.firstChild();
+ TQDomElement root = xmiClipNode.toElement();
if ( root.isNull() ) {
return false;
}
@@ -568,9 +568,9 @@ bool UMLDrag::decodeClip3(const QMimeSource* mimeSource, UMLListViewItemList& um
}
//listviewitems
- QDomNode listItemNode = xmiClipNode.firstChild();
- QDomNode listItems = listItemNode.firstChild();
- QDomElement listItemElement = listItems.toElement();
+ TQDomNode listItemNode = xmiClipNode.firstChild();
+ TQDomNode listItems = listItemNode.firstChild();
+ TQDomElement listItemElement = listItems.toElement();
if ( listItemElement.isNull() ) {
kWarning() << "no listitems in XMI clip" << endl;
return false;
@@ -578,7 +578,7 @@ bool UMLDrag::decodeClip3(const QMimeSource* mimeSource, UMLListViewItemList& um
while ( !listItemElement.isNull() ) {
// Get the ListView_Type beforehand so that we can construct an
// UMLListViewItem instance.
- QString type = listItemElement.attribute( "type", "-1" );
+ TQString type = listItemElement.attribute( "type", "-1" );
if (type == "-1") {
kDebug() << "Pech gehabt" << endl;
continue;
@@ -596,28 +596,28 @@ bool UMLDrag::decodeClip3(const QMimeSource* mimeSource, UMLListViewItemList& um
return true;
}
-bool UMLDrag::decodeClip4(const QMimeSource* mimeSource, UMLObjectList& objects,
+bool UMLDrag::decodeClip4(const TQMimeSource* mimeSource, UMLObjectList& objects,
UMLWidgetList& widgets,
AssociationWidgetList& associations, Uml::Diagram_Type & dType) {
if ( !mimeSource->provides("application/x-uml-clip4") ) {
return false;
}
- QByteArray payload = mimeSource->encodedData("application/x-uml-clip4");
+ TQByteArray payload = mimeSource->encodedData("application/x-uml-clip4");
if ( !payload.size() ) {
return false;
}
- QString xmiClip = QString::fromUtf8(payload);
+ TQString xmiClip = TQString::fromUtf8(payload);
- QString error;
+ TQString error;
int line;
- QDomDocument domDoc;
+ TQDomDocument domDoc;
if( !domDoc.setContent(xmiClip, false, &error, &line) ) {
kWarning() << "Can't set content:" << error << " Line:" << line << endl;
return false;
}
- QDomNode xmiClipNode = domDoc.firstChild();
- QDomElement root = xmiClipNode.toElement();
+ TQDomNode xmiClipNode = domDoc.firstChild();
+ TQDomElement root = xmiClipNode.toElement();
if ( root.isNull() ) {
return false;
}
@@ -629,12 +629,12 @@ bool UMLDrag::decodeClip4(const QMimeSource* mimeSource, UMLObjectList& objects,
dType = (Uml::Diagram_Type)(root.attribute("diagramtype", "0").toInt());
//UMLObjects
- QDomNode objectsNode = xmiClipNode.firstChild();
- QDomNode objectElement = objectsNode.firstChild();
- QDomElement element = objectElement.toElement();
+ TQDomNode objectsNode = xmiClipNode.firstChild();
+ TQDomNode objectElement = objectsNode.firstChild();
+ TQDomElement element = objectElement.toElement();
while ( !element.isNull() ) {
UMLObject* pObject = 0;
- QString type = element.tagName();
+ TQString type = element.tagName();
//FIXME associations don't load
if (type == "UML:Association")
continue;
@@ -656,9 +656,9 @@ bool UMLDrag::decodeClip4(const QMimeSource* mimeSource, UMLObjectList& objects,
}
//widgets
- QDomNode widgetsNode = objectsNode.nextSibling();
- QDomNode widgetNode = widgetsNode.firstChild();
- QDomElement widgetElement = widgetNode.toElement();
+ TQDomNode widgetsNode = objectsNode.nextSibling();
+ TQDomNode widgetNode = widgetsNode.firstChild();
+ TQDomElement widgetElement = widgetNode.toElement();
if ( widgetElement.isNull() ) {
kWarning() << "no widgets in XMI clip" << endl;
return false;
@@ -676,9 +676,9 @@ bool UMLDrag::decodeClip4(const QMimeSource* mimeSource, UMLObjectList& objects,
}
//AssociationWidgets
- QDomNode associationWidgetsNode = widgetsNode.nextSibling();
- QDomNode associationWidgetNode = associationWidgetsNode.firstChild();
- QDomElement associationWidgetElement = associationWidgetNode.toElement();
+ TQDomNode associationWidgetsNode = widgetsNode.nextSibling();
+ TQDomNode associationWidgetNode = associationWidgetsNode.firstChild();
+ TQDomElement associationWidgetElement = associationWidgetNode.toElement();
while ( !associationWidgetElement.isNull() ) {
AssociationWidget* associationWidget = new AssociationWidget(view);
if (associationWidget->loadFromXMI(associationWidgetElement, widgets))
@@ -694,26 +694,26 @@ bool UMLDrag::decodeClip4(const QMimeSource* mimeSource, UMLObjectList& objects,
return true;
}
-bool UMLDrag::decodeClip5(const QMimeSource* mimeSource, UMLObjectList& objects,
+bool UMLDrag::decodeClip5(const TQMimeSource* mimeSource, UMLObjectList& objects,
UMLClassifier* newParent) {
if ( !mimeSource->provides("application/x-uml-clip5") ) {
return false;
}
- QByteArray payload = mimeSource->encodedData("application/x-uml-clip5");
+ TQByteArray payload = mimeSource->encodedData("application/x-uml-clip5");
if ( !payload.size() ) {
return false;
}
- QString xmiClip = QString::fromUtf8(payload);
+ TQString xmiClip = TQString::fromUtf8(payload);
- QString error;
+ TQString error;
int line;
- QDomDocument domDoc;
+ TQDomDocument domDoc;
if( !domDoc.setContent(xmiClip, false, &error, &line) ) {
kWarning() << "Can't set content:" << error << " Line:" << line << endl;
return false;
}
- QDomNode xmiClipNode = domDoc.firstChild();
- QDomElement root = xmiClipNode.toElement();
+ TQDomNode xmiClipNode = domDoc.firstChild();
+ TQDomElement root = xmiClipNode.toElement();
if ( root.isNull() ) {
return false;
}
@@ -723,14 +723,14 @@ bool UMLDrag::decodeClip5(const QMimeSource* mimeSource, UMLObjectList& objects,
}
//UMLObjects
- QDomNode objectsNode = xmiClipNode.firstChild();
- QDomNode objectElement = objectsNode.firstChild();
- QDomElement element = objectElement.toElement();
+ TQDomNode objectsNode = xmiClipNode.firstChild();
+ TQDomNode objectElement = objectsNode.firstChild();
+ TQDomElement element = objectElement.toElement();
if ( element.isNull() ) {
return false;//return ok as it means there is no umlobjects
}
while ( !element.isNull() ) {
- QString type = element.tagName();
+ TQString type = element.tagName();
UMLClassifierListItem *pObject = newParent->makeChildObject(type);
if( !pObject ) {
kWarning() << "Given wrong type of umlobject to create:" << type << endl;
@@ -749,7 +749,7 @@ bool UMLDrag::decodeClip5(const QMimeSource* mimeSource, UMLObjectList& objects,
return true;
}
-int UMLDrag::getCodingType(const QMimeSource* mimeSource) {
+int UMLDrag::getCodingType(const TQMimeSource* mimeSource) {
int result = 0;
if (mimeSource->provides("application/x-uml-clip1") ) {
result = 1;