mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-23 10:50:42 +00:00
Split -synchronizeLastEventId in two methods.
The first method (updateUserDefaultsWithLastEventId) just sets the default while the other (synchronizeUserDefaultsWithDisk) forces a synchronization with the disk.
This commit is contained in:
@@ -195,7 +195,8 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
|
||||
*/
|
||||
- (void)clear
|
||||
{
|
||||
[self synchronizeLastEventId];
|
||||
[self updateUserDefaultsWithLastEventId];
|
||||
[self synchronizeUserDefaultsWithDisk];
|
||||
currentProjectURL = nil;
|
||||
currentProjectName = nil;
|
||||
[ignoredFilePaths removeAllObjects];
|
||||
@@ -254,17 +255,24 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
|
||||
}
|
||||
|
||||
/*!
|
||||
Synchronizes the last recorded event ID with the user defaults.
|
||||
Updates the user defaults with the last recorded event Id.
|
||||
*/
|
||||
- (void)synchronizeLastEventId {
|
||||
- (void)updateUserDefaultsWithLastEventId
|
||||
{
|
||||
if (lastEventId && [lastEventId longLongValue] != 0)
|
||||
{
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
[defaults setObject:lastEventId forKey:@"lastEventId"];
|
||||
[defaults synchronize];
|
||||
[[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