|
|
|
@ -39,7 +39,9 @@
@@ -39,7 +39,9 @@
|
|
|
|
|
#include <QStringList> |
|
|
|
|
#include <QUrl> |
|
|
|
|
|
|
|
|
|
#include "base/global.h" |
|
|
|
|
#include "base/utils/fs.h" |
|
|
|
|
#include "base/utils/misc.h" |
|
|
|
|
#include "infohash.h" |
|
|
|
|
#include "trackerentry.h" |
|
|
|
|
|
|
|
|
@ -116,10 +118,9 @@ TorrentInfo TorrentInfo::loadFromFile(const QString &path, QString *error) noexc
@@ -116,10 +118,9 @@ TorrentInfo TorrentInfo::loadFromFile(const QString &path, QString *error) noexc
|
|
|
|
|
return TorrentInfo(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const qint64 fileSizeLimit = 100 * 1024 * 1024; // 100 MB
|
|
|
|
|
if (file.size() > fileSizeLimit) { |
|
|
|
|
if (file.size() > MAX_TORRENT_SIZE) { |
|
|
|
|
if (error) |
|
|
|
|
*error = tr("File size exceeds max limit %1").arg(fileSizeLimit); |
|
|
|
|
*error = tr("File size exceeds max limit %1").arg(Utils::Misc::friendlyUnit(MAX_TORRENT_SIZE)); |
|
|
|
|
return TorrentInfo(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|