* @brief Restores the selected extension index by matching the previous entry's ID. */
| 1034 | * @brief Restores the selected extension index by matching the previous entry's ID. |
| 1035 | */ |
| 1036 | void 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. |