Skip to content
Permalink
Browse files

ThemeInfo: fix loading of platform-specific QSS files.

A refactor during the code review of the ThemeInfo loading
code broke loading of platform-specific QSS files.
  • Loading branch information...
mkrautz committed Dec 25, 2015
1 parent 7cb6bb1 commit 17194964b131e8f9b43e5328f7a9daeceec0af98
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/mumble/ThemeInfo.cpp
@@ -44,7 +44,7 @@ QFileInfo ThemeInfo::StyleInfo::getPlatformQss() const {
}

boost::optional<ThemeInfo::StyleInfo> readStyleFromConfig(QSettings &themeConfig, const QString &styleId, const ThemeInfo &theme, const QDir &themeDir) {
QRegExp qssPlatformRegex(QLatin1String("^qss_(.*)"));
QRegExp qssPlatformRegex(QString::fromLatin1("^%1/qss_(.*)").arg(styleId));

ThemeInfo::StyleInfo style;

@@ -66,7 +66,7 @@ boost::optional<ThemeInfo::StyleInfo> readStyleFromConfig(QSettings &themeConfig
qssPlatformRegex.indexIn(platformQssConfig);
const QString platform = qssPlatformRegex.cap(1);

QFileInfo platformQss = (themeDir.filePath(themeConfig.value(QString::fromLatin1("%1/%2").arg(styleId, platformQssConfig)).toString()));
QFileInfo platformQss = (themeDir.filePath(themeConfig.value(platformQssConfig).toString()));
if (!platformQss.exists() || !platformQss.isFile()) {
qWarning() << "Style" << style.name << " of theme " << theme.name << " references invalid qss " << platformQss.filePath() << " for platform " << platform << ", skipping theme";
return boost::none;

0 comments on commit 1719496

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