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

Method findToolView

kdevplatform/shell/uicontroller.cpp:288–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286}
287
288QWidget* UiController::findToolView(const QString& name, IToolViewFactory *factory, FindFlags flags)
289{
290 Q_D(UiController);
291
292 auto* const area = restoredActiveArea();
293 if (!area) {
294 return nullptr;
295 }
296
297 const auto& views = area->toolViews();
298 const auto it = std::find_if(views.cbegin(), views.cend(), [&name](const Sublime::View* view) {
299 return view->document()->title() == name;
300 });
301 if (it != views.cend()) {
302 auto* const view = *it;
303 auto* const widget = view->widget();
304 Q_ASSERT(widget);
305 if(flags & Raise)
306 area->raiseToolView(view);
307 return widget;
308 }
309
310 QWidget* ret = nullptr;
311
312 if(flags & Create)
313 {
314 Sublime::ToolDocument* doc = d->factoryDocuments.value(factory);
315 if(!doc) {
316 doc = new Sublime::ToolDocument(name, this, new UiToolViewFactory(factory));
317 d->factoryDocuments.insert(factory, doc);
318 }
319
320 const auto* const view = addToolViewToArea(factory, doc, area);
321 if (view) {
322 ret = view->widget();
323 Q_ASSERT(ret);
324 }
325
326 if(flags & Raise)
327 findToolView(name, factory, Raise);
328 }
329
330 return ret;
331}
332
333void UiController::raiseToolView(const QString& documentSpecifier)
334{

Callers 9

showDocumentationMethod · 0.80
showUsesDelayedMethod · 0.80
updateReviewMethod · 0.80
startSearchMethod · 0.80
previewTemplateMethod · 0.80
resultMethod · 0.80
resultMethod · 0.80
findInClassBrowserMethod · 0.80
showModelMethod · 0.80

Calls 7

findToolViewFunction · 0.85
titleMethod · 0.45
documentMethod · 0.45
widgetMethod · 0.45
raiseToolViewMethod · 0.45
valueMethod · 0.45
insertMethod · 0.45

Tested by 2

resultMethod · 0.64
resultMethod · 0.64