diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-07-08 23:29:49 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-07-08 23:29:49 +0200 |
commit | fa1801471c2708ed8266ec7b99bd4cec886ccc1b (patch) | |
tree | aa56218c2c7e4939aaf11a2046b0f12760326545 /gui/process_detector.cpp | |
parent | 90940a774eab876c38d5cef981b4be5bae67a462 (diff) |
options: fix 2 issues
1. Calling valueChanged didn't invoke machinery in
value<t>, only base_value aka value_.
There's a fast path in value<t>::type() despite the
pessimization.
2. Split global scope stuff into options::globals from
the options::globals stuff
3. Adjust usages
Diffstat (limited to 'gui/process_detector.cpp')
-rw-r--r-- | gui/process_detector.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gui/process_detector.cpp b/gui/process_detector.cpp index 969b1856..0ff05f93 100644 --- a/gui/process_detector.cpp +++ b/gui/process_detector.cpp @@ -24,31 +24,32 @@ static constexpr inline auto RECORD_SEPARATOR = QChar(char(0x1e)); // RS ^] static constexpr inline auto UNIT_SEPARATOR = QChar(char(0x1f)); // US ^_ using namespace options; +using namespace options::globals; void proc_detector_settings::set_game_list(const QString &game_list) { - group::with_global_settings_object([&](QSettings& settings) { + with_global_settings_object([&](QSettings& settings) { settings.setValue("executable-list", game_list); }); } QString proc_detector_settings::get_game_list() { - return group::with_global_settings_object([&](QSettings& settings) { + return with_global_settings_object([&](QSettings& settings) { return settings.value("executable-list").toString(); }); } bool proc_detector_settings::is_enabled() { - return group::with_global_settings_object([&](QSettings& settings) { + return with_global_settings_object([&](QSettings& settings) { return settings.value("executable-detector-enabled", false).toBool(); }); } void proc_detector_settings::set_is_enabled(bool enabled) { - group::with_global_settings_object([&](QSettings& settings) { + with_global_settings_object([&](QSettings& settings) { settings.setValue("executable-detector-enabled", enabled); }); } @@ -76,7 +77,7 @@ QHash<QString, QString> proc_detector_settings::split_process_names() void BrowseButton::browse() { - QString dir_path = QFileInfo(group::ini_pathname()).absolutePath(); + QString dir_path = QFileInfo(ini_pathname()).absolutePath(); QString filename = QFileDialog::getOpenFileName( this, tr("Set executable name"), @@ -96,7 +97,7 @@ int process_detector::add_row(QString const& exe_name, QString const& profile) QComboBox* cb = new QComboBox(); cb->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum); cb->addItem(""); - cb->addItems(group::ini_list()); + cb->addItems(ini_list()); ui.tableWidget->setCellWidget(i, 1, cb); QTableWidgetItem* twi = new QTableWidgetItem(exe_name); |