From 03206272636c63702270ee6b4714801b15d12d29 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Fri, 19 Jun 2015 16:49:21 +0200 Subject: [PATCH] shell_i: Use a more specific name for ContentManager Since we use that class to lookup the NSBundle using bundleForClass use a more specific name to avoid any clash with any othe liferay extension. I couldn't figure out from the documentation if that is only resolved using the class name, but found some warnings on stackoverflow and better be safe than sorry for what it costs. --- .../MacOSX/OwnCloudFinder/ContentManager.h | 4 ++-- .../MacOSX/OwnCloudFinder/ContentManager.m | 6 +++--- shell_integration/MacOSX/OwnCloudFinder/FinderHook.m | 2 +- .../MacOSX/OwnCloudFinder/IconOverlayHandlers.m | 6 +++--- .../MacOSX/OwnCloudFinder/RequestManager.m | 10 +++++----- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/shell_integration/MacOSX/OwnCloudFinder/ContentManager.h b/shell_integration/MacOSX/OwnCloudFinder/ContentManager.h index 763226bbc..82d3b52c4 100644 --- a/shell_integration/MacOSX/OwnCloudFinder/ContentManager.h +++ b/shell_integration/MacOSX/OwnCloudFinder/ContentManager.h @@ -14,7 +14,7 @@ #import -@interface ContentManager : NSObject +@interface OwnCloudFinderContentManager : NSObject { NSMutableDictionary* _fileNamesCache; NSMutableDictionary* _oldFileNamesCache; @@ -31,7 +31,7 @@ NSNumber *_icnErrSwm; } -+ (ContentManager*)sharedInstance; ++ (OwnCloudFinderContentManager*)sharedInstance; - (void)enableFileIcons:(BOOL)enable; - (NSNumber*)iconByPath:(NSString*)path isDirectory:(BOOL)isDir; diff --git a/shell_integration/MacOSX/OwnCloudFinder/ContentManager.m b/shell_integration/MacOSX/OwnCloudFinder/ContentManager.m index 3a9660d33..73f017beb 100644 --- a/shell_integration/MacOSX/OwnCloudFinder/ContentManager.m +++ b/shell_integration/MacOSX/OwnCloudFinder/ContentManager.m @@ -20,9 +20,9 @@ #import "RequestManager.h" #import "IconCache.h" -static ContentManager* sharedInstance = nil; +static OwnCloudFinderContentManager* sharedInstance = nil; -@implementation ContentManager +@implementation OwnCloudFinderContentManager - init { self = [super init]; @@ -49,7 +49,7 @@ static ContentManager* sharedInstance = nil; [super dealloc]; } -+ (ContentManager*)sharedInstance ++ (OwnCloudFinderContentManager*)sharedInstance { @synchronized(self) { diff --git a/shell_integration/MacOSX/OwnCloudFinder/FinderHook.m b/shell_integration/MacOSX/OwnCloudFinder/FinderHook.m index 4c487762c..788c16e86 100644 --- a/shell_integration/MacOSX/OwnCloudFinder/FinderHook.m +++ b/shell_integration/MacOSX/OwnCloudFinder/FinderHook.m @@ -95,7 +95,7 @@ static BOOL installed = NO; // NSLog(@"SyncStateFinder: uninstalling"); - [[ContentManager sharedInstance] dealloc]; + [[OwnCloudFinderContentManager sharedInstance] dealloc]; [[IconCache sharedInstance] dealloc]; diff --git a/shell_integration/MacOSX/OwnCloudFinder/IconOverlayHandlers.m b/shell_integration/MacOSX/OwnCloudFinder/IconOverlayHandlers.m index 0b4f414d1..7db375ea6 100644 --- a/shell_integration/MacOSX/OwnCloudFinder/IconOverlayHandlers.m +++ b/shell_integration/MacOSX/OwnCloudFinder/IconOverlayHandlers.m @@ -33,7 +33,7 @@ isDir = NO; } - NSNumber* imageIndex = [[ContentManager sharedInstance] iconByPath:[url path] isDirectory:isDir]; + NSNumber* imageIndex = [[OwnCloudFinderContentManager sharedInstance] iconByPath:[url path] isDirectory:isDir]; //NSLog(@"1 The icon index is %d", [imageIndex intValue]); if ([imageIndex intValue] > 0) @@ -76,7 +76,7 @@ isDir = NO; } - NSNumber* imageIndex = [[ContentManager sharedInstance] iconByPath:[url path] isDirectory:isDir]; + NSNumber* imageIndex = [[OwnCloudFinderContentManager sharedInstance] iconByPath:[url path] isDirectory:isDir]; //NSLog(@"2 The icon index is %d %@ %@", [imageIndex intValue], [url path], isDir ? @"isDir" : @""); if ([imageIndex intValue] > 0) @@ -157,7 +157,7 @@ isDir = NO; } - NSNumber* imageIndex = [[ContentManager sharedInstance] iconByPath:[url path] isDirectory:isDir]; + NSNumber* imageIndex = [[OwnCloudFinderContentManager sharedInstance] iconByPath:[url path] isDirectory:isDir]; //NSLog(@"3 The icon index is %d", [imageIndex intValue]); if ([imageIndex intValue] > 0) diff --git a/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m b/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m index fad200244..ba450f423 100644 --- a/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m +++ b/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m @@ -101,27 +101,27 @@ static RequestManager* sharedInstance = nil; { // The client will broadcast all changes, do not fill the cache for paths that Finder didn't ask for. if ([_requestedPaths containsObject:path]) { - [[ContentManager sharedInstance] setResultForPath:path result:result]; + [[OwnCloudFinderContentManager sharedInstance] setResultForPath:path result:result]; } } - (void)reFetchFileNameCacheForPath:(NSString*)path { [_requestedPaths removeAllObjects]; - [[ContentManager sharedInstance] reFetchFileNameCacheForPath:path]; + [[OwnCloudFinderContentManager sharedInstance] reFetchFileNameCacheForPath:path]; } - (void)registerPath:(NSString*)path { NSNumber *one = [NSNumber numberWithInt:1]; [_registeredPathes setObject:one forKey:path]; - [[ContentManager sharedInstance] repaintAllWindows]; + [[OwnCloudFinderContentManager sharedInstance] repaintAllWindows]; } - (void)unregisterPath:(NSString*)path { [_registeredPathes removeObjectForKey:path]; - [[ContentManager sharedInstance] repaintAllWindows]; + [[OwnCloudFinderContentManager sharedInstance] repaintAllWindows]; } - (void)setShareMenuTitle:(NSString*)title @@ -139,7 +139,7 @@ static RequestManager* sharedInstance = nil; [_requestedPaths removeAllObjects]; // clear the caches in conent manager - ContentManager *contentman = [ContentManager sharedInstance]; + OwnCloudFinderContentManager *contentman = [OwnCloudFinderContentManager sharedInstance]; [contentman clearFileNameCache]; [contentman repaintAllWindows]; }