Skip to content

Commit

Permalink
Nixed the Hidden File Filter
Browse files Browse the repository at this point in the history
To provide the utmost flexibility and usability in the project, hidden
files are no longer filtered out of the returned files. If you would
like to filter out hidden files, you should do so in the
iCloudFilesDidChange: delegate method. Closes #59.
  • Loading branch information
Sam Spencer committed Jan 27, 2015
1 parent ef3fe3f commit 2585517
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions iCloud/iCloud.m
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,9 @@ - (void)updateFiles {
}

if ([fileStatus isEqualToString:NSURLUbiquitousItemDownloadingStatusCurrent]) {
NSNumber *aBool = nil;

// Exclude hidden files
[fileURL getResourceValue:&aBool forKey:NSURLIsHiddenKey error:nil];
if (aBool && ![aBool boolValue]) {
// Add the file metadata and file names to arrays
[discoveredFiles addObject:result];
[names addObject:[result valueForAttribute:NSMetadataItemFSNameKey]];
}
// Add the file metadata and file names to arrays
[discoveredFiles addObject:result];
[names addObject:[result valueForAttribute:NSMetadataItemFSNameKey]];

if (self.query.resultCount-1 >= idx) {
// Notify the delegate of the results on the main thread
Expand Down Expand Up @@ -333,11 +327,7 @@ - (void)updateFiles {
// Gather the query results
for (NSMetadataItem *result in queryResults) {
NSURL *fileURL = [result valueForAttribute:NSMetadataItemURLKey];
NSNumber *aBool = nil;

// Don't include hidden files
[fileURL getResourceValue:&aBool forKey:NSURLIsHiddenKey error:nil];
if (aBool && ![aBool boolValue]) [discoveredFiles addObject:result];
[discoveredFiles addObject:result];
}

// Get file names in from the query
Expand Down

0 comments on commit 2585517

Please sign in to comment.