summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorLeo Lam <leolino.lam@gmail.com>2017-08-20 23:27:14 +0200
committerGitHub <noreply@github.com>2017-08-20 23:27:14 +0200
commitcfee348736c06d349dd2eda9df01e95987b4531c (patch)
tree183e95fd6d8a47060deae7976194d2b1abfe1f45 /Source
parent8d7f28e79b12cde5c467d79c9e752d64da8992b7 (diff)
parent623026f42066be41790b2625b334f9a3b3912f04 (diff)
Merge pull request #5945 from ligfx/gamelistmodelcleanup
Add initial paths to GameTracker after construction
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/DolphinQt2/GameList/GameList.cpp2
-rw-r--r--Source/Core/DolphinQt2/GameList/GameListModel.cpp7
-rw-r--r--Source/Core/DolphinQt2/GameList/GameListModel.h4
-rw-r--r--Source/Core/DolphinQt2/GameList/GameTracker.cpp3
4 files changed, 5 insertions, 11 deletions
diff --git a/Source/Core/DolphinQt2/GameList/GameList.cpp b/Source/Core/DolphinQt2/GameList/GameList.cpp
index 3e71ac7aa8..c51708980e 100644
--- a/Source/Core/DolphinQt2/GameList/GameList.cpp
+++ b/Source/Core/DolphinQt2/GameList/GameList.cpp
@@ -49,8 +49,6 @@ GameList::GameList(QWidget* parent) : QStackedWidget(parent)
connect(m_list, &QTableView::doubleClicked, this, &GameList::GameSelected);
connect(m_grid, &QListView::doubleClicked, this, &GameList::GameSelected);
- connect(&Settings::Instance(), &Settings::PathAdded, m_model, &GameListModel::DirectoryAdded);
- connect(&Settings::Instance(), &Settings::PathRemoved, m_model, &GameListModel::DirectoryRemoved);
connect(m_model, &QAbstractItemModel::rowsInserted, this, &GameList::ConsiderViewChange);
connect(m_model, &QAbstractItemModel::rowsRemoved, this, &GameList::ConsiderViewChange);
diff --git a/Source/Core/DolphinQt2/GameList/GameListModel.cpp b/Source/Core/DolphinQt2/GameList/GameListModel.cpp
index 860fbbe9d0..0cf62c92e0 100644
--- a/Source/Core/DolphinQt2/GameList/GameListModel.cpp
+++ b/Source/Core/DolphinQt2/GameList/GameListModel.cpp
@@ -14,8 +14,11 @@ GameListModel::GameListModel(QObject* parent) : QAbstractTableModel(parent)
{
connect(&m_tracker, &GameTracker::GameLoaded, this, &GameListModel::UpdateGame);
connect(&m_tracker, &GameTracker::GameRemoved, this, &GameListModel::RemoveGame);
- connect(this, &GameListModel::DirectoryAdded, &m_tracker, &GameTracker::AddDirectory);
- connect(this, &GameListModel::DirectoryRemoved, &m_tracker, &GameTracker::RemoveDirectory);
+ connect(&Settings::Instance(), &Settings::PathAdded, &m_tracker, &GameTracker::AddDirectory);
+ connect(&Settings::Instance(), &Settings::PathRemoved, &m_tracker, &GameTracker::RemoveDirectory);
+
+ for (const QString& dir : Settings::Instance().GetPaths())
+ m_tracker.AddDirectory(dir);
connect(&Settings::Instance(), &Settings::ThemeChanged, [this] {
// Tell the view to repaint. The signal 'dataChanged' also seems like it would work here, but
diff --git a/Source/Core/DolphinQt2/GameList/GameListModel.h b/Source/Core/DolphinQt2/GameList/GameListModel.h
index 1230573d98..7e3d926f86 100644
--- a/Source/Core/DolphinQt2/GameList/GameListModel.h
+++ b/Source/Core/DolphinQt2/GameList/GameListModel.h
@@ -48,10 +48,6 @@ public:
void UpdateGame(QSharedPointer<GameFile> game);
void RemoveGame(const QString& path);
-signals:
- void DirectoryAdded(const QString& dir);
- void DirectoryRemoved(const QString& dir);
-
private:
// Index in m_games, or -1 if it isn't found
int FindGame(const QString& path) const;
diff --git a/Source/Core/DolphinQt2/GameList/GameTracker.cpp b/Source/Core/DolphinQt2/GameList/GameTracker.cpp
index fb832512b5..6050feaa8d 100644
--- a/Source/Core/DolphinQt2/GameList/GameTracker.cpp
+++ b/Source/Core/DolphinQt2/GameList/GameTracker.cpp
@@ -28,9 +28,6 @@ GameTracker::GameTracker(QObject* parent) : QFileSystemWatcher(parent)
connect(m_loader, &GameLoader::GameLoaded, this, &GameTracker::GameLoaded);
m_loader_thread.start();
-
- for (QString dir : Settings::Instance().GetPaths())
- AddDirectory(dir);
}
GameTracker::~GameTracker()