]> sigrok.org Git - pulseview.git/commitdiff
MainWindow: Tidied restore_ui_settings
authorJoel Holdsworth <redacted>
Sun, 12 Apr 2015 15:24:06 +0000 (16:24 +0100)
committerUwe Hermann <redacted>
Thu, 11 Jun 2015 18:38:48 +0000 (20:38 +0200)
pv/mainwindow.cpp

index 3480d8cc2fcaaa62feacb6f85f7f5651f9019328..767ab6f31149bd4881b0db163635c86025c08818 100644 (file)
@@ -509,7 +509,6 @@ void MainWindow::restore_ui_settings()
 
        map<string, string> dev_info;
        list<string> key_list;
-       string value;
 
        settings.beginGroup("MainWindow");
 
@@ -530,12 +529,12 @@ void MainWindow::restore_ui_settings()
        key_list.push_back("connection_id");
 
        for (string key : key_list) {
-               if (!settings.contains(QString::fromUtf8(key.c_str())))
+               const QString k = QString::fromStdString(key);
+               if (!settings.contains(k))
                        continue;
 
-               value = settings.value(QString::fromUtf8(key.c_str())).toString().toStdString();
-
-               if (value.size() > 0)
+               const string value = settings.value(k).toString().toStdString();
+               if (!value.empty())
                        dev_info.insert(std::make_pair(key, value));
        }