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 2a148e2 commit 82e189e02fad7a8e3024e4f328566f09771cb1fd
Showing with 5 additions and 1 deletion.
  1. +1 −1 src/app/qgisappstylesheet.cpp
  2. +4 −0 src/app/qgsoptions.cpp
@@ -124,7 +124,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 {"
@@ -567,6 +567,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() );

0 comments on commit 82e189e

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