aboutsummaryrefslogtreecommitdiff
path: root/lib/connection.cpp
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-06-18 21:26:43 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-06-18 21:26:43 +0200
commit6b355d1aa87072143e09ea5269e8cf465318a64f (patch)
tree5de8b227d319e8c677ef4ea3d7931233a808bd5a /lib/connection.cpp
parent2dd85770cbfd6d9c7506757f25765c05ef74987d (diff)
downloadlibquotient-6b355d1aa87072143e09ea5269e8cf465318a64f.tar.gz
libquotient-6b355d1aa87072143e09ea5269e8cf465318a64f.zip
Drop pre-Qt 5.15 code
Diffstat (limited to 'lib/connection.cpp')
-rw-r--r--lib/connection.cpp16
1 files changed, 0 insertions, 16 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index c390cc05..2319a38a 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -49,10 +49,6 @@
# include <qt5keychain/keychain.h>
#endif
-#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
-# include <QtCore/QCborValue>
-#endif
-
#include <QtCore/QCoreApplication>
#include <QtCore/QDir>
#include <QtCore/QElapsedTimer>
@@ -1826,16 +1822,10 @@ void Connection::saveRoomState(Room* r) const
QFile outRoomFile { stateCacheDir().filePath(
SyncData::fileNameForRoom(r->id())) };
if (outRoomFile.open(QFile::WriteOnly)) {
-#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
const auto data =
d->cacheToBinary
? QCborValue::fromJsonValue(r->toJson()).toCbor()
: QJsonDocument(r->toJson()).toJson(QJsonDocument::Compact);
-#else
- QJsonDocument json { r->toJson() };
- const auto data = d->cacheToBinary ? json.toBinaryData()
- : json.toJson(QJsonDocument::Compact);
-#endif
outRoomFile.write(data.data(), data.size());
qCDebug(MAIN) << "Room state cache saved to" << outRoomFile.fileName();
} else {
@@ -1905,15 +1895,9 @@ void Connection::saveState() const
}
#endif
-#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
const auto data =
d->cacheToBinary ? QCborValue::fromJsonValue(rootObj).toCbor()
: QJsonDocument(rootObj).toJson(QJsonDocument::Compact);
-#else
- QJsonDocument json { rootObj };
- const auto data = d->cacheToBinary ? json.toBinaryData()
- : json.toJson(QJsonDocument::Compact);
-#endif
qCDebug(PROFILER) << "Cache for" << userId() << "generated in" << et;
outFile.write(data.data(), data.size());