From fc37766a6fa954fa4cf43fc27a9dd0a03ff16c5d Mon Sep 17 00:00:00 2001 From: auria Date: Tue, 19 Nov 2013 01:02:36 +0000 Subject: [PATCH] fix harmless spinner warning git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14474 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/guiengine/widgets/spinner_widget.cpp | 26 +++++------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/src/guiengine/widgets/spinner_widget.cpp b/src/guiengine/widgets/spinner_widget.cpp index 1489c5f85..0b0c058a2 100644 --- a/src/guiengine/widgets/spinner_widget.cpp +++ b/src/guiengine/widgets/spinner_widget.cpp @@ -62,33 +62,17 @@ void SpinnerWidget::add() if (min_s.size() > 0) { - int i; - std::istringstream myStream(min_s); - myStream >> i; - bool is_number = (i!=0); - if (is_number) + if (!StringUtils::parseString(min_s, &m_min)) { - m_min = i; - } - else - { - std::cerr << "WARNING : invalid value for spinner widget minimum value : '" << min_s << "'\n"; + Log::warn("invalid value for spinner widget minimum value : %s", min_s.c_str()); } } if (max_s.size() > 0) { - int i; - std::istringstream myStream(max_s); - myStream >> i; - bool is_number = (i!=0); - if (is_number) - { - m_max = i; - } - else - { - std::cerr << "WARNING : invalid value for spinner widget maximal value : '" << max_s << "'\n"; + if (!StringUtils::parseString(max_s, &m_max)) + { + Log::warn("invalid value for spinner widget maximum value : %s", max_s.c_str()); } }