Remove option of using icons from system theme

PR #17292.
Closes #17150.
This commit is contained in:
Nowshed H. Imran 2022-07-05 10:32:35 +06:00 committed by GitHub
parent d293c22a52
commit 92afbd45e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 0 additions and 70 deletions

View file

@ -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, {});
}