MCPcopy Create free account
hub / github.com/SpartanJ/eepp / openBuildTypeModel

Method openBuildTypeModel

src/tools/ecode/universallocator.cpp:824–847  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

822}
823
824std::shared_ptr<ItemListOwnerModel<std::string>>
825UniversalLocator::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
849std::shared_ptr<ItemListOwnerModel<std::string>>
850UniversalLocator::openRunTargetModel( const std::string& pattern ) {

Callers

nothing calls this directly

Calls 10

sortFunction · 0.85
getConfigMethod · 0.80
reserveMethod · 0.80
push_backMethod · 0.80
findMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected