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

Method labelClicked

kdevplatform/shell/workingsets/workingsettooltipwidget.cpp:351–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349}
350
351void WorkingSetToolTipWidget::labelClicked()
352{
353 QPointer<WorkingSetToolTipWidget> stillExists(this);
354
355 auto* s = qobject_cast<WorkingSetFileLabel*>(sender());
356 Q_ASSERT(s);
357
358 bool found = false;
359
360 auto* window = static_cast<Sublime::MainWindow*>(ICore::self()->uiController()->activeMainWindow());
361
362 const auto views = window->area()->views();
363 for (Sublime::View* view : views) {
364 if(view->document()->documentSpecifier() == s->objectName())
365 {
366 window->activateView(view);
367 found = true;
368 break;
369 }
370 }
371
372 if(!found)
373 Core::self()->documentControllerInternal()->openDocument(QUrl::fromUserInput(s->objectName()));
374
375 if(stillExists)
376 updateFileButtons();
377}
378
379#include "workingsettooltipwidget.moc"
380#include "moc_workingsettooltipwidget.cpp"

Callers

nothing calls this directly

Calls 9

uiControllerMethod · 0.80
activeMainWindowMethod · 0.45
viewsMethod · 0.45
areaMethod · 0.45
documentSpecifierMethod · 0.45
documentMethod · 0.45
activateViewMethod · 0.45
openDocumentMethod · 0.45

Tested by

no test coverage detected