[Kstars-devel] KDE/kdeedu/kstars/kstars
Akarsh Simha
akarshsimha at gmail.com
Sun Dec 28 21:14:04 CET 2008
SVN commit 902623 by asimha:
The code in the Location Dialog was using QString::toDouble() to
convert the text in the time zone box into an integer. This did not
work with localization settings that use anything other than '.' for a
decimal point.
The patch fixes this by converting the localized version of the
decimal point to '.' and then calling toDouble() on the string. [As
done in dms::setFromString()]
CCMAIL: kstars-devel at kde.org
BUG: 178908
M +3 -1 locationdialog.cpp
--- trunk/KDE/kdeedu/kstars/kstars/locationdialog.cpp #902622:902623
@@ -211,7 +211,9 @@
bool latOk(false), lngOk(false), tzOk(false);
dms lat = ui->NewLat->createDms( true, &latOk );
dms lng = ui->NewLong->createDms( true, &lngOk );
- double TZ = ui->TZBox->lineEdit()->text().toDouble( &tzOk );
+ QString TimeZoneString = ui->TZBox->lineEdit()->text();
+ TimeZoneString.replace( KGlobal::locale()->decimalSymbol(), "." );
+ double TZ = TimeZoneString.toDouble( &tzOk );
if ( ui->NewCityName->text().isEmpty() || ui->NewCountryName->text().isEmpty() ) {
QString message = i18n( "All fields (except province) must be filled to add this location." );
More information about the Kstars-devel
mailing list