MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / hasUpdate

Method hasUpdate

app/src/Misc/ExtensionManager.cpp:272–287  ·  view source on GitHub ↗

* @brief Returns whether a newer version is available for the given addon. */

Source from the content-addressed store, hash-verified

270 * @brief Returns whether a newer version is available for the given addon.
271 */
272bool Misc::ExtensionManager::hasUpdate(const QString& id) const
273{
274 if (!isInstalled(id))
275 return false;
276
277 const auto installed = m_installedExtensions.value(id).toObject();
278 const auto localVer = installed.value("version").toString();
279
280 for (const auto& entry : std::as_const(m_allExtensions)) {
281 const auto obj = entry.toObject();
282 if (obj.value("id").toString() == id)
283 return obj.value("version").toString() != localVer;
284 }
285
286 return false;
287}
288
289/**
290 * @brief Returns the installed version string for the given addon, or empty.

Callers 1

getAddonInfoMethod · 0.80

Calls 1

valueMethod · 0.45

Tested by

no test coverage detected