MCPcopy Create free account
hub / github.com/Aloshi/EmulationStation / setSortIndex

Method setSortIndex

src/components/GuiGameList.cpp:229–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229void GuiGameList::setSortIndex(size_t index)
230{
231 //make the index valid
232 if (index >= sortStates.size()) {
233 index = 0;
234 }
235 if (index != sortStateIndex) {
236 //get sort state from vector and sort list
237 sortStateIndex = index;
238 sort(sortStates.at(sortStateIndex).comparisonFunction, sortStates.at(sortStateIndex).ascending);
239 }
240 //save new index to settings
241 Settings::getInstance()->setInt("GameListSortIndex", sortStateIndex);
242}
243
244void GuiGameList::setNextSortIndex()
245{

Callers

nothing calls this directly

Calls 2

sortFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected