~threeve/ubuntuone-ios-files/background-processing

« back to all changes in this revision

Viewing changes to Files/FilesAppDelegate.m

MergeĀ lp:~threeve/ubuntuone-ios-files/fix-upload-failure-node-deletion

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
        {
92
92
                [self showVolumes];
93
93
        }
 
94
        
 
95
        // XXX: Remove this later, some users still have an app icon badge set
 
96
        [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
94
97
 
95
98
        return YES;
96
99
}
97
100
 
 
101
- (void)applicationDidBecomeActive:(UIApplication *)application;
 
102
{
 
103
        if (![[U1AccountManager sharedAccountManager] hasCredentials])
 
104
        {
 
105
                [self showLoginController];
 
106
        }
 
107
}
 
108
 
98
109
- (void)applicationWillResignActive:(UIApplication *)application;
99
110
{
100
111
        [self.dataRepository save:NULL];
101
112
        [[NSUserDefaults standardUserDefaults] synchronize];
102
 
        [[UIApplication sharedApplication] setApplicationIconBadgeNumber:[self.filesClient queueCount]];
103
113
        [[UIApplication sharedApplication] setIdleTimerDisabled:NO];
104
114
}
105
115
 
108
118
        // TODO: check error
109
119
        [self.dataRepository save:NULL];
110
120
    [[NSUserDefaults standardUserDefaults] synchronize];
111
 
        [[UIApplication sharedApplication] setApplicationIconBadgeNumber:[self.filesClient queueCount]];
112
121
        [[UIApplication sharedApplication] setIdleTimerDisabled:NO];
113
122
}
114
123