summaryrefslogtreecommitdiffstats
path: root/tdecore/tdelocale.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdecore/tdelocale.cpp')
-rw-r--r--tdecore/tdelocale.cpp73
1 files changed, 31 insertions, 42 deletions
diff --git a/tdecore/tdelocale.cpp b/tdecore/tdelocale.cpp
index 2229418a1..1e771c85a 100644
--- a/tdecore/tdelocale.cpp
+++ b/tdecore/tdelocale.cpp
@@ -1,4 +1,3 @@
-// -*- c-basic-offset: 2 -*-
/* This file is part of the KDE libraries
Copyright (c) 1997,2001 Stephan Kulow <coolo@kde.org>
Copyright (c) 1999 Preston Brown <pbrown@kde.org>
@@ -34,16 +33,16 @@
#include "kcatalogue.h"
#include "tdeglobal.h"
-#include "kstandarddirs.h"
-#include "ksimpleconfig.h"
-#include "kinstance.h"
+#include "tdestandarddirs.h"
+#include "tdesimpleconfig.h"
+#include "tdeinstance.h"
#include "tdeconfig.h"
#include "kdebug.h"
#include "kcalendarsystem.h"
#include "kcalendarsystemfactory.h"
#include "tdelocale.h"
-#ifdef Q_WS_WIN
+#ifdef TQ_WS_WIN
#include <windows.h>
#endif
@@ -73,7 +72,7 @@ public:
KCalendarSystem * calendar;
bool utf8FileEncoding;
TQString appName;
-#ifdef Q_WS_WIN
+#ifdef TQ_WS_WIN
char win32SystemEncoding[3+7]; //"cp " + lang ID
#endif
bool useMainCatalogue;
@@ -311,7 +310,7 @@ void TDELocale::initFormat()
TDEConfigGroupSaver saver(config, "Locale");
- KSimpleConfig entry(locate("locale",
+ TDESimpleConfig entry(locate("locale",
TQString::fromLatin1("l10n/%1/entry.desktop")
.arg(m_country)), true);
entry.setGroup("KCM Locale");
@@ -371,7 +370,7 @@ void TDELocale::initFormat()
//Grammatical
//Precedence here is l10n / i18n / config file
- KSimpleConfig language(locate("locale",
+ TDESimpleConfig language(locate("locale",
TQString::fromLatin1("%1/entry.desktop")
.arg(m_language)), true);
language.setGroup("KCM Locale");
@@ -1219,34 +1218,34 @@ static void _inc_by_one(TQString &str, int position)
switch(last_char)
{
case '0':
- str[i] = (QChar)'1';
+ str[i] = (TQChar)'1';
break;
case '1':
- str[i] = (QChar)'2';
+ str[i] = (TQChar)'2';
break;
case '2':
- str[i] = (QChar)'3';
+ str[i] = (TQChar)'3';
break;
case '3':
- str[i] = (QChar)'4';
+ str[i] = (TQChar)'4';
break;
case '4':
- str[i] = (QChar)'5';
+ str[i] = (TQChar)'5';
break;
case '5':
- str[i] = (QChar)'6';
+ str[i] = (TQChar)'6';
break;
case '6':
- str[i] = (QChar)'7';
+ str[i] = (TQChar)'7';
break;
case '7':
- str[i] = (QChar)'8';
+ str[i] = (TQChar)'8';
break;
case '8':
- str[i] = (QChar)'9';
+ str[i] = (TQChar)'9';
break;
case '9':
- str[i] = (QChar)'0';
+ str[i] = (TQChar)'0';
if (i == 0) str.prepend('1');
continue;
case '.':
@@ -1311,8 +1310,8 @@ TQString TDELocale::formatNumber(const TQString &numStr, bool round,
// Skip the sign (for now)
- bool neg = (tmpString[0] == (QChar)'-');
- if (neg || tmpString[0] == (QChar)'+') tmpString.remove(0, 1);
+ bool neg = (tmpString[0] == (TQChar)'-');
+ if (neg || tmpString[0] == (TQChar)'+') tmpString.remove(0, 1);
// Split off exponential part (including 'e'-symbol)
TQString mantString = tmpString.section('e', 0, 0,
@@ -1473,7 +1472,7 @@ double TDELocale::readNumber(const TQString &_str, bool * ok) const
}
TQString tot;
- if (neg) tot = (QChar)'-';
+ if (neg) tot = (TQChar)'-';
tot += major + '.' + minor + exponentialPart;
@@ -1503,7 +1502,7 @@ double TDELocale::readMoney(const TQString &_str, bool * ok) const
// (with a special case for parenthesis)
if (negativeMonetarySignPosition() == ParensAround)
{
- if (str[0] == (QChar)'(' && str[str.length()-1] == (QChar)')')
+ if (str[0] == (TQChar)'(' && str[str.length()-1] == (TQChar)')')
{
neg = true;
str.remove(str.length()-1,1);
@@ -1570,7 +1569,7 @@ double TDELocale::readMoney(const TQString &_str, bool * ok) const
}
TQString tot;
- if (neg) tot = (QChar)'-';
+ if (neg) tot = (TQChar)'-';
tot += major + '.' + minior;
return tot.toDouble(ok);
}
@@ -1627,7 +1626,7 @@ TQDate TDELocale::readDate(const TQString &intstr, const TQString &fmt, bool* ok
TQChar c = fmt.at(fmtpos++);
- if (c != (QChar)'%') {
+ if (c != (TQChar)'%') {
if (c.isSpace() && str.at(strpos).isSpace())
strpos++;
else if (c != str.at(strpos++))
@@ -1649,7 +1648,7 @@ TQDate TDELocale::readDate(const TQString &intstr, const TQString &fmt, bool* ok
error = true;
j = 1;
while (error && (j < 8)) {
- TQString s = calendar()->weekDayName(j, c == (QChar)'a').lower();
+ TQString s = calendar()->weekDayName(j, c == (TQChar)'a').lower();
int len = s.length();
if (str.mid(strpos, len) == s)
{
@@ -1666,7 +1665,7 @@ TQDate TDELocale::readDate(const TQString &intstr, const TQString &fmt, bool* ok
if (d->nounDeclension && d->dateMonthNamePossessive) {
j = 1;
while (error && (j < 13)) {
- TQString s = calendar()->monthNamePossessive(j, year, c == (QChar)'b').lower();
+ TQString s = calendar()->monthNamePossessive(j, year, c == (TQChar)'b').lower();
int len = s.length();
if (str.mid(strpos, len) == s) {
month = j;
@@ -1678,7 +1677,7 @@ TQDate TDELocale::readDate(const TQString &intstr, const TQString &fmt, bool* ok
}
j = 1;
while (error && (j < 13)) {
- TQString s = calendar()->monthName(j, year, c == (QChar)'b').lower();
+ TQString s = calendar()->monthName(j, year, c == (TQChar)'b').lower();
int len = s.length();
if (str.mid(strpos, len) == s) {
month = j;
@@ -1767,7 +1766,7 @@ TQTime TDELocale::readTime(const TQString &intstr, ReadTimeFlags flags, bool *ok
TQChar c = Format.at(Formatpos++);
- if (c != (QChar)'%')
+ if (c != (TQChar)'%')
{
if (c.isSpace())
strpos++;
@@ -1886,7 +1885,7 @@ TQString TDELocale::formatTime(const TQTime &pTime, bool includeSecs, bool isDur
switch ( TQChar(rst.at( format_index )).unicode() )
{
case '%':
- buffer[index++] = (QChar)'%';
+ buffer[index++] = (TQChar)'%';
break;
case 'H':
put_it_in( buffer, index, pTime.hour() );
@@ -1970,8 +1969,8 @@ TQString TDELocale::formatDateTime(const TQDateTime &pDateTime,
bool includeSeconds) const
{
return translate("concatenation of dates and time", "%1 %2")
- .arg( formatDate( TQT_TQDATE_OBJECT(pDateTime.date()), shortFormat ) )
- .arg( formatTime( TQT_TQTIME_OBJECT(pDateTime.time()), includeSeconds ) );
+ .arg( formatDate( pDateTime.date(), shortFormat ) )
+ .arg( formatTime( pDateTime.time(), includeSeconds ) );
}
TQString i18n(const char* text)
@@ -2084,22 +2083,12 @@ void TDELocale::initFileNameEncoding(TDEConfig *)
// which, on Unix platforms, use the locale's codec.
}
-#ifdef USE_QT3
TQCString TDELocale::encodeFileNameUTF8( const TQString & fileName )
-#endif // USE_QT3
-#ifdef USE_QT4
-QByteArray TDELocale::encodeFileNameUTF8( const QString & fileName )
-#endif // USE_QT4
{
return TQString(fileName).utf8();
}
-#ifdef USE_QT3
TQString TDELocale::decodeFileNameUTF8( const TQCString & localFileName )
-#endif // USE_QT3
-#ifdef USE_QT4
-QString TDELocale::decodeFileNameUTF8( const QByteArray & localFileName )
-#endif // USE_QT4
{
return TQString::fromUtf8(localFileName);
}
@@ -2275,7 +2264,7 @@ TQString TDELocale::defaultCountry()
const char * TDELocale::encoding() const
{
-#ifdef Q_WS_WIN
+#ifdef TQ_WS_WIN
if (0==qstrcmp("System", codecForEncoding()->name()))
{
//win32 returns "System" codec name here but KDE apps expect a real name: