649 |
[defaults synchronize]; |
[defaults synchronize]; |
650 |
|
|
651 |
[[NSDistributedNotificationCenter defaultCenter] addObserver: self |
[[NSDistributedNotificationCenter defaultCenter] addObserver: self |
652 |
selector: @selector(fileSystemWillChangeNotification:) |
selector: @selector(fileSystemWillChange:) |
653 |
name: GWFileSystemWillChangeNotification |
name: GWFileSystemWillChangeNotification |
654 |
object: nil]; |
object: nil]; |
655 |
|
|
656 |
[[NSDistributedNotificationCenter defaultCenter] addObserver: self |
[[NSDistributedNotificationCenter defaultCenter] addObserver: self |
657 |
selector: @selector(fileSystemDidChangeNotification:) |
selector: @selector(fileSystemDidChange:) |
658 |
name: GWFileSystemDidChangeNotification |
name: GWFileSystemDidChangeNotification |
659 |
object: nil]; |
object: nil]; |
660 |
|
|
1244 |
} |
} |
1245 |
} |
} |
1246 |
|
|
1247 |
- (void)fileSystemWillChangeNotification:(NSNotification *)notif |
- (void)fileSystemWillChange:(NSNotification *)notif |
1248 |
{ |
{ |
1249 |
NSDictionary *info = [notif userInfo]; |
NSDictionary *info = [notif userInfo]; |
1250 |
NSString *operation = [info objectForKey: @"operation"]; |
NSString *operation = [info objectForKey: @"operation"]; |
1303 |
object: dict]; |
object: dict]; |
1304 |
} |
} |
1305 |
|
|
1306 |
- (void)fileSystemDidChangeNotification:(NSNotification *)notif |
- (void)fileSystemDidChange:(NSNotification *)notif |
1307 |
{ |
{ |
1308 |
NSDictionary *info = [notif userInfo]; |
NSDictionary *info = [notif userInfo]; |
1309 |
NSString *operation = [info objectForKey: @"operation"]; |
NSString *operation = [info objectForKey: @"operation"]; |
1310 |
NSString *source = [info objectForKey: @"source"]; |
NSString *source = [info objectForKey: @"source"]; |
1311 |
NSString *destination = [info objectForKey: @"destination"]; |
NSString *destination = [info objectForKey: @"destination"]; |
1312 |
NSArray *files = [info objectForKey: @"files"]; |
NSArray *files = [info objectForKey: @"files"]; |
1313 |
|
NSArray *origfiles = [info objectForKey: @"origfiles"]; |
1314 |
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity: 1]; |
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity: 1]; |
1315 |
NSString *opPtr = nil; |
NSString *opPtr = nil; |
1316 |
|
|
1338 |
|| opPtr == NSWorkspaceDuplicateOperation |
|| opPtr == NSWorkspaceDuplicateOperation |
1339 |
|| opPtr == NSWorkspaceRecycleOperation |
|| opPtr == NSWorkspaceRecycleOperation |
1340 |
|| opPtr == GWorkspaceRecycleOutOperation) { |
|| opPtr == GWorkspaceRecycleOutOperation) { |
1341 |
[GWLib unLockFiles: files inDirectoryAtPath: destination]; |
[GWLib unLockFiles: origfiles inDirectoryAtPath: destination]; |
1342 |
} |
} |
1343 |
|
|
1344 |
if (opPtr == NSWorkspaceMoveOperation |
if (opPtr == NSWorkspaceMoveOperation |
1346 |
|| opPtr == NSWorkspaceRecycleOperation |
|| opPtr == NSWorkspaceRecycleOperation |
1347 |
|| opPtr == GWorkspaceRecycleOutOperation |
|| opPtr == GWorkspaceRecycleOutOperation |
1348 |
|| opPtr == GWorkspaceEmptyRecyclerOperation) { |
|| opPtr == GWorkspaceEmptyRecyclerOperation) { |
1349 |
[GWLib unLockFiles: files inDirectoryAtPath: source]; |
[GWLib unLockFiles: origfiles inDirectoryAtPath: source]; |
1350 |
} |
} |
1351 |
|
|
1352 |
[dict setObject: opPtr forKey: @"operation"]; |
[dict setObject: opPtr forKey: @"operation"]; |
1356 |
|
|
1357 |
[[NSNotificationCenter defaultCenter] |
[[NSNotificationCenter defaultCenter] |
1358 |
postNotificationName: GWFileSystemDidChangeNotification |
postNotificationName: GWFileSystemDidChangeNotification |
1359 |
object: dict]; |
object: dict]; |
1360 |
} |
} |
1361 |
|
|
1362 |
- (void)setSelectedPaths:(NSArray *)paths |
- (void)setSelectedPaths:(NSArray *)paths |
1470 |
[notifObj setObject: @"" forKey: @"source"]; |
[notifObj setObject: @"" forKey: @"source"]; |
1471 |
[notifObj setObject: basePath forKey: @"destination"]; |
[notifObj setObject: basePath forKey: @"destination"]; |
1472 |
[notifObj setObject: [NSArray arrayWithObjects: fileName, nil] forKey: @"files"]; |
[notifObj setObject: [NSArray arrayWithObjects: fileName, nil] forKey: @"files"]; |
1473 |
|
[notifObj setObject: [NSArray arrayWithObjects: fileName, nil] forKey: @"origfiles"]; |
1474 |
|
|
1475 |
[[NSNotificationCenter defaultCenter] |
[[NSNotificationCenter defaultCenter] |
1476 |
postNotificationName: GWFileSystemWillChangeNotification |
postNotificationName: GWFileSystemWillChangeNotification |
1554 |
[notifObj setObject: basePath forKey: @"source"]; |
[notifObj setObject: basePath forKey: @"source"]; |
1555 |
[notifObj setObject: basePath forKey: @"destination"]; |
[notifObj setObject: basePath forKey: @"destination"]; |
1556 |
[notifObj setObject: [NSArray arrayWithObjects: path, nil] forKey: @"files"]; |
[notifObj setObject: [NSArray arrayWithObjects: path, nil] forKey: @"files"]; |
1557 |
|
[notifObj setObject: [NSArray arrayWithObjects: path, nil] forKey: @"origfiles"]; |
1558 |
|
|
1559 |
[[NSNotificationCenter defaultCenter] |
[[NSNotificationCenter defaultCenter] |
1560 |
postNotificationName: GWFileSystemWillChangeNotification |
postNotificationName: GWFileSystemWillChangeNotification |