Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homogenize window title separator #36998

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/mesh/qgsmeshlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ QgsMeshLayerProperties::QgsMeshLayerProperties( QgsMapLayer *lyr, QgsMapCanvas *
mOptStackedWidget->indexOf( mOptsPage_Style ) );
}

QString title = QString( tr( "Layer Properties - %1" ) ).arg( lyr->name() );
QString title = QString( tr( "Layer Properties %1" ) ).arg( lyr->name() );

if ( !mMeshLayer->styleManager()->isDefault( mMeshLayer->styleManager()->currentStyle() ) )
title += QStringLiteral( " (%1)" ).arg( mMeshLayer->styleManager()->currentStyle() );
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ static void setTitleBarText_( QWidget &qgisApp )
}
if ( !caption.isEmpty() )
{
caption += QLatin1String( " - " );
caption += QStringLiteral( " " );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This results in corrupt strings on windows builds... You need to use the character code instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure (like for the three dots) I guess. But let me ask you a questions, is there anything particular in this line of code or should we change the other 27 occurrences of that character, because I just copy-pasted that character from one of the many other another pre-existing string in the code and I don't understand why it suddenly became a problem after my changes if it wasn't before.

$ grep -r '—' src|egrep 'cpp:'|wc -l
27

... or maybe you are just saying that it is always been a problem but this is an opportunity to fix it?

Copy link
Contributor Author

@elpaso elpaso Jun 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see it's been used mostly inside tr:

QObject::tr( "Warning — this algorithm modifies......

does that need replacing too?

or is it just when it is inside a QStringLiteral ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine when it's inside tr, and it's fine from Python -- it's only QStringLiteral and raw characters strings which are an issue. That said, this may have changed since #35737. I'd probably still err on the side of caution though!

}
if ( QgsProject::instance()->isDirty() )
caption.prepend( '*' );
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsattributetabledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ void QgsAttributeTableDialog::updateTitle()
QWidget *w = mDock ? qobject_cast<QWidget *>( mDock )
: mDialog ? qobject_cast<QWidget *>( mDialog )
: qobject_cast<QWidget *>( this );
w->setWindowTitle( tr( " %1 :: Features Total: %2, Filtered: %3, Selected: %4" )
w->setWindowTitle( tr( " %1 Features Total: %2, Filtered: %3, Selected: %4" )
.arg( mLayer->name() )
.arg( std::max( static_cast< long >( mMainView->featureCount() ), mLayer->featureCount() ) ) // layer count may be estimated, so use larger of the two
.arg( mMainView->filteredFeatureCount() )
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsselectbyformdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ QgsSelectByFormDialog::QgsSelectByFormDialog( QgsVectorLayer *layer, const QgsAt

QgsGui::enableAutoGeometryRestore( this );

setWindowTitle( tr( "%1 - Select Features" ).arg( layer->name() ) );
setWindowTitle( tr( "%1 Select Features" ).arg( layer->name() ) );
}

void QgsSelectByFormDialog::setMessageBar( QgsMessageBar *messageBar )
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsoptionsdialogbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ void QgsOptionsDialogBase::updateWindowTitle()
QListWidgetItem *curitem = mOptListWidget->currentItem();
if ( curitem )
{
setWindowTitle( QStringLiteral( "%1 | %2" ).arg( mDialogTitle, curitem->text() ) );
setWindowTitle( QStringLiteral( "%1 %2" ).arg( mDialogTitle, curitem->text() ) );
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/gui/raster/qgsrasterlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanv

mResetColorRenderingBtn->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionUndo.svg" ) ) );

QString title = QString( tr( "Layer Properties - %1" ) ).arg( lyr->name() );
QString title = QString( tr( "Layer Properties %1" ) ).arg( lyr->name() );

if ( !mRasterLayer->styleManager()->isDefault( mRasterLayer->styleManager()->currentStyle() ) )
title += QStringLiteral( " (%1)" ).arg( mRasterLayer->styleManager()->currentStyle() );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/vector/qgsvectorlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
mOptStackedWidget->indexOf( mOptsPage_Style ) );
}

QString title = QString( tr( "Layer Properties - %1" ) ).arg( mLayer->name() );
QString title = QString( tr( "Layer Properties %1" ) ).arg( mLayer->name() );
if ( !mLayer->styleManager()->isDefault( mLayer->styleManager()->currentStyle() ) )
title += QStringLiteral( " (%1)" ).arg( mLayer->styleManager()->currentStyle() );
restoreOptionsBaseUi( title );
Expand Down