diff --git a/Source/Core/DolphinQt2/GameList/GameList.cpp b/Source/Core/DolphinQt2/GameList/GameList.cpp index 00e8632f12..8d09f63091 100644 --- a/Source/Core/DolphinQt2/GameList/GameList.cpp +++ b/Source/Core/DolphinQt2/GameList/GameList.cpp @@ -416,16 +416,7 @@ QString GameList::GetSelectedGame() const return QStringLiteral(""); } -<<<<<<< HEAD -GameListModel* GameList::GetModel() const -{ - return m_model; -} - -void GameList::SetPreferredView(bool table) -======= void GameList::SetPreferredView(bool list) ->>>>>>> af63a1c36d... tmp. { m_prefer_list = list; Settings::Instance().SetPreferredView(list); diff --git a/Source/Core/DolphinQt2/GameList/GameList.h b/Source/Core/DolphinQt2/GameList/GameList.h index dbe4a9a568..44af5b58d4 100644 --- a/Source/Core/DolphinQt2/GameList/GameList.h +++ b/Source/Core/DolphinQt2/GameList/GameList.h @@ -20,7 +20,6 @@ class GameList final : public QStackedWidget public: explicit GameList(QWidget* parent = nullptr); QString GetSelectedGame() const; - GameListModel* GetModel() const; void SetListView() { SetPreferredView(true); } void SetGridView() { SetPreferredView(false); } diff --git a/Source/Core/DolphinQt2/Settings.cpp b/Source/Core/DolphinQt2/Settings.cpp index 99632fa78b..505614eae3 100644 --- a/Source/Core/DolphinQt2/Settings.cpp +++ b/Source/Core/DolphinQt2/Settings.cpp @@ -11,6 +11,7 @@ #include "Common/FileUtil.h" #include "Common/StringUtil.h" #include "Core/ConfigManager.h" +#include "DolphinQt2/GameList/GameListModel.h" #include "DolphinQt2/Settings.h" #include "InputCommon/InputConfig.h" @@ -171,3 +172,29 @@ void Settings::SetLogConfigVisible(bool visible) emit LogConfigVisibilityChanged(visible); } } + +GameListModel* Settings::GetGameListModel() const +{ + static GameListModel* model = new GameListModel; + return model; +} + +NetPlayClient* Settings::GetNetPlayClient() +{ + return m_client.get(); +} + +void Settings::ResetNetPlayClient(NetPlayClient* client) +{ + m_client.reset(client); +} + +NetPlayServer* Settings::GetNetPlayServer() +{ + return m_server.get(); +} + +void Settings::ResetNetPlayServer(NetPlayServer* server) +{ + m_server.reset(server); +} diff --git a/Source/Core/DolphinQt2/Settings.h b/Source/Core/DolphinQt2/Settings.h index be9e32dec4..d3d800668b 100644 --- a/Source/Core/DolphinQt2/Settings.h +++ b/Source/Core/DolphinQt2/Settings.h @@ -4,16 +4,22 @@ #pragma once +#include + #include #include #include "Common/NonCopyable.h" +#include "Core/NetPlayClient.h" +#include "Core/NetPlayServer.h" + namespace DiscIO { enum class Language; } +class GameListModel; class InputConfig; // UI settings to be stored in the config directory. @@ -57,6 +63,15 @@ public: void IncreaseVolume(int volume); void DecreaseVolume(int volume); + // NetPlay + NetPlayClient* GetNetPlayClient(); + void ResetNetPlayClient(NetPlayClient* client = nullptr); + NetPlayServer* GetNetPlayServer(); + void ResetNetPlayServer(NetPlayServer* server = nullptr); + + // Other + GameListModel* GetGameListModel() const; + signals: void ThemeChanged(); void PathAdded(const QString&); @@ -68,5 +83,7 @@ signals: void LogConfigVisibilityChanged(bool visible); private: + std::unique_ptr m_client; + std::unique_ptr m_server; Settings(); };