Add a workaround to allow some customer plugins to still build.

This commit is contained in:
Michael Zanetti 2019-07-10 11:05:04 +02:00
parent 9eaafc8ee9
commit 0ba3f6ca39
2 changed files with 15 additions and 0 deletions

View File

@ -155,6 +155,10 @@ void PluginMetadata::parse(const QJsonObject &jsonObject)
// Load deviceclasses of this vendor
foreach (const QJsonValue &deviceClassJson, vendorJson.toObject().value("deviceClasses").toArray()) {
// FIXME: Drop this when possible, see .h for context
m_currentScopUuids.clear();
QJsonObject deviceClassObject = deviceClassJson.toObject();
/*! Returns a list of all valid JSON properties a DeviceClass JSON definition can have. */
QStringList deviceClassProperties = QStringList() << "id" << "name" << "displayName" << "createMethods" << "setupMethod"
@ -720,6 +724,11 @@ QPair<bool, Types::InputType> PluginMetadata::loadAndVerifyInputType(const QStri
bool PluginMetadata::verifyDuplicateUuid(const QUuid &uuid)
{
if (m_allUuids.contains(uuid)) {
// FIXME: Drop debug, activate return! (see .h for more context)
qCWarning(dcPluginMetadata()) << "THIS PLUGIN USES DUPLICATE UUID" << uuid.toString() << "! THIS WILL STOP WORKING SOON.";
// return false;
}
if (m_currentScopUuids.contains(uuid)) {
return false;
}
m_allUuids.append(uuid);

View File

@ -65,6 +65,12 @@ private:
DeviceClasses m_deviceClasses;
QList<QUuid> m_allUuids;
// FIXME: Due to the fact that we have duplicate UUIDs in use in plugins out there in
// products, we can't just break those plugins now. For now, let's make the check
// As strict as possible without breaking them, but this should be removed ASAP
// and only m_allUuids should be used to check for dupes
QList<QUuid> m_currentScopUuids;
};
#endif // PLUGINMETADATA_H