From: helge Date: Mon, 18 Jul 2005 15:36:16 +0000 (+0000) Subject: improved handling of multivalue formkeys X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f14eb1237aa7c5bdec118e0700da2772e79672b;p=scalable-opengroupware.org improved handling of multivalue formkeys git-svn-id: http://svn.opengroupware.org/SOGo/trunk@799 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/UI/MailerUI/ChangeLog b/SOGo/UI/MailerUI/ChangeLog index 6c372729..2720a7f3 100644 --- a/SOGo/UI/MailerUI/ChangeLog +++ b/SOGo/UI/MailerUI/ChangeLog @@ -1,5 +1,8 @@ 2005-07-18 Helge Hess + * UIxMailSortableTableHeader.m: improved handling of multivalue form + keys (v0.9.149) + * UIxMailAccountView.m: added method to check whether folder-create button should be visible on the account folder view (checks INBOX for the ACL, does check the alt-namespace default), diff --git a/SOGo/UI/MailerUI/UIxMailSortableTableHeader.m b/SOGo/UI/MailerUI/UIxMailSortableTableHeader.m index 7dc1a346..bc407a2f 100644 --- a/SOGo/UI/MailerUI/UIxMailSortableTableHeader.m +++ b/SOGo/UI/MailerUI/UIxMailSortableTableHeader.m @@ -83,6 +83,18 @@ return self->queryDictionary; } +- (id)singleQueryValueForKey:(NSString *)_key { + id so; + + so = [self->queryDictionary objectForKey:@"sort"]; + if (![so isNotNull]) return nil; + + if (![so isKindOfClass:[NSArray class]]) + return so; + + return ([so count] > 0) ? [so objectAtIndex:0] : nil; +} + - (void)setIsDefault:(BOOL)_isDefault { self->isDefault = _isDefault; } @@ -90,11 +102,12 @@ return self->isDefault; } +/* derived accessors */ + - (BOOL)isSelected { NSString *so; - so = [self->queryDictionary objectForKey:@"sort"]; - if (![so isNotNull]) + if ((so = [self singleQueryValueForKey:@"sort"]) == nil) return self->isDefault; return [so isEqualToString:self->sortKey]; @@ -102,10 +115,10 @@ - (BOOL)isSortedDescending { NSString *desc; - - desc = [self->queryDictionary objectForKey:@"desc"]; - if (desc == nil) + + if ((desc = [self singleQueryValueForKey:@"desc"]) == nil) return NO; + return [desc boolValue]; } diff --git a/SOGo/UI/MailerUI/Version b/SOGo/UI/MailerUI/Version index 9d77989c..0f952de8 100644 --- a/SOGo/UI/MailerUI/Version +++ b/SOGo/UI/MailerUI/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=148 +SUBMINOR_VERSION:=149 # v0.9.140 requires SoObjects/Mailer v0.9.100 # v0.9.134 requires libSOGo v0.9.41