summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorAnthony <Helios747@users.noreply.github.com>2017-05-10 11:30:52 -0700
committerGitHub <noreply@github.com>2017-05-10 11:30:52 -0700
commiteab243d6ee651efc508fc0470bf4598d529de9b6 (patch)
tree1f3decaf353d392ce448782b4fb0e163c0bf2a6e /Source/Core
parentf1f8beef258093edfabe2933a36adff7e9ee86c4 (diff)
parent4d4dc038012a6bfd3b63ef80201eaa2454baa4b7 (diff)
Merge pull request #5402 from spycrab/qt_gamelist_cfix
Qt: Fix that some columns are not hidden properly
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinQt2/GameList/GameList.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/Source/Core/DolphinQt2/GameList/GameList.cpp b/Source/Core/DolphinQt2/GameList/GameList.cpp
index 1f83646c7b..19bde59059 100644
--- a/Source/Core/DolphinQt2/GameList/GameList.cpp
+++ b/Source/Core/DolphinQt2/GameList/GameList.cpp
@@ -9,6 +9,7 @@
#include <QFileInfo>
#include <QHeaderView>
#include <QKeyEvent>
+#include <QMap>
#include <QMenu>
#include <QMessageBox>
#include <QProgressDialog>
@@ -392,14 +393,18 @@ void GameList::keyReleaseEvent(QKeyEvent* event)
void GameList::OnColumnVisibilityToggled(const QString& row, bool visible)
{
- for (int i = 0; i < m_table->model()->columnCount(); i++)
- {
- if (m_table->model()->headerData(i, Qt::Horizontal).toString() == row)
- {
- m_table->setColumnHidden(i, !visible);
- return;
- }
- }
+ static const QMap<QString, int> rowname_to_col_index = {
+ {tr("Banner"), GameListModel::COL_BANNER},
+ {tr("Country"), GameListModel::COL_COUNTRY},
+ {tr("Description"), GameListModel::COL_DESCRIPTION},
+ {tr("ID"), GameListModel::COL_ID},
+ {tr("Maker"), GameListModel::COL_MAKER},
+ {tr("Platform"), GameListModel::COL_PLATFORM},
+ {tr("Size"), GameListModel::COL_SIZE},
+ {tr("Title"), GameListModel::COL_TITLE},
+ {tr("Quality"), GameListModel::COL_RATING}};
+
+ m_table->setColumnHidden(rowname_to_col_index[row], !visible);
}
static bool CompressCB(const std::string& text, float percent, void* ptr)