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

Method openBuildModel

src/tools/ecode/universallocator.cpp:772–787  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

770}
771
772std::shared_ptr<ItemListOwnerModel<std::string>>
773UniversalLocator::openBuildModel( const std::string& pattern ) {
774 if ( nullptr == mApp->getProjectBuildManager() )
775 return ItemListOwnerModel<std::string>::create( {} );
776 const auto& builds = mApp->getProjectBuildManager()->getBuilds();
777 std::vector<std::string> buildNames;
778 if ( builds.empty() )
779 return ItemListOwnerModel<std::string>::create( {} );
780 buildNames.reserve( builds.size() );
781 for ( const auto& build : builds ) {
782 if ( pattern.empty() || String::icontains( build.first, pattern ) )
783 buildNames.push_back( build.first );
784 }
785 std::sort( buildNames.begin(), buildNames.end() );
786 return ItemListOwnerModel<std::string>::create( buildNames );
787}
788
789void UniversalLocator::updateSwitchBuildTable() {
790 mLocateTable->setModel( openBuildModel( mLocateInput->getText().substr( 3 ).trim().toUtf8() ) );

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected