From a7e36472d5aa64645c872cf35bdb0ae918f8bed4 Mon Sep 17 00:00:00 2001 From: David Given Date: Sun, 11 Sep 2022 20:08:47 +0200 Subject: [PATCH] Make includes work in the GUI. --- src/gui/mainwindow.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/gui/mainwindow.cc b/src/gui/mainwindow.cc index 0b701b47..b82ee466 100644 --- a/src/gui/mainwindow.cc +++ b/src/gui/mainwindow.cc @@ -92,7 +92,7 @@ public: continue; formatChoice->Append(it.first); - _formats.push_back(std::make_pair(it.first, std::move(config))); + _formatNames.push_back(it.first); i++; } @@ -1051,7 +1051,7 @@ public: auto formatSelection = formatChoice->GetSelection(); if (formatSelection == wxNOT_FOUND) Error() << "no format selected"; - config = *_formats[formatChoice->GetSelection()].second; + FlagGroup::parseConfigFile(_formatNames[formatChoice->GetSelection()], formats); for (auto setting : split(_extraConfiguration, '\n')) { @@ -1285,9 +1285,9 @@ public: int defaultFormat = 0; int i = 0; - for (const auto& it : _formats) + for (const auto& it : _formatNames) { - if (it.first == s) + if (it == s) { formatChoice->SetSelection(i); break; @@ -1518,8 +1518,7 @@ private: wxConfig _config; wxDataFormat _dndFormat; - std::vector>> - _formats; + std::vector _formatNames; std::vector> _devices; int _state = STATE_IDLE; int _errorState;