[rkward-cvs] SF.net SVN: rkward: [2090] branches/KDE4_port/rkward/misc/rkspinbox.cpp

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Oct 18 16:02:07 UTC 2007


Revision: 2090
          http://rkward.svn.sourceforge.net/rkward/?rev=2090&view=rev
Author:   tfry
Date:     2007-10-18 09:02:07 -0700 (Thu, 18 Oct 2007)

Log Message:
-----------
Fix int mode initialization

Modified Paths:
--------------
    branches/KDE4_port/rkward/misc/rkspinbox.cpp

Modified: branches/KDE4_port/rkward/misc/rkspinbox.cpp
===================================================================
--- branches/KDE4_port/rkward/misc/rkspinbox.cpp	2007-10-18 15:02:13 UTC (rev 2089)
+++ branches/KDE4_port/rkward/misc/rkspinbox.cpp	2007-10-18 16:02:07 UTC (rev 2090)
@@ -26,6 +26,8 @@
 #include "../debug.h"
 
 RKSpinBox::RKSpinBox (QWidget *parent) : QSpinBox (parent) {
+	RK_TRACE (MISC);
+
 	validator = 0;
 	mode = Integer;
 	updating = updating_b = false;
@@ -38,15 +40,21 @@
 }
 
 RKSpinBox::~RKSpinBox () {
+	RK_TRACE (MISC);
+
 	delete validator;
 }
 
 void RKSpinBox::setRealValue (double new_value) {
+	RK_TRACE (MISC);
+
 	real_value = new_value;
 	setValue (0);
 }
 
 void RKSpinBox::setIntValue (int new_value) {
+	RK_TRACE (MISC);
+
 	int_value = new_value;
 	setValue (0);
 }
@@ -81,14 +89,17 @@
 }
 
 void RKSpinBox::stepBy (int steps) {
+	RK_TRACE (MISC);
 	setValue (steps);
 }
 
-QValidator::State RKSpinBox::validate (QString &input, int &pos ) const {
+QValidator::State RKSpinBox::validate (QString &input, int &pos) const {
+	RK_TRACE (MISC);
 	return (validator->validate (input, pos));
 }
 
 void RKSpinBox::updateValue (int change) {
+	RK_TRACE (MISC);
 	if (mode == Real) {
 		if (change != 0) {
 			setValue (0);
@@ -126,6 +137,7 @@
 }
 
 void RKSpinBox::setRealMode (double min, double max, double initial, int default_precision, int max_precision) {
+	RK_TRACE (MISC);
 	RK_ASSERT ((max_precision >= default_precision) && (max_precision <= 8));
 
 	mode = Real;
@@ -150,7 +162,10 @@
 }
 
 void RKSpinBox::setIntMode (int min, int max, int initial) {
+	RK_TRACE (MISC);
 	QValidator *new_validator = new QIntValidator (min, max, this);
+	delete validator;
+	validator = new_validator;
 
 	/* see setRealMode for comments */
 
@@ -162,8 +177,6 @@
 	int_max = max;
 	int_value = initial;
 
-	delete validator;
-	validator = new_validator;
 	mode = Integer;
 
 	setValue (0);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list