Skip to content

Commit 5732a6b

Browse files
TurboTheTurtleglassez
authored andcommitted
Resolve relative UI theme paths
PR qbittorrent#24514. Closes qbittorrent#24489.
1 parent 9cb32d1 commit 5732a6b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/gui/uithememanager.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include "base/global.h"
4141
#include "base/logger.h"
4242
#include "base/path.h"
43+
#include "base/profile.h"
4344
#include "base/preferences.h"
4445
#include "uithemecommon.h"
4546

@@ -51,6 +52,11 @@ namespace
5152
const QColor &color = palette.color(QPalette::Active, QPalette::Base);
5253
return (color.lightness() < 127);
5354
}
55+
56+
Path resolveThemePath(const Path &themePath)
57+
{
58+
return (themePath.isAbsolute() ? themePath : (Profile::instance()->rootPath() / themePath));
59+
}
5460
}
5561

5662
UIThemeManager *UIThemeManager::m_instance = nullptr;
@@ -91,7 +97,7 @@ UIThemeManager::UIThemeManager()
9197

9298
if (m_useCustomTheme)
9399
{
94-
const Path themePath = Preferences::instance()->customUIThemePath();
100+
const Path themePath = resolveThemePath(Preferences::instance()->customUIThemePath());
95101

96102
if (themePath.hasExtension(u".qbtheme"_s))
97103
{

0 commit comments

Comments
 (0)