From kde-commits Fri Jan 31 22:23:45 2003 From: Sebastian Trueg Date: Fri, 31 Jan 2003 22:23:45 +0000 To: kde-commits Subject: kdeextragear-1/k3b/src/data X-MARC-Message: https://marc.info/?l=kde-commits&m=104405186618292 CVS commit by trueg: dropping not on an item adds to root now which makes more sense than the old behaviour M +6 -9 k3bdatadirtreeview.cpp 1.29 --- kdeextragear-1/k3b/src/data/k3bdatadirtreeview.cpp #1.28:1.29 @@ -94,5 +94,5 @@ bool K3bDataDirTreeView::acceptDrag(QDro -void K3bDataDirTreeView::slotDropped( QDropEvent* e, QListViewItem*, QListViewItem* parentViewItem ) +void K3bDataDirTreeView::slotDropped( QDropEvent* e, QListViewItem*, QListViewItem* ) { if( !e->isAccepted() ) @@ -101,7 +101,9 @@ void K3bDataDirTreeView::slotDropped( QD // determine K3bDirItem to add the items to K3bDirItem* parent = 0; - if( K3bDataDirViewItem* dirViewItem = dynamic_cast( parentViewItem ) ) { + if( K3bDataDirViewItem* dirViewItem = dynamic_cast( itemAt(e->pos()) ) ) { parent = dirViewItem->dirItem(); } + else + parent = m_doc->root(); if( parent ) { @@ -136,10 +138,4 @@ void K3bDataDirTreeView::slotDropped( QD } } - - else if( QUriDrag::canDecode(e) ) { - KURL::List urls; - if( KURLDrag::decode( e, urls ) ) - emit urlsDropped( urls, parentViewItem ); - } } @@ -187,5 +183,6 @@ void K3bDataDirTreeView::updateContents( if( !m_itemMap.contains(dirItem) ) { K3bDataDirViewItem* parentViewItem = m_itemMap[dirItem->parent()]; - m_itemMap.insert( dirItem, new K3bDataDirViewItem( dirItem, parentViewItem ) ); + K3bDataDirViewItem* newDirItem = new K3bDataDirViewItem( dirItem, parentViewItem ); + m_itemMap.insert( dirItem, newDirItem ); } else {