[PATCH] QLibraryInfo: speed up checking if ":/qt/etc/qt.conf" resource exists
authorThiago Macieira <thiago.macieira@intel.com>
Fri, 24 Jan 2025 19:07:58 +0000 (11:07 -0800)
committerPatrick Franz <deltaone@debian.org>
Thu, 19 Jun 2025 22:08:21 +0000 (00:08 +0200)
commit64d931a920e9ae48028e68dde6e708df393bc2ff
treec733c05f81cb706942ab4b65fbeb48f1fc9bbae6
parentd0e3676a0e449cffaacd0331d5141a4be53382a0
[PATCH] QLibraryInfo: speed up checking if ":/qt/etc/qt.conf" resource exists

Go straight for QResource, because this is run very early in Qt's
initialization, usually as a result of some debug message, via
QLoggingRegistry::initializeRules(). This bypasses the need to create
QResourceFileEnginePrivate, QResourceFileEngine, QFileInfoPrivate, and
QFileInfo, all of which would end up in this .isValid() call.

Additionally, I'm making it query in the C locale, which will also avoid
initializing the system & default QLocales. If a resource exists in any
language, the C locale query will find it.

Task-number: QTBUG-133206
Change-Id: I434b498903d793c12d35fffd3e297bfdbdc1b6fe
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d59e640c868f3db2d661970f3d34a22013d49053)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ae2502b4ad3d1215211bf4ed44037a40f52a313d)

Gbp-Pq: Name upstream_qlibraryinfo_speedup.patch
src/corelib/global/qlibraryinfo.cpp