From 01e308b2cc552ccdfcd728bdf105b4ee97d95ce8 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 13 Dec 2024 12:42:23 +0100 Subject: [PATCH] PluginManager: Write plugin id, not name, to startup check We write information about the currently "starting" plugin, so if that crashes we notice that at the next startup and ask the user if they really want to try to load that plugin again. Nowadays we must write the id(), not the name() anymore. Change-Id: Ibdee163eb5d58820347f6e8e11b8a3d4f29ff53a Reviewed-by: Marcus Tillmanns --- src/libs/extensionsystem/pluginmanager.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 8ebf877bcdd..b4f16338b14 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -1622,7 +1622,7 @@ public: QDir().mkpath(QFileInfo(m_filePath).absolutePath()); QFile f(m_filePath); if (f.open(QIODevice::WriteOnly)) { - f.write(spec->name().toUtf8()); + f.write(spec->id().toUtf8()); f.write("\n"); f.close(); } else { @@ -1933,9 +1933,11 @@ PluginSpec *PluginManagerPrivate::pluginForOption(const QString &option, bool *r return nullptr; } -PluginSpec *PluginManagerPrivate::pluginById(const QString &id) const +PluginSpec *PluginManagerPrivate::pluginById(const QString &id_in) const { - QTC_CHECK(id.isLower()); // Plugin ids are always lower case. So the id argument should be too. + QString id = id_in; + // Plugin ids are always lower case. So the id argument should be too. + QTC_ASSERT(id.isLower(), id = id.toLower()); return Utils::findOrDefault(pluginSpecs, [id](PluginSpec *spec) { return spec->id() == id; }); }