Commit bfa3662f authored by Laurent Montel's avatar Laurent Montel 😁

KGlobal::locale() -> KLocale::global()

parent 23024943
......@@ -31,6 +31,7 @@
#include <QTimer>
#include <QPointer>
#include <KLocale>
//#define DEBUG_ARCHIVEMAILAGENT 1
......@@ -39,8 +40,8 @@ ArchiveMailAgent::ArchiveMailAgent( const QString &id )
{
mArchiveManager = new ArchiveMailManager(this);
connect(mArchiveManager, SIGNAL(needUpdateConfigDialogBox()), SIGNAL(needUpdateConfigDialogBox()));
//QT5 KGlobal::locale()->insertCatalog( QLatin1String("akonadi_archivemail_agent") );
//QT5 KGlobal::locale()->insertCatalog( QLatin1String("libmailcommon") );
//QT5 KLocale::global()->insertCatalog( QLatin1String("akonadi_archivemail_agent") );
//QT5 KLocale::global()->insertCatalog( QLatin1String("libmailcommon") );
Akonadi::Monitor *collectionMonitor = new Akonadi::Monitor( this );
collectionMonitor->fetchCollection( true );
......
......@@ -244,7 +244,7 @@ void ArchiveMailWidget::createOrUpdateItem(ArchiveMailInfo *info, ArchiveMailIte
item->setCheckState(ArchiveMailWidget::Name, info->isEnabled() ? Qt::Checked : Qt::Unchecked);
item->setText(ArchiveMailWidget::StorageDirectory, info->url().toLocalFile());
if (info->lastDateSaved().isValid()) {
item->setText(ArchiveMailWidget::LastArchiveDate,KGlobal::locale()->formatDate(info->lastDateSaved()));
item->setText(ArchiveMailWidget::LastArchiveDate,KLocale::global()->formatDate(info->lastDateSaved()));
updateDiffDate(item, info);
} else {
item->setBackgroundColor(ArchiveMailWidget::NextArchive,Qt::green);
......@@ -263,7 +263,7 @@ void ArchiveMailWidget::updateDiffDate(ArchiveMailItem *item, ArchiveMailInfo *i
else
item->setBackgroundColor(ArchiveMailWidget::NextArchive,Qt::lightGray);
} else {
item->setToolTip(ArchiveMailWidget::NextArchive,i18n("Archive will be done %1",KGlobal::locale()->formatDate(diffDate)));
item->setToolTip(ArchiveMailWidget::NextArchive,i18n("Archive will be done %1",KLocale::global()->formatDate(diffDate)));
}
}
......
......@@ -51,14 +51,15 @@
#include <errno.h>
#include <KSharedConfig>
#include <KLocale>
using namespace MailCommon;
FilterLogDialog::FilterLogDialog( QWidget * parent )
: KDialog( parent ), mIsInitialized( false )
{
KGlobal::locale()->insertCatalog(QLatin1String("akonadi_mailfilter_agent"));
KGlobal::locale()->insertCatalog(QLatin1String("libpimcommon"));
//QT5 KLocale::global()->insertCatalog(QLatin1String("akonadi_mailfilter_agent"));
//QT5 KLocale::global()->insertCatalog(QLatin1String("libpimcommon"));
setCaption( i18n( "Filter Log Viewer" ) );
setButtons( User1|User2|Close );
setWindowIcon( KIcon( QLatin1String("view-filter") ) );
......
......@@ -50,6 +50,7 @@
#include <boost/bind.hpp>
#include <errno.h>
#include <KSharedConfig>
#include <KLocale>
using namespace MailCommon;
......@@ -256,7 +257,7 @@ bool FilterManager::Private::beginFiltering( const Akonadi::Item &item ) const
const QString subject = msg->subject()->asUnicodeString();
const QString from = msg->from()->asUnicodeString();
const KDateTime dateTime = msg->date()->dateTime();
const QString date = KGlobal::locale()->formatDateTime( dateTime, KLocale::LongDate );
const QString date = KLocale::global()->formatDateTime( dateTime, KLocale::LongDate );
const QString logText( i18n( "<b>Begin filtering on message \"%1\" from \"%2\" at \"%3\" :</b>",
subject, from, date ) );
FilterLog::instance()->add( logText, FilterLog::PatternDescription );
......
......@@ -42,7 +42,7 @@ NotesAgent::NotesAgent(const QString &id)
: Akonadi::AgentBase( id )
{
mNotesManager = new NotesManager(this);
KGlobal::locale()->insertCatalog( QLatin1String("akonadi_notes_agent") );
//QT5 KLocale::global()->insertCatalog( QLatin1String("akonadi_notes_agent") );
new NotesAgentAdaptor( this );
Akonadi::DBusConnectionPool::threadConnection().registerObject( QLatin1String( "/NotesAgent" ), this, QDBusConnection::ExportAdaptors );
Akonadi::DBusConnectionPool::threadConnection().registerService( QLatin1String( "org.freedesktop.Akonadi.NotesAgent" ) );
......
......@@ -55,7 +55,7 @@ NotesAgentAlarmDialog::NotesAgentAlarmDialog(QWidget *parent)
w->setLayout(vbox);
mCurrentDateTime = new QLabel;
mCurrentDateTime->setText(KGlobal::locale()->formatDateTime(QDateTime::currentDateTime()));
mCurrentDateTime->setText(KLocale::global()->formatDateTime(QDateTime::currentDateTime()));
vbox->addWidget(mCurrentDateTime);
QLabel *lab = new QLabel(i18n("The following notes triggered alarms:"));
......@@ -124,7 +124,7 @@ void NotesAgentAlarmDialog::writeConfig()
void NotesAgentAlarmDialog::addListAlarm(const Akonadi::Item::List &lstAlarm)
{
mListWidget->setNotes(lstAlarm);
mCurrentDateTime->setText(KGlobal::locale()->formatDateTime(QDateTime::currentDateTime()));
mCurrentDateTime->setText(KLocale::global()->formatDateTime(QDateTime::currentDateTime()));
}
void NotesAgentAlarmDialog::slotItemDoubleClicked(QListWidgetItem *item)
......
......@@ -48,7 +48,7 @@ SendLaterAgent::SendLaterAgent(const QString &id)
{
mManager = new SendLaterManager(this);
connect(mManager, SIGNAL(needUpdateConfigDialogBox()), SIGNAL(needUpdateConfigDialogBox()));
KGlobal::locale()->insertCatalog( QLatin1String("akonadi_sendlater_agent") );
//QT5 KLocale::global()->insertCatalog( QLatin1String("akonadi_sendlater_agent") );
new SendLaterAgentAdaptor( this );
Akonadi::DBusConnectionPool::threadConnection().registerObject( QLatin1String( "/SendLaterAgent" ), this, QDBusConnection::ExportAdaptors );
Akonadi::DBusConnectionPool::threadConnection().registerService( QLatin1String( "org.freedesktop.Akonadi.SendLaterAgent" ) );
......
......@@ -133,7 +133,7 @@ int JobTrackerModel::columnCount(const QModelIndex & parent) const
static QString formatTimeWithMsec( const QTime &time )
{
return QString(KGlobal::locale()->formatTime( time, true )
return QString(KLocale::global()->formatTime( time, true )
+ QString::fromLatin1( ".%1" ).arg( time.msec(), 3, 10, QLatin1Char('0') ) );
}
......
......@@ -244,7 +244,7 @@ QVariant NotificationModel::data( const QModelIndex &index, int role ) const
if ( role == Qt::DisplayRole ) {
switch ( index.column() ) {
case 0:
return QString( KGlobal::locale()->formatTime( block->timestamp.time(), true ) +
return QString( KLocale::global()->formatTime( block->timestamp.time(), true ) +
QString::fromLatin1( ".%1" ).arg( block->timestamp.time().msec(), 3, 10, QLatin1Char('0') ) );
case 1:
return block->nodes.count();
......
......@@ -38,6 +38,7 @@
#include <QPaintDevice>
#include <QPalette>
#include <QString>
#include <KLocale>
using namespace boost;
using namespace Syndication;
......@@ -54,11 +55,11 @@ namespace {
const QString type = enclosure.type();
QString inf;
if ( !type.isEmpty() && length > 0 )
inf = i18n( "(%1, %2)", type, KGlobal::locale()->formatByteSize( length ) );
inf = i18n( "(%1, %2)", type, KLocale::global()->formatByteSize( length ) );
else if ( !type.isNull() )
inf = type;
else if ( length > 0 )
inf = KGlobal::locale()->formatByteSize( length );
inf = KLocale::global()->formatByteSize( length );
QString str = i18n( "<a href=\"%1\">%2</a> %3", enclosure.url(), title, inf );
return str;
}
......@@ -189,7 +190,7 @@ QString DefaultNormalViewFormatter::formatArticle(const Article& article, IconOp
text += QString("<span class=\"header\" dir=\"%1\">").arg(Utils::directionOf(i18n("Date")));
text += QString ("%1:").arg(i18n("Date"));
text += "</span><span class=\"headertext\">";
text += KGlobal::locale()->formatDateTime(article.pubDate(), KLocale::FancyLongDate) +"</span>\n"; // TODO: might need RTL?
text += KLocale::global()->formatDateTime(article.pubDate(), KLocale::FancyLongDate) +"</span>\n"; // TODO: might need RTL?
}
const QString author = article.authorAsHtml();
if (!author.isEmpty())
......@@ -385,7 +386,7 @@ QString DefaultCombinedViewFormatter::formatArticle(const Article& article, Icon
text += QString("<span class=\"header\" dir=\"%1\">").arg(Utils::directionOf(i18n("Date")));
text += QString ("%1:").arg(i18n("Date"));
text += "</span><span class=\"headertext\">";
text += KGlobal::locale()->formatDateTime(article.pubDate(), KLocale::FancyLongDate) + "</span>\n"; // TODO: might need RTL?
text += KLocale::global()->formatDateTime(article.pubDate(), KLocale::FancyLongDate) + "</span>\n"; // TODO: might need RTL?
}
const QString author = article.authorAsHtml();
......
......@@ -296,7 +296,7 @@ static int maxDateColumnWidth( const QFontMetrics &fm )
int width = 0;
KDateTime date( KDateTime::currentLocalDate(), QTime(23, 59) );
for (int x=0; x<10; x++, date = date.addDays( -1 ) ) {
QString txt = ' ' + KGlobal::locale()->formatDateTime(date, KLocale::FancyShortDate ) + ' ';
QString txt = ' ' + KLocale::global()->formatDateTime(date, KLocale::FancyShortDate ) + ' ';
width = qMax( width, fm.width( txt ) );
}
return width;
......
......@@ -144,7 +144,7 @@ QVariant Akregator::ArticleModel::data( const QModelIndex& index, int role ) con
case FeedTitleColumn:
return article.feed() ? article.feed()->title() : QVariant();
case DateColumn:
return KGlobal::locale()->formatDateTime(article.pubDate(),
return KLocale::global()->formatDateTime(article.pubDate(),
KLocale::FancyShortDate );
case ItemTitleColumn:
return d->titleCache[row];
......
......@@ -41,6 +41,7 @@
#include <KMessageBox>
#include <KTemporaryFile>
#include <KIO/NetAccess>
#include <KLocale>
using namespace KCalCore;
using namespace KCalUtils;
......@@ -141,7 +142,7 @@ void EventArchiver::run( const Akonadi::ETMCalendar::Ptr &calendar,
if ( withGUI && errorIfNone ) {
KMessageBox::information( widget,
i18n( "There are no items before %1",
KGlobal::locale()->formatDate( limitDate ) ),
KLocale::global()->formatDate( limitDate ) ),
QLatin1String("ArchiverNoIncidences") );
}
return;
......@@ -173,7 +174,7 @@ void EventArchiver::deleteIncidences( Akonadi::IncidenceChanger *changer,
widget,
i18n( "Delete all items before %1 without saving?\n"
"The following items will be deleted:",
KGlobal::locale()->formatDate( limitDate ) ),
KLocale::global()->formatDate( limitDate ) ),
incidenceStrs,
i18n( "Delete Old Items" ), KStandardGuiItem::del() );
if ( result != KMessageBox::Continue ) {
......
......@@ -45,6 +45,7 @@
#include <QDateTime>
#include <QPainter>
#include <QPrinter>
#include <KLocale>
using namespace CalendarSupport;
......@@ -317,7 +318,7 @@ void CalPrintIncidence::print( QPainter &p, int width, int height )
exceptString = i18nc( "except for listed dates", " except" );
for ( int i = 0; i < recurs->exDates().size(); ++i ) {
exceptString.append( QLatin1String(" ") );
exceptString.append( KGlobal::locale()->formatDate( recurs->exDates()[i],
exceptString.append( KLocale::global()->formatDate( recurs->exDates()[i],
KLocale::ShortDate ) );
}
}
......@@ -518,26 +519,26 @@ void CalPrintIncidence::print( QPainter &p, int width, int height )
if ( todo->dtStart().isValid() ) {
datesString += i18nc(
"subitem start date", "Start Date: %1\n",
KGlobal::locale()->formatDate( todo->dtStart().toTimeSpec( spec ).date(),
KLocale::global()->formatDate( todo->dtStart().toTimeSpec( spec ).date(),
KLocale::ShortDate ) );
if ( !todo->allDay() ) {
datesString += i18nc(
"subitem start time", "Start Time: %1\n",
KGlobal::locale()->formatTime( todo->dtStart().toTimeSpec( spec ).time(),
KLocale::global()->formatTime( todo->dtStart().toTimeSpec( spec ).time(),
false, false ) );
}
}
if ( todo->dateTime( KCalCore::Incidence::RoleEnd ).isValid() ) {
subitemString +=
i18nc( "subitem due date", "Due Date: %1\n",
KGlobal::locale()->formatDate(
KLocale::global()->formatDate(
todo->dateTime( KCalCore::Incidence::RoleEnd ).toTimeSpec( spec ).date(),
KLocale::ShortDate ) );
if ( !todo->allDay() ) {
subitemString += i18nc(
"subitem due time", "Due Time: %1\n",
KGlobal::locale()->formatTime(
KLocale::global()->formatTime(
todo->dateTime( KCalCore::Incidence::RoleEnd ).toTimeSpec( spec ).time(),
false, false ) );
}
......@@ -806,7 +807,7 @@ void CalPrintDay::print( QPainter &p, int width, int height )
QRect footerBox( 0, height - footerHeight(), width, footerHeight() );
height -= footerHeight();
KLocale *local = KGlobal::locale();
KLocale *local = KLocale::global();
switch ( mDayPrintType ) {
case Filofax:
......@@ -1095,7 +1096,7 @@ void CalPrintWeek::print( QPainter &p, int width, int height )
toWeek = mToDate.addDays( 6 - weekdayCol );
curWeek = fromWeek.addDays( 6 );
KLocale *local = KGlobal::locale();
KLocale *local = KLocale::global();
QString line1, line2, title;
QRect headerBox( 0, 0, width, headerHeight() );
......
......@@ -47,6 +47,7 @@
#include <QTextDocument>
#include <QTextDocumentFragment>
#include <qmath.h> // qCeil krazy:exclude=camelcase since no QMath
#include <KLocale>
using namespace CalendarSupport;
......@@ -316,7 +317,7 @@ KCalCore::Event::Ptr CalPrintPluginBase::holidayEvent( const QDate &date ) const
const KCalendarSystem *CalPrintPluginBase::calendarSystem()
{
if ( !mCalSys ) {
mCalSys = KGlobal::locale()->calendar();
mCalSys = KLocale::global()->calendar();
}
return mCalSys;
}
......@@ -645,7 +646,7 @@ int CalPrintPluginBase::drawFooter( QPainter &p, const QRect &footbox )
p.setFont( QFont( QLatin1String("sans-serif"), 6 ) );
QFontMetrics fm( p.font() );
QString dateStr =
KGlobal::locale()->formatDateTime( QDateTime::currentDateTime(), KLocale::LongDate );
KLocale::global()->formatDateTime( QDateTime::currentDateTime(), KLocale::LongDate );
p.drawText( footbox, Qt::AlignCenter | Qt::AlignVCenter | Qt::TextSingleLine,
i18nc( "print date: formatted-datetime", "printed: %1", dateStr ) );
p.setFont( oldfont );
......@@ -768,7 +769,7 @@ void CalPrintPluginBase::drawTimeLine( QPainter &p, const QTime &fromTime,
if ( newY < box.bottom() ) {
QFont oldFont( p.font() );
// draw the time:
if ( !KGlobal::locale()->use12Clock() ) {
if ( !KLocale::global()->use12Clock() ) {
p.drawLine( xcenter, (int)newY, box.right(), (int)newY );
numStr.setNum( curTime.hour() );
if ( cellHeight > 30 ) {
......@@ -784,7 +785,7 @@ void CalPrintPluginBase::drawTimeLine( QPainter &p, const QTime &fromTime,
} else {
p.drawLine( box.left(), (int)newY, box.right(), (int)newY );
QTime time( curTime.hour(), 0 );
numStr = KGlobal::locale()->formatTime( time );
numStr = KLocale::global()->formatTime( time );
if ( box.width() < 60 ) {
p.setFont( QFont( QLatin1String("sans-serif"), 7, QFont::Bold ) ); // for weekprint
} else {
......@@ -1026,14 +1027,14 @@ void CalPrintPluginBase::drawAgendaItem( PrintCellItem *item, QPainter &p,
if ( event->location().isEmpty() ) {
str = i18nc( "starttime - endtime summary",
"%1-%2 %3",
KGlobal::locale()->formatTime( item->start().toLocalZone().time() ),
KGlobal::locale()->formatTime( item->end().toLocalZone().time() ),
KLocale::global()->formatTime( item->start().toLocalZone().time() ),
KLocale::global()->formatTime( item->end().toLocalZone().time() ),
cleanStr( event->summary() ) );
} else {
str = i18nc( "starttime - endtime summary, location",
"%1-%2 %3, %4",
KGlobal::locale()->formatTime( item->start().toLocalZone().time() ),
KGlobal::locale()->formatTime( item->end().toLocalZone().time() ),
KLocale::global()->formatTime( item->start().toLocalZone().time() ),
KLocale::global()->formatTime( item->end().toLocalZone().time() ),
cleanStr( event->summary() ),
cleanStr( event->location() ) );
}
......@@ -1075,7 +1076,7 @@ void CalPrintPluginBase::drawDayBox( QPainter &p, const QDate &qd,
bool excludePrivate )
{
QString dayNumStr;
const KLocale *local = KGlobal::locale();
const KLocale *local = KLocale::global();
QTime myFromTime, myToTime;
if ( fromTime.isValid() ) {
......@@ -1203,7 +1204,7 @@ void CalPrintPluginBase::drawDayBox( QPainter &p, const QDate &qd,
continue;
}
if ( todo->hasStartDate() && !todo->allDay() ) {
timeText = KGlobal::locale()->formatTime( todo->dtStart().toLocalZone().time() ) + QLatin1Char(' ');
timeText = KLocale::global()->formatTime( todo->dtStart().toLocalZone().time() ) + QLatin1Char(' ');
} else {
timeText.clear();
}
......@@ -1220,11 +1221,11 @@ void CalPrintPluginBase::drawDayBox( QPainter &p, const QDate &qd,
if ( !todo->allDay() ) {
str = i18nc( "to-do summary (Due: datetime)", "%1 (Due: %2)",
summaryStr,
KGlobal::locale()->formatDateTime( todo->dtDue().toLocalZone() ) );
KLocale::global()->formatDateTime( todo->dtDue().toLocalZone() ) );
} else {
str = i18nc( "to-do summary (Due: date)", "%1 (Due: %2)",
summaryStr,
KGlobal::locale()->formatDate(
KLocale::global()->formatDate(
todo->dtDue().toLocalZone().date(), KLocale::ShortDate ) );
}
} else {
......@@ -1892,7 +1893,7 @@ void CalPrintPluginBase::drawTodo( int &count, const KCalCore::Todo::Ptr &todo,
bool excludePrivate )
{
QString outStr;
const KLocale *local = KGlobal::locale();
const KLocale *local = KLocale::global();
QRect rect;
TodoParentStart startpt;
// This list keeps all starting points of the parent to-dos so the connection
......@@ -2084,7 +2085,7 @@ void CalPrintPluginBase::drawTodo( int &count, const KCalCore::Todo::Ptr &todo,
int CalPrintPluginBase::weekdayColumn( int weekday )
{
int w = weekday + 7 - KGlobal::locale()->weekStartDay();
int w = weekday + 7 - KLocale::global()->weekStartDay();
return w % 7;
}
......@@ -2121,7 +2122,7 @@ void CalPrintPluginBase::drawJournal( const KCalCore::Journal::Ptr &journal, QPa
QFont oldFont( p.font() );
p.setFont( QFont( QLatin1String("sans-serif"), 15 ) );
QString headerText;
QString dateText( KGlobal::locale()->formatDate( journal->dtStart().toLocalZone().date(),
QString dateText( KLocale::global()->formatDate( journal->dtStart().toLocalZone().date(),
KLocale::LongDate ) );
if ( journal->summary().isEmpty() ) {
......
......@@ -26,6 +26,7 @@
#include <KGlobal>
#include <KDebug>
#include <KConfigGroup>
#include <KLocale>
using namespace CalendarSupport;
......@@ -119,7 +120,7 @@ void CalPrintYear::setDateRange( const QDate &from, const QDate &to )
void CalPrintYear::print( QPainter &p, int width, int height )
{
const KCalendarSystem *calsys = calendarSystem();
KLocale *locale = KGlobal::locale();
KLocale *locale = KLocale::global();
if ( !calsys || !locale ) {
return;
}
......
......@@ -177,7 +177,7 @@ void MarcusBains::updateLocationRecalc( bool recalculate )
QPalette pal1 = d->mTimeBox->palette();
pal1.setColor( QPalette::WindowText, color );
d->mTimeBox->setPalette( pal1 );
d->mTimeBox->setText( KGlobal::locale()->formatTime( time, showSeconds ) );
d->mTimeBox->setText( KLocale::global()->formatTime( time, showSeconds ) );
d->mTimeBox->adjustSize();
if ( y - d->mTimeBox->height() >= 0 ) {
y -= d->mTimeBox->height();
......
......@@ -48,6 +48,7 @@
#include <QPixmapCache>
#include <QToolTip>
#include <QMimeData>
#include <KLocale>
using namespace KCalCore;
using namespace EventViews;
......@@ -942,24 +943,24 @@ void AgendaItem::paintEvent( QPaintEvent *ev )
QString shortH;
QString longH;
if ( !isMultiItem() ) {
shortH = KGlobal::locale()->formatTime(incidence->dateTime( KCalCore::Incidence::RoleDisplayStart ).
shortH = KLocale::global()->formatTime(incidence->dateTime( KCalCore::Incidence::RoleDisplayStart ).
toTimeSpec( mEventView->preferences()->timeSpec() ).time() );
if ( CalendarSupport::hasEvent( mIncidence ) ) {
longH = i18n( "%1 - %2",
shortH,
KGlobal::locale()->formatTime(
KLocale::global()->formatTime(
incidence->dateTime( KCalCore::Incidence::RoleEnd ).toTimeSpec(
mEventView->preferences()->timeSpec() ).time() ) );
} else {
longH = shortH;
}
} else if ( !mMultiItemInfo->mFirstMultiItem ) {
shortH = KGlobal::locale()->formatTime(
shortH = KLocale::global()->formatTime(
incidence->dtStart().toTimeSpec( mEventView->preferences()->timeSpec() ).time() );
longH = shortH;
} else {
shortH = KGlobal::locale()->formatTime(
shortH = KLocale::global()->formatTime(
incidence->dateTime( KCalCore::Incidence::RoleEnd ).toTimeSpec(
mEventView->preferences()->timeSpec() ).time() );
longH = i18n( "- %1", shortH );
......@@ -1051,9 +1052,9 @@ void AgendaItem::paintEvent( QPaintEvent *ev )
// multi-day, all-day event
shortH =
i18n( "%1 - %2",
KGlobal::locale()->formatDate(
KLocale::global()->formatDate(
incidence->dtStart().toTimeSpec( mEventView->preferences()->timeSpec() ).date() ),
KGlobal::locale()->formatDate(
KLocale::global()->formatDate(
incidence->dateTime( KCalCore::Incidence::RoleEnd ).toTimeSpec(
mEventView->preferences()->timeSpec() ).date() ) );
longH = shortH;
......
......@@ -64,6 +64,7 @@
#include <QSplitter>
#include <QStyle>
#include <QTimer>
#include <KLocale>
using namespace EventViews;
......@@ -1125,7 +1126,7 @@ void AgendaView::createDayLabels( bool force )
KVBox *bottomWeekLabelBox = new KVBox( d->mBottomDayLabels );
d->mLayoutBottomDayLabels->addWidget( bottomWeekLabelBox );
const KCalendarSystem *calsys = KGlobal::locale()->calendar();
const KCalendarSystem *calsys = KLocale::global()->calendar();
#ifndef EVENTVIEWS_NODECOS
QList<CalendarDecoration::Decoration *> topDecos;
......@@ -1145,7 +1146,7 @@ void AgendaView::createDayLabels( bool force )
d->mLayoutBottomDayLabels->addWidget( bottomDayLabelBox );
int dW = calsys->dayOfWeek( date );
QString veryLongStr = KGlobal::locale()->formatDate( date );
QString veryLongStr = KLocale::global()->formatDate( date );
QString longstr = i18nc( "short_weekday date (e.g. Mon 13)","%1 %2",
calsys->weekDayName( dW, KCalendarSystem::ShortDayName ),
calsys->day( date ) );
......
......@@ -36,6 +36,7 @@
#include <QMenu>
#include <QPainter>
#include <QPointer>
#include <KLocale>
static const KCatalogLoader loader( QLatin1String("timezones4") );
......@@ -127,11 +128,11 @@ void TimeLabels::updateConfig()
setFont( mTimeLabelsZone->preferences()->agendaTimeLabelsFont() );
QString test = QLatin1String("20");
if ( KGlobal::locale()->use12Clock() ) {
if ( KLocale::global()->use12Clock() ) {
test = QLatin1String("12");
}
mMiniWidth = fontMetrics().width( test );
if ( KGlobal::locale()->use12Clock() ) {
if ( KLocale::global()->use12Clock() ) {
test = QLatin1String("pm");
} else {
test = QLatin1String("00");
......@@ -211,7 +212,7 @@ void TimeLabels::paintEvent( QPaintEvent * )
//TODO: rewrite this using KLocale's time formats. "am/pm" doesn't make sense
// in some locale's
QString suffix;
if ( !KGlobal::locale()->use12Clock() ) {
if ( !KLocale::global()->use12Clock() ) {
suffix = QLatin1String("00");
} else {
suffix = QLatin1String("am");
......@@ -263,7 +264,7 @@ void TimeLabels::paintEvent( QPaintEvent * )
hour.setNum( cell + 24 );
}
// handle 24h and am/pm time formats
if ( KGlobal::locale()->use12Clock() ) {
if ( KLocale::global()->use12Clock() ) {
if ( cell == 12 ) {
suffix =QLatin1String( "pm");
}
......
......@@ -45,6 +45,7 @@
#include <QBoxLayout>
#include <QHeaderView>
#include <QTreeWidget>
#include <KLocale>
using namespace EventViews;
using namespace KCalCore;
......@@ -65,7 +66,7 @@ static QString cleanSummary( const QString &summary, const KDateTime &next )
if ( next.isValid() ) {
const QString dateStr =
KGlobal::locale()->formatDate(
KLocale::global()->formatDate(