mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-11-14 05:55:13 +01:00
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:
parent
756a3d404a
commit
ce823759cc
@ -267,7 +267,8 @@ void GameList::onFilterCloseClicked() {
|
|||||||
|
|
||||||
GameList::GameList(GMainWindow* parent) : QWidget{parent} {
|
GameList::GameList(GMainWindow* parent) : QWidget{parent} {
|
||||||
watcher = new QFileSystemWatcher(this);
|
watcher = new QFileSystemWatcher(this);
|
||||||
connect(watcher, &QFileSystemWatcher::directoryChanged, this, &GameList::RefreshGameDirectory);
|
connect(watcher, &QFileSystemWatcher::directoryChanged, this, &GameList::RefreshGameDirectory,
|
||||||
|
Qt::UniqueConnection);
|
||||||
|
|
||||||
this->main_window = parent;
|
this->main_window = parent;
|
||||||
layout = new QVBoxLayout;
|
layout = new QVBoxLayout;
|
||||||
@ -325,6 +326,16 @@ void GameList::setFilterVisible(bool visibility) {
|
|||||||
search_field->setVisible(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() {
|
void GameList::clearFilter() {
|
||||||
search_field->clear();
|
search_field->clear();
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,7 @@ public:
|
|||||||
void clearFilter();
|
void clearFilter();
|
||||||
void setFilterFocus();
|
void setFilterFocus();
|
||||||
void setFilterVisible(bool visibility);
|
void setFilterVisible(bool visibility);
|
||||||
|
void setDirectoryWatcherEnabled(bool enabled);
|
||||||
bool isEmpty();
|
bool isEmpty();
|
||||||
|
|
||||||
void LoadCompatibilityList();
|
void LoadCompatibilityList();
|
||||||
|
@ -1013,6 +1013,7 @@ void GMainWindow::OnMenuInstallCIA() {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
ui.action_Install_CIA->setEnabled(false);
|
ui.action_Install_CIA->setEnabled(false);
|
||||||
|
game_list->setDirectoryWatcherEnabled(false);
|
||||||
progress_bar->show();
|
progress_bar->show();
|
||||||
progress_bar->setMaximum(INT_MAX);
|
progress_bar->setMaximum(INT_MAX);
|
||||||
|
|
||||||
@ -1066,7 +1067,9 @@ void GMainWindow::OnCIAInstallReport(Service::AM::InstallStatus status, QString
|
|||||||
void GMainWindow::OnCIAInstallFinished() {
|
void GMainWindow::OnCIAInstallFinished() {
|
||||||
progress_bar->hide();
|
progress_bar->hide();
|
||||||
progress_bar->setValue(0);
|
progress_bar->setValue(0);
|
||||||
|
game_list->setDirectoryWatcherEnabled(true);
|
||||||
ui.action_Install_CIA->setEnabled(true);
|
ui.action_Install_CIA->setEnabled(true);
|
||||||
|
game_list->PopulateAsync(UISettings::values.game_dirs);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GMainWindow::OnMenuRecentFile() {
|
void GMainWindow::OnMenuRecentFile() {
|
||||||
|
Loading…
Reference in New Issue
Block a user