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

Method uninstallExtension

app/src/Misc/ExtensionManager.cpp:621–645  ·  view source on GitHub ↗

* @brief Uninstalls the currently selected addon, returning false on an invalid selection * or a partial-delete failure. */

Source from the content-addressed store, hash-verified

619 * or a partial-delete failure.
620 */
621bool Misc::ExtensionManager::uninstallExtension()
622{
623 if (m_selectedIndex < 0 || m_selectedIndex >= m_filteredExtensions.count())
624 return false;
625
626 const auto addon = m_filteredExtensions.at(m_selectedIndex).toMap();
627 const auto id = addon.value("id").toString();
628 const auto type = addon.value("type").toString();
629
630 if (id.isEmpty() || !isInstalled(id))
631 return false;
632
633 const auto installDir = extensionsPath() + "/" + type + "/" + id;
634 const bool removed = QDir(installDir).removeRecursively();
635
636 m_installedExtensions.remove(id);
637 m_pluginMetadataCache.remove(id);
638 saveInstalledManifest();
639
640 Q_EMIT extensionUninstalled(id);
641 applyFilter();
642 rebuildInstalledPlugins();
643
644 return removed;
645}
646
647//--------------------------------------------------------------------------------------------------
648// Auto-update

Callers

nothing calls this directly

Calls 4

isEmptyMethod · 0.80
countMethod · 0.45
valueMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected