mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 07:21:14 +01:00
Qt: Refresh Gamelist more thoroughly
This commit is contained in:
parent
64c3d01551
commit
bb8b872863
@ -25,8 +25,8 @@ GameListModel::GameListModel(QObject* parent) : QAbstractTableModel(parent)
|
|||||||
connect(&m_tracker, &GameTracker::GameRemoved, this, &GameListModel::RemoveGame);
|
connect(&m_tracker, &GameTracker::GameRemoved, this, &GameListModel::RemoveGame);
|
||||||
connect(&Settings::Instance(), &Settings::PathAdded, &m_tracker, &GameTracker::AddDirectory);
|
connect(&Settings::Instance(), &Settings::PathAdded, &m_tracker, &GameTracker::AddDirectory);
|
||||||
connect(&Settings::Instance(), &Settings::PathRemoved, &m_tracker, &GameTracker::RemoveDirectory);
|
connect(&Settings::Instance(), &Settings::PathRemoved, &m_tracker, &GameTracker::RemoveDirectory);
|
||||||
connect(&Settings::Instance(), &Settings::PathReloadRequested, &m_tracker,
|
connect(&Settings::Instance(), &Settings::GameListRefreshRequested, &m_tracker,
|
||||||
&GameTracker::ReloadDirectory);
|
&GameTracker::RefreshAll);
|
||||||
connect(&Settings::Instance(), &Settings::TitleDBReloadRequested, this,
|
connect(&Settings::Instance(), &Settings::TitleDBReloadRequested, this,
|
||||||
[this] { m_title_database = Core::TitleDatabase(); });
|
[this] { m_title_database = Core::TitleDatabase(); });
|
||||||
|
|
||||||
|
@ -156,10 +156,18 @@ void GameTracker::RemoveDirectory(const QString& dir)
|
|||||||
m_load_thread.EmplaceItem(Command{CommandType::RemoveDirectory, dir});
|
m_load_thread.EmplaceItem(Command{CommandType::RemoveDirectory, dir});
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameTracker::ReloadDirectory(const QString& dir)
|
void GameTracker::RefreshAll()
|
||||||
{
|
{
|
||||||
m_load_thread.EmplaceItem(Command{CommandType::RemoveDirectory, dir});
|
for (auto& file : m_tracked_files.keys())
|
||||||
m_load_thread.EmplaceItem(Command{CommandType::AddDirectory, dir});
|
emit GameRemoved(file.toStdString());
|
||||||
|
|
||||||
|
m_tracked_files.clear();
|
||||||
|
|
||||||
|
for (const QString& dir : Settings::Instance().GetPaths())
|
||||||
|
{
|
||||||
|
m_load_thread.EmplaceItem(Command{CommandType::RemoveDirectory, dir});
|
||||||
|
m_load_thread.EmplaceItem(Command{CommandType::AddDirectory, dir});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameTracker::UpdateDirectory(const QString& dir)
|
void GameTracker::UpdateDirectory(const QString& dir)
|
||||||
|
@ -36,7 +36,7 @@ public:
|
|||||||
|
|
||||||
void AddDirectory(const QString& dir);
|
void AddDirectory(const QString& dir);
|
||||||
void RemoveDirectory(const QString& dir);
|
void RemoveDirectory(const QString& dir);
|
||||||
void ReloadDirectory(const QString& dir);
|
void RefreshAll();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void GameLoaded(const std::shared_ptr<const UICommon::GameFile>& game);
|
void GameLoaded(const std::shared_ptr<const UICommon::GameFile>& game);
|
||||||
|
@ -533,9 +533,7 @@ void MainWindow::ConnectStack()
|
|||||||
void MainWindow::RefreshGameList()
|
void MainWindow::RefreshGameList()
|
||||||
{
|
{
|
||||||
Settings::Instance().ReloadTitleDB();
|
Settings::Instance().ReloadTitleDB();
|
||||||
|
Settings::Instance().RefreshGameList();
|
||||||
for (const auto& path : Settings::Instance().GetPaths())
|
|
||||||
Settings::Instance().ReloadPath(path);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MainWindow::PromptFileName()
|
QString MainWindow::PromptFileName()
|
||||||
|
@ -123,9 +123,9 @@ void Settings::RemovePath(const QString& qpath)
|
|||||||
emit PathRemoved(qpath);
|
emit PathRemoved(qpath);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::ReloadPath(const QString& qpath)
|
void Settings::RefreshGameList()
|
||||||
{
|
{
|
||||||
emit PathReloadRequested(qpath);
|
emit GameListRefreshRequested();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::ReloadTitleDB()
|
void Settings::ReloadTitleDB()
|
||||||
|
@ -69,7 +69,7 @@ public:
|
|||||||
void SetPreferredView(bool list);
|
void SetPreferredView(bool list);
|
||||||
QString GetDefaultGame() const;
|
QString GetDefaultGame() const;
|
||||||
void SetDefaultGame(QString path);
|
void SetDefaultGame(QString path);
|
||||||
void ReloadPath(const QString& qpath);
|
void RefreshGameList();
|
||||||
void ReloadTitleDB();
|
void ReloadTitleDB();
|
||||||
bool IsAutoRefreshEnabled() const;
|
bool IsAutoRefreshEnabled() const;
|
||||||
void SetAutoRefreshEnabled(bool enabled);
|
void SetAutoRefreshEnabled(bool enabled);
|
||||||
@ -137,7 +137,7 @@ signals:
|
|||||||
void PathAdded(const QString&);
|
void PathAdded(const QString&);
|
||||||
void PathRemoved(const QString&);
|
void PathRemoved(const QString&);
|
||||||
void DefaultGameChanged(const QString&);
|
void DefaultGameChanged(const QString&);
|
||||||
void PathReloadRequested(const QString&);
|
void GameListRefreshRequested();
|
||||||
void TitleDBReloadRequested();
|
void TitleDBReloadRequested();
|
||||||
void AutoRefreshToggled(bool enabled);
|
void AutoRefreshToggled(bool enabled);
|
||||||
void HideCursorChanged();
|
void HideCursorChanged();
|
||||||
|
@ -137,8 +137,7 @@ QGroupBox* PathPane::MakeGameFolderBox()
|
|||||||
|
|
||||||
connect(recursive_checkbox, &QCheckBox::toggled, this, [](bool checked) {
|
connect(recursive_checkbox, &QCheckBox::toggled, this, [](bool checked) {
|
||||||
SConfig::GetInstance().m_RecursiveISOFolder = checked;
|
SConfig::GetInstance().m_RecursiveISOFolder = checked;
|
||||||
for (const auto& path : Settings::Instance().GetPaths())
|
Settings::Instance().RefreshGameList();
|
||||||
Settings::Instance().ReloadPath(path);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(auto_checkbox, &QCheckBox::toggled, &Settings::Instance(),
|
connect(auto_checkbox, &QCheckBox::toggled, &Settings::Instance(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user