aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/luapluginspec.cpp
diff options
context:
space:
mode:
authorMarcus Tillmanns <[email protected]>2024-07-25 12:52:23 +0200
committerMarcus Tillmanns <[email protected]>2024-07-30 13:11:01 +0000
commit8974d844ffca71016d34110cb99c45fb826a3f05 (patch)
treef483a0fbf803b4a0a9e861d229fc42eb021d54a3 /src/plugins/lua/luapluginspec.cpp
parent8c91d12ca123d131266dffa19923f7aad718bc77 (diff)
Lua: Introduce LuaCompatibleVersion
The new field "LuaCompatibleVersion" is required when a lua plugin depends on a C++ plugin. A dependency will be fulfilled if: "LuaCompatibleVersion <= dependency.version <= Version" Change-Id: I61466055a56e20abbb1fa5f73a5735a0e3a4c471 Reviewed-by: Eike Ziller <[email protected]>
Diffstat (limited to 'src/plugins/lua/luapluginspec.cpp')
-rw-r--r--src/plugins/lua/luapluginspec.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/plugins/lua/luapluginspec.cpp b/src/plugins/lua/luapluginspec.cpp
index 17a303bdf1f..8a829c5f5ef 100644
--- a/src/plugins/lua/luapluginspec.cpp
+++ b/src/plugins/lua/luapluginspec.cpp
@@ -98,10 +98,18 @@ bool LuaPluginSpec::provides(PluginSpec *spec, const PluginDependency &dependenc
if (QString::compare(dependency.name, spec->name(), Qt::CaseInsensitive) != 0)
return false;
- // Since we first released the lua support with Qt Creator 14.0.0, but the internal version
- // number was still 13.0.82, we needed to special case this version.
- if (versionCompare(dependency.version, "14.0.0") <= 0)
- return true;
+ const QString luaCompatibleVersion = spec->metaData().value("LuaCompatibleVersion").toString();
+
+ if (luaCompatibleVersion.isEmpty()) {
+ qCWarning(luaPluginSpecLog)
+ << "The plugin" << spec->name()
+ << "does not specify a \"LuaCompatibleVersion\", but the lua plugin" << name()
+ << "requires it.";
+ return false;
+ }
+
+ if (versionCompare(luaCompatibleVersion, dependency.version) > 0)
+ return false;
return (versionCompare(spec->version(), dependency.version) >= 0);
}
@@ -114,6 +122,7 @@ bool LuaPluginSpec::loadLibrary()
setState(PluginSpec::State::Loaded);
return true;
}
+
bool LuaPluginSpec::initializePlugin()
{
QTC_ASSERT(!d->activeLuaState, return false);