From 58fda26298e969a9ef75ca69a544a58216484360 Mon Sep 17 00:00:00 2001 From: jriegel Date: Sun, 9 Feb 2014 19:28:15 +0100 Subject: [PATCH] Fix doulbe value entry in history of InpuField --- src/Gui/InputField.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Gui/InputField.cpp b/src/Gui/InputField.cpp index 7a08e170fd..34ae8b0fb8 100644 --- a/src/Gui/InputField.cpp +++ b/src/Gui/InputField.cpp @@ -162,12 +162,19 @@ void InputField::newInput(const QString & text) void InputField::pushToHistory(const QString &valueq) { - std::string value; + QString val; if(valueq.isEmpty()) - value = this->text().toUtf8().constData(); + val = this->text(); else - value = valueq.toUtf8().constData(); + val = valueq; + + // check if already in: + std::vector hist = InputField::getHistory(); + for(std::vector::const_iterator it = hist.begin();it!=hist.end();++it) + if( *it == val) + return; + std::string value(val.toUtf8()); if(_handle.isValid()){ char hist1[21]; char hist0[21];