Permalink
Browse files

Merge branch 'master' of github.com:myellow/Less-2-Do

  • Loading branch information...
2 parents c129919 + 86c0dc8 commit 994cad18c20b7658038ce3eb9d48d6327dd17de9 Gerhard Schraml committed Jan 18, 2010
@@ -152,6 +152,13 @@ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEd
NSUInteger row = [indexPath row];
NSError *error;
Context *context = [list objectAtIndex:row];
+
+ for (Task *t in context.tasks) {
+ t.context = nil;
+ }
+
+ [context removeTasks:context.tasks];
+
DLog ("Try to delete Context '%@'", context.name);
[self.controllersSection1 removeObjectAtIndex:row];
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
@@ -63,7 +63,7 @@ - (void)viewWillAppear:(BOOL)animated {
{
// for schleife objekte erzeugen und array addObject:currentContext
for (int i=0; i<[objects count]; i++) {
- Context *folder = [objects objectAtIndex:i];
+ Folder *folder = [objects objectAtIndex:i];
TasksListViewController *folderView = [[TasksListViewController alloc] initWithStyle:UITableViewStylePlain];
folderView.title = folder.name;
folderView.selector = @selector(getTasksInFolder:error:);
@@ -177,10 +177,16 @@ -(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(N
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
-
NSUInteger row = [indexPath row];
NSError *error;
Folder *folder = [self.list objectAtIndex:row];
+
+ for (Task *t in folder.tasks) {
+ t.folder = nil;
+ }
+
+ [folder removeTasks:folder.tasks];
+
DLog ("Try to delete Folder '%@'", folder.name);
[self.controllersSection1 removeObjectAtIndex:row];
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
@@ -173,7 +173,7 @@ -(IBAction)syncButtonPressed:(id)sender
if(error == nil)
{
BOOL successful = NO;
- if(settings.preferToodleDo)
+ if([settings.preferToodleDo boolValue])
successful = [syncManager syncWithPreference:SyncPreferRemote error:&error];
else
successful = [syncManager syncWithPreference:SyncPreferLocal error:&error];

0 comments on commit 994cad1

Please sign in to comment.