Fix game title sorting (#2286)

* Fix game title sorting

* fix

* fix

* fix
This commit is contained in:
DanielSvoboda authored and GitHub committed 2025-01-30 10:34:42 -08:00
1 parent e805b97520
commit ad5bd91a13
2 files changed
+8 -3

No files matched your search

+7 -2
View File
@@ -69,7 +69,7 @@ GameListFrame::GameListFrame(std::shared_ptr<GameInfoClass> game_info_get,
ListSortedAsc = true;
}
this->clearContents();
PopulateGameList();
PopulateGameList(false);
});
connect(this, &QTableWidget::customContextMenuRequested, this, [=, this](const QPoint& pos) {
@@ -103,7 +103,7 @@ void GameListFrame::PlayBackgroundMusic(QTableWidgetItem* item) {
BackgroundMusicPlayer::getInstance().playMusic(snd0path);
}
void GameListFrame::PopulateGameList() {
void GameListFrame::PopulateGameList(bool isInitialPopulation) {
// Do not show status column if it is not enabled
this->setColumnHidden(2, !Config::getCompatibilityEnabled());
this->setColumnHidden(6, !Config::GetLoadGameSizeEnabled());
@@ -111,6 +111,11 @@ void GameListFrame::PopulateGameList() {
this->setRowCount(m_game_info->m_games.size());
ResizeIcons(icon_size);
if (isInitialPopulation) {
SortNameAscending(1); // Column 1 = Name
ResizeIcons(icon_size);
}
for (int i = 0; i < m_game_info->m_games.size(); i++) {
SetTableItem(i, 1, QString::fromStdString(m_game_info->m_games[i].name));
SetTableItem(i, 3, QString::fromStdString(m_game_info->m_games[i].serial));
+1 -1
View File
@@ -46,7 +46,7 @@ private:
bool ListSortedAsc = true;
public:
void PopulateGameList();
void PopulateGameList(bool isInitialPopulation = true);
void ResizeIcons(int iconSize);
QImage backgroundImage;