Author: rmottola Date: Wed Oct 22 16:33:30 2014 New Revision: 38128 URL: http://svn.gna.org/viewcvs/gnustep?rev=38128&view=rev Log: cleanup
Modified: apps/gworkspace/trunk/ChangeLog apps/gworkspace/trunk/Operation/FileOpInfo.h apps/gworkspace/trunk/Operation/FileOpInfo.m Modified: apps/gworkspace/trunk/ChangeLog URL: http://svn.gna.org/viewcvs/gnustep/apps/gworkspace/trunk/ChangeLog?rev=38128&r1=38127&r2=38128&view=diff ============================================================================== --- apps/gworkspace/trunk/ChangeLog (original) +++ apps/gworkspace/trunk/ChangeLog Wed Oct 22 16:33:30 2014 @@ -1,3 +1,9 @@ +2014-09-22 Riccardo Mottola <r...@gnu.org> + + * Operation/FileOpInfo.h + * Operation/FileOpInfo.m + Cleanup. + 2014-09-22 Riccardo Mottola <r...@gnu.org> * Operation/FileOpInfo.h Modified: apps/gworkspace/trunk/Operation/FileOpInfo.h URL: http://svn.gna.org/viewcvs/gnustep/apps/gworkspace/trunk/Operation/FileOpInfo.h?rev=38128&r1=38127&r2=38128&view=diff ============================================================================== --- apps/gworkspace/trunk/Operation/FileOpInfo.h (original) +++ apps/gworkspace/trunk/Operation/FileOpInfo.h Wed Oct 22 16:33:30 2014 @@ -76,8 +76,6 @@ - (BOOL)isPaused; -- (void)done; - @end @@ -223,8 +221,6 @@ - (NSData *)processedFiles; -- (void)done; - - (void)doMove; - (void)doCopy; Modified: apps/gworkspace/trunk/Operation/FileOpInfo.m URL: http://svn.gna.org/viewcvs/gnustep/apps/gworkspace/trunk/Operation/FileOpInfo.m?rev=38128&r1=38127&r2=38128&view=diff ============================================================================== --- apps/gworkspace/trunk/Operation/FileOpInfo.m (original) +++ apps/gworkspace/trunk/Operation/FileOpInfo.m Wed Oct 22 16:33:30 2014 @@ -363,17 +363,14 @@ { if (paused == NO) { - NSLog(@"start pause remaining files: %d", [files count]); [pauseButt setTitle: NSLocalizedString(@"Continue", @"")]; paused = YES; } else { - NSLog(@"continue from pause"); [self detachOperationThread]; [pauseButt setTitle: NSLocalizedString(@"Pause", @"")]; paused = NO; - NSLog(@"performing operation...."); } } @@ -841,8 +838,8 @@ - (BOOL)checkSameName { - NSArray *dirContents; - int i; + NSArray *dirContents; + NSUInteger i; samename = NO; @@ -853,33 +850,40 @@ return NO; } - if (destination && [files count]) { - dirContents = [fm directoryContentsAtPath: destination]; - for (i = 0; i < [files count]; i++) { - NSDictionary *dict = [files objectAtIndex: i]; - NSString *name = [dict objectForKey: @"name"]; - - if ([dirContents containsObject: name]) { - samename = YES; - break; - } - } - } + if (destination && [files count]) + { + dirContents = [fm directoryContentsAtPath: destination]; + for (i = 0; i < [files count]; i++) + { + NSDictionary *dict = [files objectAtIndex: i]; + NSString *name = [dict objectForKey: @"name"]; + + if ([dirContents containsObject: name]) + { + samename = YES; + break; + } + } + } - if (samename) { - if (([operation isEqual: NSWorkspaceMoveOperation]) + if (samename) + { + if (([operation isEqual: NSWorkspaceMoveOperation]) || ([operation isEqual: NSWorkspaceCopyOperation]) || ([operation isEqual: NSWorkspaceLinkOperation]) - || ([operation isEqual: @"GWorkspaceRecycleOutOperation"])) { - return YES; - - } else if (([operation isEqual: NSWorkspaceDestroyOperation]) - || ([operation isEqual: NSWorkspaceDuplicateOperation]) - || ([operation isEqual: NSWorkspaceRecycleOperation]) - || ([operation isEqual: @"GWorkspaceEmptyRecyclerOperation"])) { - return NO; - } - } + || ([operation isEqual: @"GWorkspaceRecycleOutOperation"])) + { + return YES; + + } + else if (([operation isEqual: NSWorkspaceDestroyOperation]) + || ([operation isEqual: NSWorkspaceDuplicateOperation]) + || ([operation isEqual: NSWorkspaceRecycleOperation]) + || ([operation isEqual: @"GWorkspaceEmptyRecyclerOperation"])) + { + return NO; + } + } return NO; } @@ -946,7 +950,10 @@ } if (stopped) - [self done]; + { + [fileOp endOperation]; + [fileOp cleanUpExecutor]; + } fcount = 0; stepcount = 0; @@ -1425,11 +1432,6 @@ return nil; } -- (void)done -{ - [fileOp sendDidChangeNotification]; - [fileOp endOperation]; -} - (BOOL)fileManager:(NSFileManager *)manager shouldProceedAfterError:(NSDictionary *)errorDict @@ -1462,7 +1464,8 @@ if (result != NSAlertDefaultReturn) { - [self done]; + [fileOp endOperation]; + [fileOp cleanUpExecutor]; } else { @@ -1485,15 +1488,23 @@ path = [path stringByDeletingLastPathComponent]; } - if ([files count]) { - if (found) { - [self performOperation]; - } else { - [fileOp showErrorAlertWithMessage: @"File Operation Error!"]; - [self done]; + if ([files count]) + { + if (found) + { + [self performOperation]; + } + else + { + [fileOp showErrorAlertWithMessage: @"File Operation Error!"]; + [fileOp endOperation]; + [fileOp cleanUpExecutor]; + } } - } else { - [self done]; + else + { + [fileOp endOperation]; + [fileOp cleanUpExecutor]; } } @@ -1512,9 +1523,11 @@ } } - if (stopped) { - [self done]; - } + if (stopped) + { + [fileOp endOperation]; + [fileOp cleanUpExecutor]; + } } @end _______________________________________________ Gnustep-cvs mailing list Gnustep-cvs@gna.org https://mail.gna.org/listinfo/gnustep-cvs