summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir
diff options
context:
space:
mode:
Diffstat (limited to 'facetracknoir')
-rw-r--r--facetracknoir/ui.cpp13
-rw-r--r--facetracknoir/ui.h1
2 files changed, 13 insertions, 1 deletions
diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp
index 6437b9d1..4d93f3b2 100644
--- a/facetracknoir/ui.cpp
+++ b/facetracknoir/ui.cpp
@@ -124,7 +124,7 @@ MainWindow::~MainWindow()
if (tray)
tray->hide();
stopTracker();
- _save();
+ maybe_save();
}
void MainWindow::set_working_directory()
@@ -142,6 +142,15 @@ void MainWindow::save()
save_timer.start(5000);
}
+void MainWindow::maybe_save()
+{
+ if (save_timer.isActive())
+ {
+ save_timer.stop();
+ _save();
+ }
+}
+
void MainWindow::_save() {
s.b->save();
save_mappings();
@@ -307,6 +316,8 @@ void MainWindow::stopTracker( ) {
if (pFilterDialog)
pFilterDialog->unregister_filter();
+ maybe_save();
+
work = nullptr;
libs = SelectedLibraries();
diff --git a/facetracknoir/ui.h b/facetracknoir/ui.h
index cfaf47cb..91e4ebbf 100644
--- a/facetracknoir/ui.h
+++ b/facetracknoir/ui.h
@@ -75,6 +75,7 @@ class MainWindow : public QMainWindow, private State
void set_title(const QString& game_title = QStringLiteral(""));
static bool get_new_config_name_from_dialog(QString &ret);
void set_profile(const QString& profile);
+ void maybe_save();
private slots:
void _save();
void save();