diff options
author | Thomas Hartmann <[email protected]> | 2024-08-29 14:11:52 +0200 |
---|---|---|
committer | Thomas Hartmann <[email protected]> | 2024-08-29 12:24:43 +0000 |
commit | 0dd40a41d68bf6d1b22baa8782e30e235e4cb5b8 (patch) | |
tree | afcd4dd8791b88a8eac76a8432fd73774ec7dafa /src/plugins/qmlprojectmanager/qmlprojectplugin.cpp | |
parent | 32181cdb96654edb0fea1c5007c9405b8715e77e (diff) |
QmlProject: Delay the opening of the fake project
There are cases e.g. when restarting QDS when the correct
.qmlproject will be opened anyway.
Task-number: QDS-13495
Change-Id: I04e13d148484c3afa8e08fe2a43eb700c615720a
Reviewed-by: Burak Hancerli <[email protected]>
Reviewed-by: Thomas Hartmann <[email protected]>
Diffstat (limited to 'src/plugins/qmlprojectmanager/qmlprojectplugin.cpp')
-rw-r--r-- | src/plugins/qmlprojectmanager/qmlprojectplugin.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp b/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp index 2f8ce7c7f42..d195c2b5e4a 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp @@ -409,10 +409,16 @@ void QmlProjectPlugin::initialize() [](Core::IDocument *document) { if (!ProjectManager::startupProject() && document->filePath().completeSuffix() == "ui.qml") { - const Utils::FilePath fileName = Utils::FilePath::fromString( - document->filePath().toString() + Constants::fakeProjectName); - auto result = ProjectExplorer::ProjectExplorerPlugin::openProjects({fileName}); - QTC_ASSERT(result.project(), return); + QTimer::singleShot(1000, [document]() { + if (ProjectManager::startupProject()) + return; + + const Utils::FilePath fileName = Utils::FilePath::fromString( + document->filePath().toString() + Constants::fakeProjectName); + auto result = ProjectExplorer::ProjectExplorerPlugin::openProjects( + {fileName}); + QTC_ASSERT(result.project(), return); + }); } }); |