Skip to content
Permalink
Browse files

Suggestions from JEF

  • Loading branch information
elpaso committed Apr 26, 2019
1 parent a3368d4 commit da49f790459cb2cad8aecb89f8380c556b8d3102
@@ -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 )
@@ -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 );
@@ -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
{
@@ -265,7 +265,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>671</width>
<width>537</width>
<height>795</height>
</rect>
</property>
@@ -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">
@@ -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">
@@ -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>
@@ -1576,7 +1576,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>671</width>
<width>598</width>
<height>2732</height>
</rect>
</property>
@@ -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,

0 comments on commit da49f79

Please sign in to comment.
You can’t perform that action at this time.