From 59d153016be1e09cb31cdb18bef0a649acfc6292 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 1 Feb 2013 08:17:52 -0600 Subject: [PATCH] Rename KLocale to enhance compatibility with KDE4 --- KDE2PORTING.html | 8 +- KDE3PORTING.html | 6 +- kabc/address.h | 4 +- kded/kded.cpp | 2 +- kded/khostname.cpp | 2 +- kded/tde-menu.cpp | 4 +- kded/tdebuildsycoca.cpp | 6 +- kdoctools/meinproc.cpp | 2 +- kinit/tdelauncher_main.cpp | 2 +- libtdescreensaver/main.cpp | 2 +- tdecore/kaboutdata.cpp | 2 +- tdecore/kcalendarsystem.cpp | 6 +- tdecore/kcalendarsystem.h | 6 +- tdecore/kcalendarsystemfactory.cpp | 2 +- tdecore/kcalendarsystemfactory.h | 4 +- tdecore/kcalendarsystemgregorian.cpp | 2 +- tdecore/kcalendarsystemgregorian.h | 4 +- tdecore/kcalendarsystemhebrew.cpp | 2 +- tdecore/kcalendarsystemhebrew.h | 4 +- tdecore/kcalendarsystemhijri.cpp | 2 +- tdecore/kcalendarsystemhijri.h | 4 +- tdecore/kcalendarsystemjalali.cpp | 2 +- tdecore/kcalendarsystemjalali.h | 2 +- tdecore/kcatalogue.h | 2 +- tdecore/kdebug.areas | 2 +- tdecore/kdebugrc | 2 +- tdecore/kglobal.cpp | 6 +- tdecore/kglobal.h | 6 +- tdecore/klocale.cpp | 286 +++++++++--------- tdecore/klocale.h | 46 +-- tdecore/kstandarddirs.h | 2 +- tdecore/tde-config.cpp.cmake | 4 +- tdecore/tde-config.cpp.in | 4 +- tdecore/tdeconfigbackend.cpp | 12 +- tdecore/tdeconfigbackend.h | 6 +- tdecore/tdeconfigbase.cpp | 2 +- tdecore/tests/kcalendartest.cpp | 8 +- tdecore/tests/kcmdlineargstest.cpp | 2 +- tdecore/tests/klocaletest.cpp | 10 +- tdecore/tests/klocaletest.h | 2 +- tdeio/kssl/ksslutils.h | 4 +- tdeio/misc/tdemailservice.cpp | 2 +- tdeio/misc/tdesendbugmail/main.cpp | 2 +- tdeio/misc/tdetelnetservice.cpp | 2 +- tdeio/misc/uiserver.cpp | 2 +- tdeio/tdefile/tests/kcustommenueditortest.cpp | 2 +- tdeioslave/file/file.cc | 2 +- tdeioslave/ftp/ftp.cc | 4 +- tdeioslave/http/http.cc | 2 +- tdeioslave/http/http_cache_cleaner.cpp | 2 +- tdeioslave/http/kcookiejar/main.cpp | 2 +- tdeprint/ChangeLog | 2 +- tdeprint/marginwidget.cpp | 2 +- tdeui/kbugreport.cpp | 2 +- tdeui/kdatewidget.cpp | 4 +- tdeui/knuminput.h | 2 +- tdeui/knumvalidator.cpp | 2 +- tdeui/knumvalidator.h | 6 +- tdeui/kswitchlanguagedialog.cpp | 2 +- tdeui/tests/kcolordlgtest.cpp | 2 +- tdeui/tests/kdatepicktest.cpp | 2 +- tdeui/tests/kdatetimewidgettest.cpp | 2 +- tdeui/tests/kdatewidgettest.cpp | 2 +- tdeui/tests/ktimewidgettest.cpp | 2 +- 64 files changed, 270 insertions(+), 270 deletions(-) diff --git a/KDE2PORTING.html b/KDE2PORTING.html index 8f6070bf7..e77898f37 100644 --- a/KDE2PORTING.html +++ b/KDE2PORTING.html @@ -21,7 +21,7 @@ or this page online.

  • automoc/am_edit, Makefile.am tags
  • TDEApplication
  • TDECmdLineArgs
  • -
  • KLocale
  • +
  • TDELocale
  • TDEGlobal: access to KDE global objects.
  • KIconLoader
  • KTMainWindow
  • @@ -109,7 +109,7 @@ or this page online.

    TDEApplication

    - doesn't hold any longer a KLocale instance. With this getLocale() + doesn't hold any longer a TDELocale instance. With this getLocale() and isLocaleInstantiated are now replaced by TDEGlobal::locale()

    it also doesn't hold a KiconLoader instance. As this also getIconLoader() @@ -179,7 +179,7 @@ or this page online.

    Return to the Table of Contents

    -

    KLocale

    +

    TDELocale

    i18n is no longer a macro

    @@ -206,7 +206,7 @@ must have created a TDEApplication object before the methods can be used.

           #include <kglobal.h>
           #include <tdeconfig.h>      // Needed to use TDEConfig
    -      #include <klocale.h>      // Needed to use KLocale
    +      #include <klocale.h>      // Needed to use TDELocale
           #include <kiconloader.h>  // Needed to use KIconLoader
         
    diff --git a/KDE3PORTING.html b/KDE3PORTING.html index d9a1f2a7a..b3fdff0d0 100644 --- a/KDE3PORTING.html +++ b/KDE3PORTING.html @@ -135,7 +135,7 @@ They have been replaced by TQCString and KMD5::Digest.
    The API has been cleaned up, it is no longer necessary to call finalize(). Simply remove any calls to it. -

    KLocale

    +

    TDELocale

  • charset() has been removed. You might want to use encoding() instead.
  • setCharset(const TQString &) has been removed. You might want to use setEncoding(int) instead. @@ -143,9 +143,9 @@ setEncoding(int) instead.
  • formatNumber(const TQString &) has been removed.
  • languages() has been removed. Use languageList() instead.
  • All references to monthName(), monthNamePossessive(), and weekDayName() -should be replaced with methods from KLocale::calendar(). +should be replaced with methods from TDELocale::calendar().
  • Hard coded date handling or date handling with TQDate should in most -cases be replaced by methods in KLocale::calendar(). +cases be replaced by methods in TDELocale::calendar().

    Accelerators Keys

    KAccel
    diff --git a/kabc/address.h b/kabc/address.h index a1ffa9f17..b4165a098 100644 --- a/kabc/address.h +++ b/kabc/address.h @@ -281,7 +281,7 @@ class KABC_EXPORT Address /** Returns ISO code for a localized country name. Only localized country - names will be understood. This might be replaced by a KLocale method in + names will be understood. This might be replaced by a TDELocale method in the future. @param cname name of the country @return two digit ISO code @@ -290,7 +290,7 @@ class KABC_EXPORT Address /** Returns a localized country name for a ISO code. - This might be replaced by a KLocale method in the future. + This might be replaced by a TDELocale method in the future. @param ISOname two digit ISO code @return localized name of the country @since 3.2 diff --git a/kded/kded.cpp b/kded/kded.cpp index b769fa508..704dd9fbf 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -885,7 +885,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[]) TDECmdLineArgs::addCmdLineOptions( options ); // this program is in tdelibs so it uses tdelibs as catalog - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); // WABA: Make sure not to enable session management. putenv(strdup("SESSION_MANAGER=")); diff --git a/kded/khostname.cpp b/kded/khostname.cpp index 7e080378b..7bdc12858 100644 --- a/kded/khostname.cpp +++ b/kded/khostname.cpp @@ -365,7 +365,7 @@ void KHostName::changeSessionManager() int main(int argc, char **argv) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDEAboutData d(appName, I18N_NOOP("KDontChangeTheHostName"), appVersion, I18N_NOOP("Informs TDE about a change in hostname"), TDEAboutData::License_GPL, "(c) 2001 Waldo Bastian"); diff --git a/kded/tde-menu.cpp b/kded/tde-menu.cpp index 6a8721915..e1f79f77c 100644 --- a/kded/tde-menu.cpp +++ b/kded/tde-menu.cpp @@ -107,7 +107,7 @@ static void findMenuEntry(KServiceGroup::Ptr parent, const TQString &name, const int main(int argc, char **argv) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); const char *description = I18N_NOOP("TDE Menu query tool.\n" "This tool can be used to find in which menu a specific application is shown.\n" "The --highlight option can be used to visually indicate to the user where\n" @@ -126,7 +126,7 @@ int main(int argc, char **argv) k.disableSessionManagement(); // this program is in tdelibs so it uses tdelibs as catalog - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); if (args->count() != 1) diff --git a/kded/tdebuildsycoca.cpp b/kded/tdebuildsycoca.cpp index 47b7a9bf4..f9b0238c7 100644 --- a/kded/tdebuildsycoca.cpp +++ b/kded/tdebuildsycoca.cpp @@ -717,7 +717,7 @@ public: extern "C" KDE_EXPORT int kdemain(int argc, char **argv) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDEAboutData d(appName, I18N_NOOP("KBuildSycoca"), appVersion, I18N_NOOP("Rebuilds the system configuration cache."), TDEAboutData::License_GPL, "(c) 1999-2002 KDE Developers"); @@ -764,8 +764,8 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) KCrash::setApplicationName(TQString(appName)); // this program is in tdelibs so it uses tdelibs as catalog - KLocale::setMainCatalogue("tdelibs"); - // force generating of KLocale object. if not, the database will get + TDELocale::setMainCatalogue("tdelibs"); + // force generating of TDELocale object. if not, the database will get // be translated TDEGlobal::locale(); TDEGlobal::dirs()->addResourceType("app-reg", "share/application-registry" ); diff --git a/kdoctools/meinproc.cpp b/kdoctools/meinproc.cpp index 952e3f48f..91d973c0b 100644 --- a/kdoctools/meinproc.cpp +++ b/kdoctools/meinproc.cpp @@ -98,7 +98,7 @@ int main(int argc, char **argv) { TDECmdLineArgs::init(argc, argv, &aboutData); TDECmdLineArgs::addCmdLineOptions( options ); - KLocale::setMainCatalogue("tdeio_help"); + TDELocale::setMainCatalogue("tdeio_help"); TDEInstance ins("meinproc"); TDEGlobal::locale(); diff --git a/kinit/tdelauncher_main.cpp b/kinit/tdelauncher_main.cpp index 54ab94d54..059496c0c 100644 --- a/kinit/tdelauncher_main.cpp +++ b/kinit/tdelauncher_main.cpp @@ -72,7 +72,7 @@ extern "C" KDE_EXPORT int kdemain( int argc, char**argv ) putenv(strdup("SESSION_MANAGER=")); // Allow the locale to initialize properly - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); diff --git a/libtdescreensaver/main.cpp b/libtdescreensaver/main.cpp index 9f908b81a..cd8e2d392 100644 --- a/libtdescreensaver/main.cpp +++ b/libtdescreensaver/main.cpp @@ -93,7 +93,7 @@ typedef WId Window; KDE_EXPORT int main(int argc, char *argv[]) { - KLocale::setMainCatalogue("libtdescreensaver"); + TDELocale::setMainCatalogue("libtdescreensaver"); TDECmdLineArgs::init(argc, argv, kss_applicationName, kss_description, kss_version); TDECmdLineArgs::addCmdLineOptions(options); diff --git a/tdecore/kaboutdata.cpp b/tdecore/kaboutdata.cpp index 2add13022..fd7cce483 100644 --- a/tdecore/kaboutdata.cpp +++ b/tdecore/kaboutdata.cpp @@ -267,7 +267,7 @@ TDEAboutData::internalProgramName() const } // KCrash should call as few things as possible and should avoid e.g. malloc() -// because it may deadlock. Since i18n() needs it, when KLocale is available +// because it may deadlock. Since i18n() needs it, when TDELocale is available // the i18n() call will be done here in advance. void TDEAboutData::translateInternalProgramName() const diff --git a/tdecore/kcalendarsystem.cpp b/tdecore/kcalendarsystem.cpp index ab38dc4ca..39331e170 100644 --- a/tdecore/kcalendarsystem.cpp +++ b/tdecore/kcalendarsystem.cpp @@ -30,10 +30,10 @@ class KCalendarSystemPrivate { public: - const KLocale * locale; + const TDELocale * locale; }; -KCalendarSystem::KCalendarSystem(const KLocale * locale) +KCalendarSystem::KCalendarSystem(const TDELocale * locale) : d(new KCalendarSystemPrivate) { d->locale = locale; @@ -44,7 +44,7 @@ KCalendarSystem::~KCalendarSystem() delete d; } -const KLocale * KCalendarSystem::locale() const +const TDELocale * KCalendarSystem::locale() const { if ( d->locale ) return d->locale; diff --git a/tdecore/kcalendarsystem.h b/tdecore/kcalendarsystem.h index bd936336c..bd3fbe4ff 100644 --- a/tdecore/kcalendarsystem.h +++ b/tdecore/kcalendarsystem.h @@ -25,7 +25,7 @@ #include #include "tdelibs_export.h" -class KLocale; +class TDELocale; class KCalendarSystemPrivate; @@ -47,7 +47,7 @@ public: * * @param locale It will use this locale for translations, 0 means global. */ - KCalendarSystem(const KLocale * locale = 0); + KCalendarSystem(const TDELocale * locale = 0); /** * Descructor. @@ -348,7 +348,7 @@ protected: * Gets the locale the calendar uses for translations. Set in * the constructor. */ - const KLocale * locale() const; + const TDELocale * locale() const; private: KCalendarSystemPrivate * d; diff --git a/tdecore/kcalendarsystemfactory.cpp b/tdecore/kcalendarsystemfactory.cpp index 723873497..d3bd166e0 100644 --- a/tdecore/kcalendarsystemfactory.cpp +++ b/tdecore/kcalendarsystemfactory.cpp @@ -41,7 +41,7 @@ KCalendarSystemFactory::~KCalendarSystemFactory() } KCalendarSystem *KCalendarSystemFactory::create( const TQString &calType, - const KLocale * locale ) + const TDELocale * locale ) { if ( calType == "hebrew" ) return new KCalendarSystemHebrew(locale); diff --git a/tdecore/kcalendarsystemfactory.h b/tdecore/kcalendarsystemfactory.h index 6ebba1573..96aef1c4a 100644 --- a/tdecore/kcalendarsystemfactory.h +++ b/tdecore/kcalendarsystemfactory.h @@ -26,7 +26,7 @@ #include "tdelibs_export.h" class KCalendarSystem; -class KLocale; +class TDELocale; /** * Factory class for calendar types @@ -50,7 +50,7 @@ public: * @return a KCalendarSystem object */ static KCalendarSystem *create (const TQString & calType = TQString::fromLatin1("gregorian"), - const KLocale * locale = 0); + const TDELocale * locale = 0); /** * Gets list of names of supported calendar systems diff --git a/tdecore/kcalendarsystemgregorian.cpp b/tdecore/kcalendarsystemgregorian.cpp index 38ee1014a..ead1aca66 100644 --- a/tdecore/kcalendarsystemgregorian.cpp +++ b/tdecore/kcalendarsystemgregorian.cpp @@ -29,7 +29,7 @@ #include "kcalendarsystemgregorian.h" -KCalendarSystemGregorian::KCalendarSystemGregorian(const KLocale * locale) +KCalendarSystemGregorian::KCalendarSystemGregorian(const TDELocale * locale) : KCalendarSystem(locale) { } diff --git a/tdecore/kcalendarsystemgregorian.h b/tdecore/kcalendarsystemgregorian.h index 98fd10e90..34c9ecde3 100644 --- a/tdecore/kcalendarsystemgregorian.h +++ b/tdecore/kcalendarsystemgregorian.h @@ -35,7 +35,7 @@ class KCalendarSystemGregorianPrivate; * The Gregorian calender is the most used calendar today. The first year in * the calendar is set to the birth of Christ. * - * @see KLocale,KCalendarSystem,KCalendarSystemFactory + * @see TDELocale,KCalendarSystem,KCalendarSystemFactory * * @author Carlos Moro * @since 3.2 @@ -44,7 +44,7 @@ class TDECORE_EXPORT KCalendarSystemGregorian: public KCalendarSystem { public: /** Constructor. Just like KCalendarSystem::KCalendarSystem(). */ - KCalendarSystemGregorian (const KLocale * locale = 0); + KCalendarSystemGregorian (const TDELocale * locale = 0); virtual ~KCalendarSystemGregorian (); virtual int year (const TQDate & date) const; diff --git a/tdecore/kcalendarsystemhebrew.cpp b/tdecore/kcalendarsystemhebrew.cpp index 2824445bb..a0db927f4 100644 --- a/tdecore/kcalendarsystemhebrew.cpp +++ b/tdecore/kcalendarsystemhebrew.cpp @@ -259,7 +259,7 @@ static bool is_leap_year(int year) } // Ok -KCalendarSystemHebrew::KCalendarSystemHebrew(const KLocale * locale) +KCalendarSystemHebrew::KCalendarSystemHebrew(const TDELocale * locale) : KCalendarSystem(locale) { } diff --git a/tdecore/kcalendarsystemhebrew.h b/tdecore/kcalendarsystemhebrew.h index 728954c58..1482c1a80 100644 --- a/tdecore/kcalendarsystemhebrew.h +++ b/tdecore/kcalendarsystemhebrew.h @@ -37,7 +37,7 @@ class KCalendarSystemHebrewPrivate; * The Hebrew calendar is the traditional Islamic calendar used in the Midle * East. * - * @see KLocale,KCalendarSystem,KCalendarSystemFactory + * @see TDELocale,KCalendarSystem,KCalendarSystemFactory * * @author Hans Petter Bieker * @since 3.2 @@ -46,7 +46,7 @@ class TDECORE_EXPORT KCalendarSystemHebrew : public KCalendarSystem { public: /** Constructor. Just like KCalendarSystem::KCalendarSystem(). */ - KCalendarSystemHebrew(const KLocale * locale = 0); + KCalendarSystemHebrew(const TDELocale * locale = 0); virtual ~KCalendarSystemHebrew(); virtual int year (const TQDate & date) const; diff --git a/tdecore/kcalendarsystemhijri.cpp b/tdecore/kcalendarsystemhijri.cpp index a6487060e..8c9fac471 100644 --- a/tdecore/kcalendarsystemhijri.cpp +++ b/tdecore/kcalendarsystemhijri.cpp @@ -178,7 +178,7 @@ static void gregorianToHijri(const TQDate & date, int * pYear, int * pMonth, *pDay = islamic.getDay(); } -KCalendarSystemHijri::KCalendarSystemHijri(const KLocale * locale) +KCalendarSystemHijri::KCalendarSystemHijri(const TDELocale * locale) : KCalendarSystem(locale) { } diff --git a/tdecore/kcalendarsystemhijri.h b/tdecore/kcalendarsystemhijri.h index 444f938c7..0ba1e52df 100644 --- a/tdecore/kcalendarsystemhijri.h +++ b/tdecore/kcalendarsystemhijri.h @@ -35,7 +35,7 @@ class KCalendarSystemHijriPrivate; * The Hijri calendar is the traditional Islamic calendar used in the Midle * East. * - * @see KLocale,KCalendarSystem,KCalendarSystemFactory + * @see TDELocale,KCalendarSystem,KCalendarSystemFactory * * @author Carlos Moro * @since 3.2 @@ -44,7 +44,7 @@ class TDECORE_EXPORT KCalendarSystemHijri : public KCalendarSystem { public: /** Constructor. Just like KCalendarSystem::KCalendarSystem(). */ - KCalendarSystemHijri(const KLocale * locale = 0); + KCalendarSystemHijri(const TDELocale * locale = 0); virtual ~KCalendarSystemHijri(); virtual int year (const TQDate & date) const; diff --git a/tdecore/kcalendarsystemjalali.cpp b/tdecore/kcalendarsystemjalali.cpp index 29798a1dd..559ebb39c 100644 --- a/tdecore/kcalendarsystemjalali.cpp +++ b/tdecore/kcalendarsystemjalali.cpp @@ -200,7 +200,7 @@ static int hndays(int m,int y) } -KCalendarSystemJalali::KCalendarSystemJalali(const KLocale * locale) +KCalendarSystemJalali::KCalendarSystemJalali(const TDELocale * locale) : KCalendarSystem(locale) { } diff --git a/tdecore/kcalendarsystemjalali.h b/tdecore/kcalendarsystemjalali.h index e5dd56681..8f9c4ddb9 100644 --- a/tdecore/kcalendarsystemjalali.h +++ b/tdecore/kcalendarsystemjalali.h @@ -37,7 +37,7 @@ class TDECORE_EXPORT KCalendarSystemJalali : public KCalendarSystem { public: /** Constructor. Just like KCalendarSystem::KCalendarSystem(). */ - KCalendarSystemJalali(const KLocale * locale = 0); + KCalendarSystemJalali(const TDELocale * locale = 0); virtual ~KCalendarSystemJalali(); diff --git a/tdecore/kcatalogue.h b/tdecore/kcatalogue.h index be918789d..04ba4594b 100644 --- a/tdecore/kcatalogue.h +++ b/tdecore/kcatalogue.h @@ -31,7 +31,7 @@ class KCataloguePrivate; * This class abstracts a gettext message catalog. It will take care of * opening the file and reading the catalog. * - * @see KLocale + * @see TDELocale */ //REVISED: hausmann class TDECORE_EXPORT KCatalogue diff --git a/tdecore/kdebug.areas b/tdecore/kdebug.areas index bb4990920..67a027c88 100644 --- a/tdecore/kdebug.areas +++ b/tdecore/kdebug.areas @@ -17,7 +17,7 @@ 170 tdecore (KNetwork socket) 171 tdecore (KSocks) 172 tdecore (TDEStartupInfo) -173 tdecore (KLocale) +173 tdecore (TDELocale) 174 tdecore (KProcIO) 175 tdecore (TDEProcess) 176 tdecore (KWin) diff --git a/tdecore/kdebugrc b/tdecore/kdebugrc index 6bbca7d66..c697da031 100644 --- a/tdecore/kdebugrc +++ b/tdecore/kdebugrc @@ -48,7 +48,7 @@ InfoOutput=4 [172] InfoOutput=4 -# KLocale debug info off +# TDELocale debug info off [173] InfoOutput=4 diff --git a/tdecore/kglobal.cpp b/tdecore/kglobal.cpp index 7b492b5a8..9d39c0d6c 100644 --- a/tdecore/kglobal.cpp +++ b/tdecore/kglobal.cpp @@ -101,7 +101,7 @@ TDEInstance *TDEGlobal::instance() return _instance; } -KLocale *TDEGlobal::locale() +TDELocale *TDEGlobal::locale() { if( _locale == 0 ) { if (!_instance) @@ -109,7 +109,7 @@ KLocale *TDEGlobal::locale() kglobal_init(); // will set _locale if it works - otherwise 0 is returned - KLocale::initInstance(); + TDELocale::initInstance(); if( _instance->aboutData()) _instance->aboutData()->translateInternalProgramName(); } @@ -217,7 +217,7 @@ TDEGlobal::deleteStaticDeleters() KStringDict *TDEGlobal::_stringDict = 0; TDEInstance *TDEGlobal::_instance = 0; TDEInstance *TDEGlobal::_activeInstance = 0; -KLocale *TDEGlobal::_locale = 0; +TDELocale *TDEGlobal::_locale = 0; KCharsets *TDEGlobal::_charsets = 0; KStaticDeleterList *TDEGlobal::_staticDeleters = 0; diff --git a/tdecore/kglobal.h b/tdecore/kglobal.h index 4b727b281..90548d8b5 100644 --- a/tdecore/kglobal.h +++ b/tdecore/kglobal.h @@ -27,7 +27,7 @@ class TDESharedConfig; class KIconLoader; class TDEHardwareDevices; class TDEGlobalNetworkManager; -class KLocale; +class TDELocale; class TDEStandardDirs; class KStaticDeleterBase; class KStaticDeleterList; @@ -95,7 +95,7 @@ public: * Returns the global locale object. * @return the global locale object */ - static KLocale *locale(); + static TDELocale *locale(); /** * The global charset manager. @@ -168,7 +168,7 @@ public: //private: static KStringDict *_stringDict; static TDEInstance *_instance; - static KLocale *_locale; + static TDELocale *_locale; static KCharsets *_charsets; static KStaticDeleterList *_staticDeleters; diff --git a/tdecore/klocale.cpp b/tdecore/klocale.cpp index f7a3cf77a..3e169ba03 100644 --- a/tdecore/klocale.cpp +++ b/tdecore/klocale.cpp @@ -51,7 +51,7 @@ static const char * const SYSTEM_MESSAGES = "tdelibs"; static const char *maincatalogue = 0; -class KLocalePrivate +class TDELocalePrivate { public: int weekStartDay; @@ -65,7 +65,7 @@ public: TDEConfig * config; bool formatInited; int /*TQPrinter::PageSize*/ pageSize; - KLocale::MeasureSystem measureSystem; + TDELocale::MeasureSystem measureSystem; TQStringList langTwoAlpha; TDEConfig *languages; @@ -79,11 +79,11 @@ public: bool useMainCatalogue; }; -static KLocale *this_klocale = 0; +static TDELocale *this_klocale = 0; -KLocale::KLocale( const TQString & catalog, TDEConfig * config ) +TDELocale::TDELocale( const TQString & catalog, TDEConfig * config ) { - d = new KLocalePrivate; + d = new TDELocalePrivate; d->config = config; d->languages = 0; d->calendar = 0; @@ -103,7 +103,7 @@ KLocale::KLocale( const TQString & catalog, TDEConfig * config ) initMainCatalogues(catalog); } -TQString KLocale::_initLanguage(TDEConfigBase *config) +TQString TDELocale::_initLanguage(TDEConfigBase *config) { if (this_klocale) { @@ -115,7 +115,7 @@ TQString KLocale::_initLanguage(TDEConfigBase *config) return TQString::null; } -void KLocale::initMainCatalogues(const TQString & catalog) +void TDELocale::initMainCatalogues(const TQString & catalog) { // Use the first non-null string. TQString mainCatalogue = catalog; @@ -128,7 +128,7 @@ void KLocale::initMainCatalogues(const TQString & catalog) } if (mainCatalogue.isEmpty()) { - kdDebug(173) << "KLocale instance created called without valid " + kdDebug(173) << "TDELocale instance created called without valid " << "catalog! Give an argument or call setMainCatalogue " << "before init" << endl; } @@ -144,7 +144,7 @@ void KLocale::initMainCatalogues(const TQString & catalog) } } -void KLocale::initLanguageList(TDEConfig * config, bool useEnv) +void TDELocale::initLanguageList(TDEConfig * config, bool useEnv) { TDEConfigGroupSaver saver(config, "Locale"); @@ -193,7 +193,7 @@ void KLocale::initLanguageList(TDEConfig * config, bool useEnv) setLanguage( languageList ); } -void KLocale::initPluralTypes() +void TDELocale::initPluralTypes() { for ( TQValueList::Iterator it = d->catalogues.begin(); it != d->catalogues.end(); @@ -206,7 +206,7 @@ void KLocale::initPluralTypes() } -int KLocale::pluralType( const TQString & language ) +int TDELocale::pluralType( const TQString & language ) { for ( TQValueList::ConstIterator it = d->catalogues.begin(); it != d->catalogues.end(); @@ -220,7 +220,7 @@ int KLocale::pluralType( const TQString & language ) return -1; } -int KLocale::pluralType( const KCatalogue& catalog ) +int TDELocale::pluralType( const KCatalogue& catalog ) { const char* pluralFormString = I18N_NOOP("_: Dear translator, please do not translate this string " @@ -285,28 +285,28 @@ int KLocale::pluralType( const KCatalogue& catalog ) } } -void KLocale::doFormatInit() const +void TDELocale::doFormatInit() const { if ( d->formatInited ) return; - KLocale * that = const_cast(this); + TDELocale * that = const_cast(this); that->initFormat(); d->formatInited = true; } -void KLocale::initFormat() +void TDELocale::initFormat() { TDEConfig *config = d->config; if (!config) config = TDEGlobal::instance()->config(); Q_ASSERT( config ); - kdDebug(173) << "KLocale::initFormat" << endl; + kdDebug(173) << "TDELocale::initFormat" << endl; // make sure the config files are read using the correct locale - // ### Why not add a TDEConfigBase::setLocale( const KLocale * )? + // ### Why not add a TDEConfigBase::setLocale( const TDELocale * )? // ### Then we could remove this hack - KLocale *lsave = TDEGlobal::_locale; + TDELocale *lsave = TDEGlobal::_locale; TDEGlobal::_locale = this; TDEConfigGroupSaver saver(config, "Locale"); @@ -388,7 +388,7 @@ void KLocale::initFormat() TDEGlobal::_locale = lsave; } -bool KLocale::setCountry(const TQString & country) +bool TDELocale::setCountry(const TQString & country) { // Check if the file exists too?? if ( country.isEmpty() ) @@ -401,7 +401,7 @@ bool KLocale::setCountry(const TQString & country) return true; } -TQString KLocale::catalogueFileName(const TQString & language, +TQString TDELocale::catalogueFileName(const TQString & language, const KCatalogue & catalog) { TQString path = TQString::fromLatin1("%1/LC_MESSAGES/%2.mo") @@ -415,7 +415,7 @@ TQString KLocale::catalogueFileName(const TQString & language, return fileName; } -bool KLocale::setLanguage(const TQString & language) +bool TDELocale::setLanguage(const TQString & language) { if ( d->languageList.contains( language ) ) { d->languageList.remove( language ); @@ -433,7 +433,7 @@ bool KLocale::setLanguage(const TQString & language) return true; // Maybe the mo-files for this language are empty, but in principle we can speak all languages } -bool KLocale::setLanguage(const TQStringList & languages) +bool TDELocale::setLanguage(const TQStringList & languages) { TQStringList languageList( languages ); // This list might contain @@ -484,7 +484,7 @@ bool KLocale::setLanguage(const TQStringList & languages) return true; // we found something. Maybe it's only English, but we found something } -bool KLocale::isApplicationTranslatedInto( const TQString & language) +bool TDELocale::isApplicationTranslatedInto( const TQString & language) { if ( language.isEmpty() ) { return false; @@ -518,7 +518,7 @@ bool KLocale::isApplicationTranslatedInto( const TQString & language) return ! sAbsFileName.isEmpty(); } -void KLocale::splitLocale(const TQString & aStr, +void TDELocale::splitLocale(const TQString & aStr, TQString & language, TQString & country, TQString & chrset) @@ -551,17 +551,17 @@ void KLocale::splitLocale(const TQString & aStr, language = str; } -TQString KLocale::language() const +TQString TDELocale::language() const { return m_language; } -TQString KLocale::country() const +TQString TDELocale::country() const { return m_country; } -TQString KLocale::monthName(int i, bool shortName) const +TQString TDELocale::monthName(int i, bool shortName) const { if ( shortName ) switch ( i ) @@ -599,7 +599,7 @@ TQString KLocale::monthName(int i, bool shortName) const return TQString::null; } -TQString KLocale::monthNamePossessive(int i, bool shortName) const +TQString TDELocale::monthNamePossessive(int i, bool shortName) const { if ( shortName ) switch ( i ) @@ -637,12 +637,12 @@ TQString KLocale::monthNamePossessive(int i, bool shortName) const return TQString::null; } -TQString KLocale::weekDayName (int i, bool shortName) const +TQString TDELocale::weekDayName (int i, bool shortName) const { return calendar()->weekDayName(i, shortName); } -void KLocale::insertCatalogue( const TQString & catalog ) +void TDELocale::insertCatalogue( const TQString & catalog ) { if ( !d->catalogNames.contains( catalog) ) { d->catalogNames.append( catalog ); @@ -650,7 +650,7 @@ void KLocale::insertCatalogue( const TQString & catalog ) updateCatalogues( ); // evaluate the changed list and generate the neccessary KCatalog objects } -void KLocale::updateCatalogues( ) +void TDELocale::updateCatalogues( ) { // some changes have occured. Maybe we have learned or forgotten some languages. // Maybe the language precedence has changed. @@ -691,7 +691,7 @@ void KLocale::updateCatalogues( ) -void KLocale::removeCatalogue(const TQString &catalog) +void TDELocale::removeCatalogue(const TQString &catalog) { if ( d->catalogNames.contains( catalog )) { d->catalogNames.remove( catalog ); @@ -700,7 +700,7 @@ void KLocale::removeCatalogue(const TQString &catalog) } } -void KLocale::setActiveCatalogue(const TQString &catalog) +void TDELocale::setActiveCatalogue(const TQString &catalog) { if ( d->catalogNames.contains( catalog ) ) { d->catalogNames.remove( catalog ); @@ -709,7 +709,7 @@ void KLocale::setActiveCatalogue(const TQString &catalog) } } -KLocale::~KLocale() +TDELocale::~TDELocale() { delete d->calendar; delete d->languages; @@ -717,7 +717,7 @@ KLocale::~KLocale() d = 0L; } -TQString KLocale::translate_priv(const char *msgid, +TQString TDELocale::translate_priv(const char *msgid, const char *fallback, const char **translated, int* pluralType ) const @@ -727,7 +727,7 @@ TQString KLocale::translate_priv(const char *msgid, } if (!msgid || !msgid[0]) { - kdWarning() << "KLocale: trying to look up \"\" in catalog. " + kdWarning() << "TDELocale: trying to look up \"\" in catalog. " << "Fix the program" << endl; return TQString::null; } @@ -766,16 +766,16 @@ TQString KLocale::translate_priv(const char *msgid, return TQString::fromUtf8( fallback ); } -TQString KLocale::translate(const char* msgid) const +TQString TDELocale::translate(const char* msgid) const { return translate_priv(msgid, msgid); } -TQString KLocale::translate( const char *index, const char *fallback) const +TQString TDELocale::translate( const char *index, const char *fallback) const { if (!index || !index[0] || !fallback || !fallback[0]) { - kdDebug(173) << "KLocale: trying to look up \"\" in catalog. " + kdDebug(173) << "TDELocale: trying to look up \"\" in catalog. " << "Fix the program" << endl; return TQString::null; } @@ -807,12 +807,12 @@ static TQString put_n_in(const TQString &orig, unsigned long n) kdError() << "translation of \"" << singular << "\" doesn't contain " << x << " different plural forms as expected\n"; \ return TQString( "BROKEN TRANSLATION %1" ).arg( singular ); } -TQString KLocale::translate( const char *singular, const char *plural, +TQString TDELocale::translate( const char *singular, const char *plural, unsigned long n ) const { if (!singular || !singular[0] || !plural || !plural[0]) { - kdWarning() << "KLocale: trying to look up \"\" in catalog. " + kdWarning() << "TDELocale: trying to look up \"\" in catalog. " << "Fix the program" << endl; return TQString::null; } @@ -960,11 +960,11 @@ TQString KLocale::translate( const char *singular, const char *plural, return TQString::null; } -TQString KLocale::translateQt( const char *context, const char *source, +TQString TDELocale::translateQt( const char *context, const char *source, const char *message) const { if (!source || !source[0]) { - kdWarning() << "KLocale: trying to look up \"\" in catalog. " + kdWarning() << "TDELocale: trying to look up \"\" in catalog. " << "Fix the program" << endl; return TQString::null; } @@ -1004,97 +1004,97 @@ TQString KLocale::translateQt( const char *context, const char *source, return TQString::null; } -bool KLocale::nounDeclension() const +bool TDELocale::nounDeclension() const { doFormatInit(); return d->nounDeclension; } -bool KLocale::dateMonthNamePossessive() const +bool TDELocale::dateMonthNamePossessive() const { doFormatInit(); return d->dateMonthNamePossessive; } -int KLocale::weekStartDay() const +int TDELocale::weekStartDay() const { doFormatInit(); return d->weekStartDay; } -bool KLocale::weekStartsMonday() const //deprecated +bool TDELocale::weekStartsMonday() const //deprecated { doFormatInit(); return (d->weekStartDay==1); } -TQString KLocale::decimalSymbol() const +TQString TDELocale::decimalSymbol() const { doFormatInit(); return m_decimalSymbol; } -TQString KLocale::thousandsSeparator() const +TQString TDELocale::thousandsSeparator() const { doFormatInit(); return m_thousandsSeparator; } -TQString KLocale::currencySymbol() const +TQString TDELocale::currencySymbol() const { doFormatInit(); return m_currencySymbol; } -TQString KLocale::monetaryDecimalSymbol() const +TQString TDELocale::monetaryDecimalSymbol() const { doFormatInit(); return m_monetaryDecimalSymbol; } -TQString KLocale::monetaryThousandsSeparator() const +TQString TDELocale::monetaryThousandsSeparator() const { doFormatInit(); return m_monetaryThousandsSeparator; } -TQString KLocale::positiveSign() const +TQString TDELocale::positiveSign() const { doFormatInit(); return m_positiveSign; } -TQString KLocale::negativeSign() const +TQString TDELocale::negativeSign() const { doFormatInit(); return m_negativeSign; } -int KLocale::fracDigits() const +int TDELocale::fracDigits() const { doFormatInit(); return m_fracDigits; } -bool KLocale::positivePrefixCurrencySymbol() const +bool TDELocale::positivePrefixCurrencySymbol() const { doFormatInit(); return m_positivePrefixCurrencySymbol; } -bool KLocale::negativePrefixCurrencySymbol() const +bool TDELocale::negativePrefixCurrencySymbol() const { doFormatInit(); return m_negativePrefixCurrencySymbol; } -KLocale::SignPosition KLocale::positiveMonetarySignPosition() const +TDELocale::SignPosition TDELocale::positiveMonetarySignPosition() const { doFormatInit(); return m_positiveMonetarySignPosition; } -KLocale::SignPosition KLocale::negativeMonetarySignPosition() const +TDELocale::SignPosition TDELocale::negativeMonetarySignPosition() const { doFormatInit(); return m_negativeMonetarySignPosition; @@ -1127,7 +1127,7 @@ static void _insertSeparator(TQString &str, const TQString &separator, str = mainPart + fracPart; } -TQString KLocale::formatMoney(double num, +TQString TDELocale::formatMoney(double num, const TQString & symbol, int precision) const { @@ -1188,24 +1188,24 @@ TQString KLocale::formatMoney(double num, return res; } -TQString KLocale::formatMoney(const TQString &numStr) const +TQString TDELocale::formatMoney(const TQString &numStr) const { return formatMoney(numStr.toDouble()); } -TQString KLocale::formatNumber(double num, int precision) const +TQString TDELocale::formatNumber(double num, int precision) const { if (precision == -1) precision = 2; // no need to round since TQString::number does this for us return formatNumber(TQString::number(num, 'f', precision), false, 0); } -TQString KLocale::formatLong(long num) const +TQString TDELocale::formatLong(long num) const { return formatNumber((double)num, 0); } -TQString KLocale::formatNumber(const TQString &numStr) const +TQString TDELocale::formatNumber(const TQString &numStr) const { return formatNumber(numStr, true, 2); } @@ -1301,7 +1301,7 @@ static void _round(TQString &str, int precision) if (precision == 0) str = str.section('.', 0, 0); } -TQString KLocale::formatNumber(const TQString &numStr, bool round, +TQString TDELocale::formatNumber(const TQString &numStr, bool round, int precision) const { TQString tmpString = numStr; @@ -1335,7 +1335,7 @@ TQString KLocale::formatNumber(const TQString &numStr, bool round, return mantString + expString; } -TQString KLocale::formatDate(const TQDate &pDate, bool shortFormat) const +TQString TDELocale::formatDate(const TQDate &pDate, bool shortFormat) const { const TQString rst = shortFormat?dateFormatShort():dateFormat(); @@ -1410,12 +1410,12 @@ TQString KLocale::formatDate(const TQDate &pDate, bool shortFormat) const return buffer; } -void KLocale::setMainCatalogue(const char *catalog) +void TDELocale::setMainCatalogue(const char *catalog) { maincatalogue = catalog; } -double KLocale::readNumber(const TQString &_str, bool * ok) const +double TDELocale::readNumber(const TQString &_str, bool * ok) const { TQString str = _str.stripWhiteSpace(); bool neg = str.find(negativeSign()) == 0; @@ -1480,7 +1480,7 @@ double KLocale::readNumber(const TQString &_str, bool * ok) const return tot.toDouble(ok); } -double KLocale::readMoney(const TQString &_str, bool * ok) const +double TDELocale::readMoney(const TQString &_str, bool * ok) const { TQString str = _str.stripWhiteSpace(); bool neg = false; @@ -1594,7 +1594,7 @@ static int readInt(const TQString &str, uint &pos) return result; } -TQDate KLocale::readDate(const TQString &intstr, bool* ok) const +TQDate TDELocale::readDate(const TQString &intstr, bool* ok) const { TQDate date; date = readDate(intstr, ShortFormat, ok); @@ -1602,15 +1602,15 @@ TQDate KLocale::readDate(const TQString &intstr, bool* ok) const return readDate(intstr, NormalFormat, ok); } -TQDate KLocale::readDate(const TQString &intstr, ReadDateFlags flags, bool* ok) const +TQDate TDELocale::readDate(const TQString &intstr, ReadDateFlags flags, bool* ok) const { TQString fmt = ((flags & ShortFormat) ? dateFormatShort() : dateFormat()).simplifyWhiteSpace(); return readDate( intstr, fmt, ok ); } -TQDate KLocale::readDate(const TQString &intstr, const TQString &fmt, bool* ok) const +TQDate TDELocale::readDate(const TQString &intstr, const TQString &fmt, bool* ok) const { - //kdDebug() << "KLocale::readDate intstr=" << intstr << " fmt=" << fmt << endl; + //kdDebug() << "TDELocale::readDate intstr=" << intstr << " fmt=" << fmt << endl; TQString str = intstr.simplifyWhiteSpace().lower(); int day = -1, month = -1; // allow the year to be omitted if not in the format @@ -1722,7 +1722,7 @@ TQDate KLocale::readDate(const TQString &intstr, const TQString &fmt, bool* ok) error = true; } - //kdDebug(173) << "KLocale::readDate day=" << day << " month=" << month << " year=" << year << endl; + //kdDebug(173) << "TDELocale::readDate day=" << day << " month=" << month << " year=" << year << endl; if ( year != -1 && month != -1 && day != -1 && !error) { if (ok) *ok = true; @@ -1739,7 +1739,7 @@ TQDate KLocale::readDate(const TQString &intstr, const TQString &fmt, bool* ok) } } -TQTime KLocale::readTime(const TQString &intstr, bool *ok) const +TQTime TDELocale::readTime(const TQString &intstr, bool *ok) const { TQTime _time; _time = readTime(intstr, WithSeconds, ok); @@ -1747,7 +1747,7 @@ TQTime KLocale::readTime(const TQString &intstr, bool *ok) const return readTime(intstr, WithoutSeconds, ok); } -TQTime KLocale::readTime(const TQString &intstr, ReadTimeFlags flags, bool *ok) const +TQTime TDELocale::readTime(const TQString &intstr, ReadTimeFlags flags, bool *ok) const { TQString str = intstr.simplifyWhiteSpace().lower(); TQString Format = timeFormat().simplifyWhiteSpace(); @@ -1855,12 +1855,12 @@ TQTime KLocale::readTime(const TQString &intstr, ReadTimeFlags flags, bool *ok) } //BIC: merge with below -TQString KLocale::formatTime(const TQTime &pTime, bool includeSecs) const +TQString TDELocale::formatTime(const TQTime &pTime, bool includeSecs) const { return formatTime( pTime, includeSecs, false ); } -TQString KLocale::formatTime(const TQTime &pTime, bool includeSecs, bool isDuration) const +TQString TDELocale::formatTime(const TQTime &pTime, bool includeSecs, bool isDuration) const { const TQString rst = timeFormat(); @@ -1946,7 +1946,7 @@ TQString KLocale::formatTime(const TQTime &pTime, bool includeSecs, bool isDurat return ret; } -bool KLocale::use12Clock() const +bool TDELocale::use12Clock() const { if ((timeFormat().contains(TQString::fromLatin1("%I")) > 0) || (timeFormat().contains(TQString::fromLatin1("%l")) > 0)) @@ -1955,17 +1955,17 @@ bool KLocale::use12Clock() const return false; } -TQString KLocale::languages() const +TQString TDELocale::languages() const { return d->languageList.join( TQString::fromLatin1(":") ); } -TQStringList KLocale::languageList() const +TQStringList TDELocale::languageList() const { return d->languageList; } -TQString KLocale::formatDateTime(const TQDateTime &pDateTime, +TQString TDELocale::formatDateTime(const TQDateTime &pDateTime, bool shortFormat, bool includeSeconds) const { @@ -1976,7 +1976,7 @@ TQString KLocale::formatDateTime(const TQDateTime &pDateTime, TQString i18n(const char* text) { - register KLocale *instance = TDEGlobal::locale(); + register TDELocale *instance = TDEGlobal::locale(); if (instance) return instance->translate(text); return TQString::fromUtf8(text); @@ -1984,7 +1984,7 @@ TQString i18n(const char* text) TQString i18n(const char* index, const char *text) { - register KLocale *instance = TDEGlobal::locale(); + register TDELocale *instance = TDEGlobal::locale(); if (instance) return instance->translate(index, text); return TQString::fromUtf8(text); @@ -1992,7 +1992,7 @@ TQString i18n(const char* index, const char *text) TQString i18n(const char* singular, const char* plural, unsigned long n) { - register KLocale *instance = TDEGlobal::locale(); + register TDELocale *instance = TDEGlobal::locale(); if (instance) return instance->translate(singular, plural, n); if (n == 1) @@ -2001,23 +2001,23 @@ TQString i18n(const char* singular, const char* plural, unsigned long n) return put_n_in(TQString::fromUtf8(plural), n); } -void KLocale::initInstance() +void TDELocale::initInstance() { if (TDEGlobal::_locale) return; TDEInstance *app = TDEGlobal::instance(); if (app) { - TDEGlobal::_locale = new KLocale(TQString::fromLatin1(app->instanceName())); + TDEGlobal::_locale = new TDELocale(TQString::fromLatin1(app->instanceName())); // only do this for the global instance TQTextCodec::setCodecForLocale(TDEGlobal::_locale->codecForEncoding()); } else - kdDebug(173) << "no app name available using KLocale - nothing to do\n"; + kdDebug(173) << "no app name available using TDELocale - nothing to do\n"; } -TQString KLocale::langLookup(const TQString &fname, const char *rtype) +TQString TDELocale::langLookup(const TQString &fname, const char *rtype) { TQStringList search; @@ -2049,12 +2049,12 @@ TQString KLocale::langLookup(const TQString &fname, const char *rtype) return TQString::null; } -bool KLocale::useDefaultLanguage() const +bool TDELocale::useDefaultLanguage() const { return language() == defaultLanguage(); } -void KLocale::initEncoding(TDEConfig *) +void TDELocale::initEncoding(TDEConfig *) { const int mibDefault = 4; // ISO 8859-1 @@ -2070,65 +2070,65 @@ void KLocale::initEncoding(TDEConfig *) Q_ASSERT( d->codecForEncoding ); } -void KLocale::initFileNameEncoding(TDEConfig *) +void TDELocale::initFileNameEncoding(TDEConfig *) { // If the following environment variable is set, assume all filenames // are in UTF-8 regardless of the current C locale. d->utf8FileEncoding = getenv("TDE_UTF8_FILENAMES") != 0; if (d->utf8FileEncoding) { - TQFile::setEncodingFunction(KLocale::encodeFileNameUTF8); - TQFile::setDecodingFunction(KLocale::decodeFileNameUTF8); + TQFile::setEncodingFunction(TDELocale::encodeFileNameUTF8); + TQFile::setDecodingFunction(TDELocale::decodeFileNameUTF8); } // Otherwise, stay with QFile's default filename encoding functions // which, on Unix platforms, use the locale's codec. } #ifdef USE_QT3 -TQCString KLocale::encodeFileNameUTF8( const TQString & fileName ) +TQCString TDELocale::encodeFileNameUTF8( const TQString & fileName ) #endif // USE_QT3 #ifdef USE_QT4 -QByteArray KLocale::encodeFileNameUTF8( const QString & fileName ) +QByteArray TDELocale::encodeFileNameUTF8( const QString & fileName ) #endif // USE_QT4 { return TQString(fileName).utf8(); } #ifdef USE_QT3 -TQString KLocale::decodeFileNameUTF8( const TQCString & localFileName ) +TQString TDELocale::decodeFileNameUTF8( const TQCString & localFileName ) #endif // USE_QT3 #ifdef USE_QT4 -QString KLocale::decodeFileNameUTF8( const QByteArray & localFileName ) +QString TDELocale::decodeFileNameUTF8( const QByteArray & localFileName ) #endif // USE_QT4 { return TQString::fromUtf8(localFileName); } -void KLocale::setDateFormat(const TQString & format) +void TDELocale::setDateFormat(const TQString & format) { doFormatInit(); m_dateFormat = format.stripWhiteSpace(); } -void KLocale::setDateFormatShort(const TQString & format) +void TDELocale::setDateFormatShort(const TQString & format) { doFormatInit(); m_dateFormatShort = format.stripWhiteSpace(); } -void KLocale::setDateMonthNamePossessive(bool possessive) +void TDELocale::setDateMonthNamePossessive(bool possessive) { doFormatInit(); d->dateMonthNamePossessive = possessive; } -void KLocale::setTimeFormat(const TQString & format) +void TDELocale::setTimeFormat(const TQString & format) { doFormatInit(); m_timeFormat = format.stripWhiteSpace(); } -void KLocale::setWeekStartsMonday(bool start) //deprecated +void TDELocale::setWeekStartsMonday(bool start) //deprecated { doFormatInit(); if (start) @@ -2137,7 +2137,7 @@ void KLocale::setWeekStartsMonday(bool start) //deprecated d->weekStartDay = 7; } -void KLocale::setWeekStartDay(int day) +void TDELocale::setWeekStartDay(int day) { doFormatInit(); if (day>7 || day<1) @@ -2146,134 +2146,134 @@ void KLocale::setWeekStartDay(int day) d->weekStartDay = day; } -TQString KLocale::dateFormat() const +TQString TDELocale::dateFormat() const { doFormatInit(); return m_dateFormat; } -TQString KLocale::dateFormatShort() const +TQString TDELocale::dateFormatShort() const { doFormatInit(); return m_dateFormatShort; } -TQString KLocale::timeFormat() const +TQString TDELocale::timeFormat() const { doFormatInit(); return m_timeFormat; } -void KLocale::setDecimalSymbol(const TQString & symbol) +void TDELocale::setDecimalSymbol(const TQString & symbol) { doFormatInit(); m_decimalSymbol = symbol.stripWhiteSpace(); } -void KLocale::setThousandsSeparator(const TQString & separator) +void TDELocale::setThousandsSeparator(const TQString & separator) { doFormatInit(); // allow spaces here m_thousandsSeparator = separator; } -void KLocale::setPositiveSign(const TQString & sign) +void TDELocale::setPositiveSign(const TQString & sign) { doFormatInit(); m_positiveSign = sign.stripWhiteSpace(); } -void KLocale::setNegativeSign(const TQString & sign) +void TDELocale::setNegativeSign(const TQString & sign) { doFormatInit(); m_negativeSign = sign.stripWhiteSpace(); } -void KLocale::setPositiveMonetarySignPosition(SignPosition signpos) +void TDELocale::setPositiveMonetarySignPosition(SignPosition signpos) { doFormatInit(); m_positiveMonetarySignPosition = signpos; } -void KLocale::setNegativeMonetarySignPosition(SignPosition signpos) +void TDELocale::setNegativeMonetarySignPosition(SignPosition signpos) { doFormatInit(); m_negativeMonetarySignPosition = signpos; } -void KLocale::setPositivePrefixCurrencySymbol(bool prefix) +void TDELocale::setPositivePrefixCurrencySymbol(bool prefix) { doFormatInit(); m_positivePrefixCurrencySymbol = prefix; } -void KLocale::setNegativePrefixCurrencySymbol(bool prefix) +void TDELocale::setNegativePrefixCurrencySymbol(bool prefix) { doFormatInit(); m_negativePrefixCurrencySymbol = prefix; } -void KLocale::setFracDigits(int digits) +void TDELocale::setFracDigits(int digits) { doFormatInit(); m_fracDigits = digits; } -void KLocale::setMonetaryThousandsSeparator(const TQString & separator) +void TDELocale::setMonetaryThousandsSeparator(const TQString & separator) { doFormatInit(); // allow spaces here m_monetaryThousandsSeparator = separator; } -void KLocale::setMonetaryDecimalSymbol(const TQString & symbol) +void TDELocale::setMonetaryDecimalSymbol(const TQString & symbol) { doFormatInit(); m_monetaryDecimalSymbol = symbol.stripWhiteSpace(); } -void KLocale::setCurrencySymbol(const TQString & symbol) +void TDELocale::setCurrencySymbol(const TQString & symbol) { doFormatInit(); m_currencySymbol = symbol.stripWhiteSpace(); } -int KLocale::pageSize() const +int TDELocale::pageSize() const { doFormatInit(); return d->pageSize; } -void KLocale::setPageSize(int pageSize) +void TDELocale::setPageSize(int pageSize) { // #### check if it's in range?? doFormatInit(); d->pageSize = pageSize; } -KLocale::MeasureSystem KLocale::measureSystem() const +TDELocale::MeasureSystem TDELocale::measureSystem() const { doFormatInit(); return d->measureSystem; } -void KLocale::setMeasureSystem(MeasureSystem value) +void TDELocale::setMeasureSystem(MeasureSystem value) { doFormatInit(); d->measureSystem = value; } -TQString KLocale::defaultLanguage() +TQString TDELocale::defaultLanguage() { return TQString::fromLatin1("en_US"); } -TQString KLocale::defaultCountry() +TQString TDELocale::defaultCountry() { return TQString::fromLatin1("C"); } -const char * KLocale::encoding() const +const char * TDELocale::encoding() const { #ifdef Q_WS_WIN if (0==qstrcmp("System", codecForEncoding()->name())) @@ -2290,24 +2290,24 @@ const char * KLocale::encoding() const return codecForEncoding()->name(); } -int KLocale::encodingMib() const +int TDELocale::encodingMib() const { return codecForEncoding()->mibEnum(); } -int KLocale::fileEncodingMib() const +int TDELocale::fileEncodingMib() const { if (d->utf8FileEncoding) return 106; return codecForEncoding()->mibEnum(); } -TQTextCodec * KLocale::codecForEncoding() const +TQTextCodec * TDELocale::codecForEncoding() const { return d->codecForEncoding; } -bool KLocale::setEncoding(int mibEnum) +bool TDELocale::setEncoding(int mibEnum) { TQTextCodec * codec = TQTextCodec::codecForMib(mibEnum); if (codec) @@ -2316,7 +2316,7 @@ bool KLocale::setEncoding(int mibEnum) return codec != 0; } -TQStringList KLocale::languagesTwoAlpha() const +TQStringList TDELocale::languagesTwoAlpha() const { if (d->langTwoAlpha.count()) return d->langTwoAlpha; @@ -2356,7 +2356,7 @@ TQStringList KLocale::languagesTwoAlpha() const return result; } -TQStringList KLocale::allLanguagesTwoAlpha() const +TQStringList TDELocale::allLanguagesTwoAlpha() const { if (!d->languages) d->languages = new TDEConfig("all_languages", true, false, "locale"); @@ -2364,7 +2364,7 @@ TQStringList KLocale::allLanguagesTwoAlpha() const return d->languages->groupList(); } -TQString KLocale::twoAlphaToLanguageName(const TQString &code) const +TQString TDELocale::twoAlphaToLanguageName(const TQString &code) const { if (!d->languages) d->languages = new TDEConfig("all_languages", true, false, "locale"); @@ -2377,7 +2377,7 @@ TQString KLocale::twoAlphaToLanguageName(const TQString &code) const return d->languages->readEntry("Name"); } -TQStringList KLocale::allCountriesTwoAlpha() const +TQStringList TDELocale::allCountriesTwoAlpha() const { TQStringList countries; TQStringList paths = TDEGlobal::dirs()->findAllResources("locale", "l10n/*/entry.desktop"); @@ -2391,14 +2391,14 @@ TQStringList KLocale::allCountriesTwoAlpha() const return countries; } -TQString KLocale::twoAlphaToCountryName(const TQString &code) const +TQString TDELocale::twoAlphaToCountryName(const TQString &code) const { TDEConfig cfg("l10n/"+code.lower()+"/entry.desktop", true, false, "locale"); cfg.setGroup("KCM Locale"); return cfg.readEntry("Name"); } -void KLocale::setCalendar(const TQString & calType) +void TDELocale::setCalendar(const TQString & calType) { doFormatInit(); @@ -2408,14 +2408,14 @@ void KLocale::setCalendar(const TQString & calType) d->calendar = 0; } -TQString KLocale::calendarType() const +TQString TDELocale::calendarType() const { doFormatInit(); return d->calendarType; } -const KCalendarSystem * KLocale::calendar() const +const KCalendarSystem * TDELocale::calendar() const { doFormatInit(); @@ -2426,14 +2426,14 @@ const KCalendarSystem * KLocale::calendar() const return d->calendar; } -KLocale::KLocale(const KLocale & rhs) +TDELocale::TDELocale(const TDELocale & rhs) { - d = new KLocalePrivate; + d = new TDELocalePrivate; *this = rhs; } -KLocale & KLocale::operator=(const KLocale & rhs) +TDELocale & TDELocale::operator=(const TDELocale & rhs) { // Numbers and money m_decimalSymbol = rhs.m_decimalSymbol; @@ -2465,8 +2465,8 @@ KLocale & KLocale::operator=(const KLocale & rhs) return *this; } -bool KLocale::setCharset(const TQString & ) { return true; } -TQString KLocale::charset() const { return TQString::fromLatin1("UTF-8"); } +bool TDELocale::setCharset(const TQString & ) { return true; } +TQString TDELocale::charset() const { return TQString::fromLatin1("UTF-8"); } // KDE4: remove #if 0 diff --git a/tdecore/klocale.h b/tdecore/klocale.h index 7a8e05e98..65a21d13d 100644 --- a/tdecore/klocale.h +++ b/tdecore/klocale.h @@ -34,7 +34,7 @@ class TQDateTime; class TDEGlobal; class TDEConfig; class TDEConfigBase; -class KLocalePrivate; +class TDELocalePrivate; class KCatalogue; class KCalendarSystem; @@ -44,7 +44,7 @@ class KCalendarSystem; #ifndef I18N_NOOP /** - * \relates KLocale + * \relates TDELocale * I18N_NOOP marks a string to be translated without translating it. * Do not use this unless you know you need it. * http://developer.kde.org/documentation/other/developer-faq.html#q2.11.2 @@ -54,7 +54,7 @@ class KCalendarSystem; #ifndef I18N_NOOP2 /** - * \relates KLocale + * \relates TDELocale * If the string is too ambiguous to be translated well to a non-english * language, use this instead of I18N_NOOP to separate lookup string and english. * \warning You need to call i18n( comment, stringVar ) later on, not just i18n( stringVar ). @@ -64,7 +64,7 @@ class KCalendarSystem; #endif /** - * \relates KLocale + * \relates TDELocale * i18n is the function that does everything you need to translate * a string. You just wrap around every user visible string a i18n * call to get a TQString with the string in the user's preferred @@ -78,7 +78,7 @@ class KCalendarSystem; TDECORE_EXPORT TQString i18n(const char *text); /** - * \relates KLocale + * \relates TDELocale * If the string is too ambiguous to be translated well to a non-english * language, use this form of i18n to separate lookup string and english * text. @@ -87,7 +87,7 @@ TDECORE_EXPORT TQString i18n(const char *text); TDECORE_EXPORT TQString i18n(const char *comment, const char *text); /** - * \relates KLocale + * \relates TDELocale * If you want to handle plural forms, use this form of i18n. * @param singular the singular form of the word, for example "file". * @param plural the plural form of the word. Must contain a "%n" that will @@ -100,7 +100,7 @@ TDECORE_EXPORT TQString i18n(const char *comment, const char *text); TDECORE_EXPORT TQString i18n(const char *singular, const char *plural, unsigned long n); /** - * \relates KLocale + * \relates TDELocale * Qt3's uic generates i18n( "msg", "comment" ) calls which conflict * with our i18n method. We use uic -tr tr2i18n to redirect * to the right i18n() function @@ -111,52 +111,52 @@ inline TQString tr2i18n(const char* message, const char* =0) { /** * - * KLocale provides support for country specific stuff like + * TDELocale provides support for country specific stuff like * the national language. * - * KLocale supports translating, as well as specifying the format + * TDELocale supports translating, as well as specifying the format * for numbers, currency, time, and date. * * @author Stephan Kulow , Preston Brown , * Hans Petter Bieker , Lukas Tinkl * @short class for supporting locale settings and national language */ -class TDECORE_EXPORT KLocale +class TDECORE_EXPORT TDELocale { friend class TDEGlobal; // for initInstance() public: /** - * Constructs a KLocale with the given catalog name. + * Constructs a TDELocale with the given catalog name. * The constructor looks for an entry Locale/Language in the * configuration file. * If no config file is specified, it will also look for languages * using the environment variables (TDE_LANG, LC_MESSAGES, LC_ALL, LANG), - * as well as the global configuration file. If KLocale is not able to use + * as well as the global configuration file. If TDELocale is not able to use * any of the specified languages, the default language (en_US) will be * used. * * If you specify a configuration file, it has to be valid until - * the KLocale object is destroyed. + * the TDELocale object is destroyed. * * @param catalog The name of the main language file * @param config The configuration file to use. */ - KLocale( const TQString& catalog, TDEConfig *config = 0 ); + TDELocale( const TQString& catalog, TDEConfig *config = 0 ); /** * Copy constructor. */ - KLocale( const KLocale & rhs ); + TDELocale( const TDELocale & rhs ); /** * Assignment operator. */ - KLocale& operator= ( const KLocale & rhs ); + TDELocale& operator= ( const TDELocale & rhs ); /** * Destructor. */ - ~KLocale(); + ~TDELocale(); /** * Translates the string into the corresponding string in @@ -877,14 +877,14 @@ public: * * Please use setWeekStartDay instead. * - * Changes how KLocale defines the first day in week. + * Changes how TDELocale defines the first day in week. * * @param start True if Monday is the first day in the week */ void setWeekStartsMonday(bool start) KDE_DEPRECATED; //### remove for KDE 4.0 /** - * Changes how KLocale defines the first day in week. + * Changes how TDELocale defines the first day in week. * * @param day first day of the week (Monday=1..Sunday=7) as integer * @since 3.1 @@ -1105,10 +1105,10 @@ public: TQString & charset); /** - * Use this as main catalog for *all* KLocales, if not the appname + * Use this as main catalog for *all* TDELocales, if not the appname * will be used. This function is best to be the very first instruction * in your program's main function as it only has an effect before the - * first KLocale object is created. + * first TDELocale object is created. * * @param catalog Catalogue to override all other main catalogues. */ @@ -1173,7 +1173,7 @@ private: protected: /** - * @internal Creates a KLocale object for TDEGlobal and inits the locale + * @internal Creates a TDELocale object for TDEGlobal and inits the locale * pointer. */ static void initInstance(); @@ -1344,7 +1344,7 @@ private: bool m_positivePrefixCurrencySymbol; bool m_negativePrefixCurrencySymbol; - KLocalePrivate *d; + TDELocalePrivate *d; }; #endif diff --git a/tdecore/kstandarddirs.h b/tdecore/kstandarddirs.h index c07b9c682..29a5a9627 100644 --- a/tdecore/kstandarddirs.h +++ b/tdecore/kstandarddirs.h @@ -77,7 +77,7 @@ class TDEStandardDirsPrivate; * @li html - HTML documentation. * @li icon - Icons, see KIconLoader. * @li lib - Libraries. - * @li locale - Translation files for KLocale. + * @li locale - Translation files for TDELocale. * @li mime - Mime types. * @li module - Module (dynamically loaded library). * @li qtplugins - Qt plugins (dynamically loaded objects for Qt) diff --git a/tdecore/tde-config.cpp.cmake b/tdecore/tde-config.cpp.cmake index 18d2a373f..b633aa2d4 100644 --- a/tdecore/tde-config.cpp.cmake +++ b/tdecore/tde-config.cpp.cmake @@ -113,7 +113,7 @@ void printResult(const TQString &s) int main(int argc, char **argv) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDEAboutData about("tde-config", "tde-config", "1.0", description, TDEAboutData::License_GPL, "(C) 2000 Stephan Kulow"); TDECmdLineArgs::init( argc, argv, &about); @@ -176,7 +176,7 @@ int main(int argc, char **argv) "kcfg", I18N_NOOP("Configuration description files"), "lib", I18N_NOOP("Libraries"), "include", I18N_NOOP("Includes/Headers"), - "locale", I18N_NOOP("Translation files for KLocale"), + "locale", I18N_NOOP("Translation files for TDELocale"), "mime", I18N_NOOP("Mime types"), "module", I18N_NOOP("Loadable modules"), "qtplugins", I18N_NOOP("Qt plugins"), diff --git a/tdecore/tde-config.cpp.in b/tdecore/tde-config.cpp.in index 3d6ba7850..fdcc5ba74 100644 --- a/tdecore/tde-config.cpp.in +++ b/tdecore/tde-config.cpp.in @@ -113,7 +113,7 @@ void printResult(const TQString &s) int main(int argc, char **argv) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDEAboutData about("tde-config", "tde-config", "1.0", description, TDEAboutData::License_GPL, "(C) 2000 Stephan Kulow"); TDECmdLineArgs::init( argc, argv, &about); @@ -176,7 +176,7 @@ int main(int argc, char **argv) "kcfg", I18N_NOOP("Configuration description files"), "lib", I18N_NOOP("Libraries"), "include", I18N_NOOP("Includes/Headers"), - "locale", I18N_NOOP("Translation files for KLocale"), + "locale", I18N_NOOP("Translation files for TDELocale"), "mime", I18N_NOOP("Mime types"), "module", I18N_NOOP("Loadable modules"), "qtplugins", I18N_NOOP("Qt plugins"), diff --git a/tdecore/tdeconfigbackend.cpp b/tdecore/tdeconfigbackend.cpp index e48bd8cc9..77260e326 100644 --- a/tdecore/tdeconfigbackend.cpp +++ b/tdecore/tdeconfigbackend.cpp @@ -385,7 +385,7 @@ bool TDEConfigINIBackEnd::parseConfigFiles() TQString bootLanguage; if (useKDEGlobals && localeString.isEmpty() && !TDEGlobal::_locale) { // Boot strap language - bootLanguage = KLocale::_initLanguage(pConfig); + bootLanguage = TDELocale::_initLanguage(pConfig); setLocaleString(bootLanguage.utf8()); } @@ -415,7 +415,7 @@ bool TDEConfigINIBackEnd::parseConfigFiles() TQString currentLanguage; if (!bootLanguage.isEmpty()) { - currentLanguage = KLocale::_initLanguage(pConfig); + currentLanguage = TDELocale::_initLanguage(pConfig); // If the file changed the language, we need to read the file again // with the new language setting. if (bootLanguage != currentLanguage) @@ -730,9 +730,9 @@ tqWarning("SIGBUS while reading %s", rFile.name().latin1()); pConfig->putData(aEntryKey, aEntry, false); } } - // Look up translations using KLocale + // Look up translations using TDELocale // https://launchpad.net/distros/ubuntu/+spec/langpacks-desktopfiles-kde - // This calls KLocale up to 10 times for each config file (and each TDEConfig has up to 4 files) + // This calls TDELocale up to 10 times for each config file (and each TDEConfig has up to 4 files) // so I'll see how much of a performance hit it is // it also only acts on the last group in a file // Ideas: only translate most important fields, only translate "Desktop Entry" files, @@ -741,7 +741,7 @@ tqWarning("SIGBUS while reading %s", rFile.name().latin1()); TQFile file("file.txt"); if (foundGettextDomain) { - KLocale locale(gettextDomain); + TDELocale locale(gettextDomain); TQString language = locale.language(); translateKey(locale, aCurrentGroup, TQCString("Name")); @@ -772,7 +772,7 @@ tqWarning("SIGBUS while reading %s", rFile.name().latin1()); #endif } -void TDEConfigINIBackEnd::translateKey(KLocale& locale, TQCString currentGroup, TQCString key) { +void TDEConfigINIBackEnd::translateKey(TDELocale& locale, TQCString currentGroup, TQCString key) { KEntryKey entryKey = KEntryKey(currentGroup, key); KEntry entry = pConfig->lookupData(entryKey); if (TQString(entry.mValue) != "") { diff --git a/tdecore/tdeconfigbackend.h b/tdecore/tdeconfigbackend.h index 916479643..05884cb7f 100644 --- a/tdecore/tdeconfigbackend.h +++ b/tdecore/tdeconfigbackend.h @@ -128,7 +128,7 @@ public: /** * Set the locale string that defines the current language. * @param _localeString the identifier of the language - * @see KLocale + * @see TDELocale */ void setLocaleString(const TQCString &_localeString) { localeString = _localeString; } @@ -252,9 +252,9 @@ protected: bool bGlobal = false, bool bDefault = false); // Kubuntu patch, 2006-08-03 - // looks up a key in with KLocale + // looks up a key in with TDELocale // see https://launchpad.net/distros/ubuntu/+spec/langpacks-desktopfiles-kde - void translateKey(KLocale& locale, TQCString currentGroup, TQCString key); + void translateKey(TDELocale& locale, TQCString currentGroup, TQCString key); /** * Writes configuration file back. diff --git a/tdecore/tdeconfigbase.cpp b/tdecore/tdeconfigbase.cpp index b00430f27..d2ecef888 100644 --- a/tdecore/tdeconfigbase.cpp +++ b/tdecore/tdeconfigbase.cpp @@ -66,7 +66,7 @@ void TDEConfigBase::setLocale() if (TDEGlobal::locale()) aLocaleString = TDEGlobal::locale()->language().utf8(); else - aLocaleString = KLocale::defaultLanguage().utf8(); + aLocaleString = TDELocale::defaultLanguage().utf8(); if (backEnd) backEnd->setLocaleString(aLocaleString); } diff --git a/tdecore/tests/kcalendartest.cpp b/tdecore/tests/kcalendartest.cpp index fef409d71..53ba63615 100644 --- a/tdecore/tests/kcalendartest.cpp +++ b/tdecore/tests/kcalendartest.cpp @@ -14,7 +14,7 @@ #include #include -class KLocale; +class TDELocale; void test(TQDate & date); @@ -81,7 +81,7 @@ int main(int argc, char **argv) { void test(TQDate & date) { - kdDebug() << "(KLocale) readDate" << endl; + kdDebug() << "(TDELocale) readDate" << endl; kdDebug() << "Created calendar: " << TDEGlobal::locale()->calendar()->calendarName() << endl; @@ -117,8 +117,8 @@ void test(TQDate & date) { kdDebug() << "It's week number " << TDEGlobal::locale()->calendar()->weekNumber(date) << endl; - kdDebug() << "(KLocale) Formatted date: " << TDEGlobal::locale()->formatDate(date) << endl; - kdDebug() << "(KLocale) Short formatted date: " << TDEGlobal::locale()->formatDate(date, true) << endl; + kdDebug() << "(TDELocale) Formatted date: " << TDEGlobal::locale()->formatDate(date) << endl; + kdDebug() << "(TDELocale) Short formatted date: " << TDEGlobal::locale()->formatDate(date, true) << endl; kdDebug() << "That month have : " << TDEGlobal::locale()->calendar()->daysInMonth(date) << " days" << endl; diff --git a/tdecore/tests/kcmdlineargstest.cpp b/tdecore/tests/kcmdlineargstest.cpp index d04a21bff..940a45153 100644 --- a/tdecore/tests/kcmdlineargstest.cpp +++ b/tdecore/tests/kcmdlineargstest.cpp @@ -24,7 +24,7 @@ static KCmdLineOptions options[] = int main(int argc, char *argv[]) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDECmdLineArgs::init( argc, argv, "testapp", description, version); TDECmdLineArgs::addCmdLineOptions( options ); // Add my own options. diff --git a/tdecore/tests/klocaletest.cpp b/tdecore/tests/klocaletest.cpp index bcb7bc9e8..1d0ca7aba 100644 --- a/tdecore/tests/klocaletest.cpp +++ b/tdecore/tests/klocaletest.cpp @@ -51,7 +51,7 @@ bool checkDate(TQString txt, TQDate a, TQDate b) Test::Test( TQWidget *parent, const char *name ) : TQWidget( parent, name ) { - setCaption("Testing KLocale"); + setCaption("Testing TDELocale"); TQWidget *d = tqApp->desktop(); setGeometry((d->width()-320)>>1, (d->height()-160)>>1, 420, 420); @@ -99,7 +99,7 @@ void Test::createFields() int main( int argc, char ** argv ) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDEApplication a( argc, argv, "klocaletest" ); TDEGlobal::locale()->setLanguage(TQString::fromLatin1("en_US")); @@ -142,7 +142,7 @@ int main( int argc, char ** argv ) tqDebug( "%s", TQString::number( num, 'g', 12 ).latin1() ); // warning this is the only way to see all decimals check("readNumber(1.12345678912)",ok && num==1.12345678912?"yes":"no","yes"); // bug 95511 - KLocale locale(*TDEGlobal::locale()); + TDELocale locale(*TDEGlobal::locale()); locale.setCurrencySymbol("$$"); num = locale.readMoney("1,234,567.89$$", &ok); check("readMoney(1,234,567.89$$)",ok?"yes":"no","yes"); @@ -166,10 +166,10 @@ int main( int argc, char ** argv ) check("readTime(\"foo\")", (!ok && !time.isValid()) ? "invalid" : "valid", "invalid"); - time = TDEGlobal::locale()->readTime( "11:22:33", KLocale::WithoutSeconds, &ok ); + time = TDEGlobal::locale()->readTime( "11:22:33", TDELocale::WithoutSeconds, &ok ); check("readTime(\"11:22:33\", WithoutSeconds)", (!ok && !time.isValid()) ? "invalid" : "valid", "invalid"); - time = TDEGlobal::locale()->readTime( "11:22", KLocale::WithoutSeconds, &ok ); + time = TDEGlobal::locale()->readTime( "11:22", TDELocale::WithoutSeconds, &ok ); check("readTime(\"11:22\", WithoutSeconds)", (ok && time == TQTime(11, 22, 0)) ? "yes" : "no", "yes"); diff --git a/tdecore/tests/klocaletest.h b/tdecore/tests/klocaletest.h index 83f4f5cef..6634b6107 100644 --- a/tdecore/tests/klocaletest.h +++ b/tdecore/tests/klocaletest.h @@ -7,7 +7,7 @@ class TQLabel; -/** test: a small test program for KLocale +/** test: a small test program for TDELocale */ class Test : public TQWidget { diff --git a/tdeio/kssl/ksslutils.h b/tdeio/kssl/ksslutils.h index 4c087374f..58a817e83 100644 --- a/tdeio/kssl/ksslutils.h +++ b/tdeio/kssl/ksslutils.h @@ -41,7 +41,7 @@ class TQDateTime; #ifdef KSSL_HAVE_SSL // This functionality is missing in OpenSSL /** - * Convert an ASN1 UTCTIME value to a string. Uses KLocale settings. + * Convert an ASN1 UTCTIME value to a string. Uses TDELocale settings. * * @param tm the OpenSSL ASN1_UTCTIME pointer * @@ -51,7 +51,7 @@ class TQDateTime; KDE_EXPORT TQString ASN1_UTCTIME_QString(ASN1_UTCTIME *tm); /** - * Convert an ASN1 UTCTIME value to a TQDateTime. Uses KLocale settings. + * Convert an ASN1 UTCTIME value to a TQDateTime. Uses TDELocale settings. * * @param tm the OpenSSL ASN1_UTCTIME pointer * @param isGmt set to 1 if the date is set to GMT diff --git a/tdeio/misc/tdemailservice.cpp b/tdeio/misc/tdemailservice.cpp index 3f9b04feb..d1d6bb939 100644 --- a/tdeio/misc/tdemailservice.cpp +++ b/tdeio/misc/tdemailservice.cpp @@ -28,7 +28,7 @@ static const KCmdLineOptions options[] = int main( int argc, char **argv ) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDECmdLineArgs::init( argc, argv, "tdemailservice", I18N_NOOP("KMailService"), I18N_NOOP("Mail service"), "unknown" ); TDECmdLineArgs::addCmdLineOptions( options ); diff --git a/tdeio/misc/tdesendbugmail/main.cpp b/tdeio/misc/tdesendbugmail/main.cpp index 162e6ad5c..7df3a344a 100644 --- a/tdeio/misc/tdesendbugmail/main.cpp +++ b/tdeio/misc/tdesendbugmail/main.cpp @@ -58,7 +58,7 @@ void BugMailer::slotSend() { int main(int argc, char **argv) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDEAboutData d("tdesendbugmail", I18N_NOOP("KSendBugMail"), "1.0", I18N_NOOP("Sends a short bug report to submit@bugs.kde.org"), TDEAboutData::License_GPL, "(c) 2000 Stephan Kulow"); diff --git a/tdeio/misc/tdetelnetservice.cpp b/tdeio/misc/tdetelnetservice.cpp index 655a5b32a..a814b8e52 100644 --- a/tdeio/misc/tdetelnetservice.cpp +++ b/tdeio/misc/tdetelnetservice.cpp @@ -37,7 +37,7 @@ static const KCmdLineOptions options[] = int main(int argc, char **argv) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDECmdLineArgs::init(argc, argv, "tdetelnetservice", I18N_NOOP("telnet service"), I18N_NOOP("telnet protocol handler"), "unknown"); TDECmdLineArgs::addCmdLineOptions(options); diff --git a/tdeio/misc/uiserver.cpp b/tdeio/misc/uiserver.cpp index 6ba92a6a2..8a9c7f21e 100644 --- a/tdeio/misc/uiserver.cpp +++ b/tdeio/misc/uiserver.cpp @@ -1377,7 +1377,7 @@ UIServer* UIServer::createInstance() extern "C" KDE_EXPORT int kdemain(int argc, char **argv) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); // GS 5/2001 - I changed the name to "TDE" to make it look better // in the titles of dialogs which are displayed. TDEAboutData aboutdata("tdeio_uiserver", I18N_NOOP("TDE"), diff --git a/tdeio/tdefile/tests/kcustommenueditortest.cpp b/tdeio/tdefile/tests/kcustommenueditortest.cpp index df2c692f6..40a34b203 100644 --- a/tdeio/tdefile/tests/kcustommenueditortest.cpp +++ b/tdeio/tdefile/tests/kcustommenueditortest.cpp @@ -5,7 +5,7 @@ int main(int argc, char** argv) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDEApplication app(argc, argv, "KCustomMenuEditorTest"); KCustomMenuEditor editor(0); TDEConfig *cfg = new TDEConfig("kdesktop_custom_menu2"); diff --git a/tdeioslave/file/file.cc b/tdeioslave/file/file.cc index 61be4a521..477db8754 100644 --- a/tdeioslave/file/file.cc +++ b/tdeioslave/file/file.cc @@ -112,7 +112,7 @@ extern "C" { KDE_EXPORT int kdemain(int argc, char **argv); } int kdemain( int argc, char **argv ) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDEInstance instance( "tdeio_file" ); ( void ) TDEGlobal::locale(); diff --git a/tdeioslave/ftp/ftp.cc b/tdeioslave/ftp/ftp.cc index dfe0f338e..5b582d376 100644 --- a/tdeioslave/ftp/ftp.cc +++ b/tdeioslave/ftp/ftp.cc @@ -139,7 +139,7 @@ extern "C" { KDE_EXPORT int kdemain(int argc, char **argv); } int kdemain( int argc, char **argv ) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDEInstance instance( "tdeio_ftp" ); ( void ) TDEGlobal::locale(); @@ -1926,7 +1926,7 @@ bool Ftp::ftpReadDir(FtpEntry& de) // Get day number (always second field) tmptr->tm_mday = atoi( p_date_2 ); // Get month from first field - // NOTE : no, we don't want to use KLocale here + // NOTE : no, we don't want to use TDELocale here // It seems all FTP servers use the English way //kdDebug(7102) << "Looking for month " << p_date_1 << endl; static const char * s_months[12] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", diff --git a/tdeioslave/http/http.cc b/tdeioslave/http/http.cc index 32ee24ad3..2dd5cc143 100644 --- a/tdeioslave/http/http.cc +++ b/tdeioslave/http/http.cc @@ -98,7 +98,7 @@ extern "C" { int kdemain( int argc, char **argv ) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDEInstance instance( "tdeio_http" ); ( void ) TDEGlobal::locale(); diff --git a/tdeioslave/http/http_cache_cleaner.cpp b/tdeioslave/http/http_cache_cleaner.cpp index b4d235c1c..991dbc0aa 100644 --- a/tdeioslave/http/http_cache_cleaner.cpp +++ b/tdeioslave/http/http_cache_cleaner.cpp @@ -189,7 +189,7 @@ void scanDirectory(FileInfoList &fileEntries, const TQString &name, const TQStri extern "C" KDE_EXPORT int kdemain(int argc, char **argv) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDECmdLineArgs::init( argc, argv, appName, I18N_NOOP("TDE HTTP cache maintenance tool"), description, version, true); diff --git a/tdeioslave/http/kcookiejar/main.cpp b/tdeioslave/http/kcookiejar/main.cpp index e24112888..6542dc5af 100644 --- a/tdeioslave/http/kcookiejar/main.cpp +++ b/tdeioslave/http/kcookiejar/main.cpp @@ -42,7 +42,7 @@ static const KCmdLineOptions options[] = extern "C" KDE_EXPORT int kdemain(int argc, char *argv[]) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDECmdLineArgs::init(argc, argv, "kcookiejar", I18N_NOOP("HTTP cookie daemon"), description, version); diff --git a/tdeprint/ChangeLog b/tdeprint/ChangeLog index cc18bd7eb..da61b9dfd 100644 --- a/tdeprint/ChangeLog +++ b/tdeprint/ChangeLog @@ -59,7 +59,7 @@ Since 2.2 release, Michael Goffioul printers (to not confuse the CUPS daemon for example) * Improved how the default printer is selected in print dialog to work in any cases - * General: make use of KLocale::pageSize() to determine the default + * General: make use of TDELocale::pageSize() to determine the default page size (used for example for pseudo printers and classes) * Wizard: fix buffer overflow when adding a remote LPD queue having a lot of jobs waiting diff --git a/tdeprint/marginwidget.cpp b/tdeprint/marginwidget.cpp index 3a809e06b..3ec1872f2 100644 --- a/tdeprint/marginwidget.cpp +++ b/tdeprint/marginwidget.cpp @@ -206,7 +206,7 @@ MarginWidget::MarginWidget(TQWidget *parent, const char* name, bool allowMetricU if ( allowMetricUnit ) { - int mode = (TDEGlobal::locale()->measureSystem() == KLocale::Metric ? 2 : 1); + int mode = (TDEGlobal::locale()->measureSystem() == TDELocale::Metric ? 2 : 1); m_top->setMode(mode); m_bottom->setMode(mode); m_left->setMode(mode); diff --git a/tdeui/kbugreport.cpp b/tdeui/kbugreport.cpp index a6267b039..efee22366 100644 --- a/tdeui/kbugreport.cpp +++ b/tdeui/kbugreport.cpp @@ -460,7 +460,7 @@ TQString KBugReport::text() const bodyText += line; } - if (severity == TQString::fromLatin1("i18n") && TDEGlobal::locale()->language() != KLocale::defaultLanguage()) { + if (severity == TQString::fromLatin1("i18n") && TDEGlobal::locale()->language() != TDELocale::defaultLanguage()) { // Case 1 : i18n bug TQString package = TQString::fromLatin1("i18n_%1").arg(TDEGlobal::locale()->language()); package = package.replace(TQString::fromLatin1("_"), TQString::fromLatin1("-")); diff --git a/tdeui/kdatewidget.cpp b/tdeui/kdatewidget.cpp index cb690b0ea..2f240a256 100644 --- a/tdeui/kdatewidget.cpp +++ b/tdeui/kdatewidget.cpp @@ -72,7 +72,7 @@ KDateWidget::KDateWidget( TQDate date, TQWidget *parent, void KDateWidget::init() { d = new KDateWidgetPrivate; - KLocale *locale = TDEGlobal::locale(); + TDELocale *locale = TDEGlobal::locale(); TQHBoxLayout *layout = new TQHBoxLayout(this, 0, KDialog::spacingHint()); layout->setAutoAdd(true); d->m_day = new KDateWidgetSpinBox(1, 1, this); @@ -96,7 +96,7 @@ void KDateWidget::init() void KDateWidget::init(const TQDate& date) { d = new KDateWidgetPrivate; - KLocale *locale = TDEGlobal::locale(); + TDELocale *locale = TDEGlobal::locale(); TQHBoxLayout *layout = new TQHBoxLayout(this, 0, KDialog::spacingHint()); layout->setAutoAdd(true); d->m_day = new KDateWidgetSpinBox(1, 1, this); diff --git a/tdeui/knuminput.h b/tdeui/knuminput.h index 9b7121e79..4716d8051 100644 --- a/tdeui/knuminput.h +++ b/tdeui/knuminput.h @@ -863,7 +863,7 @@ public: bool acceptLocalizedNumbers() const; /** Sets whether to use and accept localized numbers as returned by - KLocale::formatNumber() */ + TDELocale::formatNumber() */ virtual void setAcceptLocalizedNumbers( bool accept ); /** Sets a new range for the spin box values. Note that @p lower, @p diff --git a/tdeui/knumvalidator.cpp b/tdeui/knumvalidator.cpp index 89f0ca88c..ce5c66842 100644 --- a/tdeui/knumvalidator.cpp +++ b/tdeui/knumvalidator.cpp @@ -326,7 +326,7 @@ void KDoubleValidator::setAcceptLocalizedNumbers( bool accept ) { TQValidator::State KDoubleValidator::validate( TQString & input, int & p ) const { TQString s = input; if ( acceptLocalizedNumbers() ) { - KLocale * l = TDEGlobal::locale(); + TDELocale * l = TDEGlobal::locale(); // ok, we have to re-format the number to have: // 1. decimalSymbol == '.' // 2. negativeSign == '-' diff --git a/tdeui/knumvalidator.h b/tdeui/knumvalidator.h index 8fa2ea76e..5c7b31484 100644 --- a/tdeui/knumvalidator.h +++ b/tdeui/knumvalidator.h @@ -147,7 +147,7 @@ class TDEUI_EXPORT KFloatValidator : public TQValidator { virtual double top () const; /** * Sets the validator to be locale aware if @p is true. In this case, the - * character KLocale::decimalSymbol() from the global locale is recognized + * character TDELocale::decimalSymbol() from the global locale is recognized * as decimal separator. */ void setAcceptLocalizedNumbers(bool b); @@ -169,8 +169,8 @@ class TDEUI_EXPORT KFloatValidator : public TQValidator { KDoubleValidator extends TQDoubleValidator to be locale-aware. That means that - subject to not being disabled - - KLocale::decimalSymbol(), KLocale::thousandsSeparator() - and KLocale::positiveSign() and KLocale::negativeSign() + TDELocale::decimalSymbol(), TDELocale::thousandsSeparator() + and TDELocale::positiveSign() and TDELocale::negativeSign() are respected. @author Marc Mutz diff --git a/tdeui/kswitchlanguagedialog.cpp b/tdeui/kswitchlanguagedialog.cpp index 57f1dee15..c9bb7552a 100644 --- a/tdeui/kswitchlanguagedialog.cpp +++ b/tdeui/kswitchlanguagedialog.cpp @@ -241,7 +241,7 @@ KSwitchLanguageDialogPrivate::KSwitchLanguageDialogPrivate( void KSwitchLanguageDialogPrivate::fillApplicationLanguages(KLanguageButton *button) { - KLocale *locale = TDEGlobal::locale(); + TDELocale *locale = TDEGlobal::locale(); TQStringList allLanguages = locale->allLanguagesTwoAlpha(); for ( TQStringList::ConstIterator it = allLanguages.begin(); it != allLanguages.end(); ++it ) { diff --git a/tdeui/tests/kcolordlgtest.cpp b/tdeui/tests/kcolordlgtest.cpp index 1a506cbc0..23c0b89ea 100644 --- a/tdeui/tests/kcolordlgtest.cpp +++ b/tdeui/tests/kcolordlgtest.cpp @@ -26,7 +26,7 @@ int main( int argc, char *argv[] ) { TQColor color; - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TQApplication::setColorMode( TQApplication::CustomColors ); TDEApplication a( argc, argv, "KColorDialogTest" ); TDEConfig aConfig; diff --git a/tdeui/tests/kdatepicktest.cpp b/tdeui/tests/kdatepicktest.cpp index da5e872e1..df8bc7013 100644 --- a/tdeui/tests/kdatepicktest.cpp +++ b/tdeui/tests/kdatepicktest.cpp @@ -5,7 +5,7 @@ int main(int argc, char** argv) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDEApplication app(argc, argv, "KDatePickertest"); KDatePicker picker; app.setMainWidget(&picker); diff --git a/tdeui/tests/kdatetimewidgettest.cpp b/tdeui/tests/kdatetimewidgettest.cpp index 55ba7cbea..9b158faf8 100644 --- a/tdeui/tests/kdatetimewidgettest.cpp +++ b/tdeui/tests/kdatetimewidgettest.cpp @@ -4,7 +4,7 @@ int main(int argc, char** argv) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDEApplication app(argc, argv, "KDateTimeWidgettest"); KDateTimeWidget dateTimeWidget; app.setMainWidget(&dateTimeWidget); diff --git a/tdeui/tests/kdatewidgettest.cpp b/tdeui/tests/kdatewidgettest.cpp index 6e1c8d504..16521da20 100644 --- a/tdeui/tests/kdatewidgettest.cpp +++ b/tdeui/tests/kdatewidgettest.cpp @@ -5,7 +5,7 @@ int main(int argc, char** argv) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDEApplication app(argc, argv, "KDateWidgettest"); KDateWidget dateWidget; app.setMainWidget(&dateWidget); diff --git a/tdeui/tests/ktimewidgettest.cpp b/tdeui/tests/ktimewidgettest.cpp index fe56c6df7..f4465fbf7 100644 --- a/tdeui/tests/ktimewidgettest.cpp +++ b/tdeui/tests/ktimewidgettest.cpp @@ -4,7 +4,7 @@ int main(int argc, char** argv) { - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); TDEApplication app(argc, argv, "KTimeWidgettest"); KTimeWidget timeWidget; app.setMainWidget(&timeWidget);