From 2f3b7642c218c48e57962b07dd4a8ba9145d82c5 Mon Sep 17 00:00:00 2001 From: thalieht Date: Mon, 8 Apr 2019 20:12:52 +0300 Subject: [PATCH] Show user friendly size in error --- src/base/bittorrent/torrentinfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/base/bittorrent/torrentinfo.cpp b/src/base/bittorrent/torrentinfo.cpp index 8d11c44ba..17fd58f65 100644 --- a/src/base/bittorrent/torrentinfo.cpp +++ b/src/base/bittorrent/torrentinfo.cpp @@ -41,6 +41,7 @@ #include "base/global.h" #include "base/utils/fs.h" +#include "base/utils/misc.h" #include "infohash.h" #include "trackerentry.h" @@ -119,7 +120,7 @@ TorrentInfo TorrentInfo::loadFromFile(const QString &path, QString *error) noexc if (file.size() > MAX_TORRENT_SIZE) { if (error) - *error = tr("File size exceeds max limit %1").arg(MAX_TORRENT_SIZE); + *error = tr("File size exceeds max limit %1").arg(Utils::Misc::friendlyUnit(MAX_TORRENT_SIZE)); return TorrentInfo(); }