From 8d80623a0f6885810bbfe8448128d5fbc7cc9ddb Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 29 Sep 2022 10:11:28 +0200 Subject: [PATCH] CMake: Delay restoration until devices load If the devices have not loaded yet, trying to restore a remote cmake will result in errors. Change-Id: I08a802441d64b203388334e5cbb6b962d1f0d213 Reviewed-by: Cristian Adam Reviewed-by: --- src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp index 0178164b39c..1551030ce0b 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp @@ -31,6 +31,8 @@ #include #include +#include + using namespace Core; using namespace ProjectExplorer; using namespace Utils; @@ -118,8 +120,8 @@ bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString * void CMakeProjectPlugin::extensionsInitialized() { - //restore the cmake tools before loading the kits - CMakeToolManager::restoreCMakeTools(); + // Delay the restoration to allow the devices to load first. + QTimer::singleShot(0, this, [] { CMakeToolManager::restoreCMakeTools(); }); } void CMakeProjectPlugin::updateContextActions(Node *node)