summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiosfileengineassetslibrary.mm
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@theqtcompany.com>2015-04-24 13:24:42 +0200
committerRichard Moe Gustavsen <richard.gustavsen@theqtcompany.com>2015-05-06 08:00:06 +0000
commit4a4faedc3d457893058a829b3dfe74eb8170085a (patch)
treecb55047da5aacdf413acd8068ac5190ad8d0997c /src/plugins/platforms/ios/qiosfileengineassetslibrary.mm
parent7bc241c8d3db142c2f01b908b16cf4ede43b7301 (diff)
ios: report correct file flags for assets 'directory'
If the asset url indicates that this file engine points to the asset folder, report the file as a directory. Also, if the app is authorized to access assets, report that the directory has read access. Change-Id: Ic8f656fa30a1b2a0ec6402e8b19256bdf5f7345e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/ios/qiosfileengineassetslibrary.mm')
-rw-r--r--src/plugins/platforms/ios/qiosfileengineassetslibrary.mm7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/platforms/ios/qiosfileengineassetslibrary.mm b/src/plugins/platforms/ios/qiosfileengineassetslibrary.mm
index b7b7a589d7..43d40e9f56 100644
--- a/src/plugins/platforms/ios/qiosfileengineassetslibrary.mm
+++ b/src/plugins/platforms/ios/qiosfileengineassetslibrary.mm
@@ -169,7 +169,10 @@ bool QIOSFileEngineAssetsLibrary::close()
QAbstractFileEngine::FileFlags QIOSFileEngineAssetsLibrary::fileFlags(QAbstractFileEngine::FileFlags type) const
{
QAbstractFileEngine::FileFlags flags = 0;
- if (!loadAsset())
+ const bool isDir = (m_assetUrl == QLatin1String("assets-library://"));
+ const bool exists = isDir || loadAsset();
+
+ if (!exists)
return flags;
if (type & FlagsMask)
@@ -180,7 +183,7 @@ QAbstractFileEngine::FileFlags QIOSFileEngineAssetsLibrary::fileFlags(QAbstractF
flags |= ReadOwnerPerm | ReadUserPerm | ReadGroupPerm | ReadOtherPerm;
}
if (type & TypesMask)
- flags |= FileType;
+ flags |= isDir ? DirectoryType : FileType;
return flags;
}