From 63224612e3dc0f45eacac2c97924e6b7a8a72e54 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 3 May 2007 15:12:51 +0000 Subject: [PATCH] Monotone-Parent: 25630ef22852aad3a540cf9873929b9324dcb479 Monotone-Revision: 33d6ed4d81ea69479070eeecb494de1a86f32771 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-03T15:12:51 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 7 +++++++ SoObjects/SOGo/AgenorUserDefaults.m | 22 +++++++++------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 11f9fae3a..a79f5dc96 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-05-03 Wolfgang Sourdeau + + * SoObjects/SOGo/AgenorUserDefaults.m ([AgenorUserDefaults + -primaryFetchProfile]): the values returned from the database are + converted to a put dictionary first, since the dictionary returned + is actually an immutable one, which can cause a crash afterwards. + 2007-04-27 Wolfgang Sourdeau * SoObjects/SOGo/SOGoPermissions.m: added "SOGoRole_ObjectViewer" diff --git a/SoObjects/SOGo/AgenorUserDefaults.m b/SoObjects/SOGo/AgenorUserDefaults.m index 1069645b7..ff553d75d 100644 --- a/SoObjects/SOGo/AgenorUserDefaults.m +++ b/SoObjects/SOGo/AgenorUserDefaults.m @@ -104,7 +104,7 @@ static NSString *uidColumnName = @"uid"; { GCSChannelManager *cm; EOAdaptorChannel *channel; - NSDictionary *row; + NSDictionary *row, *oldValues; NSException *ex; NSString *sql; NSArray *attrs; @@ -122,15 +122,15 @@ static NSString *uidColumnName = @"uid"; @" WHERE %@ = '%@'"), fieldName, [[self tableURL] gcsTableName], uidColumnName, [self uid]]; - + + [values release]; + values = [NSMutableDictionary new]; + /* run SQL */ ex = [channel evaluateExpressionX: sql]; if (ex) - { - [self errorWithFormat:@"could not run SQL '%@': %@", sql, ex]; - values = [NSMutableDictionary new]; - } + [self errorWithFormat:@"could not run SQL '%@': %@", sql, ex]; else { /* fetch schema */ @@ -142,14 +142,10 @@ static NSString *uidColumnName = @"uid"; [channel cancelFetch]; /* remember values */ - [values release]; - values = [[row objectForKey: fieldName] propertyList]; - if (values) - [values retain]; - else - values = [NSMutableDictionary new]; + oldValues = [[row objectForKey: fieldName] propertyList]; + [values setDictionary: oldValues]; - ASSIGN(lastFetch, [NSCalendarDate date]); + ASSIGN (lastFetch, [NSCalendarDate date]); defFlags.modified = NO; rc = YES; }