[Uml-devel] KDE/kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Sat Jun 18 01:38:16 UTC 2005


SVN commit 426709 by okellogg:

Implement listview drag/drop of attributes and operations.
The update of the model objects is still missing.
CCBUG:107551


 M  +21 -1     umllistview.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/umllistview.cpp #426708:426709
@@ -836,7 +836,8 @@
 	while((item=it.current()) != 0) {
 		++it;
 		Uml::ListView_Type type = item->getType();
-		if ( !typeIsCanvasWidget(type) && !typeIsDiagram(type) && !typeIsFolder(type) ) {
+		if ( !typeIsCanvasWidget(type) && !typeIsDiagram(type) && !typeIsFolder(type)
+		     && type != Uml::lvt_Attribute && type != Uml::lvt_Operation) {
 			return 0;
 		}
 		list.append(item);
@@ -1087,6 +1088,17 @@
 					accept = (dstType == Uml::lvt_Logical_Folder);
 				}
 				break;
+			case Uml::lvt_Attribute:
+				if (dstType == Uml::lvt_Class) {
+					accept = !item->isOwnParent(data->id);
+				}
+				break;
+			case Uml::lvt_Operation:
+				if (dstType == Uml::lvt_Class ||
+				    dstType == Uml::lvt_Interface) {
+					accept = !item->isOwnParent(data->id);
+				}
+				break;
 			case Uml::lvt_Datatype:
 				accept = (dstType == Uml::lvt_Logical_Folder ||
 					  dstType == Uml::lvt_Datatype_Folder ||
@@ -1254,6 +1266,14 @@
 				m_doc->getCurrentView()->updateContainment(o);
 			}
 			break;
+		case Uml::lvt_Attribute:
+		case Uml::lvt_Operation:
+			if (newParentType == Uml::lvt_Class ||
+			    newParentType == Uml::lvt_Interface) {
+				newItem = move->deepCopy(newParent);
+				delete move;
+			}
+			break;
 		default:
 			break;
 	}




More information about the umbrello-devel mailing list