mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Remove option of using icons from system theme
PR #17292. Closes #17150.
This commit is contained in:
parent
d293c22a52
commit
92afbd45e8
6 changed files with 0 additions and 70 deletions
|
@ -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, {});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue