[Libreoffice-commits] core.git: android/source

Mert Tumer merttumer at outlook.com
Mon Sep 19 06:13:36 UTC 2016


 android/source/src/java/org/libreoffice/storage/external/ExternalFile.java |   16 +++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

New commits:
commit c57e7685f22c4b010a7ddb25fa896f8405e95818
Author: Mert Tumer <merttumer at outlook.com>
Date:   Tue Aug 2 18:43:34 2016 +0300

    tdf#101260 - Android: Filter in External SD doesn't work
    
    Change-Id: Iaba74749c11cbac972fecf816e5bb090edd9e06c
    Reviewed-on: https://gerrit.libreoffice.org/27802
    Reviewed-by: jan iversen <jani at documentfoundation.org>
    Tested-by: jan iversen <jani at documentfoundation.org>

diff --git a/android/source/src/java/org/libreoffice/storage/external/ExternalFile.java b/android/source/src/java/org/libreoffice/storage/external/ExternalFile.java
index 6381110..7c7f09f 100644
--- a/android/source/src/java/org/libreoffice/storage/external/ExternalFile.java
+++ b/android/source/src/java/org/libreoffice/storage/external/ExternalFile.java
@@ -83,8 +83,22 @@ public class ExternalFile implements IFile{
 
     @Override
     public List<IFile> listFiles(FileFilter filter) {
-        // TODO: no filtering yet
+        File file;
+        try{
+            List<IFile> children = new ArrayList<IFile>();
+            for (DocumentFile child : docFile.listFiles()) {
+                file = new File(new URI(child.getUri().toString()));
+                if(filter.accept(file))
+                    children.add(new ExternalFile(provider, child, context));
+            }
+            return children;
+
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        /* if something goes wrong */
         return listFiles();
+
     }
 
     @Override


More information about the Libreoffice-commits mailing list