MCPcopy Create free account
hub / github.com/KDE/kdevelop / removeOutput

Method removeOutput

plugins/standardoutputview/outputwidget.cpp:290–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290void OutputWidget::removeOutput( int id )
291{
292 const auto viewIt = m_views.constFind(id);
293 if (data->outputdata.contains(id) && (viewIt != m_views.constEnd())) {
294 auto view = viewIt->view;
295 if( data->type & KDevelop::IOutputView::MultipleView || data->type & KDevelop::IOutputView::HistoryView )
296 {
297 if( data->type & KDevelop::IOutputView::MultipleView )
298 {
299 int idx = m_tabwidget->indexOf( view );
300 if (idx != -1)
301 {
302 m_tabwidget->removeTab( idx );
303 }
304 } else
305 {
306 int idx = m_stackwidget->indexOf( view );
307 if (idx != -1)
308 {
309 m_stackwidget->removeWidget(view);
310 }
311 }
312 } else {
313 // KDevelop::IOutputView::OneView case
314 // Do nothig here since our single view will be automatically removed from layout
315 // during it's destroy
316 }
317
318 m_views.erase(viewIt);
319 // remove our view with proxy model which is view's child (see outputFilter() method).
320 delete view;
321
322 emit outputRemoved(id);
323 }
324 enableActions();
325}
326
327bool OutputWidget::closeView(const QWidget* view)
328{

Callers 3

closeViewMethod · 0.45
closeOtherViewsMethod · 0.45

Calls 5

constEndMethod · 0.80
removeWidgetMethod · 0.80
constFindMethod · 0.45
containsMethod · 0.45
indexOfMethod · 0.45

Tested by 1