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

Method disuse

kdevplatform/sublime/idealcontroller.cpp:301–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301bool ToolViewWidgetCache::disuse(const View& view)
302{
303 Q_ASSERT(view.widget());
304 const auto* const document = view.document();
305 Q_ASSERT(document);
306
307 const auto it = m_widgets.find(document);
308 Q_ASSERT(it != m_widgets.end());
309 Q_ASSERT(it->widget() == view.widget());
310
311 if (it->useCount() == 1) {
312 m_widgets.erase(it);
313 qCDebug(SUBLIME) << "destroying a no longer used tool view widget" << document->documentSpecifier();
314 return true;
315 }
316
317 it->removeUse();
318 qCDebug(SUBLIME).nospace() << "keeping a still used tool view widget " << document->documentSpecifier()
319 << ", use count: " << it->useCount();
320 return false;
321}
322
323QWidget* ToolViewWidgetCache::remove(const Document* document)
324{

Callers 1

removeViewMethod · 0.80

Calls 7

useCountMethod · 0.80
widgetMethod · 0.45
documentMethod · 0.45
findMethod · 0.45
endMethod · 0.45
documentSpecifierMethod · 0.45
removeUseMethod · 0.45

Tested by

no test coverage detected