From 4a4faedc3d457893058a829b3dfe74eb8170085a Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Fri, 24 Apr 2015 13:24:42 +0200 Subject: ios: report correct file flags for assets 'directory' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø --- src/plugins/platforms/ios/qiosfileengineassetslibrary.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/ios/qiosfileengineassetslibrary.mm') 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; } -- cgit v1.2.3