diff options
author | Markus Goetz <markus@woboq.com> | 2015-01-29 23:13:09 +0300 |
---|---|---|
committer | Markus Goetz <markus@woboq.com> | 2015-01-29 23:13:09 +0300 |
commit | bb215ad095de407bc5a56ccca676e2edecd2dbc9 (patch) | |
tree | 33686ad4cce87c95127a7160648871c23d563a97 /shell_integration/MacOSX | |
parent | df214cd6c1a38c551fdb47c970b87c529c3af335 (diff) |
OS X: Don't show menu item outside sync folder
As per #2732
Diffstat (limited to 'shell_integration/MacOSX')
-rw-r--r-- | shell_integration/MacOSX/OwnCloudFinder/MenuManager.m | 10 | ||||
-rw-r--r-- | shell_integration/MacOSX/OwnCloudFinder/RequestManager.m | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/shell_integration/MacOSX/OwnCloudFinder/MenuManager.m b/shell_integration/MacOSX/OwnCloudFinder/MenuManager.m index 8a2293e7e..740b34e29 100644 --- a/shell_integration/MacOSX/OwnCloudFinder/MenuManager.m +++ b/shell_integration/MacOSX/OwnCloudFinder/MenuManager.m @@ -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"]; diff --git a/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m b/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m index bf675e8fa..7d73c0064 100644 --- a/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m +++ b/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m @@ -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:@"/"]; } |