Skip to content

Commit

Permalink
Merge pull request #4151 from ronso0/skinstyles-fix-url-transform
Browse files Browse the repository at this point in the history
Skins: append / when setting skin base path
Holzhaus authored Jul 27, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 1557ef2 + 7859b10 commit 6b09f1f
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/skin/legacy/legacyskinparser.cpp
Original file line number Diff line number Diff line change
@@ -410,7 +410,7 @@ QWidget* LegacySkinParser::parseSkin(const QString& skinPath, QWidget* pParent)

LaunchImage* LegacySkinParser::parseLaunchImage(const QString& skinPath, QWidget* pParent) {
m_pContext = std::make_unique<SkinContext>(m_pConfig, skinPath + "/skin.xml");
m_pContext->setSkinBasePath(skinPath + "/");
m_pContext->setSkinBasePath(skinPath);

QDomElement skinDocument = openSkin(skinPath);
if (skinDocument.isNull()) {
@@ -2308,7 +2308,5 @@ QString LegacySkinParser::stylesheetAbsIconPaths(QString& style) {
// <Style> nodes) with absolute file paths.
// TODO Can be removed/disabled as soon as all target distros have the fixed
// package in their repo.
// Note: It's safe to use the base path after parseSkin() has updated it
// (parseLaunchImage() appends "/" earlier)
return style.replace("url(skin:", "url(" + m_pContext->getSkinBasePath());
}
2 changes: 1 addition & 1 deletion src/skin/legacy/skincontext.h
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ class SkinContext {
void setSkinBasePath(const QString& skinBasePath) {
QStringList skinPaths(skinBasePath);
QDir::setSearchPaths("skin", skinPaths);
m_skinBasePath = skinBasePath;
m_skinBasePath = skinBasePath + "/";
}

// Sets the base path used by getSkinPath.

0 comments on commit 6b09f1f

Please sign in to comment.