зеркало из https://github.com/nextcloud/desktop.git
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:
Родитель
0b461e2275
Коммит
ccf4298c81
|
@ -72,7 +72,7 @@ static ContentManager* sharedInstance = nil;
|
||||||
_icnWarnSwm = [[IconCache sharedInstance] registerIcon:[base stringByAppendingPathComponent:@"warning_swm.icns"]];
|
_icnWarnSwm = [[IconCache sharedInstance] registerIcon:[base stringByAppendingPathComponent:@"warning_swm.icns"]];
|
||||||
_icnErrSwm = [[IconCache sharedInstance] registerIcon:[base stringByAppendingPathComponent:@"error_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
|
- (void)enableFileIcons:(BOOL)enable
|
||||||
|
@ -111,7 +111,7 @@ static ContentManager* sharedInstance = nil;
|
||||||
}else if( [result isEqualToString:@"NOP"]) {
|
}else if( [result isEqualToString:@"NOP"]) {
|
||||||
// Nothing.
|
// Nothing.
|
||||||
} else {
|
} else {
|
||||||
NSLog(@"Unknown status code %@", result);
|
NSLog(@"OwnCloud: Unknown status code %@", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
NSString* normalizedPath = [path decomposedStringWithCanonicalMapping];
|
NSString* normalizedPath = [path decomposedStringWithCanonicalMapping];
|
||||||
|
@ -129,7 +129,7 @@ static ContentManager* sharedInstance = nil;
|
||||||
//NSLog(@"%@ %@", NSStringFromSelector(_cmd), path);
|
//NSLog(@"%@ %@", NSStringFromSelector(_cmd), path);
|
||||||
if (!_fileIconsEnabled)
|
if (!_fileIconsEnabled)
|
||||||
{
|
{
|
||||||
NSLog(@"Icons are NOT ENABLED!");
|
NSLog(@"OwnCloud: Icons are NOT ENABLED!");
|
||||||
// return nil;
|
// return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,12 +44,12 @@ static BOOL installed = NO;
|
||||||
{
|
{
|
||||||
if (installed)
|
if (installed)
|
||||||
{
|
{
|
||||||
NSLog(@"OwnCloudFinder: already installed");
|
// NSLog(@"OwnCloudFinder: already installed");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSLog(@"OwnCloudFinder: installing ownCloud Shell extension");
|
// NSLog(@"OwnCloudFinder: installing ownCloud Shell extension");
|
||||||
|
|
||||||
[RequestManager sharedInstance];
|
[RequestManager sharedInstance];
|
||||||
|
|
||||||
|
@ -81,19 +81,19 @@ static BOOL installed = NO;
|
||||||
|
|
||||||
installed = YES;
|
installed = YES;
|
||||||
|
|
||||||
NSLog(@"OwnCloudFinder: installed");
|
// NSLog(@"OwnCloudFinder: installed");
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)uninstall
|
+ (void)uninstall
|
||||||
{
|
{
|
||||||
if (!installed)
|
if (!installed)
|
||||||
{
|
{
|
||||||
NSLog(@"OwnCloudFinder: not installed");
|
// NSLog(@"OwnCloudFinder: not installed");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSLog(@"OwnCloudFinder: uninstalling");
|
// NSLog(@"OwnCloudFinder: uninstalling");
|
||||||
|
|
||||||
[[ContentManager sharedInstance] dealloc];
|
[[ContentManager sharedInstance] dealloc];
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ static BOOL installed = NO;
|
||||||
|
|
||||||
installed = NO;
|
installed = NO;
|
||||||
|
|
||||||
NSLog(@"OwnCloudFinder: uninstalled");
|
// NSLog(@"OwnCloudFinder: uninstalled");
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
|
@ -138,7 +138,7 @@ static RequestManager* sharedInstance = nil;
|
||||||
ContentManager *contentman = [ContentManager sharedInstance];
|
ContentManager *contentman = [ContentManager sharedInstance];
|
||||||
|
|
||||||
if( chunks && [chunks count] > 0 && tag == READ_TAG ) {
|
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"] ) {
|
if( [[chunks objectAtIndex:0] isEqualToString:@"STATUS"] ) {
|
||||||
NSString *path = [chunks objectAtIndex:2];
|
NSString *path = [chunks objectAtIndex:2];
|
||||||
if( [chunks count] > 3 ) {
|
if( [chunks count] > 3 ) {
|
||||||
|
@ -154,7 +154,7 @@ static RequestManager* sharedInstance = nil;
|
||||||
} else if( [[chunks objectAtIndex:0 ] isEqualToString:@"REGISTER_PATH"] ) {
|
} else if( [[chunks objectAtIndex:0 ] isEqualToString:@"REGISTER_PATH"] ) {
|
||||||
NSNumber *one = [NSNumber numberWithInt:1];
|
NSNumber *one = [NSNumber numberWithInt:1];
|
||||||
NSString *path = [chunks objectAtIndex:1];
|
NSString *path = [chunks objectAtIndex:1];
|
||||||
NSLog(@"Registering path: %@", path);
|
// NSLog(@"Registering path: %@", path);
|
||||||
[_registeredPathes setObject:one forKey:path];
|
[_registeredPathes setObject:one forKey:path];
|
||||||
|
|
||||||
[contentman repaintAllWindows];
|
[contentman repaintAllWindows];
|
||||||
|
@ -168,12 +168,12 @@ static RequestManager* sharedInstance = nil;
|
||||||
[[ContentManager sharedInstance] loadIconResourcePath:path];
|
[[ContentManager sharedInstance] loadIconResourcePath:path];
|
||||||
} else if( [[chunks objectAtIndex:0 ] isEqualToString:@"SHARE_MENU_TITLE"] ) {
|
} else if( [[chunks objectAtIndex:0 ] isEqualToString:@"SHARE_MENU_TITLE"] ) {
|
||||||
_shareMenuTitle = [[chunks objectAtIndex:1] copy];
|
_shareMenuTitle = [[chunks objectAtIndex:1] copy];
|
||||||
NSLog(@"Received shar menu title: %@", _shareMenuTitle);
|
// NSLog(@"Received shar menu title: %@", _shareMenuTitle);
|
||||||
} else {
|
} else {
|
||||||
NSLog(@"Unknown command %@", [chunks objectAtIndex:0]);
|
NSLog(@"OwnCloud: Unknown command %@", [chunks objectAtIndex:0]);
|
||||||
}
|
}
|
||||||
} else if (tag != READ_TAG) {
|
} else if (tag != READ_TAG) {
|
||||||
NSLog(@"Received unknown tag %ld <%@>", tag, answer);
|
NSLog(@"OwnCloud: Received unknown tag %ld <%@>", tag, answer);
|
||||||
}
|
}
|
||||||
// Read on and on
|
// Read on and on
|
||||||
NSData* stop = [@"\n" dataUsingEncoding:NSUTF8StringEncoding];
|
NSData* stop = [@"\n" dataUsingEncoding:NSUTF8StringEncoding];
|
||||||
|
@ -188,13 +188,13 @@ static RequestManager* sharedInstance = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)socket:(GCDAsyncSocket*)socket didConnectToUrl:(NSURL *)url {
|
-(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;
|
_isConnected = YES;
|
||||||
|
|
||||||
[self askOnSocket:@"" query:@"SHARE_MENU_TITLE"];
|
[self askOnSocket:@"" query:@"SHARE_MENU_TITLE"];
|
||||||
|
|
||||||
if( [_requestQueue count] > 0 ) {
|
if( [_requestQueue count] > 0 ) {
|
||||||
NSLog( @"We have to empty the queue");
|
// NSLog( @"We have to empty the queue");
|
||||||
for( NSString *path in _requestQueue ) {
|
for( NSString *path in _requestQueue ) {
|
||||||
[self askOnSocket:path query:@"RETRIEVE_FILE_STATUS"];
|
[self askOnSocket:path query:@"RETRIEVE_FILE_STATUS"];
|
||||||
}
|
}
|
||||||
|
@ -211,7 +211,7 @@ static RequestManager* sharedInstance = nil;
|
||||||
|
|
||||||
- (void)socketDidDisconnect:(GCDAsyncSocket*)socket withError:(NSError*)err
|
- (void)socketDidDisconnect:(GCDAsyncSocket*)socket withError:(NSError*)err
|
||||||
{
|
{
|
||||||
NSLog(@"Socket DISconnected! %@", [err localizedDescription]);
|
// NSLog(@"Socket DISconnected! %@", [err localizedDescription]);
|
||||||
|
|
||||||
_isConnected = NO;
|
_isConnected = NO;
|
||||||
|
|
||||||
|
@ -272,7 +272,7 @@ static RequestManager* sharedInstance = nil;
|
||||||
if (!pnsError && paths && [paths count] > 0) {
|
if (!pnsError && paths && [paths count] > 0) {
|
||||||
NSString *currentLatestPath = nil;
|
NSString *currentLatestPath = nil;
|
||||||
if (paths.count > 1) {
|
if (paths.count > 1) {
|
||||||
NSLog(@"Possible paths: %@", paths);
|
// NSLog(@"Possible paths: %@", paths);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < paths.count; i++) {
|
for (int i = 0; i < paths.count; i++) {
|
||||||
NSString *currentPath = [syncStateHelperDir stringByAppendingPathComponent:[paths objectAtIndex:i]];
|
NSString *currentPath = [syncStateHelperDir stringByAppendingPathComponent:[paths objectAtIndex:i]];
|
||||||
|
@ -288,7 +288,7 @@ static RequestManager* sharedInstance = nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (url) {
|
if (url) {
|
||||||
NSLog(@"Connect Socket to %@", url);
|
// NSLog(@"Connect Socket to %@", url);
|
||||||
[_socket connectToUrl:url withTimeout:1 error:&err];
|
[_socket connectToUrl:url withTimeout:1 error:&err];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -296,7 +296,7 @@ static RequestManager* sharedInstance = nil;
|
||||||
|
|
||||||
- (void)menuItemClicked:(NSDictionary*)actionDictionary
|
- (void)menuItemClicked:(NSDictionary*)actionDictionary
|
||||||
{
|
{
|
||||||
NSLog(@"RequestManager menuItemClicked %@", actionDictionary);
|
// NSLog(@"RequestManager menuItemClicked %@", actionDictionary);
|
||||||
NSArray *filePaths = [actionDictionary valueForKey:@"files"];
|
NSArray *filePaths = [actionDictionary valueForKey:@"files"];
|
||||||
for (int i = 0; i < filePaths.count; i++) {
|
for (int i = 0; i < filePaths.count; i++) {
|
||||||
[self askOnSocket:[filePaths objectAtIndex:i] query:@"SHARE"];
|
[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;
|
minVersion = FINDER_MIN_TESTED_VERSION;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
NSLog(@"Failed to load bundle for type %d", type);
|
NSLog(@"OwnCloudInjector: Failed to load bundle for type %d", type);
|
||||||
return 8;
|
return 8;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLoaded) {
|
if (isLoaded) {
|
||||||
NSLog(@"OwnCloudInjector: %@ already loaded.", bundleName);
|
// NSLog(@"OwnCloudInjector: %@ already loaded.", bundleName);
|
||||||
return noErr;
|
return noErr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ static OSErr loadBundle(LNBundleType type, AppleEvent* reply, long refcon) {
|
||||||
}
|
}
|
||||||
id principalClassObject = NSClassFromString(NSStringFromClass(principalClass));
|
id principalClassObject = NSClassFromString(NSStringFromClass(principalClass));
|
||||||
if ([principalClassObject respondsToSelector:@selector(install)]) {
|
if ([principalClassObject respondsToSelector:@selector(install)]) {
|
||||||
NSLog(@"LiferayNativityInjector: Installing %@ ...", bundleName);
|
// NSLog(@"OwnCloudInjector: Installing %@ ...", bundleName);
|
||||||
[principalClassObject install];
|
[principalClassObject install];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ EXPORT OSErr HandleUnloadEvent(const AppleEvent* ev, AppleEvent* reply, long ref
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
@try {
|
@try {
|
||||||
if (!liferayNativityLoaded) {
|
if (!liferayNativityLoaded) {
|
||||||
NSLog(@"OwnCloudInjector: not loaded.");
|
// NSLog(@"OwnCloudInjector: not loaded.");
|
||||||
return noErr;
|
return noErr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,7 +253,7 @@ EXPORT OSErr HandleUnloadEvent(const AppleEvent* ev, AppleEvent* reply, long ref
|
||||||
}
|
}
|
||||||
id principalClassObject = NSClassFromString(NSStringFromClass(principalClass));
|
id principalClassObject = NSClassFromString(NSStringFromClass(principalClass));
|
||||||
if ([principalClassObject respondsToSelector:@selector(uninstall)]) {
|
if ([principalClassObject respondsToSelector:@selector(uninstall)]) {
|
||||||
NSLog(@"LiferayNativityInjector: Uninstalling %@ ...", bundleName);
|
// NSLog(@"OwnCloudInjector: Uninstalling %@ ...", bundleName);
|
||||||
[principalClassObject uninstall];
|
[principalClassObject uninstall];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче