* @brief Stops all running plugins. Called on application shutdown. */
| 1691 | * @brief Stops all running plugins. Called on application shutdown. |
| 1692 | */ |
| 1693 | void Misc::ExtensionManager::stopAllPlugins() |
| 1694 | { |
| 1695 | const auto ids = m_plugins.keys(); |
| 1696 | m_settings.setValue("RunningPlugins", QStringList(ids)); |
| 1697 | |
| 1698 | for (const auto& id : ids) { |
| 1699 | auto* process = m_plugins.value(id); |
| 1700 | if (!process) |
| 1701 | continue; |
| 1702 | |
| 1703 | process->disconnect(this); |
| 1704 | process->terminate(); |
| 1705 | if (!process->waitForFinished(3000)) |
| 1706 | process->kill(); |
| 1707 | |
| 1708 | delete process; |
| 1709 | } |
| 1710 | |
| 1711 | m_plugins.clear(); |
| 1712 | m_runningPlugins.clear(); |
| 1713 | Q_EMIT runningPluginsChanged(); |
| 1714 | applyFilter(); |
| 1715 | rebuildInstalledPlugins(); |
| 1716 | } |
| 1717 | |
| 1718 | /** |
| 1719 | * @brief Restores plugins that were running in the previous session. |