Skip to content

Commit

Permalink
Consider LXQt theme names case-insensitively
Browse files Browse the repository at this point in the history
This is needed after lxqt/liblxqt#308
  • Loading branch information
tsujan committed Apr 23, 2022
1 parent 29a722a commit a51ca48
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lxqt-config-appearance/lxqtthemeconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ void LXQtThemeConfig::initControls()

QTreeWidgetItemIterator it(ui->lxqtThemeList);
while (*it) {
if ((*it)->data(0, Qt::UserRole).toString() == currentTheme)
// liblxqt considers LXQt theme names case-insensitively
if (QString::compare((*it)->data(0, Qt::UserRole).toString(), currentTheme, Qt::CaseInsensitive) == 0)
{
ui->lxqtThemeList->setCurrentItem((*it));
break;
Expand All @@ -131,10 +132,10 @@ void LXQtThemeConfig::applyLxqtTheme()
return;

LXQt::LXQtTheme currentTheme{mSettings->value(QStringLiteral("theme")).toString()};
QVariant themeName = item->data(0, Qt::UserRole);
if(mSettings->value(QStringLiteral("theme")) != themeName)
QString themeName = item->data(0, Qt::UserRole).toString();
if(QString::compare(mSettings->value(QStringLiteral("theme")).toString(), themeName, Qt::CaseInsensitive) != 0)
mSettings->setValue(QStringLiteral("theme"), themeName);
LXQt::LXQtTheme theme(themeName.toString());
LXQt::LXQtTheme theme(themeName);
if(theme.isValid()) {
QString wallpaper = theme.desktopBackground();
if(!wallpaper.isEmpty() && (ui->wallpaperOverride->isChecked() || !isWallpaperChanged(currentTheme.desktopBackground()))) {
Expand Down

0 comments on commit a51ca48

Please sign in to comment.