ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.m |   12 
++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit dbab3b56694d2a66c40fc145a24b3db9df1693db
Author: Tor Lillqvist <t...@collabora.com>
Date:   Thu Jan 29 22:49:13 2015 +0200

    Only list documents directly in NSDocumentDirectory
    
    Change-Id: Ibaaa9ce5e5469b960d2b3dee1d40c536e5ae0739

diff --git a/ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.m 
b/ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.m
index 8bad26b..17fa433 100644
--- a/ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.m
+++ b/ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.m
@@ -41,8 +41,16 @@
     [documents addObject:test1];
 
     while ((document = [dirEnumerator nextObject])) {
-        nDocs++;
-        [documents addObject:[documentsDirectory 
stringByAppendingPathComponent:document]];
+        NSString *fullPath = [documentsDirectory 
stringByAppendingPathComponent:document];
+        BOOL isDirectory;
+        if ([fileManager fileExistsAtPath:fullPath isDirectory:&isDirectory]) {
+            if (isDirectory)
+                [dirEnumerator skipDescendants];
+            else {
+                nDocs++;
+                [documents addObject:fullPath];
+            }
+        }
     }
 
     if (nDocs == 0) {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to