@@ -1101,25 +1101,29 @@ QString QgsCoordinateReferenceSystem::description() const
1101
1101
1102
1102
QString QgsCoordinateReferenceSystem::userFriendlyIdentifier ( IdentifierType type ) const
1103
1103
{
1104
+ QString id;
1104
1105
if ( !authid ().isEmpty () )
1105
1106
{
1106
1107
if ( type != ShortString && !description ().isEmpty () )
1107
- return QStringLiteral ( " %1 - %2" ).arg ( authid (), description () );
1108
- return authid ();
1108
+ id = QStringLiteral ( " %1 - %2" ).arg ( authid (), description () );
1109
+ else
1110
+ id = authid ();
1109
1111
}
1110
1112
else if ( !description ().isEmpty () )
1111
- return description ();
1113
+ id = description ();
1112
1114
else if ( type == ShortString )
1113
- return isValid () ? QObject::tr ( " Custom CRS" ) : QObject::tr ( " Unknown CRS" );
1115
+ id = isValid () ? QObject::tr ( " Custom CRS" ) : QObject::tr ( " Unknown CRS" );
1114
1116
else if ( !toWkt ( WKT_PREFERRED ).isEmpty () )
1115
- return QObject::tr ( " Custom CRS: %1" ).arg (
1116
- type == MediumString ? ( toWkt ( WKT_PREFERRED ).left ( 50 ) + QString ( QChar ( 0x2026 ) ) )
1117
- : toWkt ( WKT_PREFERRED ) );
1117
+ id = QObject::tr ( " Custom CRS: %1" ).arg (
1118
+ type == MediumString ? ( toWkt ( WKT_PREFERRED ).left ( 50 ) + QString ( QChar ( 0x2026 ) ) )
1119
+ : toWkt ( WKT_PREFERRED ) );
1118
1120
else if ( !toProj ().isEmpty () )
1119
- return QObject::tr ( " Custom CRS: %1" ).arg ( type == MediumString ? ( toProj ().left ( 50 ) + QString ( QChar ( 0x2026 ) ) )
1120
- : toProj () );
1121
- else
1122
- return QString ();
1121
+ id = QObject::tr ( " Custom CRS: %1" ).arg ( type == MediumString ? ( toProj ().left ( 50 ) + QString ( QChar ( 0x2026 ) ) )
1122
+ : toProj () );
1123
+ if ( !id.isEmpty () && !std::isnan ( d->mCoordinateEpoch ) )
1124
+ id += QStringLiteral ( " (%1)" ).arg ( d->mCoordinateEpoch );
1125
+
1126
+ return id;
1123
1127
}
1124
1128
1125
1129
QString QgsCoordinateReferenceSystem::projectionAcronym () const
0 commit comments