| 325 | } |
| 326 | |
| 327 | bool OutputWidget::closeView(const QWidget* view) |
| 328 | { |
| 329 | Q_ASSERT(view); |
| 330 | Q_ASSERT(qobject_cast<const QAbstractItemView*>(view)); |
| 331 | |
| 332 | const auto fvIt = constFindFilteredView(static_cast<const QAbstractItemView*>(view)); |
| 333 | if (fvIt == m_views.cend()) { |
| 334 | return false; |
| 335 | } |
| 336 | |
| 337 | const auto id = fvIt.key(); |
| 338 | if (!(data->outputdata.value(id)->behaviour & KDevelop::IOutputView::AllowUserClose)) { |
| 339 | return false; |
| 340 | } |
| 341 | |
| 342 | data->plugin->removeOutput(id); |
| 343 | enableActions(); |
| 344 | return true; |
| 345 | } |
| 346 | |
| 347 | template<class ViewContainer> |
| 348 | void OutputWidget::closeFirstViewIfTooMany(const ViewContainer& viewContainer) |
no test coverage detected