summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/clipboard
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-12 01:36:19 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-12 01:36:19 +0000
commit99a2774ca6f1cab334de5d43fe36fc44ae889a4c (patch)
treeeff34cf0762227f6baf2a93e8fef48d4bed2651c /umbrello/umbrello/clipboard
parent1c104292188541106338d4940b0f04beeb4301a0 (diff)
downloadtdesdk-99a2774ca6f1cab334de5d43fe36fc44ae889a4c.tar.gz
tdesdk-99a2774ca6f1cab334de5d43fe36fc44ae889a4c.zip
TQt4 convert kdesdk
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1236185 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'umbrello/umbrello/clipboard')
-rw-r--r--umbrello/umbrello/clipboard/umlclipboard.cpp40
-rw-r--r--umbrello/umbrello/clipboard/umlclipboard.h9
-rw-r--r--umbrello/umbrello/clipboard/umldrag.cpp32
-rw-r--r--umbrello/umbrello/clipboard/umldrag.h7
4 files changed, 45 insertions, 43 deletions
diff --git a/umbrello/umbrello/clipboard/umlclipboard.cpp b/umbrello/umbrello/clipboard/umlclipboard.cpp
index 069ba84b..357f97f7 100644
--- a/umbrello/umbrello/clipboard/umlclipboard.cpp
+++ b/umbrello/umbrello/clipboard/umlclipboard.cpp
@@ -267,7 +267,7 @@ void UMLClipboard::checkItemForCopyType(UMLListViewItem* Item, bool & WithDiagra
}
}
-/** Adds the children of a UMLListViewItem to m_ItemList */
+/** Adds the tqchildren of a UMLListViewItem to m_ItemList */
bool UMLClipboard::insertItemChildren(UMLListViewItem * Item, UMLListViewItemList& SelectedItems) {
if(Item->childCount()) {
UMLListViewItem * child = (UMLListViewItem*)Item->firstChild();
@@ -281,7 +281,7 @@ bool UMLClipboard::insertItemChildren(UMLListViewItem * Item, UMLListViewItemLis
// If the child is selected, remove it from the list of selected items
// otherwise it will be inserted twice in m_ObjectList.
if(child->isSelected()) {
- SelectedItems.remove(SelectedItems.find(child) );
+ SelectedItems.remove(SelectedItems.tqfind(child) );
}
insertItemChildren(child, SelectedItems);
child = (UMLListViewItem*)child->nextSibling();
@@ -290,14 +290,14 @@ bool UMLClipboard::insertItemChildren(UMLListViewItem * Item, UMLListViewItemLis
return true;
}
-bool UMLClipboard::pasteChildren(UMLListViewItem *parent, IDChangeLog *chgLog) {
- if (!parent) {
- kWarning() << "Paste Children Error, parent missing" << endl;
+bool UMLClipboard::pasteChildren(UMLListViewItem *tqparent, IDChangeLog *chgLog) {
+ if (!tqparent) {
+ kWarning() << "Paste Children Error, tqparent missing" << endl;
return false;
}
UMLDoc *doc = UMLApp::app()->getDocument();
UMLListView *listView = UMLApp::app()->getListView();
- UMLListViewItem *childItem = static_cast<UMLListViewItem*>(parent->firstChild());
+ UMLListViewItem *childItem = static_cast<UMLListViewItem*>(tqparent->firstChild());
while (childItem) {
Uml::IDType oldID = childItem->getID();
Uml::IDType newID = chgLog->findNewID(oldID);
@@ -347,7 +347,7 @@ bool UMLClipboard::pasteClip1(TQMimeSource* data) {
return true;
lv->setStartedCopy(false);
/* If we get here we are pasting after a Copy and need to
- // paste possible children.
+ // paste possible tqchildren.
UMLListViewItem* itemdata = 0;
UMLListViewItemListIt it(itemdatalist);
while ( (itemdata=it.current()) != 0 ) {
@@ -571,9 +571,9 @@ bool UMLClipboard::pasteClip5(TQMimeSource* data) {
(lvitem->getType() != Uml::lvt_Class && lvitem->getType() != Uml::lvt_Interface)) {
return false;
}
- UMLClassifier *parent = dynamic_cast<UMLClassifier *>(lvitem->getUMLObject());
- if (parent == NULL) {
- kError() << "UMLClipboard::pasteClip5: parent is not a UMLClassifier"
+ UMLClassifier *tqparent = dynamic_cast<UMLClassifier *>(lvitem->getUMLObject());
+ if (tqparent == NULL) {
+ kError() << "UMLClipboard::pasteClip5: tqparent is not a UMLClassifier"
<< endl;
return false;
}
@@ -581,7 +581,7 @@ bool UMLClipboard::pasteClip5(TQMimeSource* data) {
UMLObjectList objects;
objects.setAutoDelete(false);
IDChangeLog* idchanges = 0;
- bool result = UMLDrag::decodeClip5(data, objects, parent);
+ bool result = UMLDrag::decodeClip5(data, objects, tqparent);
if(!result) {
return false;
@@ -599,16 +599,16 @@ bool UMLClipboard::pasteClip5(TQMimeSource* data) {
switch(obj->getBaseType()) {
case Uml::ot_Attribute :
{
- UMLObject *exist = parent->findChildObject(obj->getName(), Uml::ot_Attribute);
+ UMLObject *exist = tqparent->findChildObject(obj->getName(), Uml::ot_Attribute);
if (exist) {
- TQString newName = parent->uniqChildName(Uml::ot_Attribute, obj->getName());
+ TQString newName = tqparent->uniqChildName(Uml::ot_Attribute, obj->getName());
obj->setName(newName);
}
UMLAttribute *att = static_cast<UMLAttribute*>(obj);
- if (parent->addAttribute(att, idchanges)) {
+ if (tqparent->addAttribute(att, idchanges)) {
result = true;
} else {
- kError() << "UMLClipboard::pasteClip5: " << parent->getName()
+ kError() << "UMLClipboard::pasteClip5: " << tqparent->getName()
<< "->addAttribute(" << att->getName() << ") failed" << endl;
}
break;
@@ -616,21 +616,21 @@ bool UMLClipboard::pasteClip5(TQMimeSource* data) {
case Uml::ot_Operation :
{
UMLOperation *op = static_cast<UMLOperation*>(obj);
- UMLOperation *exist = parent->checkOperationSignature(op->getName(), op->getParmList());
+ UMLOperation *exist = tqparent->checkOperationSignature(op->getName(), op->getParmList());
if (exist) {
- TQString newName = parent->uniqChildName(Uml::ot_Operation, obj->getName());
+ TQString newName = tqparent->uniqChildName(Uml::ot_Operation, obj->getName());
op->setName(newName);
}
- if (parent->addOperation(op, idchanges)) {
+ if (tqparent->addOperation(op, idchanges)) {
result = true;
} else {
- kError() << "UMLClipboard::pasteClip5: " << parent->getName()
+ kError() << "UMLClipboard::pasteClip5: " << tqparent->getName()
<< "->addOperation(" << op->getName() << ") failed" << endl;
}
break;
}
default :
- kWarning() << "pasting unknown children type in clip type 5" << endl;
+ kWarning() << "pasting unknown tqchildren type in clip type 5" << endl;
return false;
}
}
diff --git a/umbrello/umbrello/clipboard/umlclipboard.h b/umbrello/umbrello/clipboard/umlclipboard.h
index ef3bbc02..b7a42e2e 100644
--- a/umbrello/umbrello/clipboard/umlclipboard.h
+++ b/umbrello/umbrello/clipboard/umlclipboard.h
@@ -33,6 +33,7 @@ class TQMimeSource;
*/
class UMLClipboard : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Constructor.
@@ -166,13 +167,13 @@ private:
bool& OnlyAttsOps);
/**
- * Adds the children of a UMLListViewItem to m_ItemList.
+ * Adds the tqchildren of a UMLListViewItem to m_ItemList.
*/
bool insertItemChildren(UMLListViewItem* Item,
UMLListViewItemList& SelectedItems);
/**
- * Inserts the data of the children of the given item
+ * Inserts the data of the tqchildren of the given item
* into the item data list. Used for clip type 4. Used
* to make * sure classes have all the attributes and
* operations saved.
@@ -180,9 +181,9 @@ private:
bool insertItemChildren(UMLListViewItem* item);
/**
- * Pastes the children of a UMLListViewItem (The Parent)
+ * Pastes the tqchildren of a UMLListViewItem (The Parent)
*/
- bool pasteChildren(UMLListViewItem* parent, IDChangeLog *chgLog);
+ bool pasteChildren(UMLListViewItem* tqparent, IDChangeLog *chgLog);
/**
* Gives a `sorry' message box if you're pasting an item which
diff --git a/umbrello/umbrello/clipboard/umldrag.cpp b/umbrello/umbrello/clipboard/umldrag.cpp
index 27f8dde2..e7bd5d90 100644
--- a/umbrello/umbrello/clipboard/umldrag.cpp
+++ b/umbrello/umbrello/clipboard/umldrag.cpp
@@ -108,11 +108,11 @@ void UMLDrag::setSubType(const TQCString& string, int index) {
data->setSubType(string, index);
}
-void UMLDrag::setEncodedData(const TQByteArray& encodedData, int index) {
- data->enc[index] = encodedData.copy();
+void UMLDrag::setEncodedData(const TQByteArray& tqencodedData, int index) {
+ data->enc[index] = tqencodedData.copy();
}
-TQByteArray UMLDrag::encodedData(const char* dataName) const {
+TQByteArray UMLDrag::tqencodedData(const char* dataName) const {
TQString str(dataName);
for (int i = 0; i < 4; i++) {
if ( !qstricmp(dataName,data->fmt[i]) ) {
@@ -286,7 +286,7 @@ bool UMLDrag::decodeClip1(const TQMimeSource* mimeSource, UMLObjectList& objects
if ( !mimeSource->provides("application/x-uml-clip1") ) {
return false;
}
- TQByteArray payload = mimeSource->encodedData("application/x-uml-clip1");
+ TQByteArray payload = mimeSource->tqencodedData("application/x-uml-clip1");
if ( !payload.size() ) {
return false;
}
@@ -376,7 +376,7 @@ bool UMLDrag::decodeClip2(const TQMimeSource* mimeSource, UMLObjectList& objects
if ( !mimeSource->provides("application/x-uml-clip2") ) {
return false;
}
- TQByteArray payload = mimeSource->encodedData("application/x-uml-clip2");
+ TQByteArray payload = mimeSource->tqencodedData("application/x-uml-clip2");
if ( !payload.size() ) {
return false;
}
@@ -439,12 +439,12 @@ bool UMLDrag::decodeClip2(const TQMimeSource* mimeSource, UMLObjectList& objects
while ( !diagramElement.isNull() ) {
TQString type = diagramElement.attribute("type", "0");
Uml::Diagram_Type dt = (Uml::Diagram_Type)type.toInt();
- UMLListViewItem *parent = listView->findFolderForDiagram(dt);
- if (parent == NULL)
+ UMLListViewItem *tqparent = listView->findFolderForDiagram(dt);
+ if (tqparent == NULL)
return false;
- UMLObject *po = parent->getUMLObject();
+ UMLObject *po = tqparent->getUMLObject();
if (po == NULL || po->getBaseType() != Uml::ot_Folder) {
- kError() << "UMLDrag::decodeClip2: bad parent for view" << endl;
+ kError() << "UMLDrag::decodeClip2: bad tqparent for view" << endl;
return false;
}
UMLFolder *f = static_cast<UMLFolder*>(po);
@@ -486,7 +486,7 @@ bool UMLDrag::getClip3TypeAndID(const TQMimeSource* mimeSource,
if ( !mimeSource->provides("application/x-uml-clip3") ) {
return false;
}
- TQByteArray payload = mimeSource->encodedData("application/x-uml-clip3");
+ TQByteArray payload = mimeSource->tqencodedData("application/x-uml-clip3");
if ( !payload.size() ) {
return false;
}
@@ -539,11 +539,11 @@ bool UMLDrag::getClip3TypeAndID(const TQMimeSource* mimeSource,
}
bool UMLDrag::decodeClip3(const TQMimeSource* mimeSource, UMLListViewItemList& umlListViewItems,
- const UMLListView* parentListView){
+ const UMLListView* tqparentListView){
if ( !mimeSource->provides("application/x-uml-clip3") ) {
return false;
}
- TQByteArray payload = mimeSource->encodedData("application/x-uml-clip3");
+ TQByteArray payload = mimeSource->tqencodedData("application/x-uml-clip3");
if ( !payload.size() ) {
return false;
}
@@ -584,8 +584,8 @@ bool UMLDrag::decodeClip3(const TQMimeSource* mimeSource, UMLListViewItemList& u
continue;
}
Uml::ListView_Type t = (Uml::ListView_Type)(type.toInt());
- UMLListViewItem* parent = parentListView->determineParentItem(t);
- UMLListViewItem* itemData = new UMLListViewItem(parent);
+ UMLListViewItem* tqparent = tqparentListView->determineParentItem(t);
+ UMLListViewItem* itemData = new UMLListViewItem(tqparent);
if ( itemData->loadFromXMI(listItemElement) )
umlListViewItems.append(itemData);
else
@@ -602,7 +602,7 @@ bool UMLDrag::decodeClip4(const TQMimeSource* mimeSource, UMLObjectList& objects
if ( !mimeSource->provides("application/x-uml-clip4") ) {
return false;
}
- TQByteArray payload = mimeSource->encodedData("application/x-uml-clip4");
+ TQByteArray payload = mimeSource->tqencodedData("application/x-uml-clip4");
if ( !payload.size() ) {
return false;
}
@@ -699,7 +699,7 @@ bool UMLDrag::decodeClip5(const TQMimeSource* mimeSource, UMLObjectList& objects
if ( !mimeSource->provides("application/x-uml-clip5") ) {
return false;
}
- TQByteArray payload = mimeSource->encodedData("application/x-uml-clip5");
+ TQByteArray payload = mimeSource->tqencodedData("application/x-uml-clip5");
if ( !payload.size() ) {
return false;
}
diff --git a/umbrello/umbrello/clipboard/umldrag.h b/umbrello/umbrello/clipboard/umldrag.h
index 97cbffb5..315e3c98 100644
--- a/umbrello/umbrello/clipboard/umldrag.h
+++ b/umbrello/umbrello/clipboard/umldrag.h
@@ -35,8 +35,9 @@ class UMLListView;
class UMLDragPrivate;
class UMLClassifier;
-class Q_EXPORT UMLDrag : public TQDragObject {
+class TQ_EXPORT UMLDrag : public TQDragObject {
Q_OBJECT
+ TQ_OBJECT
UMLDragPrivate* data;
public:
@@ -148,7 +149,7 @@ public:
*
* @param dataName the name of the data type to return
*/
- virtual TQByteArray encodedData(const char* dataName) const;
+ virtual TQByteArray tqencodedData(const char* dataName) const;
/**
* For use when the user selects only UML Objects
@@ -174,7 +175,7 @@ public:
*/
static bool decodeClip3(const TQMimeSource* mimeSource,
UMLListViewItemList& umlListViewItems,
- const UMLListView* parentListView=0);
+ const UMLListView* tqparentListView=0);
struct LvTypeAndID {
Uml::ListView_Type type;