citra-qt: disable directory watcher during CIA installation (#4284)
* disable directory watcher during CIA installation fixes several errors while installing multiple CIAs * use braces in if statement
This commit is contained in:
committed by
Sebastian Valle
parent
756a3d404a
commit
ce823759cc
@@ -267,7 +267,8 @@ void GameList::onFilterCloseClicked() {
|
||||
|
||||
GameList::GameList(GMainWindow* parent) : QWidget{parent} {
|
||||
watcher = new QFileSystemWatcher(this);
|
||||
connect(watcher, &QFileSystemWatcher::directoryChanged, this, &GameList::RefreshGameDirectory);
|
||||
connect(watcher, &QFileSystemWatcher::directoryChanged, this, &GameList::RefreshGameDirectory,
|
||||
Qt::UniqueConnection);
|
||||
|
||||
this->main_window = parent;
|
||||
layout = new QVBoxLayout;
|
||||
@@ -325,6 +326,16 @@ void GameList::setFilterVisible(bool visibility) {
|
||||
search_field->setVisible(visibility);
|
||||
}
|
||||
|
||||
void GameList::setDirectoryWatcherEnabled(bool enabled) {
|
||||
if (enabled) {
|
||||
connect(watcher, &QFileSystemWatcher::directoryChanged, this,
|
||||
&GameList::RefreshGameDirectory, Qt::UniqueConnection);
|
||||
} else {
|
||||
disconnect(watcher, &QFileSystemWatcher::directoryChanged, this,
|
||||
&GameList::RefreshGameDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
void GameList::clearFilter() {
|
||||
search_field->clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user