[Uml-devel] KDE_3_3_BRANCH: kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Tue Aug 10 12:51:02 UTC 2004
CVS commit by okellogg:
Backport of following fix on HEAD:
> CVS commit by okellogg:
>
> slotDropped(): Fix dragging an item back to the view.
M +12 -6 umllistview.cpp 1.109.2.1
--- kdesdk/umbrello/umbrello/umllistview.cpp #1.109:1.109.2.1
@@ -139,5 +139,5 @@ void UMLListView::contentsMousePressEven
break;
}
- }//end switch
+ }
if(me->button() == RightButton) {
//setSelected( item, true);
@@ -659,8 +659,7 @@ QDragObject* UMLListView::dragObject() {
UMLListViewItemList list;
list.setAutoDelete( FALSE );
- Uml::ListView_Type type;
while((item=it.current()) != 0) {
++it;
- type = item->getType();
+ Uml::ListView_Type type = item->getType();
if ( !typeIsCanvasWidget(type) && !typeIsDiagram(type) && !typeIsFolder(type) ) {
return 0;
@@ -872,10 +871,14 @@ bool UMLListView::acceptDrag(QDropEvent*
UMLListViewItem* item = (UMLListViewItem*)itemAt(mousePoint);
if(!item) {
+ kdDebug() << "UMLListView::acceptDrag: itemAt(mousePoint) returns NULL"
+ << endl;
return false;
}
((QListView*)this)->setCurrentItem( (QListViewItem*)item );
- UMLDrag::LvTypeAndID_List list;
+ UMLDrag::LvTypeAndID_List list;
if (! UMLDrag::getClip3TypeAndID(event, list)) {
+ kdDebug() << "UMLListView::acceptDrag: UMLDrag::getClip3TypeAndID returns false"
+ << endl;
return false;
}
@@ -884,5 +887,4 @@ bool UMLListView::acceptDrag(QDropEvent*
UMLDrag::LvTypeAndID * data = 0;
Uml::ListView_Type dstType = item->getType();
- //kdDebug() << "UMLListView::acceptDrag: dstType = " << dstType << endl;
bool accept = true;
while(accept && ((data = it.current()) != 0)) {
@@ -929,4 +931,6 @@ bool UMLListView::acceptDrag(QDropEvent*
}
+ //kdDebug() << "UMLListView::acceptDrag: dstType = " << dstType
+ // << ", accept=" << accept << endl;
return accept;
}
@@ -1030,5 +1034,7 @@ UMLListViewItem * UMLListView::moveObjec
void UMLListView::slotDropped(QDropEvent* de, QListViewItem* /* parent */, QListViewItem* item) {
if(!item) {
- return;
+ //kdDebug() << "UMLListView::slotDropped: item is NULL - setting to currentItem()"
+ // << endl;
+ item = (UMLListViewItem *)currentItem();
}
UMLDrag::LvTypeAndID_List srcList;
More information about the umbrello-devel
mailing list