aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Knall <rknall@gmail.com>2022-07-04 21:20:13 +0200
committerRoland Knall <rknall@gmail.com>2022-07-04 19:22:17 +0000
commitc0545013350b5f3ad5417741b2306b2e119c1141 (patch)
tree0c320382a792701d5382d23e63c0c240e10b3082
parentfed641fc272add997384fc54b749ba701953d503 (diff)
Qt: Fix compile issue for 5.9
Use the legacy method for when a Qt version below 5.10 is being used, due to the fact, that QLocale::formattedDataSize had not been introduced before
-rw-r--r--ui/qt/models/atap_data_model.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/qt/models/atap_data_model.cpp b/ui/qt/models/atap_data_model.cpp
index 55e609f92a..73734d14b4 100644
--- a/ui/qt/models/atap_data_model.cpp
+++ b/ui/qt/models/atap_data_model.cpp
@@ -17,6 +17,7 @@
#include <wsutil/utf8_entities.h>
#include <wsutil/nstime.h>
+#include <wsutil/str_util.h>
#include <ui/qt/utils/qt_ui_utils.h>
#include <ui/qt/utils/variant_pointer.h>
@@ -31,7 +32,11 @@
static QString formatString(qlonglong value)
{
+#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
+ return QString(format_size(value, FORMAT_SIZE_UNIT_NONE, FORMAT_SIZE_PREFIX_SI));
+#else
return QLocale::system().formattedDataSize(value, QLocale::DataSizeSIFormat);
+#endif
}
ATapDataModel::ATapDataModel(dataModelType type, int protoId, QString filter, QObject *parent):