[QGIS Commit] r15173 - trunk/qgis/src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Feb 15 01:21:15 EST 2011


Author: mhugent
Date: 2011-02-14 22:21:15 -0800 (Mon, 14 Feb 2011)
New Revision: 15173

Modified:
   trunk/qgis/src/app/qgsvectorlayerproperties.cpp
Log:
Fewer redraws if toggeling editing from vector props

Modified: trunk/qgis/src/app/qgsvectorlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsvectorlayerproperties.cpp	2011-02-14 19:02:06 UTC (rev 15172)
+++ trunk/qgis/src/app/qgsvectorlayerproperties.cpp	2011-02-15 06:21:15 UTC (rev 15173)
@@ -166,6 +166,7 @@
 
 void QgsVectorLayerProperties::loadRows()
 {
+  QObject::disconnect( tblAttributes, SIGNAL( cellChanged( int, int ) ), this, SLOT( on_tblAttributes_cellChanged( int, int ) ) );
   const QgsFieldMap &fields = layer->pendingFields();
 
   tblAttributes->clear();
@@ -191,6 +192,7 @@
     setRow( row, it.key(), it.value() );
 
   tblAttributes->resizeColumnsToContents();
+  QObject::connect( tblAttributes, SIGNAL( cellChanged( int, int ) ), this, SLOT( on_tblAttributes_cellChanged( int, int ) ) );
 }
 
 void QgsVectorLayerProperties::setRow( int row, int idx, const QgsField &field )
@@ -382,7 +384,7 @@
 
 void QgsVectorLayerProperties::editingToggled()
 {
-  if ( layer->isEditable() )
+  if ( !layer->isEditable() )
     loadRows();
 
   updateButtons();
@@ -1200,11 +1202,7 @@
       }
 
       layer->addJoin( info );
-
-      //prevent complete redraw for each row
-      QObject::disconnect( tblAttributes, SIGNAL( cellChanged( int, int ) ), this, SLOT( on_tblAttributes_cellChanged( int, int ) ) );
       loadRows(); //update attribute tab
-      QObject::connect( tblAttributes, SIGNAL( cellChanged( int, int ) ), this, SLOT( on_tblAttributes_cellChanged( int, int ) ) );
       addJoinToTreeWidget( info );
     }
   }
@@ -1241,11 +1239,7 @@
   }
 
   layer->removeJoin( currentJoinItem->data( 0, Qt::UserRole ).toString() );
-
-  //prevent complete redraw for each row
-  QObject::disconnect( tblAttributes, SIGNAL( cellChanged( int, int ) ), this, SLOT( on_tblAttributes_cellChanged( int, int ) ) );
   loadRows();
-  QObject::connect( tblAttributes, SIGNAL( cellChanged( int, int ) ), this, SLOT( on_tblAttributes_cellChanged( int, int ) ) );
   mJoinTreeWidget->takeTopLevelItem( mJoinTreeWidget->indexOfTopLevelItem( currentJoinItem ) );
 }
 



More information about the QGIS-commit mailing list