Plugin install: Check if archive contains a usable plugin

Checks if there is a library file which is a Qt Creator plugin
that is compatible with the version of Qt Creator that is running.

Change-Id: Ic5284e3803c45b8e2ef0d30afccb1680fabf43f3
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Eike Ziller
2020-06-23 14:11:29 +02:00
parent 5b4b09481a
commit d67ab36c6f
4 changed files with 114 additions and 13 deletions

View File

@@ -547,6 +547,16 @@ void PluginSpec::setEnabledBySettings(bool value)
d->setEnabledBySettings(value);
}
PluginSpec *PluginSpec::read(const QString &filePath)
{
auto spec = new PluginSpec;
if (!spec->d->read(filePath)) { // not a Qt Creator plugin
delete spec;
return nullptr;
}
return spec;
}
//==========PluginSpecPrivate==================
namespace {