diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> | 2015-01-23 15:32:05 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> | 2015-01-28 12:20:54 +0000 |
commit | ce9c4915d53c9dabfa3b5a28e62ecd2bb49337d4 (patch) | |
tree | e2f0b3b6eb3c815788abc6e41481d6eb812ead94 /src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp | |
parent | b65a415e674df75821600c8ac0bcdfdfc0703a2b (diff) |
Android: Don't open assets files in read/write mode
We would return true when opening assets in read/write mode despite
the fact that the files are not writable. The logic now matches
that of the qrc file engine.
This also adds a unit test for Android-specific issues.
[ChangeLog][Android][Important Behavior Changes] Opening assets with
QIODevice::ReadWrite now returns false to correctly indicate that the
files are not writable.
Change-Id: I019cc27861fc9b000dc13c5e0a38c0fc09a08671
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Diffstat (limited to 'src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp')
-rw-r--r-- | src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp index 2010c19bd4..6ff4c50c40 100644 --- a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp +++ b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp @@ -133,9 +133,7 @@ public: virtual bool open(QIODevice::OpenMode openMode) { - if (m_assetFile) - return openMode & QIODevice::ReadOnly; - return false; + return m_assetFile != 0 && (openMode & QIODevice::WriteOnly) == 0; } virtual bool close() |