From 734aa6e4117968a4c4d1abfa2a7b81a344b5c9a8 Mon Sep 17 00:00:00 2001 From: auria Date: Sun, 19 Sep 2010 17:22:49 +0000 Subject: [PATCH] Suppressed unneeded warning from spinner widget git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6063 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/guiengine/engine.cpp | 2 +- src/guiengine/widgets/spinner_widget.cpp | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/guiengine/engine.cpp b/src/guiengine/engine.cpp index 9644bef50..c27cedabe 100644 --- a/src/guiengine/engine.cpp +++ b/src/guiengine/engine.cpp @@ -129,7 +129,7 @@ A spinner component (lets you choose numbers). Specify PROP_MIN_VALUE and PROP_MAX_VALUE to have control over values - (default will be from 0 to 10). You can specify an icon; then, include a + (default will be from 0 to 99). You can specify an icon; then, include a sprintf format string like %i in the name, and at runtime the current number will be inserted into the given name to find the right file for each possible value the spinner can take. It may also display arbitrary text diff --git a/src/guiengine/widgets/spinner_widget.cpp b/src/guiengine/widgets/spinner_widget.cpp index e559349d8..547a9dbed 100644 --- a/src/guiengine/widgets/spinner_widget.cpp +++ b/src/guiengine/widgets/spinner_widget.cpp @@ -37,6 +37,8 @@ SpinnerWidget::SpinnerWidget(const bool gauge) : Widget(WTYPE_SPINNER) m_check_inside_me = true; //FIXME: not sure this is necessary m_supports_multiplayer = true; + m_min = 0; + m_max = 999; } // ----------------------------------------------------------------------------- @@ -49,6 +51,7 @@ void SpinnerWidget::add() m_warp_around = (m_properties[PROP_WARP_AROUND] == "true"); + if (min_s.size() > 0) { int i; std::istringstream myStream(min_s); @@ -59,10 +62,11 @@ void SpinnerWidget::add() } else { - std::cerr << "WARNING : invalid value from spinner widget minimum value '" << min_s << "'\n"; - m_min = 0; + std::cerr << "WARNING : invalid value for spinner widget minimum value : '" << min_s << "'\n"; } } + + if (max_s.size() > 0) { int i; std::istringstream myStream(max_s); @@ -73,8 +77,7 @@ void SpinnerWidget::add() } else { - std::cerr << "WARNING : invalid value from spinner widget maximal value '" << max_s << "'\n"; - m_max = 10; + std::cerr << "WARNING : invalid value for spinner widget maximal value : '" << max_s << "'\n"; } }