| 285 | |
| 286 | |
| 287 | QList<ProjectBaseItem*> ProjectTreeView::selectedProjects() |
| 288 | { |
| 289 | QList<ProjectBaseItem*> itemlist; |
| 290 | if ( selectionModel()->hasSelection() ) { |
| 291 | const QModelIndexList indexes = selectionModel()->selectedRows(); |
| 292 | for ( const QModelIndex& index: indexes ) { |
| 293 | auto* item = index.data( ProjectModel::ProjectItemRole ).value<ProjectBaseItem*>(); |
| 294 | if ( item ) { |
| 295 | itemlist << item; |
| 296 | m_previousSelection = item->project(); |
| 297 | } |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | // add previous selection if nothing is selected right now |
| 302 | if ( itemlist.isEmpty() && m_previousSelection ) { |
| 303 | itemlist << m_previousSelection->projectItem(); |
| 304 | } |
| 305 | |
| 306 | return itemlist; |
| 307 | } |
| 308 | |
| 309 | KDevelop::IProject* ProjectTreeView::getCurrentProject() |
| 310 | { |
nothing calls this directly
no test coverage detected