Skip to content

Commit 79aa90b

Browse files
author
mhugent
committedJul 29, 2009
Fix for ticket 1745 (QGis crashes dragging a Legend Layer File over a Legend Layer File Group)
git-svn-id: http://svn.osgeo.org/qgis/trunk@11206 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent a7eaaba commit 79aa90b

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed
 

‎src/app/legend/qgslegend.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -250,26 +250,26 @@ void QgsLegend::mouseMoveEvent( QMouseEvent * e )
250250
QgsLegendItem::DRAG_ACTION action = dest->accept( origin );
251251
if ( yCoordAboveCenter( dest, e->y() ) ) //over center of item
252252
{
253-
254-
if ( action == QgsLegendItem::REORDER || action == QgsLegendItem::INSERT )
253+
if ( action == QgsLegendItem::REORDER )
255254
{
256-
QgsDebugMsg( "mouseMoveEvent::REORDER/INSERT top half" );
257255
if ( origin->nextSibling() != dest )
258256
{
259-
if ( origin->parent() != dest->parent() )
260-
{
261-
moveItem( origin, dest );
262-
moveItem( dest, origin );
263-
}
264-
else
265-
{
266-
moveItem( dest, origin );
267-
}
257+
moveItem( dest, origin );setCurrentItem( origin );
268258
}
259+
setCurrentItem( origin );
269260
setCursor( QCursor( Qt::SizeVerCursor ) );
261+
}
262+
else if ( action == QgsLegendItem::INSERT )
263+
{
264+
setCursor( QCursor( Qt::PointingHandCursor ) );
265+
if ( origin->parent() != dest )
266+
{
267+
insertItem( origin, dest );
268+
}
270269
setCurrentItem( origin );
270+
setCursor( QCursor( Qt::PointingHandCursor ) );
271271
}
272-
else
272+
else //no action
273273
{
274274
QgsDebugMsg( "mouseMoveEvent::NO_ACTION" );
275275

0 commit comments

Comments
 (0)
Please sign in to comment.