summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-26 16:49:42 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-26 16:49:42 -0800
commit2268b6b212fca6bd84b11422b2b4f6eab6ad51ab (patch)
treea3ea1908306fdb610935c7e8e835803f12441871
parentdf9164f7e545ff2bcd19826240a4ec1aac409c4d (diff)
downloadsubsurface-2268b6b212fca6bd84b11422b2b4f6eab6ad51ab.tar.gz
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 <dirk@hohndel.org>
-rw-r--r--core/qt-init.cpp4
-rw-r--r--mobile-widgets/qmlmanager.cpp12
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("<font color=\"red\">")
-#define END_FONT QLatin1Literal("</font>")
+#define RED_FONT QLatin1String("<font color=\"red\">")
+#define END_FONT QLatin1String("</font>")
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();