diff --git a/Source/Core/DolphinQt/GameList/GameList.cpp b/Source/Core/DolphinQt/GameList/GameList.cpp index 038804d9a6..4167fb8c15 100644 --- a/Source/Core/DolphinQt/GameList/GameList.cpp +++ b/Source/Core/DolphinQt/GameList/GameList.cpp @@ -15,11 +15,14 @@ #include #include #include +#include +#include #include #include #include #include -#include +#include +#include #include #include "Common/FileUtil.h" @@ -34,6 +37,7 @@ #include "DiscIO/Enums.h" #include "DolphinQt/Config/PropertiesDialog.h" +#include "DolphinQt/GameList/GameListModel.h" #include "DolphinQt/GameList/GridProxyModel.h" #include "DolphinQt/GameList/ListProxyModel.h" #include "DolphinQt/QtUtils/DoubleClickEventFilter.h" @@ -41,6 +45,8 @@ #include "DolphinQt/Settings.h" #include "DolphinQt/WiiUpdate.h" +#include "UICommon/GameFile.h" + static bool CompressCB(const std::string&, float, void*); GameList::GameList(QWidget* parent) : QStackedWidget(parent) @@ -677,6 +683,11 @@ bool GameList::HasMultipleSelected() const m_grid->selectionModel()->selectedIndexes().size() > 1; } +void GameList::SetViewColumn(int col, bool view) +{ + m_list->setColumnHidden(col, !view); +} + void GameList::SetPreferredView(bool list) { m_prefer_list = list; diff --git a/Source/Core/DolphinQt/GameList/GameList.h b/Source/Core/DolphinQt/GameList/GameList.h index 5a51371beb..2e730c558d 100644 --- a/Source/Core/DolphinQt/GameList/GameList.h +++ b/Source/Core/DolphinQt/GameList/GameList.h @@ -6,15 +6,18 @@ #include -#include -#include -#include #include -#include -#include "DolphinQt/GameList/GameListModel.h" +class GameListModel; +class QLabel; +class QListView; +class QSortFilterProxyModel; +class QTableView; -#include "UICommon/GameFile.h" +namespace UICommon +{ +class GameFile; +} class GameList final : public QStackedWidget { @@ -30,7 +33,7 @@ public: void SetListView() { SetPreferredView(true); } void SetGridView() { SetPreferredView(false); } - void SetViewColumn(int col, bool view) { m_list->setColumnHidden(col, !view); } + void SetViewColumn(int col, bool view); void SetSearchTerm(const QString& term); void OnColumnVisibilityToggled(const QString& row, bool visible); diff --git a/Source/Core/DolphinQt/GameList/GameListModel.cpp b/Source/Core/DolphinQt/GameList/GameListModel.cpp index afd8c786b8..c2367bb985 100644 --- a/Source/Core/DolphinQt/GameList/GameListModel.cpp +++ b/Source/Core/DolphinQt/GameList/GameListModel.cpp @@ -14,6 +14,7 @@ #include "DolphinQt/Resources.h" #include "DolphinQt/Settings.h" +#include "UICommon/GameFile.h" #include "UICommon/UICommon.h" const QSize GAMECUBE_BANNER_SIZE(96, 32); @@ -226,6 +227,16 @@ std::shared_ptr GameListModel::GetGameFile(int index) return m_games[index]; } +QString GameListModel::GetPath(int index) const +{ + return QString::fromStdString(m_games[index]->GetFilePath()); +} + +QString GameListModel::GetUniqueIdentifier(int index) const +{ + return QString::fromStdString(m_games[index]->GetUniqueIdentifier()); +} + void GameListModel::AddGame(const std::shared_ptr& game) { beginInsertRows(QModelIndex(), m_games.size(), m_games.size()); diff --git a/Source/Core/DolphinQt/GameList/GameListModel.h b/Source/Core/DolphinQt/GameList/GameListModel.h index 997fa0eb34..62116dd314 100644 --- a/Source/Core/DolphinQt/GameList/GameListModel.h +++ b/Source/Core/DolphinQt/GameList/GameListModel.h @@ -14,7 +14,10 @@ #include "DolphinQt/GameList/GameTracker.h" -#include "UICommon/GameFile.h" +namespace UICommon +{ +class GameFile; +} class GameListModel final : public QAbstractTableModel { @@ -32,12 +35,9 @@ public: std::shared_ptr GetGameFile(int index) const; // Path of the game at the specified index. - QString GetPath(int index) const { return QString::fromStdString(m_games[index]->GetFilePath()); } + QString GetPath(int index) const; // Unique identifier of the game at the specified index. - QString GetUniqueIdentifier(int index) const - { - return QString::fromStdString(m_games[index]->GetUniqueIdentifier()); - } + QString GetUniqueIdentifier(int index) const; bool ShouldDisplayGameListItem(int index) const; void SetSearchTerm(const QString& term); diff --git a/Source/Core/DolphinQt/GameList/GameTracker.cpp b/Source/Core/DolphinQt/GameList/GameTracker.cpp index 86fd54e0ac..7d87ae7469 100644 --- a/Source/Core/DolphinQt/GameList/GameTracker.cpp +++ b/Source/Core/DolphinQt/GameList/GameTracker.cpp @@ -17,6 +17,8 @@ #include "DolphinQt/Settings.h" +#include "UICommon/GameFile.h" + // NOTE: Qt likes to be case-sensitive here even though it shouldn't be thus this ugly regex hack static const QStringList game_filters{ QStringLiteral("*.[gG][cC][mM]"), QStringLiteral("*.[iI][sS][oO]"), diff --git a/Source/Core/DolphinQt/GameList/GameTracker.h b/Source/Core/DolphinQt/GameList/GameTracker.h index 51fdacf4c5..db41cf3ef4 100644 --- a/Source/Core/DolphinQt/GameList/GameTracker.h +++ b/Source/Core/DolphinQt/GameList/GameTracker.h @@ -15,9 +15,13 @@ #include "Common/Event.h" #include "Common/WorkQueueThread.h" -#include "UICommon/GameFile.h" #include "UICommon/GameFileCache.h" +namespace UICommon +{ +class GameFile; +} + // Watches directories and loads GameFiles in a separate thread. // To use this, just add directories using AddDirectory, and listen for the // GameLoaded and GameRemoved signals. diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index 2be44afaf1..ab773e9b2d 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -86,6 +86,7 @@ #include "InputCommon/ControllerInterface/ControllerInterface.h" #include "UICommon/DiscordPresence.h" +#include "UICommon/GameFile.h" #include "UICommon/UICommon.h" #include "VideoCommon/VideoConfig.h" diff --git a/Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp b/Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp index 02ea319242..61bade1b0f 100644 --- a/Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp +++ b/Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp @@ -36,7 +36,7 @@ #include "Core/Core.h" #include "Core/NetPlayServer.h" -#include "DolphinQt/GameList/GameList.h" +#include "DolphinQt/GameList/GameListModel.h" #include "DolphinQt/NetPlay/GameListDialog.h" #include "DolphinQt/NetPlay/MD5Dialog.h" #include "DolphinQt/NetPlay/PadMappingDialog.h"