diff options
author | BogDan Vatra <bogdan@kde.org> | 2019-09-17 09:56:07 +0300 |
---|---|---|
committer | BogDan Vatra <bogdan@kde.org> | 2019-10-02 18:00:29 +0300 |
commit | fb09a8bfcfb9caeb9066946a7340f60d1d6f169c (patch) | |
tree | 378d597d14e01480a8ef04e6f2fb757935d8f5e5 /src/android | |
parent | 72d62144ab2bf67266aa0474515b54999b459d32 (diff) | |
download | qtbase-fb09a8bfcfb9caeb9066946a7340f60d1d6f169c.tar.gz |
Android: rework assets support
The new version fix QDirIterators and it lists all the files and dirs.
Change-Id: I5a30eedb61ab2397a84365d00f308cda0c194de2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/android')
-rw-r--r-- | src/android/jar/src/org/qtproject/qt5/android/QtNative.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java index c33d5016ce..7db16002ff 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java @@ -1013,6 +1013,25 @@ public class QtNative }); } + private static String[] listAssetContent(android.content.res.AssetManager asset, String path) { + String [] list; + ArrayList<String> res = new ArrayList<String>(); + try { + list = asset.list(path); + if (list.length > 0) { + for (String file : list) { + try { + String[] isDir = asset.list(path.length() > 0 ? path + "/" + file : file); + if (isDir != null && isDir.length > 0) + file += "/"; + res.add(file); + } catch (Exception e) {} + } + } + } catch (Exception e) {} + return res.toArray(new String[res.size()]); + } + // screen methods public static native void setDisplayMetrics(int screenWidthPixels, int screenHeightPixels, |