aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-04-19 15:07:14 +0200
committerSefa Eyeoglu <contact@scrumplex.net>2022-04-19 15:07:14 +0200
commit27c72935f8a17761e9b18a74643e014cad3587d1 (patch)
tree9e1779ba022dd6a78e90916389a8f349a9b903a7 /launcher/minecraft
parentfd7745cbebf55f5bcfccc16500fff0e67a789169 (diff)
downloadPrismLauncher-27c72935f8a17761e9b18a74643e014cad3587d1.tar.gz
PrismLauncher-27c72935f8a17761e9b18a74643e014cad3587d1.tar.bz2
PrismLauncher-27c72935f8a17761e9b18a74643e014cad3587d1.zip
fix: use size in bytes to sort by world size
Diffstat (limited to 'launcher/minecraft')
-rw-r--r--launcher/minecraft/WorldList.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/launcher/minecraft/WorldList.cpp b/launcher/minecraft/WorldList.cpp
index 344bea63..955609bf 100644
--- a/launcher/minecraft/WorldList.cpp
+++ b/launcher/minecraft/WorldList.cpp
@@ -17,6 +17,7 @@
#include "Application.h"
#include <FileSystem.h>
+#include <Qt>
#include <QMimeData>
#include <QUrl>
#include <QUuid>
@@ -190,6 +191,16 @@ QVariant WorldList::data(const QModelIndex &index, int role) const
return QVariant();
}
+ case Qt::UserRole:
+ switch (column)
+ {
+ case SizeColumn:
+ return qVariantFromValue<qlonglong>(world.bytes());
+
+ default:
+ return data(index, Qt::DisplayRole);
+ }
+
case Qt::ToolTipRole:
{
return world.folderName();
@@ -216,7 +227,7 @@ QVariant WorldList::data(const QModelIndex &index, int role) const
}
case SizeRole:
{
- return locale.formattedDataSize(world.bytes());
+ return qVariantFromValue<qlonglong>(world.bytes());
}
case IconFileRole:
{