diff --git a/src/core/proj/qgscoordinatereferencesystemutils.cpp b/src/core/proj/qgscoordinatereferencesystemutils.cpp index b323b4c56e72..a1c85bd76daa 100644 --- a/src/core/proj/qgscoordinatereferencesystemutils.cpp +++ b/src/core/proj/qgscoordinatereferencesystemutils.cpp @@ -317,9 +317,9 @@ QString QgsCoordinateReferenceSystemUtils::translateProjection( const QString &p if ( projection == QLatin1String( "lask" ) ) return QObject::tr( "Laskowski" ); if ( projection == QLatin1String( "longlat" ) ) - return QObject::tr( "Long/lat(Geodetic alias)" ); + return QObject::tr( "Long/lat (Geodetic Alias)" ); if ( projection == QLatin1String( "latlong" ) ) - return QObject::tr( "Lat/long (Geodetic alias)" ); + return QObject::tr( "Lat/long (Geodetic Alias)" ); if ( projection == QLatin1String( "lcc" ) ) return QObject::tr( "Lambert Conformal Conic" ); if ( projection == QLatin1String( "lcca" ) ) diff --git a/src/gui/qgsprojectionselectiontreewidget.cpp b/src/gui/qgsprojectionselectiontreewidget.cpp index fb0ba0b4a533..66de655d43ea 100644 --- a/src/gui/qgsprojectionselectiontreewidget.cpp +++ b/src/gui/qgsprojectionselectiontreewidget.cpp @@ -26,6 +26,7 @@ #include "qgsprojoperation.h" #include "qgsstringutils.h" #include "qgsunittypes.h" +#include "qgscoordinatereferencesystemutils.h" //qt includes #include @@ -622,7 +623,7 @@ void QgsProjectionSelectionTreeWidget::loadCrsList( QSet *crsFilter ) // Set up the query to retrieve the projection information needed to populate the list //note I am giving the full field names for clarity here and in case someone //changes the underlying view TS - QString sql = QStringLiteral( "select description, srs_id, upper(auth_name||':'||auth_id), is_geo, name, parameters, deprecated from vw_srs where %1 order by name,description" ) + QString sql = QStringLiteral( "select description, srs_id, upper(auth_name||':'||auth_id), is_geo, projection_acronym, deprecated from tbl_srs where %1 order by projection_acronym,description" ) .arg( sqlFilter ); rc = sqlite3_prepare( database, sql.toUtf8(), sql.toUtf8().length(), &stmt, &tail ); @@ -655,25 +656,28 @@ void QgsProjectionSelectionTreeWidget::loadCrsList( QSet *crsFilter ) { // This is a projected srs QTreeWidgetItem *node = nullptr; - QString srsType = QString::fromUtf8( ( char * )sqlite3_column_text( stmt, 4 ) ); - if ( srsType.isEmpty() ) - srsType = tr( "Other" ); + const QString projectionAcronym = QString::fromUtf8( ( char * )sqlite3_column_text( stmt, 4 ) ); + QString projectionName; + if ( projectionAcronym.isEmpty() ) + projectionName = tr( "Other" ); + else + projectionName = QgsCoordinateReferenceSystemUtils::translateProjection( projectionAcronym ); // Find the node for this type and add the projection to it // If the node doesn't exist, create it - if ( srsType == previousSrsType ) + if ( projectionName == previousSrsType ) { node = previousSrsTypeNode; } else { // Different from last one, need to search - QList nodes = lstCoordinateSystems->findItems( srsType, Qt::MatchExactly | Qt::MatchRecursive, NameColumn ); + QList nodes = lstCoordinateSystems->findItems( projectionName, Qt::MatchExactly | Qt::MatchRecursive, NameColumn ); if ( nodes.isEmpty() ) { // the node doesn't exist -- create it // Make in an italic font to distinguish them from real projections - node = new QTreeWidgetItem( mProjList, QStringList( srsType ) ); + node = new QTreeWidgetItem( mProjList, QStringList( projectionName ) ); node->setFlags( node->flags() & ~Qt::ItemIsSelectable ); QFont fontTemp = node->font( 0 ); @@ -685,7 +689,7 @@ void QgsProjectionSelectionTreeWidget::loadCrsList( QSet *crsFilter ) node = nodes.first(); } // Update the cache. - previousSrsType = srsType; + previousSrsType = projectionName; previousSrsTypeNode = node; } // add the item, setting the projection name in the first column of the list view