Skip to content

Commit

Permalink
Use a hardcoded list of candidate field name strings, including
Browse files Browse the repository at this point in the history
(harcoded) localized versions

See discussion at #30245
  • Loading branch information
nyalldawson committed Jun 19, 2019
1 parent 9f84acb commit 2ad2514
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/core/qgsvectorlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3139,7 +3139,15 @@ QString QgsVectorLayer::displayExpression() const
// more "interesting" field names first. As such, name should
// be selected before oldname, othername, etc.
// This candidates list is a prioritized list of candidates ranked by "interestingness"!
static QStringList sCandidates{ QStringLiteral( "name" ), QStringLiteral( "descript" ), QStringLiteral( "street" ), QStringLiteral( "road" ), QStringLiteral( "id" )};
// See discussion at https://github.com/qgis/QGIS/pull/30245 - this list must NOT be translated,
// but adding hardcoded localized variants of the strings is encouraged.
static QStringList sCandidates{ QStringLiteral( "name" ),
QStringLiteral( "heibt" ),
QStringLiteral( "desc" ),
QStringLiteral( "nom" ),
QStringLiteral( "street" ),
QStringLiteral( "road" ),
QStringLiteral( "id" )};
for ( const QString &candidate : sCandidates )
{
for ( const QgsField &field : mFields )
Expand Down

0 comments on commit 2ad2514

Please sign in to comment.