| 809 | } |
| 810 | |
| 811 | QModelIndex LaunchConfigurationsModel::indexForConfig( LaunchConfiguration* l ) const |
| 812 | { |
| 813 | if( l ) |
| 814 | { |
| 815 | TreeItem* tparent = topItems.at( 0 ); |
| 816 | if( l->project() ) |
| 817 | { |
| 818 | for (TreeItem* t : topItems) { |
| 819 | auto* pi = dynamic_cast<ProjectItem*>( t ); |
| 820 | if( pi && pi->project == l->project() ) |
| 821 | { |
| 822 | tparent = t; |
| 823 | break; |
| 824 | } |
| 825 | } |
| 826 | } |
| 827 | |
| 828 | if( tparent ) |
| 829 | { |
| 830 | for (TreeItem* c : std::as_const(tparent->children)) { |
| 831 | auto* li = dynamic_cast<LaunchItem*>( c ); |
| 832 | if( li->launch && li->launch == l ) |
| 833 | { |
| 834 | return index( c->row, 0, index( tparent->row, 0, QModelIndex() ) ); |
| 835 | } |
| 836 | } |
| 837 | } |
| 838 | } |
| 839 | return QModelIndex(); |
| 840 | } |
| 841 | |
| 842 | |
| 843 | void LaunchConfigurationsModel::deleteConfiguration( const QModelIndex& index ) |
no test coverage detected