| 227 | } |
| 228 | |
| 229 | void 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 | |
| 244 | void GuiGameList::setNextSortIndex() |
| 245 | { |