From be000a8a9aad1d6804ee27b02b12b531029427cb Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 30 Aug 2015 08:46:03 +0200 Subject: ui: save current tracker/filter/proto, not last Current tracker/filter/proto name depends on the currentTextChanged() slot. currentIndexChanged() runs before currentText() is updated, causing the old name to be saved. --- facetracknoir/ui.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp index a600543c..7b84de72 100644 --- a/facetracknoir/ui.cpp +++ b/facetracknoir/ui.cpp @@ -58,16 +58,16 @@ MainWindow::MainWindow() : tie_setting(s.filter_dll, ui.iconcomboFilter); connect(ui.iconcomboTrackerSource, - static_cast(&QComboBox::currentIndexChanged), - [&](int) -> void { if (pTrackerDialog) pTrackerDialog = nullptr; save(); }); + &QComboBox::currentTextChanged, + [&](QString) -> void { if (pTrackerDialog) pTrackerDialog = nullptr; save(); }); connect(ui.iconcomboProtocol, - static_cast(&QComboBox::currentIndexChanged), - [&](int) -> void { if (pProtocolDialog) pProtocolDialog = nullptr; save(); }); + &QComboBox::currentTextChanged, + [&](QString) -> void { if (pProtocolDialog) pProtocolDialog = nullptr; save(); }); connect(ui.iconcomboFilter, - static_cast(&QComboBox::currentIndexChanged), - [&](int) -> void { if (pFilterDialog) pFilterDialog = nullptr; save(); }); + &QComboBox::currentTextChanged, + [&](QString) -> void { if (pFilterDialog) pFilterDialog = nullptr; save(); }); connect(ui.btnStartTracker, SIGNAL(clicked()), this, SLOT(startTracker())); connect(ui.btnStopTracker, SIGNAL(clicked()), this, SLOT(stopTracker())); -- cgit v1.2.3