QIconLoader: add some more debugging help

As a drive-by, re-use the result from the first QFile::exists
check.

Pick-to: 6.6
Change-Id: I6b36b165ba3d1f82c9b4be18d44a671f71e8507e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Volker Hilsheimer 2023-07-20 02:35:53 +02:00
parent e1a93b3d9a
commit 510224f446

View File

@ -359,12 +359,12 @@ QIconTheme::QIconTheme(const QString &themeName)
if (!m_valid) { if (!m_valid) {
themeIndex.setFileName(themeDir + "/index.theme"_L1); themeIndex.setFileName(themeDir + "/index.theme"_L1);
if (themeIndex.exists()) m_valid = themeIndex.exists();
m_valid = true; qCDebug(lcIconLoader) << "Probing theme file at" << themeIndex.fileName() << m_valid;
} }
} }
#if QT_CONFIG(settings) #if QT_CONFIG(settings)
if (themeIndex.exists()) { if (m_valid) {
const QSettings indexReader(themeIndex.fileName(), QSettings::IniFormat); const QSettings indexReader(themeIndex.fileName(), QSettings::IniFormat);
const QStringList keys = indexReader.allKeys(); const QStringList keys = indexReader.allKeys();
for (const QString &key : keys) { for (const QString &key : keys) {
@ -433,7 +433,8 @@ QThemeIconInfo QIconLoader::findIconHelper(const QString &themeName,
const QString &iconName, const QString &iconName,
QStringList &visited) const QStringList &visited) const
{ {
qCDebug(lcIconLoader) << "Finding icon" << iconName << "in theme" << themeName; qCDebug(lcIconLoader) << "Finding icon" << iconName << "in theme" << themeName
<< "skipping" << visited;
QThemeIconInfo info; QThemeIconInfo info;
Q_ASSERT(!themeName.isEmpty()); Q_ASSERT(!themeName.isEmpty());