diff options
Diffstat (limited to 'ios')
-rw-r--r-- | ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.m | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.m b/ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.m index 8bad26bd13ea..17fa4332114f 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) { |