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

Method restoreSelectionByPreviousId

app/src/Misc/ExtensionManager.cpp:1036–1051  ·  view source on GitHub ↗

* @brief Restores the selected extension index by matching the previous entry's ID. */

Source from the content-addressed store, hash-verified

1034 * @brief Restores the selected extension index by matching the previous entry's ID.
1035 */
1036void Misc::ExtensionManager::restoreSelectionByPreviousId()
1037{
1038 const auto previousAddon = selectedExtension();
1039 const auto previousId = previousAddon.value("id").toString();
1040 m_selectedIndex = -1;
1041
1042 if (previousId.isEmpty())
1043 return;
1044
1045 for (int i = 0; i < m_filteredExtensions.count(); ++i) {
1046 if (m_filteredExtensions.at(i).toMap().value("id").toString() == previousId) {
1047 m_selectedIndex = i;
1048 return;
1049 }
1050 }
1051}
1052
1053/**
1054 * @brief Loads (and caches) the title/icon metadata for an installed plugin.

Callers

nothing calls this directly

Calls 3

isEmptyMethod · 0.80
valueMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected