Rename KLocale to enhance compatibility with KDE4

pull/1/head
Timothy Pearson 12 years ago
parent 5940809eb0
commit 73c978ef8c

@ -8,7 +8,7 @@
int main (int argc, char *argv[]) int main (int argc, char *argv[])
{ {
KLocale::setMainCatalogue("tdelibs"); TDELocale::setMainCatalogue("tdelibs");
TDEAboutData aboutdata("KWeatherService", I18N_NOOP("TDE"), TDEAboutData aboutdata("KWeatherService", I18N_NOOP("TDE"),
"0.8", I18N_NOOP("KWeather DCOP Service"), "0.8", I18N_NOOP("KWeather DCOP Service"),
TDEAboutData::License_GPL, "(C) 2002, Ian Reinhart Geiser"); TDEAboutData::License_GPL, "(C) 2002, Ian Reinhart Geiser");

@ -35,7 +35,7 @@ email : jratke@comcast.net
#define TEMP_F_TO_C(x) ( ((x) - 32) * 5/9 ) #define TEMP_F_TO_C(x) ( ((x) - 32) * 5/9 )
MetarParser::MetarParser(StationDatabase *stationDB, MetarParser::MetarParser(StationDatabase *stationDB,
KLocale::MeasureSystem units, TDELocale::MeasureSystem units,
TQDate date, TQDate date,
TQTime time, TQTime time,
unsigned int localUTCOffset) : unsigned int localUTCOffset) :
@ -158,7 +158,7 @@ bool MetarParser::parseCover(const TQString &s)
TQString skycondition; TQString skycondition;
height *= 100; height *= 100;
if (m_units == KLocale::Metric) if (m_units == TDELocale::Metric)
{ {
height = height * 0.3048; height = height * 0.3048;
// using plural i18n form for proper translations // using plural i18n form for proper translations
@ -435,7 +435,7 @@ void MetarParser::calcTemperatureVariables()
} }
TQString unit; TQString unit;
if (m_units == KLocale::Metric) if (m_units == TDELocale::Metric)
{ {
unit = i18n("°C"); unit = i18n("°C");
weatherInfo.qsTemperature.sprintf("%.1f", weatherInfo.tempC); weatherInfo.qsTemperature.sprintf("%.1f", weatherInfo.tempC);
@ -539,7 +539,7 @@ bool MetarParser::parseVisibility(TQStringList::ConstIterator it)
if (fVisibility > 0) if (fVisibility > 0)
{ {
if (m_units == KLocale::Metric) if (m_units == TDELocale::Metric)
{ {
fVisibility *= 1.6; fVisibility *= 1.6;
weatherInfo.qsVisibility.setNum(fVisibility); weatherInfo.qsVisibility.setNum(fVisibility);
@ -569,7 +569,7 @@ bool MetarParser::parsePressure( const TQString &s)
kdDebug(12006) << "Pressure: " << TQString(PressRegExp.capturedTexts().join("-")) kdDebug(12006) << "Pressure: " << TQString(PressRegExp.capturedTexts().join("-"))
<< endl; << endl;
if (m_units == KLocale::Metric) if (m_units == TDELocale::Metric)
{ {
if (type == "A") if (type == "A")
fPressure *= (33.8639/100); fPressure *= (33.8639/100);
@ -648,7 +648,7 @@ bool MetarParser::parseWindSpeed(const TQString &s)
kdDebug(12006) << "Wind: " << WindRegExp.capturedTexts().join("-") kdDebug(12006) << "Wind: " << WindRegExp.capturedTexts().join("-")
<< endl; << endl;
if (m_units == KLocale::Metric) if (m_units == TDELocale::Metric)
{ {
if (sWindUnit == "KT") if (sWindUnit == "KT")
{ {
@ -686,7 +686,7 @@ bool MetarParser::parseWindSpeed(const TQString &s)
if (gustSpeed >= 1) if (gustSpeed >= 1)
{ {
if (m_units == KLocale::Metric) if (m_units == TDELocale::Metric)
{ {
weatherInfo.qsCurrentList << i18n("Wind gusts up to 1 km/h", weatherInfo.qsCurrentList << i18n("Wind gusts up to 1 km/h",
"Wind gusts up to %n km/h", (int) gustSpeed); "Wind gusts up to %n km/h", (int) gustSpeed);
@ -802,7 +802,7 @@ void MetarParser::calcWindChill()
if (windChill < 48) if (windChill < 48)
{ {
if (m_units == KLocale::Metric) if (m_units == TDELocale::Metric)
{ {
weatherInfo.qsWindChill.setNum(TEMP_F_TO_C(windChill), 'f', 1); weatherInfo.qsWindChill.setNum(TEMP_F_TO_C(windChill), 'f', 1);
removeTrailingDotZero(weatherInfo.qsWindChill); removeTrailingDotZero(weatherInfo.qsWindChill);

@ -59,7 +59,7 @@ class MetarParser
{ {
public: public:
MetarParser(StationDatabase *stationDB, MetarParser(StationDatabase *stationDB,
KLocale::MeasureSystem units = KLocale::Imperial, TDELocale::MeasureSystem units = TDELocale::Imperial,
TQDate date = TQDate::currentDate(), TQDate date = TQDate::currentDate(),
TQTime time = TQTime::currentTime(), TQTime time = TQTime::currentTime(),
unsigned int localUTCOffset = KRFCDate::localUTCOffset()); unsigned int localUTCOffset = KRFCDate::localUTCOffset());
@ -101,7 +101,7 @@ class MetarParser
void reset(); void reset();
StationDatabase* const m_stationDb; StationDatabase* const m_stationDb;
const KLocale::MeasureSystem m_units; const TDELocale::MeasureSystem m_units;
const TQDate m_date; const TQDate m_date;
const TQTime m_time; const TQTime m_time;
const unsigned int m_localUTCOffset; const unsigned int m_localUTCOffset;

@ -104,7 +104,7 @@ void test1()
TQTime Time(21, 7); // hours, minutes, seconds and ms defaults to 0 TQTime Time(21, 7); // hours, minutes, seconds and ms defaults to 0
// Construct a MetarParser object for our tests. // Construct a MetarParser object for our tests.
MetarParser parser( stationDb, KLocale::Imperial, Date, Time, localUTCOffset ); MetarParser parser( stationDb, TDELocale::Imperial, Date, Time, localUTCOffset );
struct WeatherInfo results = parser.processData("KUGN", "2004/06/18 00:55 KUGN 180055Z AUTO 04004KT 9SM SCT050 17/15 A3005 RMK AO2 SLP167 T01670150 TSNO"); struct WeatherInfo results = parser.processData("KUGN", "2004/06/18 00:55 KUGN 180055Z AUTO 04004KT 9SM SCT050 17/15 A3005 RMK AO2 SLP167 T01670150 TSNO");
@ -138,7 +138,7 @@ void test2()
TQTime Time(18, 43); // hours, minutes, seconds and ms defaults to 0 TQTime Time(18, 43); // hours, minutes, seconds and ms defaults to 0
// Construct a MetarParser object for our tests. // Construct a MetarParser object for our tests.
MetarParser parser( stationDb, KLocale::Imperial, Date, Time, localUTCOffset ); MetarParser parser( stationDb, TDELocale::Imperial, Date, Time, localUTCOffset );
struct WeatherInfo results = parser.processData("KUGN", "2004/06/18 22:55 KUGN 182255Z 29005KT 10SM BKN110 21/13 A3010 RMK AO2 SLP187 T02110133"); struct WeatherInfo results = parser.processData("KUGN", "2004/06/18 22:55 KUGN 182255Z 29005KT 10SM BKN110 21/13 A3010 RMK AO2 SLP187 T02110133");

Loading…
Cancel
Save