Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 5abd5f158036c7d9a57cc5615c4d919e6e7a199b 2 parents 9a93b2d + 3ebdf8f
@myell0w authored
View
2  Classes/Entities/Context.m
@@ -179,7 +179,7 @@ + (NSArray *)getModifiedContexts:(NSError **)error
+ (Context *)getContextWithRemoteId:(NSNumber*)remoteId error:(NSError **)error
{
- NSArray* objects = [Context getContextsWithFilterPredicate:[NSPredicate predicateWithFormat:@"remoteId == %d", remoteId] error:error];
+ NSArray* objects = [Context getContextsWithFilterPredicate:[NSPredicate predicateWithFormat:@"remoteId == %d", [remoteId integerValue]] error:error];
if([objects count] != 1)
return nil;
return [objects objectAtIndex:0];
View
2  Classes/Entities/Folder.m
@@ -240,7 +240,7 @@ + (NSArray *)getModifiedFolders:(NSError **)error
+ (Folder *)getFolderWithRemoteId:(NSNumber*)remoteId error:(NSError **)error
{
- NSArray* objects = [Folder getFoldersWithFilterPredicate:[NSPredicate predicateWithFormat:@"remoteId == %d", remoteId] error:error];
+ NSArray* objects = [Folder getFoldersWithFilterPredicate:[NSPredicate predicateWithFormat:@"remoteId == %d", [remoteId integerValue]] error:error];
if([objects count] != 1)
return nil;
return [objects objectAtIndex:0];
View
34 Classes/SettingsSyncViewController.m
@@ -58,17 +58,36 @@ - (void)dealloc {
}
- (void)saveSettings {
- NSError *error;
+ NSError *error=nil;
if([self.settings.useTDSync intValue] == 1) {
[SFHFKeychainUtils deleteItemForUsername:self.settings.tdEmail andServiceName:@"Less2DoToodleDoAccount" error:&error];
}
+ if (error != nil) {
+ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
+ message:@"Error with Keychain during delete"
+ delegate:self
+ cancelButtonTitle:@"Ok"
+ otherButtonTitles:nil];
+ [alert show];
+ [alert release];
+ }
+ error = nil;
if([self.eMail.text length]!=0) {
[SFHFKeychainUtils storeUsername:[self.eMail text]
andPassword:[self.password text]
forServiceName:@"Less2DoToodleDoAccount"
- updateExisting:YES
+ updateExisting:NO
error:&error];
+ if (error != nil) {
+ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
+ message:@"Error with Keychain during save"
+ delegate:self
+ cancelButtonTitle:@"Ok"
+ otherButtonTitles:nil];
+ [alert show];
+ [alert release];
+ }
self.settings.tdEmail = [self.eMail text];
self.settings.useTDSync = [NSNumber numberWithInt:1];
self.settings.preferToodleDo = self.preferToodleDo.on == YES ? [NSNumber numberWithInt:1] : [NSNumber numberWithInt:0];
@@ -81,6 +100,7 @@ - (void)saveSettings {
}
- (IBAction)forceLocalToRemoteSync:(id)sender {
+ [self saveSettings];
NSError *error = nil;
Less2DoAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
@@ -105,6 +125,7 @@ - (IBAction)forceLocalToRemoteSync:(id)sender {
}
- (IBAction)forceRemoteToLocalSync:(id)sender {
+ [self saveSettings];
NSError *error = nil;
Less2DoAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
@@ -132,6 +153,15 @@ - (IBAction)forceRemoteToLocalSync:(id)sender {
- (IBAction)unlinkAccount:(id)sender {
NSError *error;
[SFHFKeychainUtils deleteItemForUsername:self.settings.tdEmail andServiceName:@"Less2DoToodleDoAccount" error:&error];
+ if (error != nil) {
+ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
+ message:@"Error with Keychain during delete"
+ delegate:self
+ cancelButtonTitle:@"Ok"
+ otherButtonTitles:nil];
+ [alert show];
+ [alert release];
+ }
self.settings.useTDSync = [NSNumber numberWithInt:0];
self.eMail.text = @"";
self.password.text = @"";
View
6 Classes/SyncManager.m
@@ -271,6 +271,8 @@ +(NSString *)gtdErrorMessage:(NSInteger)errorCode
GtdApiContextNotAddedError = 510,
GtdApiContextNotDeletedError = 520,
GtdApiContextNotEditedError = 530*/
+ ALog(@"gtdErrorMessage called with errorCode %d", errorCode);
+ return [NSString stringWithFormat:@"gtdErrorMessage errorCode=%d", errorCode];
switch (errorCode) {
case GtdApiNoConnectionError:
return @"Toodledo API no connection";
@@ -788,9 +790,9 @@ -(BOOL)syncTasksMatchDates
if([localTask.remoteId integerValue] == remoteTask.uid)
{
- //ALog(@"Das remoteDate: %@ das localDate: %@",remoteTask.date_modified,localTask.lastLocalModification);
+ ALog(@"Das remoteDate: %@ das localDate: %@",remoteTask.date_modified,localTask.lastLocalModification);
- if([remoteTask.date_modified compare:localTask.lastLocalModification] == NSOrderedDescending) // Remote aktueller als Folder
+ if([remoteTask.date_modified compare:localTask.lastLocalModification] == NSOrderedDescending || localTask.lastLocalModification == nil) // Remote aktueller als Folder
{
localTask.deleted = [NSNumber numberWithInteger:0]; // verhindere möglichen Löschvorgang
// überschreibe lokale Felder
View
6 Less2Do.xcodeproj/project.pbxproj
@@ -768,7 +768,7 @@
39B659F910B7080D00825C1D /* Products */ = {
isa = PBXGroup;
children = (
- 39B65A0110B7080D00825C1D /* liblibToodledoAPI.a */,
+ 39B65A0110B7080D00825C1D /* libToodledoAPI.a */,
39F5AFCA10ED19AF00E54EB1 /* libToodledoAPIMac.a */,
39B65A0310B7080D00825C1D /* UnitTests.octest */,
39F5AFCC10ED19AF00E54EB1 /* liblibToodledoAPIiPhone.a */,
@@ -1019,10 +1019,10 @@
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
- 39B65A0110B7080D00825C1D /* liblibToodledoAPI.a */ = {
+ 39B65A0110B7080D00825C1D /* libToodledoAPI.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
- path = liblibToodledoAPI.a;
+ path = libToodledoAPI.a;
remoteRef = 39B65A0010B7080D00825C1D /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
2  toodledo-objc
@@ -1 +1 @@
-Subproject commit e686f9cdcc06876675d8481361d5a91453fe7ae2
+Subproject commit 500ec06c224f01a941aef28ed6128765f0bd3818
Please sign in to comment.
Something went wrong with that request. Please try again.