BinEditor: Raise size limit to 32 GB

The determining limit is now the Qt api with int values for line numbers
and scrollbar positions, giving us <= 2^31 lines with 16 bytes each.

Change-Id: I266e5bdf358b377c6e27bc2be300a0f6a60e6f68
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
hjk
2016-06-01 09:48:53 +02:00
parent 58f25a3260
commit 7dce6bb4f2
5 changed files with 74 additions and 75 deletions

View File

@@ -289,8 +289,9 @@ public:
QMessageBox::critical(ICore::mainWindow(), tr("File Error"), msg);
return OpenResult::CannotHandle;
}
if (size > INT_MAX) {
QString msg = tr("The file is too big for the Binary Editor (max. 2GB).");
if (size / 16 >= qint64(1) << 31) {
// The limit is 2^31 lines (due to QText* interfaces) * 16 bytes per line.
QString msg = tr("The file is too big for the Binary Editor (max. 32GB).");
if (errorString)
*errorString = msg;
else