diff --git a/ChangeLog b/ChangeLog index 6d3c0ee1b..21a7f0841 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-11-26 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoUserDefaults.m (-synchronize): avoid fetching + the values from the database/the cache when they are successfully + stored. + * SoObjects/SOGo/SOGoCache.m (_cacheValues:ofType:forLogin:): we also fill the local cache with the new value to avoid ignoring it next time the cache is invoked. diff --git a/SoObjects/SOGo/SOGoUserDefaults.m b/SoObjects/SOGo/SOGoUserDefaults.m index e3e59e884..55472cc50 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.m +++ b/SoObjects/SOGo/SOGoUserDefaults.m @@ -465,25 +465,31 @@ static NSString *uidColumnName = @"c_uid"; - (BOOL) synchronize { + BOOL rc; // if (!defFlags.modified) /* was not modified */ // return YES; + rc = NO; + /* ensure fetched data (more or less guaranteed by modified!=0) */ [self fetchProfile]; - if (!values) - return NO; - - /* store */ - if (![self primaryStoreProfile]) + if (values) { - [self primaryFetchProfile]; - return NO; + /* store */ + if ([self primaryStoreProfile]) + { + rc = YES; + // /* refetch */ + // [self primaryFetchProfile]; + } + else + { + [self primaryFetchProfile]; + return NO; + } } - /* refetch */ - [self primaryFetchProfile]; - - return YES; + return rc; } /* typed accessors */