Skip to content

Commit

Permalink
Skins: append / when setting skin base path
Browse files Browse the repository at this point in the history
Tthis ensures stylesheet icon urls without leading / are transformed correctly
  • Loading branch information
ronso0 committed Jul 27, 2021
1 parent c0f4d96 commit 7859b10
Show file tree
Hide file tree
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
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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
Expand Up @@ -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.
Expand Down

0 comments on commit 7859b10

Please sign in to comment.