From ab1e915a3cd5771ca3fd772a40a58af09af2df1e Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Mon, 4 Dec 2023 17:14:23 +0530 Subject: [PATCH] NMC 1998 - Merging conflict resolve after nc 4.9.2 release --- iOSClient/Settings/CCAdvanced.m | 72 ++++----------------------------- 1 file changed, 8 insertions(+), 64 deletions(-) diff --git a/iOSClient/Settings/CCAdvanced.m b/iOSClient/Settings/CCAdvanced.m index 1d2869688b..568f3ce41a 100755 --- a/iOSClient/Settings/CCAdvanced.m +++ b/iOSClient/Settings/CCAdvanced.m @@ -104,23 +104,6 @@ - (void)initializeForm [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"]; [section addFormRow:row]; } - - // Section : Chunk -------------------------------------------------------------- - - section = [XLFormSectionDescriptor formSection]; - [form addFormSection:section]; - section.footerTitle = NSLocalizedString(@"_chunk_footer_title_", nil); - - row = [XLFormRowDescriptor formRowDescriptorWithTag:@"chunk" rowType:XLFormRowDescriptorTypeStepCounter title:NSLocalizedString(@"_chunk_size_mb_", nil)]; - row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor; - row.value = [NSString stringWithFormat:@"%ld", CCUtility.getChunkSize]; - [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"]; - [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"]; - [row.cellConfigAtConfigure setObject:@YES forKey:@"stepControl.wraps"]; - [row.cellConfigAtConfigure setObject:@1 forKey:@"stepControl.stepValue"]; - [row.cellConfigAtConfigure setObject:@0 forKey:@"stepControl.minimumValue"]; - [row.cellConfigAtConfigure setObject:@100 forKey:@"stepControl.maximumValue"]; - [section addFormRow:row]; // Section : Privacy -------------------------------------------------------------- @@ -257,7 +240,6 @@ - (void)initializeForm [XLFormOptionsObject formOptionsObjectWithValue:@(90) displayText:NSLocalizedString(@"_3_months_", nil)], [XLFormOptionsObject formOptionsObjectWithValue:@(30) displayText:NSLocalizedString(@"_1_month_", nil)], [XLFormOptionsObject formOptionsObjectWithValue:@(7) displayText:NSLocalizedString(@"_1_week_", nil)], - //[XLFormOptionsObject formOptionsObjectWithValue:@(1) displayText:NSLocalizedString(@"_1_day_", nil)], ]; [sectionSize addFormRow:row]; @@ -376,13 +358,7 @@ - (void)formRowDescriptorValueHasChanged:(XLFormRowDescriptor *)rowDescriptor ol [[NCKeychain alloc] init].logLevel = levelLog; [[[NextcloudKit shared] nkCommonInstance] setLevelLog:levelLog]; } - - if ([rowDescriptor.tag isEqualToString:@"chunk"]) { - - NSInteger chunkSize = [[rowDescriptor.value valueData] intValue]; - [CCUtility setChunkSize:chunkSize]; - } - + if ([rowDescriptor.tag isEqualToString:@"deleteoldfiles"]) { NSInteger days = [[rowDescriptor.value valueData] intValue]; @@ -398,29 +374,7 @@ - (void)clearCache:(NSString *)account [[NCNetworking shared] cancelDownloadTasks]; [[NCNetworking shared] cancelUploadTasks]; [[NCNetworking shared] cancelUploadBackgroundTask]; - [[NCNetworking shared] cancelAllTransferWithAccount:account completion:^{ }]; - [[NCOperationQueue shared] cancelAllQueue]; - [[NCNetworking shared] cancelAllTask]; - - [[NSURLCache sharedURLCache] setMemoryCapacity:0]; - [[NSURLCache sharedURLCache] setDiskCapacity:0]; - - [[NCManageDatabase shared] clearDatabaseWithAccount:account removeAccount:false]; - - [CCUtility removeGroupDirectoryProviderStorage]; - [CCUtility removeGroupLibraryDirectory]; - - [CCUtility removeDocumentsDirectory]; - [CCUtility removeTemporaryDirectory]; - - [CCUtility createDirectoryStandard]; - - [[NCAutoUpload shared] alignPhotoLibraryWithViewController:self]; - - // Inizialized home - [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:NCGlobal.shared.notificationCenterInitialize object:nil userInfo:nil]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) { NCUtilityFileSystem *ufs = [[NCUtilityFileSystem alloc] init]; @@ -476,7 +430,11 @@ - (void)clearCacheRequest:(XLFormRowDescriptor *)sender - (void)clearAllCacheRequest:(XLFormRowDescriptor *)sender { [self deselectFormRow:sender]; - [self clearCache:nil]; + + [[NCActivityIndicator shared] startActivityWithBackgroundView:nil style: UIActivityIndicatorViewStyleLarge blurEffect:true]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) { + [self clearCache:nil]; + }); } - (void)calculateSize @@ -502,24 +460,10 @@ - (void)exitNextcloud:(XLFormRowDescriptor *)sender UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"" message:NSLocalizedString(@"_want_exit_", nil) preferredStyle:UIAlertControllerStyleActionSheet]; [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) { - [appDelegate resetApplication]; tealium = [[TealiumHelper alloc] init]; [tealium trackEventWithTitle:@"magentacloud-app.settings.logout" data:nil]; [adjust trackEvent:Logout]; - [[NSURLCache sharedURLCache] setMemoryCapacity:0]; - [[NSURLCache sharedURLCache] setDiskCapacity:0]; - - [CCUtility removeGroupDirectoryProviderStorage]; - [CCUtility removeGroupApplicationSupport]; - - [CCUtility removeDocumentsDirectory]; - [CCUtility removeTemporaryDirectory]; - - [CCUtility deleteAllChainStore]; - - [[NCManageDatabase shared] removeDB]; - - exit(0); + [appDelegate resetApplication]; }]]; [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_cancel_", nil) style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { @@ -537,7 +481,7 @@ - (void)exitNextcloud:(XLFormRowDescriptor *)sender - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - if (indexPath.section == 5 && indexPath.row == 2) { + if (indexPath.section == 4 && indexPath.row == 2) { return 80; } else { return NCGlobal.shared.heightCellSettings;