| 265 | } |
| 266 | |
| 267 | void ProjectTreeView::slotActivated( const QModelIndex &index ) |
| 268 | { |
| 269 | if ( QApplication::keyboardModifiers() & Qt::CTRL || QApplication::keyboardModifiers() & Qt::SHIFT ) { |
| 270 | // Do not open file when Ctrl or Shift is pressed; that's for selection |
| 271 | return; |
| 272 | } |
| 273 | auto *item = index.data(ProjectModel::ProjectItemRole).value<ProjectBaseItem*>(); |
| 274 | if ( item && item->file() ) |
| 275 | { |
| 276 | emit activate( item->file()->path() ); |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | void ProjectTreeView::projectClosed(KDevelop::IProject* project) |
| 281 | { |