|
@@ -1139,10 +1139,13 @@
|
|
|
|
|
|
//UIImage *themingBackground = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[capabilities.themingBackground stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]]; DEPRECATED iOS9
|
|
|
UIImage *themingBackground = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[capabilities.themingBackground stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]]]]];
|
|
|
- if (themingBackground)
|
|
|
- [UIImagePNGRepresentation(themingBackground) writeToFile:[NSString stringWithFormat:@"%@/themingBackground.png", app.directoryUser] atomically:YES];
|
|
|
- else
|
|
|
+ if (themingBackground) {
|
|
|
+ dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
+ [UIImagePNGRepresentation(themingBackground) writeToFile:[NSString stringWithFormat:@"%@/themingBackground.png", app.directoryUser] atomically:YES];
|
|
|
+ });
|
|
|
+ } else {
|
|
|
[[NSFileManager defaultManager] removeItemAtPath:[NSString stringWithFormat:@"%@/themingBackground.png", app.directoryUser] error:nil];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
@@ -1295,11 +1298,17 @@
|
|
|
|
|
|
- (void)downloadFileSuccess:(NSString *)fileID serverUrl:(NSString *)serverUrl selector:(NSString *)selector selectorPost:(NSString *)selectorPost
|
|
|
{
|
|
|
- __block tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataWithPredicate:[NSPredicate predicateWithFormat:@"fileID = %@", fileID]];
|
|
|
-
|
|
|
+ tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataWithPredicate:[NSPredicate predicateWithFormat:@"fileID = %@", fileID]];
|
|
|
if (metadata == nil)
|
|
|
return;
|
|
|
|
|
|
+ tableE2eEncryption *e2eEncryption = [[NCManageDatabase sharedInstance] getE2eEncryptionWithPredicate:[NSPredicate predicateWithFormat:@"fileNameIdentifier = %@ AND serverUrl = %@", metadata.fileName, serverUrl]];
|
|
|
+ if (e2eEncryption) {
|
|
|
+ metadata.encrypted = true;
|
|
|
+ metadata.fileName = e2eEncryption.fileName;
|
|
|
+ [CCUtility insertTypeFileIconName:metadata.fileName metadata:metadata];
|
|
|
+ }
|
|
|
+
|
|
|
// Download
|
|
|
if ([selector isEqualToString:selectorDownloadFile]) {
|
|
|
[self reloadDatasource:serverUrl];
|
|
@@ -1401,30 +1410,6 @@
|
|
|
[self copyFileToPasteboard:metadata];
|
|
|
}
|
|
|
|
|
|
- //download file plist
|
|
|
- if ([selector isEqualToString:selectorLoadPlist]) {
|
|
|
-
|
|
|
- dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
|
|
|
-
|
|
|
- long countSelectorLoadPlist = 0;
|
|
|
-
|
|
|
- for (NSOperation *operation in [app.netQueue operations]) {
|
|
|
-
|
|
|
- if ([((OCnetworking *)operation).metadataNet.selector isEqualToString:selectorLoadPlist])
|
|
|
- countSelectorLoadPlist++;
|
|
|
- }
|
|
|
-
|
|
|
- NSString *directoryID = [[NCManageDatabase sharedInstance] getDirectoryID:_serverUrl];
|
|
|
-
|
|
|
- if ((countSelectorLoadPlist == 0 || countSelectorLoadPlist % k_maxConcurrentOperation == 0) && [metadata.directoryID isEqualToString:directoryID] && directoryID) {
|
|
|
-
|
|
|
- dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
- [self reloadDatasource:serverUrl];
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
//selectorLoadViewImage
|
|
|
if ([selector isEqualToString:selectorLoadViewImage]) {
|
|
|
|
|
@@ -1895,7 +1880,7 @@
|
|
|
#pragma mark ===== Search =====
|
|
|
#pragma --------------------------------------------------------------------------------------------
|
|
|
|
|
|
--(void)searchStartTimer
|
|
|
+- (void)searchStartTimer
|
|
|
{
|
|
|
NSString *home = [CCUtility getHomeServerUrlActiveUrl:app.activeUrl];
|
|
|
|
|
@@ -1907,7 +1892,7 @@
|
|
|
[self.tableView reloadEmptyDataSet];
|
|
|
}
|
|
|
|
|
|
--(void)updateSearchResultsForSearchController:(UISearchController *)searchController
|
|
|
+- (void)updateSearchResultsForSearchController:(UISearchController *)searchController
|
|
|
{
|
|
|
//[self setNeedsStatusBarAppearanceUpdate];
|
|
|
|
|
@@ -4228,6 +4213,10 @@
|
|
|
_directoryGroupBy = [CCUtility getGroupBySettings];
|
|
|
_directoryOrder = [CCUtility getOrderSettings];
|
|
|
|
|
|
+ // Remove optimization for encrypted directory
|
|
|
+ if ([CCUtility isFolderEncrypted:self.serverUrl account:app.activeAccount])
|
|
|
+ _dateReadDataSource = nil;
|
|
|
+
|
|
|
// Controllo data lettura Data Source
|
|
|
tableDirectory *directory = [[NCManageDatabase sharedInstance] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account = %@ AND serverUrl = %@", app.activeAccount, serverUrl]];
|
|
|
|