Commit 567d48da authored by David Jarvie's avatar David Jarvie
Browse files

KLocale -> QLocale

parent 4274c01f
......@@ -40,7 +40,7 @@ QString AlarmTime::alarmTimeText(const DateTime& dateTime)
{
if (!dateTime.isValid())
return i18nc("@info Alarm never occurs", "Never");
QLocale locale = QLocale::system();
QLocale locale;
const KDateTime kdt = dateTime.effectiveKDateTime().toTimeSpec(Preferences::timeZone());
QString dateTimeText = locale.toString(kdt.date(), QLocale::ShortFormat);
if (!dateTime.isDateOnly()
......
......@@ -68,6 +68,7 @@
#include <QScrollBar>
#include <QTimer>
#include <QDialogButtonBox>
#include <QLocale>
#include "kalarm_debug.h"
using namespace KCal;
......@@ -1074,11 +1075,11 @@ bool EditAlarmDlg::validate()
QString prompt = dateOnly ? i18nc("@info The parameter is a date value",
"The start date does not match the alarm's recurrence pattern, "
"so it will be adjusted to the date of the next recurrence (%1).",
KLocale::global()->formatDate(next.date(), KLocale::ShortDate))
QLocale().toString(next.date(), QLocale::ShortFormat))
: i18nc("@info The parameter is a date/time value",
"The start date/time does not match the alarm's recurrence pattern, "
"so it will be adjusted to the date/time of the next recurrence (%1).",
KLocale::global()->formatDateTime(next.kDateTime(), KLocale::ShortDate));
QLocale().toString(next.effectiveDateTime(), QLocale::ShortFormat));
if (KAMessageBox::warningContinueCancel(this, prompt) != KMessageBox::Continue)
return false;
}
......
......@@ -85,6 +85,7 @@
#include <QMutexLocker>
#include <QMimeDatabase>
#include <QUrl>
#include <QLocale>
#include "kalarm_debug.h"
#include <stdlib.h>
......@@ -853,7 +854,7 @@ QString MessageWin::dateTimeToDisplay()
if (mDateTime.isValid())
{
if (mDateTime.isDateOnly())
tm = KLocale::global()->formatDate(mDateTime.date(), KLocale::ShortDate);
tm = QLocale().toString(mDateTime.date(), QLocale::ShortFormat);
else
{
bool showZone = false;
......
......@@ -89,6 +89,7 @@ using namespace KHolidays;
#include <QResizeEvent>
#include <QStandardPaths>
#include <QComboBox>
#include <QLocale>
#include "kalarm_debug.h"
using namespace KCalCore;
......@@ -704,11 +705,11 @@ TimePrefTab::TimePrefTab(StackedScrollGroup* scrollGroup)
layout->addWidget(daybox);
QGridLayout* wgrid = new QGridLayout(daybox);
wgrid->setSpacing(style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing));
const KLocale* locale = KLocale::global();
const QLocale locale;
for (int i = 0; i < 7; ++i)
{
int day = KAlarm::localeDayInWeek_to_weekDay(i);
mWorkDays[i] = new QCheckBox(KAlarm::weekDayName(day, locale), daybox);
mWorkDays[i] = new QCheckBox(locale.dayName(day), daybox);
wgrid->addWidget(mWorkDays[i], i/3, i%3, Qt::AlignLeft);
}
daybox->setWhatsThis(i18nc("@info:whatsthis", "Check the days in the week which are work days"));
......
......@@ -59,6 +59,7 @@ using namespace KCalCore;
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QtAlgorithms>
#include <QLocale>
#include "kalarm_debug.h"
......@@ -609,7 +610,7 @@ void RecurrenceEdit::addException()
if (insert)
{
mExceptionDates.insert(it, date);
mExceptionDateList->insertItem(index, new QListWidgetItem(KLocale::global()->formatDate(date)));
mExceptionDateList->insertItem(index, new QListWidgetItem(QLocale().toString(date, QLocale::LongFormat)));
Q_EMIT contentsChanged();
}
mExceptionDateList->setCurrentItem(mExceptionDateList->item(index));
......@@ -916,7 +917,7 @@ void RecurrenceEdit::set(const KAEvent& event)
qSort(mExceptionDates);
mExceptionDateList->clear();
for (int i = 0, iend = mExceptionDates.count(); i < iend; ++i)
new QListWidgetItem(KLocale::global()->formatDate(mExceptionDates[i]), mExceptionDateList);
new QListWidgetItem(QLocale().toString(mExceptionDates[i], QLocale::LongFormat), mExceptionDateList);
enableExceptionButtons();
mExcludeHolidays->setChecked(event.holidaysExcluded());
mWorkTimeOnly->setChecked(event.workTimeOnly());
......
......@@ -365,7 +365,7 @@ QString TrayWindow::tooltipAlarmText() const
// The alarm is due today, or early tomorrow
if (Preferences::showTooltipAlarmTime())
{
item.text += QLocale::system().toString(item.dateTime.time(), QLocale::ShortFormat);
item.text += QLocale().toString(item.dateTime.time(), QLocale::ShortFormat);
item.text += QLatin1Char(' ');
}
if (Preferences::showTooltipTimeToAlarm())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment