From 3503810c0f74998d42e40a5658ce56e0755e0507 Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Sat, 3 Sep 2016 23:40:20 +0200 Subject: [PATCH] MainWindow: Don't save sessions that have no device --- pv/mainwindow.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 8787073..19c7da4 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -297,7 +297,7 @@ void MainWindow::save_ui_settings() settings.endGroup(); for (shared_ptr session : sessions_) { - // Ignore sessions using the demo device + // Ignore sessions using the demo device or no device at all if (session->device()) { shared_ptr device = dynamic_pointer_cast< devices::HardwareDevice > @@ -306,12 +306,12 @@ void MainWindow::save_ui_settings() if (device && device->hardware_device()->driver()->name() == "demo") continue; - } - settings.beginGroup("Session" + QString::number(id++)); - settings.remove(""); // Remove all keys in this group - session->save_settings(settings); - settings.endGroup(); + settings.beginGroup("Session" + QString::number(id++)); + settings.remove(""); // Remove all keys in this group + session->save_settings(settings); + settings.endGroup(); + } } settings.setValue("sessions", id); -- 2.30.2