| 270 | } |
| 271 | |
| 272 | void 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 | |
| 304 | QModelIndex OutputModel::firstHighlightIndex() |
| 305 | { |
nothing calls this directly
no test coverage detected