Monotone-Parent: 84c6073079fd585b26505ef43bd7c3cd478b2255
Monotone-Revision: 26c7b9bc924807f585951102db6677a54ac082b3 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-11-27T15:16:31 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
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>
|
2009-11-26 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
* SoObjects/SOGo/SOGoUserDefaults.m (-synchronize): avoid fetching
|
* SoObjects/SOGo/SOGoUserDefaults.m (-synchronize): avoid fetching
|
||||||
|
|
|
@ -122,7 +122,7 @@ static NSString *uidColumnName = @"c_uid";
|
||||||
/* run SQL */
|
/* run SQL */
|
||||||
ex = [channel evaluateExpressionX: sql];
|
ex = [channel evaluateExpressionX: sql];
|
||||||
if (ex)
|
if (ex)
|
||||||
[self errorWithFormat:@"could not run SQL '%@': %@", sql, ex];
|
[self errorWithFormat: @"could not run SQL '%@': %@", sql, ex];
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* fetch schema */
|
/* fetch schema */
|
||||||
|
@ -132,20 +132,19 @@ static NSString *uidColumnName = @"c_uid";
|
||||||
row = [channel fetchAttributes: attrs withZone: NULL];
|
row = [channel fetchAttributes: attrs withZone: NULL];
|
||||||
[channel cancelFetch];
|
[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];
|
value = [row objectForKey: fieldName];
|
||||||
if ([value isNotNull])
|
if ([value isNotNull])
|
||||||
{
|
/* The following enables the restitution of coded unicode
|
||||||
defFlags.isNew = NO;
|
(\U1234) characters with the Oracle adaptor. */
|
||||||
/* The following enables the restitution of coded unicode (\U1234)
|
value = [value stringByReplacingString: @"\\\\"
|
||||||
characters with the Oracle adaptor. */
|
withString: @"\\"];
|
||||||
value = [value stringByReplacingString: @"\\\\" withString: @"\\"];
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
defFlags.isNew = YES;
|
|
||||||
value = nil; /* we discard any NSNull instance */
|
value = nil; /* we discard any NSNull instance */
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
[cm releaseChannel: channel];
|
[cm releaseChannel: channel];
|
||||||
}
|
}
|
||||||
|
@ -211,18 +210,14 @@ static NSString *uidColumnName = @"c_uid";
|
||||||
{
|
{
|
||||||
if (![jsonValue isJSONString])
|
if (![jsonValue isJSONString])
|
||||||
jsonValue = [self _convertPListToJSON: jsonValue];
|
jsonValue = [self _convertPListToJSON: jsonValue];
|
||||||
defFlags.isNew = NO;
|
|
||||||
if ([fieldName isEqualToString: @"c_defaults"])
|
if ([fieldName isEqualToString: @"c_defaults"])
|
||||||
[cache setUserDefaults: jsonValue forLogin: uid];
|
[cache setUserDefaults: jsonValue forLogin: uid];
|
||||||
else
|
else
|
||||||
[cache setUserSettings: jsonValue forLogin: uid];
|
[cache setUserSettings: jsonValue forLogin: uid];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
defFlags.isNew = YES;
|
|
||||||
jsonValue = @"{}";
|
jsonValue = @"{}";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return jsonValue;
|
return jsonValue;
|
||||||
}
|
}
|
||||||
|
@ -325,7 +320,7 @@ static NSString *uidColumnName = @"c_uid";
|
||||||
if ([context beginTransaction])
|
if ([context beginTransaction])
|
||||||
{
|
{
|
||||||
defFlags.ready = YES;
|
defFlags.ready = YES;
|
||||||
ex = [channel evaluateExpressionX:sql];
|
ex = [channel evaluateExpressionX: sql];
|
||||||
if (ex)
|
if (ex)
|
||||||
{
|
{
|
||||||
[self errorWithFormat: @"could not run SQL '%@': %@", sql, ex];
|
[self errorWithFormat: @"could not run SQL '%@': %@", sql, ex];
|
||||||
|
|
Loading…
Reference in a new issue