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

Method activate

kdevplatform/outputview/outputmodel.cpp:272–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270}
271
272void OutputModel::activate( const QModelIndex& index )
273{
274 Q_D(OutputModel);
275
276 if( index.model() != this || !d->isValidIndex(index, rowCount()) )
277 {
278 return;
279 }
280 qCDebug(OUTPUTVIEW) << "Model activated" << index.row();
281
282
283 FilteredItem item = d->m_filteredItems.at( index.row() );
284 if( item.isActivatable )
285 {
286 qCDebug(OUTPUTVIEW) << "activating:" << item.lineNo << item.url;
287 KTextEditor::Cursor range( item.lineNo, item.columnNo );
288 KDevelop::IDocumentController *docCtrl = KDevelop::ICore::self()->documentController();
289 QUrl url = item.url;
290 if (item.url.isEmpty()) {
291 qCWarning(OUTPUTVIEW) << "trying to open empty url";
292 return;
293 }
294 if(url.isRelative()) {
295 url = d->m_buildDir.resolved(url);
296 }
297 Q_ASSERT(!url.isRelative());
298 docCtrl->openDocument( url, range );
299 } else {
300 qCDebug(OUTPUTVIEW) << "not an activateable item";
301 }
302}
303
304QModelIndex OutputModel::firstHighlightIndex()
305{

Callers

nothing calls this directly

Calls 8

isValidIndexMethod · 0.80
documentControllerMethod · 0.80
resolvedMethod · 0.80
modelMethod · 0.45
rowMethod · 0.45
atMethod · 0.45
isEmptyMethod · 0.45
openDocumentMethod · 0.45

Tested by

no test coverage detected