OS X: Don't show menu item outside sync folder

As per #2732
This commit is contained in:
Markus Goetz 2015-01-29 21:13:09 +01:00
parent df214cd6c1
commit bb215ad095
2 changed files with 11 additions and 1 deletions

View File

@ -79,6 +79,16 @@ static MenuManager* sharedInstance = nil;
return;
}
for (int i = 0; i < files.count; i++) {
NSString *fn = [files objectAtIndex:i];
BOOL isDir = false;
if ([[NSFileManager defaultManager] fileExistsAtPath:fn isDirectory:&isDir]) {
if (![requestManager isRegisteredPath:fn isDirectory:isDir]) {
return;
}
}
}
NSMutableArray* menuItemsArray = [[[NSMutableArray alloc] init] autorelease];
NSMutableDictionary *firstEntry = [[[NSMutableDictionary alloc] init] autorelease];
[firstEntry setValue:[NSNumber numberWithBool:YES] forKey:@"enabled"];

View File

@ -86,7 +86,7 @@ static RequestManager* sharedInstance = nil;
BOOL registered = NO;
NSString* checkPath = [NSString stringWithString:path];
if (isDir) {
if (isDir && ![checkPath hasSuffix:@"/"]) {
// append a slash
checkPath = [path stringByAppendingString:@"/"];
}