[QGIS Commit] r14217 - trunk/qgis/src/app/legend

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Sep 10 10:41:32 EDT 2010


Author: jef
Date: 2010-09-10 14:41:32 +0000 (Fri, 10 Sep 2010)
New Revision: 14217

Modified:
   trunk/qgis/src/app/legend/qgslegend.cpp
Log:
keep layer selection on legend right click

Modified: trunk/qgis/src/app/legend/qgslegend.cpp
===================================================================
--- trunk/qgis/src/app/legend/qgslegend.cpp	2010-09-10 14:40:53 UTC (rev 14216)
+++ trunk/qgis/src/app/legend/qgslegend.cpp	2010-09-10 14:41:32 UTC (rev 14217)
@@ -218,8 +218,8 @@
   else if ( e->button() == Qt::RightButton )
   {
     QTreeWidgetItem* item = itemAt( e->pos() );
-    setCurrentItem( item );
-    handleRightClickEvent( item, e->globalPos() );
+    if ( item == currentItem() )
+      handleRightClickEvent( item, e->globalPos() );
   }
   QTreeWidget::mousePressEvent( e );
 }                               // contentsMousePressEvent
@@ -622,6 +622,7 @@
     return false;
 
   setCurrentItem( ll );
+  clearSelection();
   return true;
 }
 



More information about the QGIS-commit mailing list