Skip to content

Commit 16b8b0f

Browse files
committedApr 26, 2019
Suggestions from JEF
1 parent 7b82ac5 commit 16b8b0f

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed
 

‎src/providers/postgres/qgspgtablemodel.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ QgsPgTableModel::QgsPgTableModel()
3939
headerLabels << tr( "Check PK unicity" );
4040
headerLabels << tr( "Sql" );
4141
setHorizontalHeaderLabels( headerLabels );
42-
setHeaderData( 8, Qt::Orientation::Horizontal, tr( "Disable 'Fast Access to Features at ID' capability to force keeping the attribute table in memory (e.g. in case of expensive views)." ), Qt::ToolTipRole );
43-
setHeaderData( 9, Qt::Orientation::Horizontal, tr( "Enable check for primary key unicity when loading views and materialized views. This option can make loading of large datasets significantly slower." ), Qt::ToolTipRole );
42+
setHeaderData( Columns::DbtmSelectAtId, Qt::Orientation::Horizontal, tr( "Disable 'Fast Access to Features at ID' capability to force keeping the attribute table in memory (e.g. in case of expensive views)." ), Qt::ToolTipRole );
43+
setHeaderData( Columns::DbtmCheckPkUnicity, Qt::Orientation::Horizontal, tr( "Enable check for primary key unicity when loading views and materialized views. This option can make loading of large datasets significantly slower." ), Qt::ToolTipRole );
4444
}
4545

4646
void QgsPgTableModel::addTableEntry( const QgsPostgresLayerProperty &layerProperty )
@@ -124,7 +124,7 @@ void QgsPgTableModel::addTableEntry( const QgsPostgresLayerProperty &layerProper
124124
QStandardItem *selItem = new QStandardItem( QString() );
125125
selItem->setFlags( selItem->flags() | Qt::ItemIsUserCheckable );
126126
selItem->setCheckState( Qt::Checked );
127-
selItem->setToolTip( headerData( 8, Qt::Orientation::Horizontal, Qt::ToolTipRole ).toString() );
127+
selItem->setToolTip( headerData( Columns::DbtmSelectAtId, Qt::Orientation::Horizontal, Qt::ToolTipRole ).toString() );
128128

129129
QStandardItem *checkPkUnicityItem = new QStandardItem( QString() );
130130
checkPkUnicityItem->setFlags( checkPkUnicityItem->flags() | Qt::ItemIsUserCheckable );
@@ -135,7 +135,7 @@ void QgsPgTableModel::addTableEntry( const QgsPostgresLayerProperty &layerProper
135135
if ( layerProperty.isView || layerProperty.isMaterializedView )
136136
{
137137
checkPkUnicityItem->setCheckState( QgsProject::instance( )->trustLayerMetadata() ? Qt::CheckState::Unchecked : Qt::CheckState::Checked );
138-
checkPkUnicityItem->setToolTip( headerData( 9, Qt::Orientation::Horizontal, Qt::ToolTipRole ).toString() );
138+
checkPkUnicityItem->setToolTip( headerData( Columns::DbtmCheckPkUnicity, Qt::Orientation::Horizontal, Qt::ToolTipRole ).toString() );
139139
}
140140
else
141141
{

‎src/ui/qgsprojectpropertiesbase.ui

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@
265265
<rect>
266266
<x>0</x>
267267
<y>0</y>
268-
<width>671</width>
268+
<width>537</width>
269269
<height>795</height>
270270
</rect>
271271
</property>
@@ -863,8 +863,8 @@
863863
<rect>
864864
<x>0</x>
865865
<y>0</y>
866-
<width>685</width>
867-
<height>780</height>
866+
<width>546</width>
867+
<height>164</height>
868868
</rect>
869869
</property>
870870
<layout class="QVBoxLayout" name="verticalLayout_7">
@@ -938,8 +938,8 @@
938938
<rect>
939939
<x>0</x>
940940
<y>0</y>
941-
<width>685</width>
942-
<height>780</height>
941+
<width>269</width>
942+
<height>553</height>
943943
</rect>
944944
</property>
945945
<layout class="QVBoxLayout" name="verticalLayout_12">
@@ -1378,7 +1378,7 @@
13781378
<item row="3" column="0">
13791379
<widget class="QCheckBox" name="mTrustProjectCheckBox">
13801380
<property name="toolTip">
1381-
<string>Speed up project loading by skipping data checks in Postgres layers. Useful in QGIS server context or project with huge database views or materialized views.</string>
1381+
<string>Speed up project loading by skipping data checks in PostgreSQL layers. Useful in QGIS server context or project with huge database views or materialized views.</string>
13821382
</property>
13831383
<property name="text">
13841384
<string>Trust project when data source has no metadata</string>
@@ -1576,7 +1576,7 @@
15761576
<rect>
15771577
<x>0</x>
15781578
<y>0</y>
1579-
<width>671</width>
1579+
<width>598</width>
15801580
<height>2732</height>
15811581
</rect>
15821582
</property>

‎tests/testdata/provider/testdata_pg.sql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -534,16 +534,15 @@ INSERT INTO qgis_test.check_constraints VALUES (
534534
1, -- id
535535
4, -- a
536536
3 -- b
537-
)
537+
);
538538

539539

540540
---------------------------------------------
541541
--
542542
-- Table and view for tests on checkPrimaryKeyUnicity
543543
--
544544

545-
546-
DROP TABLE IF EXISTS qgis_test.b21839_pk_unicity;
545+
DROP TABLE IF EXISTS qgis_test.b21839_pk_unicity CASCADE;
547546
CREATE TABLE qgis_test.b21839_pk_unicity
548547
(
549548
pk serial NOT NULL,

0 commit comments

Comments
 (0)
Please sign in to comment.