mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 23:17:21 -06:00
Remove option of using icons from system theme
PR #17292. Closes #17150.
This commit is contained in:
@@ -168,9 +168,6 @@ void UIThemeManager::initInstance()
|
||||
|
||||
UIThemeManager::UIThemeManager()
|
||||
: m_useCustomTheme(Preferences::instance()->useCustomUITheme())
|
||||
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MACOS))
|
||||
, m_useSystemTheme(Preferences::instance()->useSystemIconTheme())
|
||||
#endif
|
||||
{
|
||||
if (m_useCustomTheme)
|
||||
{
|
||||
@@ -206,17 +203,6 @@ QIcon UIThemeManager::getIcon(const QString &iconId, const QString &fallback) co
|
||||
if (iter != m_iconCache.end())
|
||||
return *iter;
|
||||
|
||||
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MACOS))
|
||||
// Don't cache system icons because users might change them at run time
|
||||
if (m_useSystemTheme)
|
||||
{
|
||||
QIcon icon = QIcon::fromTheme(iconId);
|
||||
if (icon.name() != iconId)
|
||||
icon = QIcon::fromTheme(fallback, QIcon(getIconPathFromResources(iconId, fallback).toString()));
|
||||
return icon;
|
||||
}
|
||||
#endif
|
||||
|
||||
const QIcon icon {getIconPathFromResources(iconId, fallback).data()};
|
||||
m_iconCache[iconId] = icon;
|
||||
return icon;
|
||||
@@ -273,22 +259,6 @@ QIcon UIThemeManager::getSystrayIcon() const
|
||||
|
||||
Path UIThemeManager::getIconPath(const QString &iconId) const
|
||||
{
|
||||
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MACOS))
|
||||
if (m_useSystemTheme)
|
||||
{
|
||||
Path path = Utils::Fs::tempPath() / Path(iconId + u".png");
|
||||
if (!path.exists())
|
||||
{
|
||||
const QIcon icon = QIcon::fromTheme(iconId);
|
||||
if (!icon.isNull())
|
||||
icon.pixmap(32).save(path.toString());
|
||||
else
|
||||
path = getIconPathFromResources(iconId);
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
#endif
|
||||
return getIconPathFromResources(iconId, {});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user