Skip to content

Commit

Permalink
[themes] Handle non-existent theme name setting in app stylesheet
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Feb 20, 2019
1 parent f3cb348 commit 8eb1c4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/qgisappstylesheet.cpp
Expand Up @@ -122,7 +122,7 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap<QString, QVariant> &opts )
ss += QLatin1String( "QGroupBox{ font-weight: 600; }" );

QString themeName = settings.value( QStringLiteral( "UI/UITheme" ), "default" ).toString();
if ( themeName == QStringLiteral( "default" ) )
if ( themeName == QStringLiteral( "default" ) || !QgsApplication::uiThemes().contains( themeName ) )
{
//sidebar style
QString style = "QListWidget#mOptionsListWidget {"
Expand Down
4 changes: 4 additions & 0 deletions src/app/qgsoptions.cpp
Expand Up @@ -572,6 +572,10 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
whileBlocking( cmbStyle )->setCurrentIndex( cmbStyle->findText( name, Qt::MatchFixedString ) );

QString theme = mSettings->value( QStringLiteral( "UI/UITheme" ), QStringLiteral( "default" ) ).toString();
if ( !QgsApplication::uiThemes().contains( theme ) )
{
theme = QStringLiteral( "default" );
}
whileBlocking( cmbUITheme )->setCurrentIndex( cmbUITheme->findText( theme, Qt::MatchFixedString ) );

mNativeColorDialogsChkBx->setChecked( mSettings->value( QStringLiteral( "/qgis/native_color_dialogs" ), false ).toBool() );
Expand Down

1 comment on commit 8eb1c4e

@nirvn
Copy link
Contributor Author

@nirvn nirvn commented on 8eb1c4e Feb 20, 2019

Choose a reason for hiding this comment

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

@Gustry , that'll fix the issue you reported yesterday. Cheers.

Please sign in to comment.