From 2268b6b212fca6bd84b11422b2b4f6eab6ad51ab Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 26 Jan 2020 16:49:42 -0800 Subject: code cleanup: QLatin1Literal is deprecated in Qt 5.14 Simply replace it with QLatin1String. There is a tiny performance penalty, but none of that code would care. Signed-off-by: Dirk Hohndel --- core/qt-init.cpp | 4 ++-- mobile-widgets/qmlmanager.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/qt-init.cpp b/core/qt-init.cpp index 105742b82..d77abfb89 100644 --- a/core/qt-init.cpp +++ b/core/qt-init.cpp @@ -76,9 +76,9 @@ void init_qt_late() qtTranslator = new QTranslator; QString translationLocation; #if defined(Q_OS_ANDROID) - translationLocation = QLatin1Literal("assets:/translations"); + translationLocation = QLatin1String("assets:/translations"); #elif defined(Q_OS_IOS) - translationLocation = QLatin1Literal(":/"); + translationLocation = QLatin1String(":/"); #else translationLocation = QLibraryInfo::location(QLibraryInfo::TranslationsPath); #endif diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 8e5005447..d9f619d5a 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -53,8 +53,8 @@ QMLManager *QMLManager::m_instance = NULL; bool noCloudToCloud = false; -#define RED_FONT QLatin1Literal("") -#define END_FONT QLatin1Literal("") +#define RED_FONT QLatin1String("") +#define END_FONT QLatin1String("") extern "C" void showErrorFromC(char *buf) { @@ -276,9 +276,9 @@ void QMLManager::applicationStateChanged(Qt::ApplicationState state) } stateText.prepend("AppState changed to "); stateText.append(" with "); - stateText.append((alreadySaving ? QLatin1Literal("") : QLatin1Literal("no ")) + QLatin1Literal("save ongoing")); + stateText.append((alreadySaving ? QLatin1String("") : QLatin1String("no ")) + QLatin1String("save ongoing")); stateText.append(" and "); - stateText.append((unsaved_changes() ? QLatin1Literal("") : QLatin1Literal("no ")) + QLatin1Literal("unsaved changes")); + stateText.append((unsaved_changes() ? QLatin1String("") : QLatin1String("no ")) + QLatin1String("unsaved changes")); appendTextToLog(stateText); if (!alreadySaving && state == Qt::ApplicationInactive && unsaved_changes()) { @@ -1663,14 +1663,14 @@ void QMLManager::setVerboseEnabled(bool verboseMode) void QMLManager::syncLoadFromCloud() { QSettings s; - QString cloudMarker = QLatin1Literal("loadFromCloud") + QString(prefs.cloud_storage_email); + QString cloudMarker = QLatin1String("loadFromCloud") + QString(prefs.cloud_storage_email); m_loadFromCloud = s.contains(cloudMarker) && s.value(cloudMarker).toBool(); } void QMLManager::setLoadFromCloud(bool done) { QSettings s; - QString cloudMarker = QLatin1Literal("loadFromCloud") + QString(prefs.cloud_storage_email); + QString cloudMarker = QLatin1String("loadFromCloud") + QString(prefs.cloud_storage_email); s.setValue(cloudMarker, done); m_loadFromCloud = done; emit loadFromCloudChanged(); -- cgit v1.2.3-70-g09d2