[Libreoffice-commits] core.git: ios/experimental

Tor Lillqvist tml at collabora.com
Thu Jan 29 12:51:30 PST 2015


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

New commits:
commit dbab3b56694d2a66c40fc145a24b3db9df1693db
Author: Tor Lillqvist <tml at 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) {


More information about the Libreoffice-commits mailing list