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 <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Marcus Tillmanns
2022-09-29 10:11:28 +02:00
parent 1748c6e80b
commit 8d80623a0f

View File

@@ -31,6 +31,8 @@
#include <utils/fsengine/fileiconprovider.h> #include <utils/fsengine/fileiconprovider.h>
#include <utils/parameteraction.h> #include <utils/parameteraction.h>
#include <QTimer>
using namespace Core; using namespace Core;
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace Utils; using namespace Utils;
@@ -118,8 +120,8 @@ bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString *
void CMakeProjectPlugin::extensionsInitialized() void CMakeProjectPlugin::extensionsInitialized()
{ {
//restore the cmake tools before loading the kits // Delay the restoration to allow the devices to load first.
CMakeToolManager::restoreCMakeTools(); QTimer::singleShot(0, this, [] { CMakeToolManager::restoreCMakeTools(); });
} }
void CMakeProjectPlugin::updateContextActions(Node *node) void CMakeProjectPlugin::updateContextActions(Node *node)