|
@@ -3194,8 +3194,8 @@
|
|
|
- (void)removeLocalFile:(tableMetadata *)metadata
|
|
|
{
|
|
|
NSString *serverUrl = [[NCManageDatabase sharedInstance] getServerUrl:_metadata.directoryID];
|
|
|
-
|
|
|
- [CCCoreData deleteLocalFileWithPredicate:[NSPredicate predicateWithFormat:@"(account == %@) AND (fileID == %@)", app.activeAccount, metadata.fileID]];
|
|
|
+
|
|
|
+ [[NCManageDatabase sharedInstance] deleteLocalFileWithPredicate:[NSPredicate predicateWithFormat:@"fileID = %@", metadata.fileID]];
|
|
|
|
|
|
[[NSFileManager defaultManager] removeItemAtPath:[NSString stringWithFormat:@"%@/%@", app.directoryUser, metadata.fileID] error:nil];
|
|
|
|
|
@@ -4099,7 +4099,7 @@
|
|
|
titoloLock = [NSString stringWithFormat:NSLocalizedString(@"_protect_passcode_", nil)];
|
|
|
}
|
|
|
|
|
|
- TableLocalFile *recordLocalFile = [CCCoreData getLocalFileWithEtag:_metadata.fileID activeAccount:app.activeAccount];
|
|
|
+ tableLocalFile *localFile = [[NCManageDatabase sharedInstance] getTableLocalFileWithPredicate:[NSPredicate predicateWithFormat:@"fileID = %@", _metadata.fileID]];
|
|
|
|
|
|
/******************************************* AHKActionSheet *******************************************/
|
|
|
|
|
@@ -4387,7 +4387,7 @@
|
|
|
[self moveOpenWindow:[[NSArray alloc] initWithObjects:indexPath, nil]];
|
|
|
}];
|
|
|
|
|
|
- if (recordLocalFile || [[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/%@", app.directoryUser, _metadata.fileID]]) {
|
|
|
+ if (localFile || [[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/%@", app.directoryUser, _metadata.fileID]]) {
|
|
|
|
|
|
[actionSheet addButtonWithTitle:NSLocalizedString(@"_remove_local_file_", nil)
|
|
|
image:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"actionSheetRemoveLocal"] color:[NCBrandColor sharedInstance].brand]
|
|
@@ -4972,7 +4972,7 @@
|
|
|
lunghezzaFile = @" ";
|
|
|
}
|
|
|
|
|
|
- TableLocalFile *recordLocalFile = [CCCoreData getLocalFileWithEtag:metadata.fileID activeAccount:app.activeAccount];
|
|
|
+ tableLocalFile *localFile = [[NCManageDatabase sharedInstance] getTableLocalFileWithPredicate:[NSPredicate predicateWithFormat:@"fileID = %@", metadata.fileID]];
|
|
|
|
|
|
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
|
|
|
[dateFormatter setDateStyle:NSDateFormatterShortStyle];
|
|
@@ -4982,7 +4982,7 @@
|
|
|
cell.labelInfoFile.text = [NSString stringWithFormat:@"%@", dataFile];
|
|
|
|
|
|
if ([metadata.type isEqualToString: k_metadataType_file] && [dataFile isEqualToString:@" "] == NO && [lunghezzaFile isEqualToString:@" "] == NO) {
|
|
|
- if (recordLocalFile && [[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/%@", app.directoryUser, metadata.fileID]])
|
|
|
+ if (localFile && [[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/%@", app.directoryUser, metadata.fileID]])
|
|
|
cell.labelInfoFile.text = [NSString stringWithFormat:@"%@ • %@", dataFile, lunghezzaFile];
|
|
|
else
|
|
|
cell.labelInfoFile.text = [NSString stringWithFormat:@"%@ ◦ %@", dataFile, lunghezzaFile];
|