Skip to content

Commit

Permalink
Added missing connection to legend to trigger signals of group moves.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12360 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Dec 7, 2009
1 parent b0d68ae commit 93a2670
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/app/legend/qgsapplegendinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
QgsAppLegendInterface::QgsAppLegendInterface( QgsLegend * legend )
: mLegend( legend )
{
connect( legend, SIGNAL( itemMoved( QModelIndex, QModelIndex ) ), this, SLOT( updateIndex( QModelIndex, QModelIndex ) ) );
}

QgsAppLegendInterface::~QgsAppLegendInterface()
Expand All @@ -44,7 +45,7 @@ void QgsAppLegendInterface::moveLayer( QgsMapLayer * ml, int groupIndex )
mLegend->moveLayer( ml, groupIndex );
}

void QgsAppLegendInterface::updateIndex( const QModelIndex &oldIndex, const QModelIndex& newIndex)
void QgsAppLegendInterface::updateIndex( QModelIndex oldIndex, QModelIndex newIndex )
{
if ( mLegend->isLegendGroup( newIndex ) )
{
Expand Down
5 changes: 3 additions & 2 deletions src/app/legend/qgsapplegendinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

#include "qgslegendinterface.h"

class QModelIndex;
#include <QModelIndex>

class QgsLegend;
class QgsMapLayer;

Expand Down Expand Up @@ -55,7 +56,7 @@ class QgsAppLegendInterface : public QgsLegendInterface
void moveLayer( QgsMapLayer * ml, int groupIndex );

//! Update an index
void updateIndex( const QModelIndex &oldIndex, const QModelIndex &newIndex );
void updateIndex( QModelIndex oldIndex, QModelIndex newIndex );

private:

Expand Down

0 comments on commit 93a2670

Please sign in to comment.