Skip to content

Commit

Permalink
Find default theme differently
Browse files Browse the repository at this point in the history
  • Loading branch information
probonopd authored Aug 18, 2023
1 parent 27c8a2b commit 53996b0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions platformthemeplugin/hintsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,14 @@ HintsSettings::HintsSettings(QObject *parent)
for (const QString &iconThemePath : iconThemePaths) {
const QFileInfo defaultIconThemeLink(iconThemePath + QStringLiteral("/default"));
if (defaultIconThemeLink.exists()) {
if (defaultIconThemeLink.isSymLink()) {
defaultIconTheme = defaultIconThemeLink.symLinkTarget();
// Check if a file "index.theme" exists in the default icon theme; if so,
// read the "Name" key from it. Is this the correct way to do it?
const QFileInfo defaultIconThemeFile(defaultIconThemeLink.symLinkTarget() + QStringLiteral("/index.theme"));
if (defaultIconThemeFile.exists()) {
QSettings indexTheme(defaultIconThemeFile.absoluteFilePath(), QSettings::IniFormat);
defaultIconTheme = indexTheme.value(QStringLiteral("Icon Theme/Name")).toString();
break;
}
// qDebug() << "defaultIconThemeLink" << defaultIconThemeLink;
break;
}
}

Expand Down

0 comments on commit 53996b0

Please sign in to comment.