Commit 706d78b5 authored by Eike Ziller's avatar Eike Ziller
Browse files

BinEditor: Complain about missing file, not empty size

When trying to open a non-existing file with the binary editor, it would
complain that it couldn't empty files, instead of complaining that the
file does not exist.

Change-Id: I50fc8afb8c59cad211ee68356020a81891708097
Task-number: QTCREATORBUG-14078
Reviewed-by: default avatarChristian Stenger <>
parent 9abfd712
......@@ -267,8 +267,10 @@ public:
bool open(QString *errorString, const QString &fileName, quint64 offset = 0) {
QFile file(fileName);
if ( {
quint64 size = static_cast<quint64>(file.size());
if (size == 0 && !fileName.isEmpty()) {
if (size == 0) {
QString msg = tr("The Binary Editor cannot open empty files.");
if (errorString)
*errorString = msg;
......@@ -278,8 +280,6 @@ public:
if (offset >= size)
return false;
if ( {
m_widget->setSizes(offset, file.size());
return true;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment