Skip to content
Permalink
Browse files

[themes] Handle non-existent theme name setting in app stylesheet

  • Loading branch information
nirvn committed Feb 20, 2019
1 parent f3cb348 commit 8eb1c4e8a0eb8db6e38c38f497efb2f08a68a570
Showing with 5 additions and 1 deletion.
  1. +1 −1 src/app/qgisappstylesheet.cpp
  2. +4 −0 src/app/qgsoptions.cpp
@@ -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 {"
@@ -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() );

1 comment on commit 8eb1c4e

@nirvn

This comment has been minimized.

Copy link
Contributor Author

@nirvn nirvn commented on 8eb1c4e Feb 20, 2019

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

Please sign in to comment.
You can’t perform that action at this time.