Fix incorrect color theme correction for AppImages

Related to #2
parent e2b499ff
...@@ -115,7 +115,7 @@ void ThemeManager::setCurrentTheme(const QString &filename) ...@@ -115,7 +115,7 @@ void ThemeManager::setCurrentTheme(const QString &filename)
if (!d->themeMenuAction || !d->themeMenuActionGroup) { if (!d->themeMenuAction || !d->themeMenuActionGroup) {
return; return;
} }
QString name = d->themeMap.key(filename, d->defaultThemeName); QString name = d->themeMap.key(filename);
// In the case of AppImage, the path to the color scheme can be invalid // In the case of AppImage, the path to the color scheme can be invalid
// on each start as filesystem is mounted with a random path, so check that and correct // on each start as filesystem is mounted with a random path, so check that and correct
if (name.isEmpty()) { if (name.isEmpty()) {
...@@ -124,8 +124,12 @@ void ThemeManager::setCurrentTheme(const QString &filename) ...@@ -124,8 +124,12 @@ void ThemeManager::setCurrentTheme(const QString &filename)
i.next(); i.next();
if (QFileInfo(i.value()).fileName() == QFileInfo(filename).fileName()) { if (QFileInfo(i.value()).fileName() == QFileInfo(filename).fileName()) {
name = i.key(); name = i.key();
break;
} }
} }
if (name.isEmpty()) {
name = d->defaultThemeName;
}
} }
bool themeFound = false; bool themeFound = false;
const QList<QAction *> list = d->themeMenuActionGroup->actions(); const QList<QAction *> list = d->themeMenuActionGroup->actions();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment