mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-06 17:12:50 +00:00
Merge pull request #1564 from tancred/xcodecapp_sync_last_event_id_more_frequently
Make XcodeCapp synchronize file system event status more frequently. Reviewed.
This commit is contained in:
commit
dc68daa859
3 files changed
+25
-7
No files matched your search
@@ -138,4 +138,6 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[xcc updateUserDefaultsWithLastEventId];
|
||||
}
|
||||
@@ -80,6 +80,8 @@ extern NSString * const XCCListeningStartNotification;
|
||||
- (void)initializeEventStreamWithPath:(NSString*)aPath;
|
||||
- (void)stopEventStream;
|
||||
- (void)updateLastEventId:(uint64_t)eventId;
|
||||
- (void)updateUserDefaultsWithLastEventId;
|
||||
- (void)synchronizeUserDefaultsWithDisk;
|
||||
- (void)listenProjectAtPath:(NSString *)path;
|
||||
- (void)clear;
|
||||
- (void)start;
|
||||
|
||||
@@ -195,13 +195,8 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
|
||||
*/
|
||||
- (void)clear
|
||||
{
|
||||
if (lastEventId && [lastEventId longLongValue] != 0)
|
||||
{
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
[defaults setObject:lastEventId forKey:@"lastEventId"];
|
||||
[defaults synchronize];
|
||||
}
|
||||
|
||||
[self updateUserDefaultsWithLastEventId];
|
||||
[self synchronizeUserDefaultsWithDisk];
|
||||
currentProjectURL = nil;
|
||||
currentProjectName = nil;
|
||||
[ignoredFilePaths removeAllObjects];
|
||||
@@ -259,6 +254,25 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
|
||||
lastEventId = [NSNumber numberWithUnsignedLongLong:eventId];
|
||||
}
|
||||
|
||||
/*!
|
||||
Updates the user defaults with the last recorded event Id.
|
||||
*/
|
||||
- (void)updateUserDefaultsWithLastEventId
|
||||
{
|
||||
if (lastEventId && [lastEventId longLongValue] != 0)
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setObject:lastEventId forKey:@"lastEventId"];
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
Tells the standard user defaults to synchronize with disk.
|
||||
*/
|
||||
- (void)synchronizeUserDefaultsWithDisk
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
|
||||
/*!
|
||||
Run a NSTask with the given arguments
|
||||
@param arguments NSArray containing the NSTask arguments
|
||||
|
||||
Reference in new issue
Block a user