Commit dc88f178 authored by Volker Krause's avatar Volker Krause

Port away from KLocale.

parent 2cb36bb2
......@@ -26,7 +26,6 @@
#include <KLocalizedString>
#include <KProtocolInfo>
#include <KRun>
#include <KGlobal>
#include <QTimer>
#include <QWidget>
......@@ -71,7 +70,8 @@ namespace MessageViewer
MyNetworkAccessManager::MyNetworkAccessManager(QObject *parent)
: KIO::AccessManager(parent)
{
QString c = KLocale::global()->language();
auto lang = QLocale::system().language();
QString c = QLocale(lang).name();
if (c == QLatin1String("C")) {
c = QLatin1String("en-US");
......
......@@ -30,8 +30,6 @@
#include "contactdisplaymessagememento.h"
#include "kxface.h"
#include <KLocale>
#include <KEmailAddress>
#include <KTextToHTML>
......@@ -62,8 +60,7 @@ QString dateString(KMime::Message *message, bool printing, bool shortDate)
return i18nc("Unknown date", "Unknown");
}
if (printing) {
KLocale *locale = KLocale::global();
return locale->formatDateTime(dateTime);
return QLocale::system().toString(dateTime, QLocale::ShortFormat);
} else {
if (shortDate) {
return dateShortStr(dateTime);
......@@ -225,7 +222,8 @@ QString dateStr(const QDateTime &dateTime)
QString dateShortStr(const QDateTime &dateTime)
{
return KLocale::global()->formatDateTime(dateTime, KLocale::FancyShortDate);
KMime::DateFormatter formatter(KMime::DateFormatter::Fancy);
return formatter.dateString(dateTime);
}
QVector<KMime::Types::Mailbox> resentFromList(KMime::Message *message)
......
......@@ -38,9 +38,8 @@
#include <KLocalizedString>
#include <kcharsets.h>
#include <kde_file.h>
#include <QUrl>
#include <KLocale>
#include <QUrl>
#include <QDir>
#include <QTextCodec>
......@@ -63,7 +62,7 @@ NodeHelper::NodeHelper() :
{
//TODO(Andras) add methods to modify these prefixes
mLocalCodec = QTextCodec::codecForName(KLocale::global()->encoding());
mLocalCodec = QTextCodec::codecForLocale();
// In the case of Japan. Japanese locale name is "eucjp" but
// The Japanese mail systems normally used "iso-2022-jp" of locale name.
......@@ -775,7 +774,7 @@ QByteArray NodeHelper::autoDetectCharset(const QByteArray &_encoding, const QStr
for (; it != end; ++it) {
QByteArray encoding = (*it).toLatin1();
if (encoding == "locale") {
encoding = QTextCodec::codecForName(KLocale::global()->encoding())->name();
encoding = QTextCodec::codecForLocale()->name();
encoding = encoding.toLower();
}
if (text.isEmpty()) {
......
......@@ -2796,7 +2796,7 @@ QString ObjectTreeParser::writeSigstatHeader(PartMetaData &block,
keyWithWithoutURL);
else
htmlStr += i18n("Message was signed on %1 with key %2.",
KLocale::global()->formatDateTime(created),
QLocale::system().toString(created, QLocale::ShortFormat),
keyWithWithoutURL);
} else {
if (onlyShowKeyURL)
......@@ -2804,7 +2804,7 @@ QString ObjectTreeParser::writeSigstatHeader(PartMetaData &block,
keyWithWithoutURL);
else
htmlStr += i18n("Message was signed by %3 on %1 with key %2",
KLocale::global()->formatDateTime(created),
QLocale::system().toString(created, QLocale::ShortFormat),
keyWithWithoutURL,
signer);
}
......@@ -2851,7 +2851,7 @@ QString ObjectTreeParser::writeSigstatHeader(PartMetaData &block,
QDateTime created = block.creationTime;
if (created.isValid())
htmlStr += i18n("Message was signed on %1 with unknown key %2.",
KLocale::global()->formatDateTime(created),
QLocale::system().toString(created, QLocale::ShortFormat),
keyWithWithoutURL);
else
htmlStr += i18n("Message was signed with unknown key %1.",
......
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