Skip to content

Commit 69c4c88

Browse files
author
mhugent
committed
Fewer redraws if toggeling editing from vector props
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15173 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent fd5f119 commit 69c4c88

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/app/qgsvectorlayerproperties.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
166166

167167
void QgsVectorLayerProperties::loadRows()
168168
{
169+
QObject::disconnect( tblAttributes, SIGNAL( cellChanged( int, int ) ), this, SLOT( on_tblAttributes_cellChanged( int, int ) ) );
169170
const QgsFieldMap &fields = layer->pendingFields();
170171

171172
tblAttributes->clear();
@@ -191,6 +192,7 @@ void QgsVectorLayerProperties::loadRows()
191192
setRow( row, it.key(), it.value() );
192193

193194
tblAttributes->resizeColumnsToContents();
195+
QObject::connect( tblAttributes, SIGNAL( cellChanged( int, int ) ), this, SLOT( on_tblAttributes_cellChanged( int, int ) ) );
194196
}
195197

196198
void QgsVectorLayerProperties::setRow( int row, int idx, const QgsField &field )
@@ -382,7 +384,7 @@ void QgsVectorLayerProperties::deleteAttribute()
382384

383385
void QgsVectorLayerProperties::editingToggled()
384386
{
385-
if ( layer->isEditable() )
387+
if ( !layer->isEditable() )
386388
loadRows();
387389

388390
updateButtons();
@@ -1200,11 +1202,7 @@ void QgsVectorLayerProperties::on_mButtonAddJoin_clicked()
12001202
}
12011203

12021204
layer->addJoin( info );
1203-
1204-
//prevent complete redraw for each row
1205-
QObject::disconnect( tblAttributes, SIGNAL( cellChanged( int, int ) ), this, SLOT( on_tblAttributes_cellChanged( int, int ) ) );
12061205
loadRows(); //update attribute tab
1207-
QObject::connect( tblAttributes, SIGNAL( cellChanged( int, int ) ), this, SLOT( on_tblAttributes_cellChanged( int, int ) ) );
12081206
addJoinToTreeWidget( info );
12091207
}
12101208
}
@@ -1241,11 +1239,7 @@ void QgsVectorLayerProperties::on_mButtonRemoveJoin_clicked()
12411239
}
12421240

12431241
layer->removeJoin( currentJoinItem->data( 0, Qt::UserRole ).toString() );
1244-
1245-
//prevent complete redraw for each row
1246-
QObject::disconnect( tblAttributes, SIGNAL( cellChanged( int, int ) ), this, SLOT( on_tblAttributes_cellChanged( int, int ) ) );
12471242
loadRows();
1248-
QObject::connect( tblAttributes, SIGNAL( cellChanged( int, int ) ), this, SLOT( on_tblAttributes_cellChanged( int, int ) ) );
12491243
mJoinTreeWidget->takeTopLevelItem( mJoinTreeWidget->indexOfTopLevelItem( currentJoinItem ) );
12501244
}
12511245

0 commit comments

Comments
 (0)