QIconLoader: add some more debugging help

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

Change-Id: I6b36b165ba3d1f82c9b4be18d44a671f71e8507e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 510224f4463c2a372b83d91f0daf24a91069a9fe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Volker Hilsheimer 2023-07-20 02:35:53 +02:00 committed by Qt Cherry-pick Bot
parent e861274f27
commit b01710cba8

View File

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