[Kstars-devel] kdeedu/kstars/kstars
Jason Harris
kstars at 30doradus.org
Mon Dec 8 21:49:19 CET 2003
CVS commit by harris:
Now that 3.2beta2 is out, back to our regularly-scheduled bug squashing...
Fixing bug #68401: The "Set Focus Manually" tool will now correctly handle
decimal-point symbol l10n.
Because the QString::toDouble() function requires a "." decimal point, we
simply replace all instances of locale()->decimalSymbol() with "." before
parsing the entry as a decimal value.
I tested it by manually setting my decimal symbol to "," in the control
center; it works fine for me now.
CCMAIL: kstars-devel at kde.org
CCMAIL: 68401-done at bugs.kde.org
M +6 -0 dms.cpp 1.24
--- kdeedu/kstars/kstars/dms.cpp #1.23:1.24
@@ -23,4 +23,6 @@
#include "skypoint.h"
#include "dms.h"
+#include <kglobal.h>
+#include <klocale.h>
#include <qregexp.h>
@@ -74,4 +76,8 @@ bool dms::setFromString( const QString &
entry.replace( QRegExp("\""), "" );
+ //Account for localized decimal-point settings
+ //QString::toDouble() requires that the decimal symbol is "."
+ entry.replace( KGlobal::locale()->decimalSymbol(), "." );
+
//empty entry returns false
if ( entry.isEmpty() ) {
More information about the Kstars-devel
mailing list