2005-07-18 Helge Hess <helge.hess@opengroupware.org>
+ * 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),
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;
}
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];
- (BOOL)isSortedDescending {
NSString *desc;
-
- desc = [self->queryDictionary objectForKey:@"desc"];
- if (desc == nil)
+
+ if ((desc = [self singleQueryValueForKey:@"desc"]) == nil)
return NO;
+
return [desc boolValue];
}