From 64fce4be364cb9cd24dee278f2d02149152e1f7c Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sat, 8 Oct 2016 20:35:34 +0000 Subject: [PATCH] remove doc path from error msg --- contrib/mobile/iOS/Onelab/ModelViewController.mm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/contrib/mobile/iOS/Onelab/ModelViewController.mm b/contrib/mobile/iOS/Onelab/ModelViewController.mm index b8ceaa7b3f..a8049674c2 100644 --- a/contrib/mobile/iOS/Onelab/ModelViewController.mm +++ b/contrib/mobile/iOS/Onelab/ModelViewController.mm @@ -315,7 +315,13 @@ -(void)addError:(std::string)msg { AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; - [appDelegate->errors addObject:[Utils getStringFromCString:msg.c_str()]]; + NSString *str = [Utils getStringFromCString:msg.c_str()]; + // remove document path from error message + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); + NSString *docPath = [[paths objectAtIndex:0] stringByAppendingString:@"/"]; + str = [str stringByReplacingOccurrencesOfString:docPath + withString:@""]; + [appDelegate->errors addObject:str]; } -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex -- GitLab