From: Joel Holdsworth Date: Sun, 12 Apr 2015 15:24:06 +0000 (+0100) Subject: MainWindow: Tidied restore_ui_settings X-Git-Tag: pulseview-0.3.0~193 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=951b5ae77957c8086f05fcd2b26beaf32f3e8e3e;p=pulseview.git MainWindow: Tidied restore_ui_settings --- diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 3480d8cc..767ab6f3 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -509,7 +509,6 @@ void MainWindow::restore_ui_settings() map dev_info; list 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)); }