shell_integration: Cleanup our uses of NSLog

Remove info messages and make sure that error messages
have an OwnCloud prefix since they will be reported by
Finder's process.
This commit is contained in:
Jocelyn Turcotte 2015-02-17 18:15:25 +01:00
Родитель 0b461e2275
Коммит ccf4298c81
4 изменённых файлов: 25 добавлений и 25 удалений

Просмотреть файл

@ -72,7 +72,7 @@ static ContentManager* sharedInstance = nil;
_icnWarnSwm = [[IconCache sharedInstance] registerIcon:[base stringByAppendingPathComponent:@"warning_swm.icns"]];
_icnErrSwm = [[IconCache sharedInstance] registerIcon:[base stringByAppendingPathComponent:@"error_swm.icns"]];
NSLog(@"Icon ok identifier: %d from %@", [_icnOk intValue], [base stringByAppendingString:@"ok.icns"]);
// NSLog(@"Icon ok identifier: %d from %@", [_icnOk intValue], [base stringByAppendingString:@"ok.icns"]);
}
- (void)enableFileIcons:(BOOL)enable
@ -111,7 +111,7 @@ static ContentManager* sharedInstance = nil;
}else if( [result isEqualToString:@"NOP"]) {
// Nothing.
} else {
NSLog(@"Unknown status code %@", result);
NSLog(@"OwnCloud: Unknown status code %@", result);
}
NSString* normalizedPath = [path decomposedStringWithCanonicalMapping];
@ -129,7 +129,7 @@ static ContentManager* sharedInstance = nil;
//NSLog(@"%@ %@", NSStringFromSelector(_cmd), path);
if (!_fileIconsEnabled)
{
NSLog(@"Icons are NOT ENABLED!");
NSLog(@"OwnCloud: Icons are NOT ENABLED!");
// return nil;
}

Просмотреть файл

@ -44,12 +44,12 @@ static BOOL installed = NO;
{
if (installed)
{
NSLog(@"OwnCloudFinder: already installed");
// NSLog(@"OwnCloudFinder: already installed");
return;
}
NSLog(@"OwnCloudFinder: installing ownCloud Shell extension");
// NSLog(@"OwnCloudFinder: installing ownCloud Shell extension");
[RequestManager sharedInstance];
@ -81,19 +81,19 @@ static BOOL installed = NO;
installed = YES;
NSLog(@"OwnCloudFinder: installed");
// NSLog(@"OwnCloudFinder: installed");
}
+ (void)uninstall
{
if (!installed)
{
NSLog(@"OwnCloudFinder: not installed");
// NSLog(@"OwnCloudFinder: not installed");
return;
}
NSLog(@"OwnCloudFinder: uninstalling");
// NSLog(@"OwnCloudFinder: uninstalling");
[[ContentManager sharedInstance] dealloc];
@ -119,7 +119,7 @@ static BOOL installed = NO;
installed = NO;
NSLog(@"OwnCloudFinder: uninstalled");
// NSLog(@"OwnCloudFinder: uninstalled");
}
@end

Просмотреть файл

@ -138,7 +138,7 @@ static RequestManager* sharedInstance = nil;
ContentManager *contentman = [ContentManager sharedInstance];
if( chunks && [chunks count] > 0 && tag == READ_TAG ) {
NSLog(@"READ from socket (%ld): <%@>", tag, answer);
// NSLog(@"READ from socket (%ld): <%@>", tag, answer);
if( [[chunks objectAtIndex:0] isEqualToString:@"STATUS"] ) {
NSString *path = [chunks objectAtIndex:2];
if( [chunks count] > 3 ) {
@ -154,7 +154,7 @@ static RequestManager* sharedInstance = nil;
} else if( [[chunks objectAtIndex:0 ] isEqualToString:@"REGISTER_PATH"] ) {
NSNumber *one = [NSNumber numberWithInt:1];
NSString *path = [chunks objectAtIndex:1];
NSLog(@"Registering path: %@", path);
// NSLog(@"Registering path: %@", path);
[_registeredPathes setObject:one forKey:path];
[contentman repaintAllWindows];
@ -168,12 +168,12 @@ static RequestManager* sharedInstance = nil;
[[ContentManager sharedInstance] loadIconResourcePath:path];
} else if( [[chunks objectAtIndex:0 ] isEqualToString:@"SHARE_MENU_TITLE"] ) {
_shareMenuTitle = [[chunks objectAtIndex:1] copy];
NSLog(@"Received shar menu title: %@", _shareMenuTitle);
// NSLog(@"Received shar menu title: %@", _shareMenuTitle);
} else {
NSLog(@"Unknown command %@", [chunks objectAtIndex:0]);
NSLog(@"OwnCloud: Unknown command %@", [chunks objectAtIndex:0]);
}
} else if (tag != READ_TAG) {
NSLog(@"Received unknown tag %ld <%@>", tag, answer);
NSLog(@"OwnCloud: Received unknown tag %ld <%@>", tag, answer);
}
// Read on and on
NSData* stop = [@"\n" dataUsingEncoding:NSUTF8StringEncoding];
@ -188,13 +188,13 @@ static RequestManager* sharedInstance = nil;
}
-(void)socket:(GCDAsyncSocket*)socket didConnectToUrl:(NSURL *)url {
NSLog( @"Connected to sync client successfully on %@", url);
// NSLog( @"Connected to sync client successfully on %@", url);
_isConnected = YES;
[self askOnSocket:@"" query:@"SHARE_MENU_TITLE"];
if( [_requestQueue count] > 0 ) {
NSLog( @"We have to empty the queue");
// NSLog( @"We have to empty the queue");
for( NSString *path in _requestQueue ) {
[self askOnSocket:path query:@"RETRIEVE_FILE_STATUS"];
}
@ -211,7 +211,7 @@ static RequestManager* sharedInstance = nil;
- (void)socketDidDisconnect:(GCDAsyncSocket*)socket withError:(NSError*)err
{
NSLog(@"Socket DISconnected! %@", [err localizedDescription]);
// NSLog(@"Socket DISconnected! %@", [err localizedDescription]);
_isConnected = NO;
@ -272,7 +272,7 @@ static RequestManager* sharedInstance = nil;
if (!pnsError && paths && [paths count] > 0) {
NSString *currentLatestPath = nil;
if (paths.count > 1) {
NSLog(@"Possible paths: %@", paths);
// NSLog(@"Possible paths: %@", paths);
}
for (int i = 0; i < paths.count; i++) {
NSString *currentPath = [syncStateHelperDir stringByAppendingPathComponent:[paths objectAtIndex:i]];
@ -288,7 +288,7 @@ static RequestManager* sharedInstance = nil;
}
}
if (url) {
NSLog(@"Connect Socket to %@", url);
// NSLog(@"Connect Socket to %@", url);
[_socket connectToUrl:url withTimeout:1 error:&err];
}
}
@ -296,7 +296,7 @@ static RequestManager* sharedInstance = nil;
- (void)menuItemClicked:(NSDictionary*)actionDictionary
{
NSLog(@"RequestManager menuItemClicked %@", actionDictionary);
// NSLog(@"RequestManager menuItemClicked %@", actionDictionary);
NSArray *filePaths = [actionDictionary valueForKey:@"files"];
for (int i = 0; i < filePaths.count; i++) {
[self askOnSocket:[filePaths objectAtIndex:i] query:@"SHARE"];

Просмотреть файл

@ -78,14 +78,14 @@ static OSErr loadBundle(LNBundleType type, AppleEvent* reply, long refcon) {
minVersion = FINDER_MIN_TESTED_VERSION;
break;
default:
NSLog(@"Failed to load bundle for type %d", type);
NSLog(@"OwnCloudInjector: Failed to load bundle for type %d", type);
return 8;
break;
}
if (isLoaded) {
NSLog(@"OwnCloudInjector: %@ already loaded.", bundleName);
// NSLog(@"OwnCloudInjector: %@ already loaded.", bundleName);
return noErr;
}
@ -149,7 +149,7 @@ static OSErr loadBundle(LNBundleType type, AppleEvent* reply, long refcon) {
}
id principalClassObject = NSClassFromString(NSStringFromClass(principalClass));
if ([principalClassObject respondsToSelector:@selector(install)]) {
NSLog(@"LiferayNativityInjector: Installing %@ ...", bundleName);
// NSLog(@"OwnCloudInjector: Installing %@ ...", bundleName);
[principalClassObject install];
}
@ -232,7 +232,7 @@ EXPORT OSErr HandleUnloadEvent(const AppleEvent* ev, AppleEvent* reply, long ref
@autoreleasepool {
@try {
if (!liferayNativityLoaded) {
NSLog(@"OwnCloudInjector: not loaded.");
// NSLog(@"OwnCloudInjector: not loaded.");
return noErr;
}
@ -253,7 +253,7 @@ EXPORT OSErr HandleUnloadEvent(const AppleEvent* ev, AppleEvent* reply, long ref
}
id principalClassObject = NSClassFromString(NSStringFromClass(principalClass));
if ([principalClassObject respondsToSelector:@selector(uninstall)]) {
NSLog(@"LiferayNativityInjector: Uninstalling %@ ...", bundleName);
// NSLog(@"OwnCloudInjector: Uninstalling %@ ...", bundleName);
[principalClassObject uninstall];
}