Marino Faggiana 6 年之前
父节点
当前提交
63a71bfefa
共有 4 个文件被更改,包括 10 次插入6 次删除
  1. 1 1
      iOSClient/AppDelegate.m
  2. 2 0
      iOSClient/Main/CCDetail.m
  3. 3 1
      iOSClient/Main/CCMain.m
  4. 4 4
      iOSClient/Networking/CCNetworking.m

+ 1 - 1
iOSClient/AppDelegate.m

@@ -1345,7 +1345,7 @@
     [_listProgressMetadata removeObjectForKey:fileID];
     
     // Progress Task
-    NSDictionary* userInfo = @{@"fileID": (fileID), @"serverUrl": (serverUrl), @"cryptated": ([NSNumber numberWithBool:NO]), @"progress": ([NSNumber numberWithFloat:0.0])};
+    NSDictionary* userInfo = @{@"fileID": (fileID), @"serverUrl": (serverUrl), @"cryptated": ([NSNumber numberWithBool:NO]), @"progress": ([NSNumber numberWithFloat:0.0]), @"totalBytes": ([NSNumber numberWithLongLong:0]), @"totalBytesExpected": ([NSNumber numberWithLongLong:0])};
     
     [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"NotificationProgressTask" object:nil userInfo:userInfo];
 

+ 2 - 0
iOSClient/Main/CCDetail.m

@@ -609,6 +609,8 @@
     NSString *fileID = [dict valueForKey:@"fileID"];
     //NSString *serverUrl = [dict valueForKey:@"serverUrl"];
     float progress = [[dict valueForKey:@"progress"] floatValue];
+    //long long totalBytes = [[dict valueForKey:@"totalBytes"] longLongValue];
+    //long long totalBytesExpected = [[dict valueForKey:@"totalBytesExpected"] longLongValue];
     
     if ([fileID isEqualToString:_fileIDNowVisible])
         [_hud progress:progress];

+ 3 - 1
iOSClient/Main/CCMain.m

@@ -2149,7 +2149,9 @@
     NSString *fileID = [dict valueForKey:@"fileID"];
     NSString *serverUrl = [dict valueForKey:@"serverUrl"];
     float progress = [[dict valueForKey:@"progress"] floatValue];
-    
+    long long totalBytes = [[dict valueForKey:@"totalBytes"] longLongValue];
+    long long totalBytesExpected = [[dict valueForKey:@"totalBytesExpected"] longLongValue];
+
     // Check
     if (!fileID || [fileID isEqualToString: @""])
         return;

+ 4 - 4
iOSClient/Networking/CCNetworking.m

@@ -572,7 +572,7 @@
     
     if (metadata) {
         
-        NSDictionary* userInfo = @{@"fileID": (metadata.fileID), @"serverUrl": (serverUrl), @"progress": ([NSNumber numberWithFloat:progress])};
+        NSDictionary* userInfo = @{@"fileID": (metadata.fileID), @"serverUrl": (serverUrl), @"progress": ([NSNumber numberWithFloat:progress]), @"totalBytes": ([NSNumber numberWithLongLong:totalBytesWritten]), @"totalBytesExpected": ([NSNumber numberWithLongLong:totalBytesExpectedToWrite])};
             
         [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"NotificationProgressTask" object:nil userInfo:userInfo];
     } else {
@@ -992,9 +992,9 @@
     tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataInSessionFromFileName:fileName directoryID:directoryID];
     
     if (metadata) {
-            
-        NSDictionary* userInfo = @{@"fileID": (metadata.fileID), @"serverUrl": (serverUrl), @"progress": ([NSNumber numberWithFloat:progress])};
-                
+
+        NSDictionary* userInfo = @{@"fileID": (metadata.fileID), @"serverUrl": (serverUrl), @"progress": ([NSNumber numberWithFloat:progress]), @"totalBytes": ([NSNumber numberWithLongLong:totalBytesSent]), @"totalBytesExpected": ([NSNumber numberWithLongLong:totalBytesExpectedToSend])};
+        
         [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"NotificationProgressTask" object:nil userInfo:userInfo];
     }
 }