From e29e8eec2febc58e36add101d63e197f3ddea0bc Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Mon, 13 Jun 2022 16:52:19 -0400 Subject: [PATCH] game_list: Eliminate variable shadowing --- src/yuzu/game_list.cpp | 8 ++++---- src/yuzu/game_list.h | 4 ++-- src/yuzu/game_list_p.h | 6 +++--- src/yuzu/game_list_worker.cpp | 12 ++++++------ src/yuzu/game_list_worker.h | 8 ++++---- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index 64a866f34..05d309827 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp @@ -28,8 +28,8 @@ #include "yuzu/uisettings.h" #include "yuzu/util/controller_navigation.h" -GameListSearchField::KeyReleaseEater::KeyReleaseEater(GameList* gamelist, QObject* parent) - : QObject(parent), gamelist{gamelist} {} +GameListSearchField::KeyReleaseEater::KeyReleaseEater(GameList* gamelist_, QObject* parent) + : QObject(parent), gamelist{gamelist_} {} // EventFilter in order to process systemkeys while editing the searchfield bool GameListSearchField::KeyReleaseEater::eventFilter(QObject* obj, QEvent* event) { @@ -309,9 +309,9 @@ void GameList::OnFilterCloseClicked() { main_window->filterBarSetChecked(false); } -GameList::GameList(FileSys::VirtualFilesystem vfs, FileSys::ManualContentProvider* provider, +GameList::GameList(FileSys::VirtualFilesystem vfs_, FileSys::ManualContentProvider* provider_, Core::System& system_, GMainWindow* parent) - : QWidget{parent}, vfs(std::move(vfs)), provider(provider), system{system_} { + : QWidget{parent}, vfs{std::move(vfs_)}, provider{provider_}, system{system_} { watcher = new QFileSystemWatcher(this); connect(watcher, &QFileSystemWatcher::directoryChanged, this, &GameList::RefreshGameDirectory); diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h index 464da98ad..bc36d015a 100644 --- a/src/yuzu/game_list.h +++ b/src/yuzu/game_list.h @@ -67,8 +67,8 @@ public: COLUMN_COUNT, // Number of columns }; - explicit GameList(std::shared_ptr vfs, - FileSys::ManualContentProvider* provider, Core::System& system_, + explicit GameList(std::shared_ptr vfs_, + FileSys::ManualContentProvider* provider_, Core::System& system_, GMainWindow* parent = nullptr); ~GameList() override; diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h index 582f6db5e..cd7d63536 100644 --- a/src/yuzu/game_list_p.h +++ b/src/yuzu/game_list_p.h @@ -225,8 +225,8 @@ public: static constexpr int GameDirRole = Qt::UserRole + 2; explicit GameListDir(UISettings::GameDir& directory, - GameListItemType dir_type = GameListItemType::CustomDir) - : dir_type{dir_type} { + GameListItemType dir_type_ = GameListItemType::CustomDir) + : dir_type{dir_type_} { setData(type(), TypeRole); UISettings::GameDir* game_dir = &directory; @@ -356,7 +356,7 @@ public: private: class KeyReleaseEater : public QObject { public: - explicit KeyReleaseEater(GameList* gamelist, QObject* parent = nullptr); + explicit KeyReleaseEater(GameList* gamelist_, QObject* parent = nullptr); private: GameList* gamelist = nullptr; diff --git a/src/yuzu/game_list_worker.cpp b/src/yuzu/game_list_worker.cpp index ca1899b5c..63326968b 100644 --- a/src/yuzu/game_list_worker.cpp +++ b/src/yuzu/game_list_worker.cpp @@ -223,12 +223,12 @@ QList MakeGameListEntry(const std::string& path, const std::stri } } // Anonymous namespace -GameListWorker::GameListWorker(FileSys::VirtualFilesystem vfs, - FileSys::ManualContentProvider* provider, - QVector& game_dirs, - const CompatibilityList& compatibility_list, Core::System& system_) - : vfs(std::move(vfs)), provider(provider), game_dirs(game_dirs), - compatibility_list(compatibility_list), system{system_} {} +GameListWorker::GameListWorker(FileSys::VirtualFilesystem vfs_, + FileSys::ManualContentProvider* provider_, + QVector& game_dirs_, + const CompatibilityList& compatibility_list_, Core::System& system_) + : vfs{std::move(vfs_)}, provider{provider_}, game_dirs{game_dirs_}, + compatibility_list{compatibility_list_}, system{system_} {} GameListWorker::~GameListWorker() = default; diff --git a/src/yuzu/game_list_worker.h b/src/yuzu/game_list_worker.h index 622d241fb..24a4e92c3 100644 --- a/src/yuzu/game_list_worker.h +++ b/src/yuzu/game_list_worker.h @@ -33,10 +33,10 @@ class GameListWorker : public QObject, public QRunnable { Q_OBJECT public: - explicit GameListWorker(std::shared_ptr vfs, - FileSys::ManualContentProvider* provider, - QVector& game_dirs, - const CompatibilityList& compatibility_list, Core::System& system_); + explicit GameListWorker(std::shared_ptr vfs_, + FileSys::ManualContentProvider* provider_, + QVector& game_dirs_, + const CompatibilityList& compatibility_list_, Core::System& system_); ~GameListWorker() override; /// Starts the processing of directory tree information.