TODO: only StandardOutputViewTest calls this function, so output tool views are never removed in KDevelop. Calling Sublime::Area::removeToolView() in a loop does not completely remove a tool view, so consider calling IUiController::removeToolView() instead. StandardOutputView::addToolView() calls IUiController::addToolView() but StandardOutputView::unload() does not call IUiController::removeToolV
| 205 | // the unloading is prevented by the absence of the "X-KDevelop-Category": "Global" |
| 206 | // entry in kdevstandardoutputview.json (see df99304843fbdb593398e3d7d912e15cbd7c56b9). |
| 207 | void StandardOutputView::removeToolView(const QString& toolViewId) |
| 208 | { |
| 209 | const auto toolViewIt = m_toolViews.find(toolViewId); |
| 210 | if (toolViewIt != m_toolViews.end()) { |
| 211 | ToolViewData* td = *toolViewIt; |
| 212 | const auto views = td->views; |
| 213 | for (Sublime::View* view : views) { |
| 214 | if (auto* const widget = view->widget()) { |
| 215 | auto* const outputWidget = qobject_cast<OutputWidget*>(widget); |
| 216 | for (auto it = td->outputdata.keyBegin(), end = td->outputdata.keyEnd(); it != end; ++it) { |
| 217 | outputWidget->removeOutput(*it); |
| 218 | } |
| 219 | } |
| 220 | for (Sublime::Area* area : KDevelop::ICore::self()->uiController()->controller()->allAreas()) { |
| 221 | area->removeToolView( view ); |
| 222 | } |
| 223 | } |
| 224 | delete td; |
| 225 | m_toolViews.erase(toolViewIt); |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | OutputWidget* StandardOutputView::outputWidgetForId( int outputId ) const |
| 230 | { |