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

Method start

plugins/quickopen/quickopenplugin.cpp:794–835  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

792struct CreateOutlineDialog
793{
794 void start()
795 {
796 if (!QuickOpenPlugin::self()->freeModel()) {
797 return;
798 }
799
800 IDocument* doc = ICore::self()->documentController()->activeDocument();
801 if (!doc) {
802 qCDebug(PLUGIN_QUICKOPEN) << "No active document";
803 return;
804 }
805
806 DUChainReadLocker lock;
807
808 TopDUContext* context = DUChainUtils::standardContextForUrl(doc->url());
809
810 if (!context) {
811 qCDebug(PLUGIN_QUICKOPEN) << "Got no standard context";
812 return;
813 }
814
815 model = new QuickOpenModel(nullptr);
816
817 OutlineFilter filter(items);
818
819 DUChainUtils::collectItems(context, filter);
820
821 if (noHtmlDestriptionInOutline) {
822 for (auto& item : items) {
823 item.m_noHtmlDestription = true;
824 }
825 }
826
827 cursorDecl = cursorContextDeclaration();
828
829 model->registerProvider(QStringList(), QStringList(), new DeclarationListDataProvider(QuickOpenPlugin::self(), items, true));
830
831 dialog = new QuickOpenWidgetDialog(i18nc("@title:window", "Outline"), model, QStringList(), QStringList(), true);
832 dialog->widget()->setSortingEnabled(true);
833
834 model->setParent(dialog->widget());
835 }
836 void finish()
837 {
838 //Select the declaration that contains the cursor

Callers 7

executeMethod · 0.45
quickOpenDeclarationMethod · 0.45
quickOpenDefinitionMethod · 0.45
createWidgetMethod · 0.45
getItemMethod · 0.45
textChangedMethod · 0.45

Calls 10

cursorContextDeclarationFunction · 0.85
QStringListClass · 0.85
freeModelMethod · 0.80
activeDocumentMethod · 0.80
documentControllerMethod · 0.80
setSortingEnabledMethod · 0.80
urlMethod · 0.45
registerProviderMethod · 0.45
widgetMethod · 0.45
setParentMethod · 0.45

Tested by

no test coverage detected