| 141 | } |
| 142 | |
| 143 | bool 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 | |
| 172 | bool DUChainItemData::isExpandable() const |
| 173 | { |
nothing calls this directly
no test coverage detected