diff options
author | Tor Lillqvist <tml@collabora.com> | 2015-01-29 22:49:13 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2015-01-29 22:50:38 +0200 |
commit | dbab3b56694d2a66c40fc145a24b3db9df1693db (patch) | |
tree | 2570f0563ddcded64b4d56d28f20fe64e8a11d2d /ios | |
parent | f8d99287493e2e5ebb3e644f58098564a96e2bc4 (diff) |
Only list documents directly in NSDocumentDirectory
Change-Id: Ibaaa9ce5e5469b960d2b3dee1d40c536e5ae0739
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) { |