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

Method execute

plugins/quickopen/duchainitemquickopen.cpp:143–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143bool DUChainItemData::execute(QString& /*filterText*/)
144{
145 DUChainReadLocker lock;
146 Declaration* decl = m_item.m_item.data();
147 if (!decl) {
148 return false;
149 }
150
151 if (m_openDefinition && FunctionDefinition::definition(decl)) {
152 decl = FunctionDefinition::definition(decl);
153 }
154
155 QUrl url = decl->url().toUrl();
156 KTextEditor::Cursor cursor = decl->rangeInCurrentRevision().start();
157
158 DUContext* internal = decl->internalContext();
159
160 if (internal && (internal->type() == DUContext::Other || internal->type() == DUContext::Class)) {
161 //Move into the body
162 if (internal->range().end.line > internal->range().start.line) {
163 cursor = KTextEditor::Cursor(internal->range().start.line + 1, 0); //Move into the body
164 }
165 }
166
167 lock.unlock();
168 ICore::self()->documentController()->openDocument(url, cursor);
169 return true;
170}
171
172bool DUChainItemData::isExpandable() const
173{

Callers

nothing calls this directly

Calls 12

documentControllerMethod · 0.80
CursorClass · 0.70
dataMethod · 0.45
toUrlMethod · 0.45
urlMethod · 0.45
startMethod · 0.45
internalContextMethod · 0.45
typeMethod · 0.45
rangeMethod · 0.45
unlockMethod · 0.45
openDocumentMethod · 0.45

Tested by

no test coverage detected