QmlDesigner: Don't scan for fonts if resource path is not valid

For some reason captureiconmode puppet is launched at QDS shutdown,
with empty resource path. This caused the entire drive to be searched
for fonts to register, making the puppet linger for up to a minute
after the shutdown.

Fixes: QDS-6482
Change-Id: I0f1fa4b6f5646c76d93f5820dae029033e1543a3
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Miikka Heikkinen
2022-03-18 12:16:14 +02:00
parent 1651efaee7
commit 10f2fb7be2

View File

@@ -1576,6 +1576,9 @@ void NodeInstanceServer::setupState(qint32 stateInstanceId)
void NodeInstanceServer::registerFonts(const QUrl &resourceUrl) const void NodeInstanceServer::registerFonts(const QUrl &resourceUrl) const
{ {
if (!resourceUrl.isValid())
return;
// Autoregister all fonts found inside the project // Autoregister all fonts found inside the project
QDirIterator it {QFileInfo(resourceUrl.toLocalFile()).absoluteFilePath(), QDirIterator it {QFileInfo(resourceUrl.toLocalFile()).absoluteFilePath(),
{"*.ttf", "*.otf"}, QDir::Files, QDirIterator::Subdirectories}; {"*.ttf", "*.otf"}, QDir::Files, QDirIterator::Subdirectories};