diff options
author | Jesus Fernandez <jesus.fernandez@theqtcompany.com> | 2016-04-11 10:55:30 +0200 |
---|---|---|
committer | Jesus Fernandez <jesus.fernandez@theqtcompany.com> | 2016-04-12 10:18:57 +0000 |
commit | 0f7171f290f0d137b4034c617d4c1fd169079209 (patch) | |
tree | 74478af9dce75d426b4453b121db77dd84105bad /src/corelib | |
parent | 5f41d344e9d66434be13a9644b4da08dd01974a9 (diff) |
Better error message when trying to load an invalid resource
Before this change QFile::errorString function was returning an
"Unknown error". Now it will return the typical ENOENT string.
Task-number: QTBUG-45259
Change-Id: Ib7634f1aa5d91f77151cf92c58d3956e20a4cc6b
Reviewed-by: hjk <hjk@theqtcompany.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qresource.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp index 0674ef34e0..c584933b97 100644 --- a/src/corelib/io/qresource.cpp +++ b/src/corelib/io/qresource.cpp @@ -1252,8 +1252,10 @@ bool QResourceFileEngine::open(QIODevice::OpenMode flags) } if(flags & QIODevice::WriteOnly) return false; - if(!d->resource.isValid()) - return false; + if (!d->resource.isValid()) { + d->errorString = qt_error_string(ENOENT); + return false; + } return true; } |