Skip to content

Commit

Permalink
fix: xdg icon loading failed with qt6
Browse files Browse the repository at this point in the history
fallback to QIconLoaderEngine on DTK_DISABLE_LIBXDG

Issue: linuxdeepin/developer-center#6459
  • Loading branch information
kegechen committed Dec 19, 2023
1 parent a66d7cc commit fe620c9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/util/private/diconproxyengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,13 @@ void DIconProxyEngine::ensureEngine()
m_iconEngine = createDBuiltinIconEngine(m_iconName);
}
#ifdef DTK_DISABLE_LIBXDG
if (!m_iconEngine && Q_UNLIKELY(!m_option.testFlag(DIconTheme::DontFallbackToQIconFromTheme)) && QGuiApplicationPrivate::platformTheme() ) {
// Warning : do not call from qplatformTheme createIconEngine (stackoverflow)
m_iconEngine = QGuiApplicationPrivate::platformTheme()->createIconEngine(m_iconName);
if (!m_iconEngine && Q_UNLIKELY(!m_option.testFlag(DIconTheme::DontFallbackToQIconFromTheme))) {
// fallback to QPlatformTheme::createIconEngine ==> QIconLoaderEngine
QPlatformTheme * const platformTheme = QGuiApplicationPrivate::platformTheme();
bool hasUserTheme = QIconLoader::instance()->hasUserTheme();
if (platformTheme && !hasUserTheme) {
m_iconEngine = platformTheme->QPlatformTheme::createIconEngine(m_iconName);
}
}
#else
if (!m_iconEngine ) {
Expand Down

0 comments on commit fe620c9

Please sign in to comment.