Rename KLocale to enhance compatibility with KDE4

pull/21/head
Timothy Pearson 12 years ago
parent 339bb51ad3
commit 6dea944252

@ -111,7 +111,7 @@ int KAddressBookApp::newInstance()
int main( int argc, char *argv[] ) int main( int argc, char *argv[] )
{ {
KLocale::setMainCatalogue( "kaddressbook" ); TDELocale::setMainCatalogue( "kaddressbook" );
TDECmdLineArgs::init( argc, argv, KABCore::createAboutData() ); TDECmdLineArgs::init( argc, argv, KABCore::createAboutData() );
TDECmdLineArgs::addCmdLineOptions( kaddressbook_options ); TDECmdLineArgs::addCmdLineOptions( kaddressbook_options );

@ -493,7 +493,7 @@ TQString AlarmListViewItem::alarmText(const KAEvent& event) const
*/ */
TQString AlarmListViewItem::alarmTimeText(const DateTime& dateTime) const TQString AlarmListViewItem::alarmTimeText(const DateTime& dateTime) const
{ {
KLocale* locale = TDEGlobal::locale(); TDELocale* locale = TDEGlobal::locale();
TQString dateTimeText = locale->formatDate(dateTime.date(), true); TQString dateTimeText = locale->formatDate(dateTime.date(), true);
if (!dateTime.isDateOnly()) if (!dateTime.isDateOnly())
{ {

@ -3028,7 +3028,7 @@ void ComposerPage::PhrasesTab::slotAddNewLanguage( const TQString& lang )
{ {
mPhraseLanguageCombo->setCurrentItem( mPhraseLanguageCombo->setCurrentItem(
mPhraseLanguageCombo->insertLanguage( lang ) ); mPhraseLanguageCombo->insertLanguage( lang ) );
KLocale locale("kmail"); TDELocale locale("kmail");
locale.setLanguage( lang ); locale.setLanguage( lang );
mLanguageList.append( mLanguageList.append(
LanguageItem( lang, LanguageItem( lang,

@ -144,7 +144,7 @@ namespace KMail {
TQString dateString; TQString dateString;
if( printing ) { if( printing ) {
TQDateTime dateTime; TQDateTime dateTime;
KLocale * locale = TDEGlobal::locale(); TDELocale * locale = TDEGlobal::locale();
dateTime.setTime_t( message->date() ); dateTime.setTime_t( message->date() );
dateString = locale->formatDateTime( dateTime ); dateString = locale->formatDateTime( dateTime );
} else { } else {
@ -243,7 +243,7 @@ namespace KMail {
TQString dateString; TQString dateString;
if( printing ) { if( printing ) {
TQDateTime dateTime; TQDateTime dateTime;
KLocale* locale = TDEGlobal::locale(); TDELocale* locale = TDEGlobal::locale();
dateTime.setTime_t( message->date() ); dateTime.setTime_t( message->date() );
dateString = locale->formatDateTime( dateTime ); dateString = locale->formatDateTime( dateTime );
} }
@ -448,7 +448,7 @@ namespace KMail {
TQString dateString; TQString dateString;
if( printing ) { if( printing ) {
TQDateTime dateTime; TQDateTime dateTime;
KLocale* locale = TDEGlobal::locale(); TDELocale* locale = TDEGlobal::locale();
dateTime.setTime_t( message->date() ); dateTime.setTime_t( message->date() );
dateString = locale->formatDateTime( dateTime ); dateString = locale->formatDateTime( dateTime );
} }
@ -914,7 +914,7 @@ namespace KMail {
TQString dateString; TQString dateString;
if( printing ) { if( printing ) {
TQDateTime dateTime; TQDateTime dateTime;
KLocale * locale = TDEGlobal::locale(); TDELocale * locale = TDEGlobal::locale();
dateTime.setTime_t( message->date() ); dateTime.setTime_t( message->date() );
dateString = locale->formatDateTime( dateTime ); dateString = locale->formatDateTime( dateTime );
} else { } else {

@ -2821,7 +2821,7 @@ void KMComposeWin::slotAttachFileResult(TDEIO::Job *job)
partCharset = TQCString( ( *it ).url.fileEncoding().latin1() ); partCharset = TQCString( ( *it ).url.fileEncoding().latin1() );
} else { } else {
EncodingDetector ed; EncodingDetector ed;
KLocale *loc = TDEGlobal::locale(); TDELocale *loc = TDEGlobal::locale();
ed.setAutoDetectLanguage( EncodingDetector::scriptForLanguageCode ( loc->language() ) ); ed.setAutoDetectLanguage( EncodingDetector::scriptForLanguageCode ( loc->language() ) );
ed.analyze( (*it).data ); ed.analyze( (*it).data );
partCharset = ed.encoding(); partCharset = ed.encoding();

@ -250,7 +250,7 @@ void insertLibraryCataloguesAndIcons() {
"libkmime" "libkmime"
}; };
KLocale * l = TDEGlobal::locale(); TDELocale * l = TDEGlobal::locale();
KIconLoader * il = TDEGlobal::iconLoader(); KIconLoader * il = TDEGlobal::iconLoader();
for ( unsigned int i = 0 ; i < sizeof catalogues / sizeof *catalogues ; ++i ) { for ( unsigned int i = 0 ; i < sizeof catalogues / sizeof *catalogues ; ++i ) {
l->insertCatalogue( catalogues[i] ); l->insertCatalogue( catalogues[i] );

@ -694,7 +694,7 @@ void TemplateParser::processWithTemplate( const TQString &tmpl )
kdDebug() << "Command: DATEEN" << endl; kdDebug() << "Command: DATEEN" << endl;
i += strlen( "DATEEN" ); i += strlen( "DATEEN" );
TQDateTime date = TQDateTime::currentDateTime(); TQDateTime date = TQDateTime::currentDateTime();
KLocale locale( "C" ); TDELocale locale( "C" );
TQString str = locale.formatDate( date.date(), false ); TQString str = locale.formatDate( date.date(), false );
body.append( str ); body.append( str );
@ -723,7 +723,7 @@ void TemplateParser::processWithTemplate( const TQString &tmpl )
kdDebug() << "Command: TIMELONGEN" << endl; kdDebug() << "Command: TIMELONGEN" << endl;
i += strlen( "TIMELONGEN" ); i += strlen( "TIMELONGEN" );
TQDateTime date = TQDateTime::currentDateTime(); TQDateTime date = TQDateTime::currentDateTime();
KLocale locale( "C"); TDELocale locale( "C");
TQString str = locale.formatTime( date.time(), true ); TQString str = locale.formatTime( date.time(), true );
body.append( str ); body.append( str );
@ -747,7 +747,7 @@ void TemplateParser::processWithTemplate( const TQString &tmpl )
if ( mOrigMsg ) { if ( mOrigMsg ) {
TQDateTime date; TQDateTime date;
date.setTime_t( mOrigMsg->date() ); date.setTime_t( mOrigMsg->date() );
KLocale locale( "C"); TDELocale locale( "C");
TQString str = locale.formatDate( date.date(), false ); TQString str = locale.formatDate( date.date(), false );
body.append( str ); body.append( str );
} }
@ -788,7 +788,7 @@ void TemplateParser::processWithTemplate( const TQString &tmpl )
if ( mOrigMsg ) { if ( mOrigMsg ) {
TQDateTime date; TQDateTime date;
date.setTime_t( mOrigMsg->date() ); date.setTime_t( mOrigMsg->date() );
KLocale locale( "C"); TDELocale locale( "C");
TQString str = locale.formatTime( date.time(), true ); TQString str = locale.formatTime( date.time(), true );
body.append( str ); body.append( str );
} }

@ -28,7 +28,7 @@ static const KCmdLineOptions options[] =
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
KLocale::setMainCatalogue("kmailcvt"); TDELocale::setMainCatalogue("kmailcvt");
TDEAboutData aboutData( "kmailcvt", I18N_NOOP("KMailCVT"), TDEAboutData aboutData( "kmailcvt", I18N_NOOP("KMailCVT"),
"3", I18N_NOOP("KMail Import Filters"), TDEAboutData::License_GPL_V2, "3", I18N_NOOP("KMail Import Filters"), TDEAboutData::License_GPL_V2,

@ -468,7 +468,7 @@ void KOEditorGeneralEvent::setDuration()
void KOEditorGeneralEvent::emitDateTimeStr() void KOEditorGeneralEvent::emitDateTimeStr()
{ {
KLocale *l = TDEGlobal::locale(); TDELocale *l = TDEGlobal::locale();
TQString from,to; TQString from,to;
if (mAlldayEventCheckbox->isChecked()) { if (mAlldayEventCheckbox->isChecked()) {

@ -565,7 +565,7 @@ void KOEditorGeneralTodo::completedChanged()
void KOEditorGeneralTodo::dateChanged() void KOEditorGeneralTodo::dateChanged()
{ {
KLocale *l = TDEGlobal::locale(); TDELocale *l = TDEGlobal::locale();
TQString dateTimeStr = ""; TQString dateTimeStr = "";
if ( mStartCheck->isChecked() ) { if ( mStartCheck->isChecked() ) {

@ -61,7 +61,7 @@ static const KCmdLineOptions options[] =
int main( int argc, char **argv ) int main( int argc, char **argv )
{ {
KLocale::setMainCatalogue( "korganizer" ); TDELocale::setMainCatalogue( "korganizer" );
TDEAboutData aboutData( "korgac", I18N_NOOP("KOrganizer Reminder Daemon"), TDEAboutData aboutData( "korgac", I18N_NOOP("KOrganizer Reminder Daemon"),
korgacVersion, I18N_NOOP("KOrganizer Reminder Daemon"), korgacVersion, I18N_NOOP("KOrganizer Reminder Daemon"),
TDEAboutData::License_GPL, TDEAboutData::License_GPL,

@ -138,7 +138,7 @@ void CalPrintYear::setDateRange( const TQDate& from, const TQDate& to )
void CalPrintYear::print( TQPainter &p, int width, int height ) void CalPrintYear::print( TQPainter &p, int width, int height )
{ {
const KCalendarSystem *calsys = calendarSystem(); const KCalendarSystem *calsys = calendarSystem();
KLocale *locale = TDEGlobal::locale(); TDELocale *locale = TDEGlobal::locale();
if ( !calsys || !locale ) return; if ( !calsys || !locale ) return;
TQRect headerBox( 0, 0, width, headerHeight() ); TQRect headerBox( 0, 0, width, headerHeight() );

@ -705,7 +705,7 @@ void CalPrintDay::print( TQPainter &p, int width, int height )
TQRect footerBox( 0, height - footerHeight(), width, footerHeight() ); TQRect footerBox( 0, height - footerHeight(), width, footerHeight() );
height -= footerHeight(); height -= footerHeight();
KLocale *local = TDEGlobal::locale(); TDELocale *local = TDEGlobal::locale();
do { do {
TQTime curStartTime( mStartTime ); TQTime curStartTime( mStartTime );
@ -915,7 +915,7 @@ void CalPrintWeek::print( TQPainter &p, int width, int height )
toWeek = mToDate.addDays( 6 - weekdayCol ); toWeek = mToDate.addDays( 6 - weekdayCol );
curWeek = fromWeek.addDays( 6 ); curWeek = fromWeek.addDays( 6 );
KLocale *local = TDEGlobal::locale(); TDELocale *local = TDEGlobal::locale();
TQString line1, line2, title; TQString line1, line2, title;
TQRect headerBox( 0, 0, width, headerHeight() ); TQRect headerBox( 0, 0, width, headerHeight() );

@ -927,7 +927,7 @@ void CalPrintPluginBase::drawDayBox( TQPainter &p, const TQDate &qd,
bool fullDate, bool printRecurDaily, bool printRecurWeekly ) bool fullDate, bool printRecurDaily, bool printRecurWeekly )
{ {
TQString dayNumStr; TQString dayNumStr;
const KLocale*local = TDEGlobal::locale(); const TDELocale*local = TDEGlobal::locale();
// This has to be localized // This has to be localized
if ( fullDate && mCalSys ) { if ( fullDate && mCalSys ) {
@ -1423,7 +1423,7 @@ void CalPrintPluginBase::drawTodo( int &count, Todo *todo, TQPainter &p,
TodoParentStart *r ) TodoParentStart *r )
{ {
TQString outStr; TQString outStr;
const KLocale *local = TDEGlobal::locale(); const TDELocale *local = TDEGlobal::locale();
TQRect rect; TQRect rect;
TodoParentStart startpt; TodoParentStart startpt;

@ -58,6 +58,6 @@ int main(int argc,char **argv)
kdDebug(5850) << "TQDateTime::currentTime(): " kdDebug(5850) << "TQDateTime::currentTime(): "
<< qtime.toString( TQt::ISODate ) << endl; << qtime.toString( TQt::ISODate ) << endl;
kdDebug(5850) << "KLocale::formatTime(): " kdDebug(5850) << "TDELocale::formatTime(): "
<< TDEGlobal::locale()->formatTime( qtime ) << endl; << TDEGlobal::locale()->formatTime( qtime ) << endl;
} }

@ -636,7 +636,7 @@ DateFormatter::qdateToTimeT(const TQDateTime& dt) const
TQString TQString
DateFormatter::fancy(time_t otime) const DateFormatter::fancy(time_t otime) const
{ {
KLocale *locale = TDEGlobal::locale(); TDELocale *locale = TDEGlobal::locale();
if ( otime <= 0 ) if ( otime <= 0 )
return i18n( "unknown" ); return i18n( "unknown" );
@ -691,13 +691,13 @@ DateFormatter::localized(time_t otime, bool shortFormat, bool includeSecs,
{ {
TQDateTime tmp; TQDateTime tmp;
TQString ret; TQString ret;
KLocale *locale = TDEGlobal::locale(); TDELocale *locale = TDEGlobal::locale();
tmp.setTime_t( otime ); tmp.setTime_t( otime );
if ( !localeLanguage.isEmpty() ) { if ( !localeLanguage.isEmpty() ) {
locale=new KLocale(localeLanguage); locale=new TDELocale(localeLanguage);
locale->setLanguage(localeLanguage); locale->setLanguage(localeLanguage);
locale->setCountry(localeLanguage); locale->setCountry(localeLanguage);
ret = locale->formatDateTime( tmp, shortFormat, includeSecs ); ret = locale->formatDateTime( tmp, shortFormat, includeSecs );

@ -223,8 +223,8 @@ namespace KMime {
* set format. * set format.
* @param otime time to format * @param otime time to format
* @param lang used <em>only</em> by the Localized format, sets the used language * @param lang used <em>only</em> by the Localized format, sets the used language
* @param shortFormat used <em>only</em> by the Localized format, is passed to KLocale::formatDateTime * @param shortFormat used <em>only</em> by the Localized format, is passed to TDELocale::formatDateTime
* @param includeSecs used <em>only</em> by the Localized format, is passed to KLocale::formatDateTime * @param includeSecs used <em>only</em> by the Localized format, is passed to TDELocale::formatDateTime
*/ */
TQString dateString(time_t otime, const TQString& lang = TQString(), TQString dateString(time_t otime, const TQString& lang = TQString(),
bool shortFormat = true, bool includeSecs=false) const; bool shortFormat = true, bool includeSecs=false) const;
@ -263,8 +263,8 @@ namespace KMime {
* @param time time to format * @param time time to format
* @param data is either the format when FormatType is Custom, or language * @param data is either the format when FormatType is Custom, or language
* when FormatType is Localized * when FormatType is Localized
* @param shortFormat used <em>only</em> by the Localized format, is passed to KLocale::formatDateTime * @param shortFormat used <em>only</em> by the Localized format, is passed to TDELocale::formatDateTime
* @param includeSecs used <em>only</em> by the Localized format, is passed to KLocale::formatDateTime * @param includeSecs used <em>only</em> by the Localized format, is passed to TDELocale::formatDateTime
*/ */
static TQString formatDate( DateFormatter::FormatType t, time_t time, static TQString formatDate( DateFormatter::FormatType t, time_t time,
const TQString& data = TQString(), const TQString& data = TQString(),
@ -275,8 +275,8 @@ namespace KMime {
* @param t specifies the FormatType to use * @param t specifies the FormatType to use
* @param data is either the format when FormatType is Custom, or language * @param data is either the format when FormatType is Custom, or language
* when FormatType is Localized * when FormatType is Localized
* @param shortFormat used <em>only</em> by the Localized format, is passed to KLocale::formatDateTime * @param shortFormat used <em>only</em> by the Localized format, is passed to TDELocale::formatDateTime
* @param includeSecs used <em>only</em> by the Localized format, is passed to KLocale::formatDateTime * @param includeSecs used <em>only</em> by the Localized format, is passed to TDELocale::formatDateTime
*/ */
static TQString formatCurrentDate( DateFormatter::FormatType t, static TQString formatCurrentDate( DateFormatter::FormatType t,
const TQString& data = TQString(), const TQString& data = TQString(),

@ -55,7 +55,7 @@ void BroadcastStatus::setStatusMsg( const TQString& message )
void BroadcastStatus::setStatusMsgWithTimestamp( const TQString& message ) void BroadcastStatus::setStatusMsgWithTimestamp( const TQString& message )
{ {
KLocale* locale = TDEGlobal::locale(); TDELocale* locale = TDEGlobal::locale();
setStatusMsg( i18n( "%1 is a time, %2 is a status message", "[%1] %2" ) setStatusMsg( i18n( "%1 is a time, %2 is a status message", "[%1] %2" )
.arg( locale->formatTime( TQTime::currentTime(), .arg( locale->formatTime( TQTime::currentTime(),
true /* with seconds */ ) ) true /* with seconds */ ) )

@ -53,7 +53,7 @@ public:
return Intermediate; return Intermediate;
bool ok = false; bool ok = false;
/*TQTime time =*/ TDEGlobal::locale()->readTime(str, KLocale::WithoutSeconds, &ok); /*TQTime time =*/ TDEGlobal::locale()->readTime(str, TDELocale::WithoutSeconds, &ok);
if ( ok ) if ( ok )
return Acceptable; return Acceptable;
// kdDebug(5300)<<"Time "<<str<<" not directly acceptable, trying military format "<<endl; // kdDebug(5300)<<"Time "<<str<<" not directly acceptable, trying military format "<<endl;
@ -91,7 +91,7 @@ public:
} }
virtual void fixup ( TQString & input ) const { virtual void fixup ( TQString & input ) const {
bool ok = false; bool ok = false;
TDEGlobal::locale()->readTime( input, KLocale::WithoutSeconds, &ok ); TDEGlobal::locale()->readTime( input, TDELocale::WithoutSeconds, &ok );
if ( !ok ) { if ( !ok ) {
// Also try to accept times in "military format", i.e. no delimiter, like 1200 // Also try to accept times in "military format", i.e. no delimiter, like 1200
int tm = input.toInt( &ok ); int tm = input.toInt( &ok );
@ -149,9 +149,9 @@ bool KTimeEdit::hasTime() const
TQTime KTimeEdit::getTime() const TQTime KTimeEdit::getTime() const
{ {
//kdDebug(5300) << "KTimeEdit::getTime(), currentText() = " << currentText() << endl; //kdDebug(5300) << "KTimeEdit::getTime(), currentText() = " << currentText() << endl;
// TODO use KLocale::WithoutSeconds in HEAD // TODO use TDELocale::WithoutSeconds in HEAD
bool ok = false; bool ok = false;
TQTime time = TDEGlobal::locale()->readTime( currentText(), KLocale::WithoutSeconds, &ok ); TQTime time = TDEGlobal::locale()->readTime( currentText(), TDELocale::WithoutSeconds, &ok );
if ( !ok ) { if ( !ok ) {
// Also try to accept times in "military format", i.e. no delimiter, like 1200 // Also try to accept times in "military format", i.e. no delimiter, like 1200
int tm = currentText().toInt( &ok ); int tm = currentText().toInt( &ok );

@ -42,7 +42,7 @@ extern "C" { KDE_EXPORT int kdemain(int argc, char* argv[]); }
int kdemain( int argc, char * argv[] ) int kdemain( int argc, char * argv[] )
{ {
KLocale::setMainCatalogue("tdelibs"); TDELocale::setMainCatalogue("tdelibs");
TDEInstance instance("tdeio_mbox"); TDEInstance instance("tdeio_mbox");
(void) TDEGlobal::locale(); (void) TDEGlobal::locale();

@ -34,7 +34,7 @@ static const KCmdLineOptions options[] =
int main(int argc,char **argv) int main(int argc,char **argv)
{ {
KLocale::setMainCatalogue( "tdepimwizards" ); TDELocale::setMainCatalogue( "tdepimwizards" );
TDEAboutData aboutData( "egroupwarewizard", TDEAboutData aboutData( "egroupwarewizard",
"eGroupware Server Configuration Wizard", "eGroupware Server Configuration Wizard",

@ -35,7 +35,7 @@ static const KCmdLineOptions options[] =
int main(int argc,char **argv) int main(int argc,char **argv)
{ {
KLocale::setMainCatalogue( "tdepimwizards" ); TDELocale::setMainCatalogue( "tdepimwizards" );
TDEAboutData aboutData( "exchangewizard", TDEAboutData aboutData( "exchangewizard",
I18N_NOOP( "Microsoft Exchange Server Configuration Wizard" ), I18N_NOOP( "Microsoft Exchange Server Configuration Wizard" ),
"0.1" ); "0.1" );

@ -35,7 +35,7 @@ static const KCmdLineOptions options[] =
int main(int argc,char **argv) int main(int argc,char **argv)
{ {
KLocale::setMainCatalogue( "tdepimwizards" ); TDELocale::setMainCatalogue( "tdepimwizards" );
TDEAboutData aboutData( "groupwisewizard", TDEAboutData aboutData( "groupwisewizard",
I18N_NOOP( "Novell GroupWise Configuration Wizard" ), I18N_NOOP( "Novell GroupWise Configuration Wizard" ),

@ -36,7 +36,7 @@ static const KCmdLineOptions options[] =
int main(int argc,char **argv) int main(int argc,char **argv)
{ {
KLocale::setMainCatalogue( "tdepimwizards" ); TDELocale::setMainCatalogue( "tdepimwizards" );
TDEAboutData aboutData( "kolabwizard", I18N_NOOP( "Kolab Configuration Wizard" ), "0.1" ); TDEAboutData aboutData( "kolabwizard", I18N_NOOP( "Kolab Configuration Wizard" ), "0.1" );
TDECmdLineArgs::init( argc, argv, &aboutData ); TDECmdLineArgs::init( argc, argv, &aboutData );

@ -14,7 +14,7 @@ static const KCmdLineOptions options[] =
int main( int argc, char **argv ) int main( int argc, char **argv )
{ {
KLocale::setMainCatalogue( "tdepimwizards" ); TDELocale::setMainCatalogue( "tdepimwizards" );
TDEAboutData aboutData( "groupwarewizard", TDEAboutData aboutData( "groupwarewizard",
I18N_NOOP( "TDE-PIM Groupware Configuration Wizard" ), "0.1" ); I18N_NOOP( "TDE-PIM Groupware Configuration Wizard" ), "0.1" );

@ -36,7 +36,7 @@ static const KCmdLineOptions options[] =
int main(int argc,char **argv) int main(int argc,char **argv)
{ {
KLocale::setMainCatalogue( "tdepimwizards" ); TDELocale::setMainCatalogue( "tdepimwizards" );
TDEAboutData aboutData( "scalixwizard", I18N_NOOP( "Scalix Configuration Wizard" ), "0.1" ); TDEAboutData aboutData( "scalixwizard", I18N_NOOP( "Scalix Configuration Wizard" ), "0.1" );
TDECmdLineArgs::init( argc, argv, &aboutData ); TDECmdLineArgs::init( argc, argv, &aboutData );

@ -35,7 +35,7 @@ static const KCmdLineOptions options[] =
int main(int argc,char **argv) int main(int argc,char **argv)
{ {
KLocale::setMainCatalogue( "tdepimwizards" ); TDELocale::setMainCatalogue( "tdepimwizards" );
TDEAboutData aboutData( "sloxwizard", TDEAboutData aboutData( "sloxwizard",
I18N_NOOP( "SUSE LINUX Openexchange Server Configuration Wizard" ), I18N_NOOP( "SUSE LINUX Openexchange Server Configuration Wizard" ),
"0.1" ); "0.1" );

Loading…
Cancel
Save