summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Jarvie <[email protected]>2016-07-17 00:54:04 +0100
committerDavid Jarvie <[email protected]>2016-07-17 00:54:04 +0100
commit2492c2558749e5e5bf1008f03498f5aafe852a5c (patch)
tree638ef0877358a4f910071d215c8de08ffba635f2
parent0b7f400e5f4cec46cc79e3b8feb1797d28f6b561 (diff)
KLocale -> QLocalev16.07.80
-rw-r--r--src/alarmtext.cpp8
-rw-r--r--src/datetime.cpp8
-rw-r--r--src/karecurrence.cpp6
3 files changed, 12 insertions, 10 deletions
diff --git a/src/alarmtext.cpp b/src/alarmtext.cpp
index 13a089a..c3ee23d 100644
--- a/src/alarmtext.cpp
+++ b/src/alarmtext.cpp
@@ -2,7 +2,7 @@
* alarmtext.cpp - text/email alarm text conversion
* This file is part of kalarmcal library, which provides access to KAlarm
* calendar data.
- * Copyright © 2004,2005,2007-2013 by David Jarvie <[email protected]>
+ * Copyright © 2004,2005,2007-2016 by David Jarvie <[email protected]>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published
@@ -24,11 +24,11 @@
#include "kaevent.h"
-#include <klocale.h>
#include <klocalizedstring.h>
#include <QStringList>
#include <QDateTime>
+#include <QLocale>
namespace
{
@@ -164,8 +164,8 @@ void AlarmText::setTodo(const KCalCore::Todo::Ptr &todo)
if (todo->hasDueDate()) {
KDateTime due = todo->dtDue(false); // fetch the next due date
if (todo->hasStartDate() && todo->dtStart() != due) {
- d->mTime = todo->allDay() ? KLocale::global()->formatDate(due.date(), KLocale::ShortDate)
- : KLocale::global()->formatDateTime(due.dateTime());
+ d->mTime = todo->allDay() ? QLocale().toString(due.date(), QLocale::ShortFormat)
+ : QLocale().toString(due.dateTime(), QLocale::ShortFormat);
}
}
}
diff --git a/src/datetime.cpp b/src/datetime.cpp
index 548d667..df7171e 100644
--- a/src/datetime.cpp
+++ b/src/datetime.cpp
@@ -2,7 +2,7 @@
* datetime.cpp - date/time with start-of-day time for date-only values
* This file is part of kalarmcal library, which provides access to KAlarm
* calendar data.
- * Copyright © 2003,2005-2007,2009-2011 by David Jarvie <[email protected]>
+ * Copyright © 2003,2005-2007,2009-2011,2016 by David Jarvie <[email protected]>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published
@@ -21,11 +21,11 @@
*/
#include "datetime.h"
-#include <klocale.h>
#include <klocalizedstring.h>
#include <ktimezone.h>
#include <QDateTime>
+#include <QLocale>
namespace KAlarmCal
{
@@ -344,7 +344,9 @@ QString DateTime::toString(const QString &format) const
QString DateTime::formatLocale(bool shortFormat) const
{
- return KLocale::global()->formatDateTime(d->mDateTime, (shortFormat ? KLocale::ShortDate : KLocale::LongDate));
+ QLocale::FormatType format = shortFormat ? QLocale::ShortFormat : QLocale::LongFormat;
+ return d->mDateTime.isDateOnly() ? QLocale().toString(d->mDateTime.date(), format)
+ : QLocale().toString(d->mDateTime.dateTime(), format);
}
void DateTime::setStartOfDay(const QTime &sod)
diff --git a/src/karecurrence.cpp b/src/karecurrence.cpp
index 5cdfbe7..956bf0f 100644
--- a/src/karecurrence.cpp
+++ b/src/karecurrence.cpp
@@ -2,7 +2,7 @@
* karecurrence.cpp - recurrence with special yearly February 29th handling
* This file is part of kalarmcal library, which provides access to KAlarm
* calendar data.
- * Copyright © 2005-2013 by David Jarvie <[email protected]>
+ * Copyright © 2005-2016 by David Jarvie <[email protected]>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published
@@ -30,7 +30,7 @@
#include <QBitArray>
#include <QDate>
-#include <KLocale>
+#include <QLocale>
using namespace KCalCore;
namespace KAlarmCal
@@ -1035,7 +1035,7 @@ Duration KARecurrence::longestInterval() const
int maxgap = 1;
// Use the user's definition of the week, starting at the
// day of the week specified by the user's locale.
- const int weekStart = KLocale::global()->weekStartDay() - 1; // zero-based
+ const int weekStart = QLocale().firstDayOfWeek() - 1; // zero-based
for (int i = 0; i < 7; ++i) {
// Get the standard KDE day-of-week number (zero-based)
// for the day-of-week number in the user's locale.