Monotone-Parent: 84c6073079fd585b26505ef43bd7c3cd478b2255
Monotone-Revision: 26c7b9bc924807f585951102db6677a54ac082b3 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-11-27T15:16:31 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
0fdae36278
commit
6d44dd58f9
|
@ -1,3 +1,9 @@
|
|||
2009-11-27 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/SOGo/SOGoUserDefaults.m (-fetchJSONProfileFromDB): the
|
||||
isNew flag depends on the presence of the row in the database
|
||||
rather than on the existence of the value.
|
||||
|
||||
2009-11-26 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/SOGo/SOGoUserDefaults.m (-synchronize): avoid fetching
|
||||
|
|
|
@ -122,7 +122,7 @@ static NSString *uidColumnName = @"c_uid";
|
|||
/* run SQL */
|
||||
ex = [channel evaluateExpressionX: sql];
|
||||
if (ex)
|
||||
[self errorWithFormat:@"could not run SQL '%@': %@", sql, ex];
|
||||
[self errorWithFormat: @"could not run SQL '%@': %@", sql, ex];
|
||||
else
|
||||
{
|
||||
/* fetch schema */
|
||||
|
@ -132,19 +132,18 @@ static NSString *uidColumnName = @"c_uid";
|
|||
row = [channel fetchAttributes: attrs withZone: NULL];
|
||||
[channel cancelFetch];
|
||||
|
||||
/* the isNew flag depends on the presence of the row in the
|
||||
database rather than on the existence of the value. */
|
||||
defFlags.isNew = (row == nil);
|
||||
|
||||
value = [row objectForKey: fieldName];
|
||||
if ([value isNotNull])
|
||||
{
|
||||
defFlags.isNew = NO;
|
||||
/* The following enables the restitution of coded unicode (\U1234)
|
||||
characters with the Oracle adaptor. */
|
||||
value = [value stringByReplacingString: @"\\\\" withString: @"\\"];
|
||||
}
|
||||
/* The following enables the restitution of coded unicode
|
||||
(\U1234) characters with the Oracle adaptor. */
|
||||
value = [value stringByReplacingString: @"\\\\"
|
||||
withString: @"\\"];
|
||||
else
|
||||
{
|
||||
defFlags.isNew = YES;
|
||||
value = nil; /* we discard any NSNull instance */
|
||||
}
|
||||
value = nil; /* we discard any NSNull instance */
|
||||
}
|
||||
|
||||
[cm releaseChannel: channel];
|
||||
|
@ -211,17 +210,13 @@ static NSString *uidColumnName = @"c_uid";
|
|||
{
|
||||
if (![jsonValue isJSONString])
|
||||
jsonValue = [self _convertPListToJSON: jsonValue];
|
||||
defFlags.isNew = NO;
|
||||
if ([fieldName isEqualToString: @"c_defaults"])
|
||||
[cache setUserDefaults: jsonValue forLogin: uid];
|
||||
else
|
||||
[cache setUserSettings: jsonValue forLogin: uid];
|
||||
}
|
||||
else
|
||||
{
|
||||
defFlags.isNew = YES;
|
||||
jsonValue = @"{}";
|
||||
}
|
||||
jsonValue = @"{}";
|
||||
}
|
||||
|
||||
return jsonValue;
|
||||
|
@ -325,7 +320,7 @@ static NSString *uidColumnName = @"c_uid";
|
|||
if ([context beginTransaction])
|
||||
{
|
||||
defFlags.ready = YES;
|
||||
ex = [channel evaluateExpressionX:sql];
|
||||
ex = [channel evaluateExpressionX: sql];
|
||||
if (ex)
|
||||
{
|
||||
[self errorWithFormat: @"could not run SQL '%@': %@", sql, ex];
|
||||
|
|
Loading…
Reference in New Issue