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[] )
{
KLocale::setMainCatalogue( "kaddressbook" );
TDELocale::setMainCatalogue( "kaddressbook" );
TDECmdLineArgs::init( argc, argv, KABCore::createAboutData() );
TDECmdLineArgs::addCmdLineOptions( kaddressbook_options );

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

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

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

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

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

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

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

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

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

@ -61,7 +61,7 @@ static const KCmdLineOptions options[] =
int main( int argc, char **argv )
{
KLocale::setMainCatalogue( "korganizer" );
TDELocale::setMainCatalogue( "korganizer" );
TDEAboutData aboutData( "korgac", I18N_NOOP("KOrganizer Reminder Daemon"),
korgacVersion, I18N_NOOP("KOrganizer Reminder Daemon"),
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 )
{
const KCalendarSystem *calsys = calendarSystem();
KLocale *locale = TDEGlobal::locale();
TDELocale *locale = TDEGlobal::locale();
if ( !calsys || !locale ) return;
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() );
height -= footerHeight();
KLocale *local = TDEGlobal::locale();
TDELocale *local = TDEGlobal::locale();
do {
TQTime curStartTime( mStartTime );
@ -915,7 +915,7 @@ void CalPrintWeek::print( TQPainter &p, int width, int height )
toWeek = mToDate.addDays( 6 - weekdayCol );
curWeek = fromWeek.addDays( 6 );
KLocale *local = TDEGlobal::locale();
TDELocale *local = TDEGlobal::locale();
TQString line1, line2, title;
TQRect headerBox( 0, 0, width, headerHeight() );

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

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

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

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

@ -55,7 +55,7 @@ void BroadcastStatus::setStatusMsg( 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" )
.arg( locale->formatTime( TQTime::currentTime(),
true /* with seconds */ ) )

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

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

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

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

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

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

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

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

Loading…
Cancel
Save