[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kstars-devel
Subject:    [Kstars-devel] kdeedu/kstars/kstars
From:       Jason Harris <kstars () 30doradus ! org>
Date:       2003-12-08 20:49:19
[Download RAW message or body]

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@kde.org
CCMAIL: 68401-done@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() ) {


_______________________________________________
Kstars-devel mailing list
Kstars-devel@kde.org
https://mail.kde.org/mailman/listinfo/kstars-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic