Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 24, 2022
1 parent bb8c198 commit 0e543ab
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions src/app/qgisapp.cpp
Expand Up @@ -613,7 +613,7 @@ static void customSrsValidation_( QgsCoordinateReferenceSystem &srs )
// srs is a reference and may be deleted before the queued slot is called.
// We also can't do ANY gui related stuff here. Best we can do is log
// a warning and move on...
QgsMessageLog::logMessage( QObject::tr( "Layer has unknown CRS" ) );
QgsMessageLog::logMessage( tr( "Layer has unknown CRS" ) );
}
else
{
Expand Down Expand Up @@ -9188,16 +9188,16 @@ void QgisApp::saveStyleFile( QgsMapLayer *layer )
}
case QgsVectorLayerProperties::DB:
{
QString infoWindowTitle = QObject::tr( "Save style to DB (%1)" ).arg( vlayer->providerType() );
QString infoWindowTitle = tr( "Save style to DB (%1)" ).arg( vlayer->providerType() );
QString msgError;

QgsVectorLayerSaveStyleDialog::SaveToDbSettings dbSettings = dlg.saveToDbSettings();

QString errorMessage;
if ( QgsProviderRegistry::instance()->styleExists( vlayer->providerType(), vlayer->source(), dbSettings.name, errorMessage ) )
{
if ( QMessageBox::question( nullptr, QObject::tr( "Save style in database" ),
QObject::tr( "A matching style already exists in the database for this layer. Do you want to overwrite it?" ),
if ( QMessageBox::question( nullptr, tr( "Save style in database" ),
tr( "A matching style already exists in the database for this layer. Do you want to overwrite it?" ),
QMessageBox::Yes | QMessageBox::No ) == QMessageBox::No )
{
return;
Expand Down Expand Up @@ -13980,15 +13980,15 @@ void QgisApp::initLayouts()
// 3D map item
#ifdef HAVE_3D
QgsApplication::layoutItemRegistry()->addLayoutItemType(
new QgsLayoutItemMetadata( QgsLayoutItemRegistry::Layout3DMap, QObject::tr( "3D Map" ), QObject::tr( "3D Maps" ), QgsLayoutItem3DMap::create )
new QgsLayoutItemMetadata( QgsLayoutItemRegistry::Layout3DMap, tr( "3D Map" ), tr( "3D Maps" ), QgsLayoutItem3DMap::create )
);

auto createRubberBand = ( []( QgsLayoutView * view )->QgsLayoutViewRubberBand *
{
return new QgsLayoutViewRectangularRubberBand( view );
} );
std::unique_ptr< QgsLayoutItemGuiMetadata > map3dMetadata = std::make_unique< QgsLayoutItemGuiMetadata>(
QgsLayoutItemRegistry::Layout3DMap, QObject::tr( "3D Map" ), QgsApplication::getThemeIcon( QStringLiteral( "/mActionAdd3DMap.svg" ) ),
QgsLayoutItemRegistry::Layout3DMap, tr( "3D Map" ), QgsApplication::getThemeIcon( QStringLiteral( "/mActionAdd3DMap.svg" ) ),
[ = ]( QgsLayoutItem * item )->QgsLayoutItemBaseWidget *
{
return new QgsLayout3DMapWidget( qobject_cast< QgsLayoutItem3DMap * >( item ) );
Expand Down Expand Up @@ -15033,7 +15033,7 @@ void QgisApp::updateCrsStatusBar()
if ( !projectCrs.authid().isEmpty() )
mOnTheFlyProjectionStatusButton->setText( projectCrs.authid() );
else
mOnTheFlyProjectionStatusButton->setText( QObject::tr( "Unknown CRS" ) );
mOnTheFlyProjectionStatusButton->setText( tr( "Unknown CRS" ) );

mOnTheFlyProjectionStatusButton->setToolTip(
tr( "Current CRS: %1" ).arg( projectCrs.userFriendlyIdentifier() ) );
Expand Down
6 changes: 3 additions & 3 deletions src/gui/qgsmaplayerstylemanagerwidget.cpp
Expand Up @@ -215,16 +215,16 @@ void QgsMapLayerStyleManagerWidget::saveAsDefault()
QString errorMessage;
if ( QgsProviderRegistry::instance()->styleExists( layer->providerType(), layer->source(), QString(), errorMessage ) )
{
if ( QMessageBox::question( nullptr, QObject::tr( "Save style in database" ),
QObject::tr( "A matching style already exists in the database for this layer. Do you want to overwrite it?" ),
if ( QMessageBox::question( nullptr, tr( "Save style in database" ),
tr( "A matching style already exists in the database for this layer. Do you want to overwrite it?" ),
QMessageBox::Yes | QMessageBox::No ) == QMessageBox::No )
{
return;
}
}
else if ( !errorMessage.isEmpty() )
{
QMessageBox::warning( nullptr, QObject::tr( "Save style in database" ),
QMessageBox::warning( nullptr, tr( "Save style in database" ),
errorMessage );
return;
}
Expand Down
6 changes: 3 additions & 3 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -4882,7 +4882,7 @@ QString QgsPostgresProvider::getNextString( const QString &txt, int &i, const QS
}
i += match.captured( 1 ).length() + 2;
jumpSpace( txt, i );
if ( !QStringView{txt} .mid( i ).startsWith( sep ) && i < txt.length() )
if ( !QStringView{txt}.mid( i ).startsWith( sep ) && i < txt.length() )
{
QgsMessageLog::logMessage( tr( "Cannot find separator: %1" ).arg( txt.mid( i ) ), tr( "PostGIS" ) );
return QString();
Expand All @@ -4895,9 +4895,9 @@ QString QgsPostgresProvider::getNextString( const QString &txt, int &i, const QS
int start = i;
for ( ; i < txt.length(); i++ )
{
if ( QStringView{txt} .mid( i ).startsWith( sep ) )
if ( QStringView{txt}.mid( i ).startsWith( sep ) )
{
QStringView v( QStringView{txt} .mid( start, i - start ) );
QStringView v( QStringView{txt}.mid( start, i - start ) );
i += sep.length();
return v.trimmed().toString();
}
Expand Down

0 comments on commit 0e543ab

Please sign in to comment.