Skip to content

Commit

Permalink
add layers to group even group is not selected but selected child item
Browse files Browse the repository at this point in the history
in this group
  • Loading branch information
alexbruy committed Dec 27, 2011
1 parent 9957ee5 commit 85918f6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
5 changes: 5 additions & 0 deletions src/app/legend/qgslegend.cpp
Expand Up @@ -809,6 +809,11 @@ void QgsLegend::addLayer( QgsMapLayer * layer )

QgsLegendGroup *lg = dynamic_cast<QgsLegendGroup *>( currentItem() );
QSettings settings;
if ( !lg && currentItem() )
{
lg = dynamic_cast<QgsLegendGroup *>( currentItem()->parent() );
}

if ( lg && settings.value( "/qgis/addNewLayersToCurrentGroup", false ).toBool() )
{
lg->insertChild( 0, llayer );
Expand Down
34 changes: 17 additions & 17 deletions src/ui/qgsoptionsbase.ui
Expand Up @@ -66,8 +66,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>799</width>
<height>761</height>
<width>803</width>
<height>763</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_12">
Expand Down Expand Up @@ -388,7 +388,7 @@
<item>
<widget class="QCheckBox" name="cbxAddNewLayersToCurrentGroup">
<property name="text">
<string>Add new layers to selected group</string>
<string>Add new layers to selected or current group</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -635,8 +635,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>799</width>
<height>761</height>
<width>803</width>
<height>763</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_8">
Expand Down Expand Up @@ -809,8 +809,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>799</width>
<height>761</height>
<width>803</width>
<height>763</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4">
Expand Down Expand Up @@ -1095,8 +1095,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>799</width>
<height>761</height>
<width>803</width>
<height>763</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_10">
Expand Down Expand Up @@ -1170,8 +1170,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>773</width>
<height>735</height>
<width>781</width>
<height>741</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_13">
Expand Down Expand Up @@ -1506,8 +1506,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>799</width>
<height>761</height>
<width>803</width>
<height>763</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_15">
Expand Down Expand Up @@ -1680,8 +1680,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>799</width>
<height>761</height>
<width>803</width>
<height>763</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_17">
Expand Down Expand Up @@ -1777,8 +1777,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>799</width>
<height>761</height>
<width>803</width>
<height>763</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_20">
Expand Down

0 comments on commit 85918f6

Please sign in to comment.