Skip to content

Commit

Permalink
Added saving of sort order for Events and Tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharland committed Aug 6, 2015
1 parent 31b959a commit 7bb551a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions UI/Scheduler/UIxCalListingActions.m
Expand Up @@ -652,7 +652,7 @@ - (WOResponse *) alarmsListAction
return [self _responseWithData: data];
}

- (void) saveFilterValue
- (void) saveEventFilterValue
{
NSString *filter;
SOGoUserSettings *us;
Expand All @@ -668,7 +668,7 @@ - (void) saveFilterValue
}
}

- (void) saveSortValue
- (void) saveSortValue: (NSString *) submodule
{
NSString *sort, *ascending;
SOGoUserSettings *us;
Expand All @@ -686,7 +686,7 @@ - (void) saveSortValue
calendarSettings = [NSMutableDictionary dictionary];
[us setObject: calendarSettings forKey: @"Calendar"];
}
[calendarSettings setObject: [NSArray arrayWithObjects: [sort lowercaseString], [NSString stringWithFormat: @"%d", (ascending?1:0)], nil] forKey: @"SortingState"];
[calendarSettings setObject: [NSArray arrayWithObjects: [sort lowercaseString], [NSString stringWithFormat: @"%d", (ascending?1:0)], nil] forKey: submodule];
[us synchronize];
}
}
Expand Down Expand Up @@ -743,8 +743,8 @@ - (WOResponse *) eventsListAction
NSString *sort, *ascending;

[self _setupContext];
[self saveFilterValue];
[self saveSortValue];
[self saveEventFilterValue];
[self saveSortValue: @"EventsSortingState"];

newEvents = [NSMutableArray array];
events = [[self _fetchFields: eventsFields
Expand Down Expand Up @@ -1436,6 +1436,7 @@ - (WOResponse *) tasksListAction
filteredTasks = [NSMutableArray array];

[self _setupContext];
[self saveSortValue: @"TasksSortingState"];

startSecs = (unsigned int) [startDate timeIntervalSince1970];
endsSecs = (unsigned int) [endDate timeIntervalSince1970];
Expand Down

0 comments on commit 7bb551a

Please sign in to comment.