| 847 | } |
| 848 | |
| 849 | std::shared_ptr<ItemListOwnerModel<std::string>> |
| 850 | UniversalLocator::openRunTargetModel( const std::string& pattern ) { |
| 851 | if ( nullptr == mApp->getProjectBuildManager() ) |
| 852 | return ItemListOwnerModel<std::string>::create( {} ); |
| 853 | const auto& builds = mApp->getProjectBuildManager()->getBuilds(); |
| 854 | const auto& cfg = mApp->getProjectBuildManager()->getConfig(); |
| 855 | auto buildIt = builds.find( cfg.buildName ); |
| 856 | if ( buildIt == builds.end() ) |
| 857 | return ItemListOwnerModel<std::string>::create( {} ); |
| 858 | const auto& build = buildIt->second; |
| 859 | const auto& runs = build.runConfigs(); |
| 860 | if ( runs.empty() ) |
| 861 | return ItemListOwnerModel<std::string>::create( {} ); |
| 862 | |
| 863 | std::vector<std::string> runTargetNames; |
| 864 | runTargetNames.reserve( runs.size() ); |
| 865 | for ( const auto& run : runs ) { |
| 866 | if ( pattern.empty() || String::icontains( run->name, pattern ) ) |
| 867 | runTargetNames.push_back( run->name ); |
| 868 | } |
| 869 | std::sort( runTargetNames.begin(), runTargetNames.end() ); |
| 870 | return ItemListOwnerModel<std::string>::create( runTargetNames ); |
| 871 | } |
| 872 | |
| 873 | void UniversalLocator::updateSwitchBuildTypeTable() { |
| 874 | mLocateTable->setModel( |