Skip to content

Commit

Permalink
Suggestions from JEF
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Apr 26, 2019
1 parent a3368d4 commit da49f79
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/providers/postgres/qgspgtablemodel.cpp
Expand Up @@ -39,8 +39,8 @@ QgsPgTableModel::QgsPgTableModel()
headerLabels << tr( "Check PK unicity" );
headerLabels << tr( "Sql" );
setHorizontalHeaderLabels( headerLabels );
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 );
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 );
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 );
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 );
}

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

QStandardItem *checkPkUnicityItem = new QStandardItem( QString() );
checkPkUnicityItem->setFlags( checkPkUnicityItem->flags() | Qt::ItemIsUserCheckable );
Expand All @@ -135,7 +135,7 @@ void QgsPgTableModel::addTableEntry( const QgsPostgresLayerProperty &layerProper
if ( layerProperty.isView || layerProperty.isMaterializedView )
{
checkPkUnicityItem->setCheckState( QgsProject::instance( )->trustLayerMetadata() ? Qt::CheckState::Unchecked : Qt::CheckState::Checked );
checkPkUnicityItem->setToolTip( headerData( 9, Qt::Orientation::Horizontal, Qt::ToolTipRole ).toString() );
checkPkUnicityItem->setToolTip( headerData( Columns::DbtmCheckPkUnicity, Qt::Orientation::Horizontal, Qt::ToolTipRole ).toString() );
}
else
{
Expand Down
14 changes: 7 additions & 7 deletions src/ui/qgsprojectpropertiesbase.ui
Expand Up @@ -265,7 +265,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>671</width>
<width>537</width>
<height>795</height>
</rect>
</property>
Expand Down Expand Up @@ -863,8 +863,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>685</width>
<height>780</height>
<width>546</width>
<height>164</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
Expand Down Expand Up @@ -938,8 +938,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>685</width>
<height>780</height>
<width>269</width>
<height>553</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_12">
Expand Down Expand Up @@ -1378,7 +1378,7 @@
<item row="3" column="0">
<widget class="QCheckBox" name="mTrustProjectCheckBox">
<property name="toolTip">
<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>
<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>
</property>
<property name="text">
<string>Trust project when data source has no metadata</string>
Expand Down Expand Up @@ -1576,7 +1576,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>671</width>
<width>598</width>
<height>2732</height>
</rect>
</property>
Expand Down
5 changes: 2 additions & 3 deletions tests/testdata/provider/testdata_pg.sql
Expand Up @@ -534,16 +534,15 @@ INSERT INTO qgis_test.check_constraints VALUES (
1, -- id
4, -- a
3 -- b
)
);


---------------------------------------------
--
-- Table and view for tests on checkPrimaryKeyUnicity
--


DROP TABLE IF EXISTS qgis_test.b21839_pk_unicity;
DROP TABLE IF EXISTS qgis_test.b21839_pk_unicity CASCADE;
CREATE TABLE qgis_test.b21839_pk_unicity
(
pk serial NOT NULL,
Expand Down

0 comments on commit da49f79

Please sign in to comment.