From: Soeren Apel Date: Wed, 17 Sep 2014 20:16:28 +0000 (+0200) Subject: Use QApplication metadata for persistent storage X-Git-Tag: pulseview-0.3.0~536 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=39eb0d45ab6c2910f08a1ad79ac60d188fa9f6ae;p=pulseview.git Use QApplication metadata for persistent storage Since the application metadata is set in application.c, we should use it instead of providing it manually every time we create a QSettings object. As I understand it, subclassing QApplication in application.c is only a workaround for bad Qt behavior. In the event that it is removed, the application metadata should be moved so that persistent storage still works. --- diff --git a/pv/application.cpp b/pv/application.cpp index 224cc600..66991dd9 100644 --- a/pv/application.cpp +++ b/pv/application.cpp @@ -28,6 +28,7 @@ Application::Application(int &argc, char* argv[]) : { setApplicationVersion(PV_VERSION_STRING); setApplicationName("PulseView"); + setOrganizationName("sigrok"); setOrganizationDomain("sigrok.org"); } diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index dae8f123..c3747e02 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -271,7 +271,7 @@ void MainWindow::setup_ui() void MainWindow::save_ui_settings() { - QSettings settings("sigrok", "PulseView"); + QSettings settings; settings.beginGroup("MainWindow"); settings.setValue("state", saveState()); @@ -281,7 +281,7 @@ void MainWindow::save_ui_settings() void MainWindow::restore_ui_settings() { - QSettings settings("sigrok", "PulseView"); + QSettings settings; settings.beginGroup("MainWindow");