Use QFileSystemWatcher to reload the game list when a change is detected. (#2555)

* Added a refresh game directory option to the file menu

* Make the game list watcher recursive and have it start watching from the initial load

* Rework game list watcher to be thread safe

* Fix code style issues
This commit is contained in:
James Rowe
2017-02-23 14:29:00 -07:00
committed by bunnei
parent 4dee08b343
commit 26823cd38b
2 changed files with 51 additions and 1 deletions

View File

@ -4,6 +4,7 @@
#pragma once
#include <QFileSystemWatcher>
#include <QModelIndex>
#include <QSettings>
#include <QStandardItem>
@ -46,8 +47,11 @@ private:
void DonePopulating();
void PopupContextMenu(const QPoint& menu_location);
void UpdateWatcherList(const std::string& path, unsigned int recursion);
void RefreshGameDirectory();
QTreeView* tree_view = nullptr;
QStandardItemModel* item_model = nullptr;
GameListWorker* current_worker = nullptr;
QFileSystemWatcher watcher;
};