handle moving files when using file level API (10.7)

This commit is contained in:
Antoine Mercadal committed 2011-11-04 23:23:16 +01:00
1 parent bc59efc3ba
commit edc58e358b
1 file changed
+26 -2
+26 -2
View File
@@ -18,6 +18,7 @@
#import "AppController.h"
#import "FSEventCallback.h"
#import "macros.h"
/*!
@@ -45,12 +46,35 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
|| [xcc isPathMatchingIgnoredPaths:path]
|| (![xcc isXIBFile:path] && ![xcc isObjJFile:path] && ![xcc isXCCIgnoreFile:path]))
continue;
// kFSEventStreamEventFlagItemRemoved = 0x00000200
if (eventFlags[i] & 0x00000200)
{
DLog(@"event type: kFSEventStreamEventFlagItemRemoved for path %@", path);
[xcc handleFileRemoval:path];
else
}
// kFSEventStreamEventFlagItemCreated = 0x00000200
if (eventFlags[i] & 0x00000100)
{
DLog(@"event type: kFSEventStreamEventFlagItemCreated for path %@", path);
[xcc handleFileModification:path notify:YES];
}
// kFSEventStreamEventFlagItemRenamed = 0x00000800
if (eventFlags[i] & 0x00000800)
{
if (![[NSFileManager defaultManager] fileExistsAtPath:path])
{
DLog(@"event type: kFSEventStreamEventFlagItemRenamed for path %@ (removed origin)", path);
[xcc handleFileRemoval:path];
}
else
{
DLog(@"event type: kFSEventStreamEventFlagItemRenamed for path %@ (added destination)", path);
[xcc handleFileModification:path notify:YES];
}
}
}
else
{