@@ -71,8 +71,7 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
7171 mColumnBox = columnBox;
7272 columnBoxInit ();
7373
74- QSettings mySettings;
75- bool myDockFlag = mySettings.value ( " /qgis/dockAttributeTable" , false ).toBool ();
74+ bool myDockFlag = settings.value ( " /qgis/dockAttributeTable" , false ).toBool ();
7675 if ( myDockFlag )
7776 {
7877 mDock = new QgsAttributeTableDock ( tr ( " Attribute table - %1 (%n Feature(s))" , " feature count" , mModel ->rowCount () ).arg ( mLayer ->name () ), QgisApp::instance () );
@@ -122,6 +121,11 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
122121 connect ( mView ->verticalHeader (), SIGNAL ( sectionPressed ( int ) ), this , SLOT ( updateRowPressed ( int ) ) );
123122 connect ( mModel , SIGNAL ( modelChanged () ), this , SLOT ( updateSelection () ) );
124123
124+ if ( settings.value ( " /qgis/attributeTableBehaviour" , 0 ).toInt () == 2 )
125+ {
126+ connect ( QgisApp::instance ()->mapCanvas (), SIGNAL ( extentsChanged () ), mModel , SLOT ( layerModified () ) );
127+ }
128+
125129 mLastClickedHeaderIndex = 0 ;
126130 mSelectionModel = new QItemSelectionModel ( mFilterModel );
127131 updateSelectionFromLayer ();
@@ -221,7 +225,19 @@ void QgsAttributeTableDialog::on_mCopySelectedRowsButton_clicked()
221225
222226void QgsAttributeTableDialog::on_mZoomMapToSelectedRowsButton_clicked ()
223227{
228+ QSettings settings;
229+ bool canvasFeatures = settings.value ( " /qgis/attributeTableBehaviour" , 0 ).toInt () == 2 ;
230+ if ( canvasFeatures )
231+ {
232+ disconnect ( QgisApp::instance ()->mapCanvas (), SIGNAL ( extentsChanged () ), mModel , SLOT ( layerModified () ) );
233+ }
234+
224235 QgisApp::instance ()->mapCanvas ()->zoomToSelected ( mLayer );
236+
237+ if ( canvasFeatures )
238+ {
239+ connect ( QgisApp::instance ()->mapCanvas (), SIGNAL ( extentsChanged () ), mModel , SLOT ( layerModified () ) );
240+ }
225241}
226242
227243void QgsAttributeTableDialog::on_mInvertSelectionButton_clicked ()
0 commit comments