| 822 | } |
| 823 | |
| 824 | std::shared_ptr<ItemListOwnerModel<std::string>> |
| 825 | UniversalLocator::openBuildTypeModel( const std::string& pattern ) { |
| 826 | if ( nullptr == mApp->getProjectBuildManager() ) |
| 827 | return ItemListOwnerModel<std::string>::create( {} ); |
| 828 | const auto& builds = mApp->getProjectBuildManager()->getBuilds(); |
| 829 | const auto& cfg = mApp->getProjectBuildManager()->getConfig(); |
| 830 | |
| 831 | auto buildIt = builds.find( cfg.buildName ); |
| 832 | if ( buildIt == builds.end() ) |
| 833 | return ItemListOwnerModel<std::string>::create( {} ); |
| 834 | const auto& build = buildIt->second; |
| 835 | const auto& buildTypes = build.buildTypes(); |
| 836 | if ( buildTypes.empty() ) |
| 837 | return ItemListOwnerModel<std::string>::create( {} ); |
| 838 | |
| 839 | std::vector<std::string> buildTypeNames; |
| 840 | buildTypeNames.reserve( buildTypes.size() ); |
| 841 | for ( const auto& build : buildTypes ) { |
| 842 | if ( pattern.empty() || String::icontains( build, pattern ) ) |
| 843 | buildTypeNames.push_back( build ); |
| 844 | } |
| 845 | std::sort( buildTypeNames.begin(), buildTypeNames.end() ); |
| 846 | return ItemListOwnerModel<std::string>::create( buildTypeNames ); |
| 847 | } |
| 848 | |
| 849 | std::shared_ptr<ItemListOwnerModel<std::string>> |
| 850 | UniversalLocator::openRunTargetModel( const std::string& pattern ) { |