* @brief Handles plugin process termination. */
| 1759 | * @brief Handles plugin process termination. |
| 1760 | */ |
| 1761 | void Misc::ExtensionManager::onPluginFinished(const QString& id) |
| 1762 | { |
| 1763 | auto it = m_plugins.find(id); |
| 1764 | if (it == m_plugins.end()) |
| 1765 | return; |
| 1766 | |
| 1767 | if (UI::Dashboard::instance().available()) |
| 1768 | m_userClosedPlugins.insert(id); |
| 1769 | |
| 1770 | auto* process = it.value(); |
| 1771 | const auto remaining = QString::fromUtf8(process->readAll()); |
| 1772 | if (!remaining.isEmpty()) |
| 1773 | m_pluginOutput[id] += remaining; |
| 1774 | |
| 1775 | const auto exitCode = process->exitCode(); |
| 1776 | m_pluginOutput[id] += QStringLiteral("[Exited with code %1]\n").arg(exitCode); |
| 1777 | Q_EMIT pluginOutputChanged(id); |
| 1778 | |
| 1779 | m_plugins.erase(it); |
| 1780 | process->deleteLater(); |
| 1781 | |
| 1782 | for (int i = 0; i < m_runningPlugins.count(); ++i) { |
| 1783 | if (m_runningPlugins.at(i).toMap().value("id").toString() == id) { |
| 1784 | m_runningPlugins.removeAt(i); |
| 1785 | break; |
| 1786 | } |
| 1787 | } |
| 1788 | |
| 1789 | Q_EMIT runningPluginsChanged(); |
| 1790 | applyFilter(); |
| 1791 | rebuildInstalledPlugins(); |
| 1792 | } |
| 1793 | |
| 1794 | //-------------------------------------------------------------------------------------------------- |
| 1795 | // Local manifest & file I/O |