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

Method indexForConfig

kdevplatform/shell/launchconfigurationdialog.cpp:811–840  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

809}
810
811QModelIndex 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
843void LaunchConfigurationsModel::deleteConfiguration( const QModelIndex& index )

Callers 2

selectionChangedMethod · 0.80

Calls 4

indexFunction · 0.70
QModelIndexClass · 0.70
atMethod · 0.45
projectMethod · 0.45

Tested by

no test coverage detected