Commit 500ead12 authored by Volker Krause's avatar Volker Krause

Port away from KLocale.

Much easier if you have John Layt next to you.
parent ebf5d2d3
......@@ -20,7 +20,7 @@
#include "settings/pimcommonsettings.h"
#include "import/importkmailautocorrection.h"
#include <KColorScheme>
#include <KLocale>
#include <QLocale>
#include "pimcommon_debug.h"
#include <QTextBlock>
#include <QTextDocument>
......@@ -925,8 +925,9 @@ void AutoCorrection::replaceTypographicQuotes()
void AutoCorrection::readAutoCorrectionXmlFile(bool forceGlobal)
{
KLocale *locale = KLocale::global();
QString kdelang = locale->languageList().at(0);
auto kdelang = QLocale::system().uiLanguages().at(0);
if (kdelang == QLatin1String("C"))
kdelang = QStringLiteral("en_US");
kdelang.remove(QRegularExpression(QStringLiteral("@.*")));
mUpperCaseExceptions.clear();
......
......@@ -16,20 +16,22 @@
*/
#include "autocorrectionlanguage.h"
#include <KLocale>
#include <QLocale>
using namespace PimCommon;
AutoCorrectionLanguage::AutoCorrectionLanguage(QWidget *parent)
: KComboBox(parent)
{
KLocale *locale = KLocale::global();
const QStringList lstLang = locale->allLanguagesList();
Q_FOREACH (const QString &lang, lstLang) {
if (lang != QLatin1String("x-test")) {
addItem(locale->languageCodeToName(lang), lang);
}
for (int i = QLocale::Abkhazian; i <= QLocale::LastLanguage; ++i) {
const auto lang = static_cast<QLocale::Language>(i);
QLocale locale(lang);
if (locale.name() == QLatin1String("C"))
continue;
addItem(QLocale::system().languageToString(lang), locale.name());
}
const QString defaultLang = locale->languageList().at(0);
auto defaultLang = QLocale::system().uiLanguages().at(0);
if (defaultLang == QLatin1String("C"))
defaultLang = QStringLiteral("en_US");
const int index = findData(defaultLang);
setCurrentIndex(index);
model()->sort(0);
......
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