Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if !defined(__has_feature) || !__has_feature(objc_arc) | 5 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 6 #error "This file requires ARC support." | 6 #error "This file requires ARC support." |
| 7 #endif | 7 #endif |
| 8 | 8 |
| 9 #import "remoting/ios/domain/host_info.h" | 9 #import "remoting/ios/domain/host_info.h" |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 host.hostId = [svr objectForKey:@"hostId"]; | 49 host.hostId = [svr objectForKey:@"hostId"]; |
| 50 host.hostName = [svr objectForKey:@"hostName"]; | 50 host.hostName = [svr objectForKey:@"hostName"]; |
| 51 host.hostOs = [svr objectForKey:@"hostOs"]; | 51 host.hostOs = [svr objectForKey:@"hostOs"]; |
| 52 host.hostVersion = [svr objectForKey:@"hostVersion"]; | 52 host.hostVersion = [svr objectForKey:@"hostVersion"]; |
| 53 host.hostOsVersion = [svr objectForKey:@"hostOsVersion"]; | 53 host.hostOsVersion = [svr objectForKey:@"hostOsVersion"]; |
| 54 host.jabberId = [svr objectForKey:@"jabberId"]; | 54 host.jabberId = [svr objectForKey:@"jabberId"]; |
| 55 host.kind = [svr objectForKey:@"kind"]; | 55 host.kind = [svr objectForKey:@"kind"]; |
| 56 host.publicKey = [svr objectForKey:@"publicKey"]; | 56 host.publicKey = [svr objectForKey:@"publicKey"]; |
| 57 host.status = [svr objectForKey:@"status"]; | 57 host.status = [svr objectForKey:@"status"]; |
| 58 | 58 |
| 59 NSString* ISO8601DateString = [svr objectForKey:@"updatedTime"]; | 59 // NSString* ISO8601DateString = [svr objectForKey:@"updatedTime"]; |
|
nicholss
2017/05/31 19:32:37
Do we need this anymore then? Can we delete?
Yuwei
2017/05/31 20:36:39
I don't think it's needed any more. I'll delete it
| |
| 60 if (ISO8601DateString != nil) { | 60 // if (ISO8601DateString != nil) { |
| 61 NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init]; | 61 // NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init]; |
| 62 [dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSSz"]; | 62 // [dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSSz"]; |
| 63 host.updatedTime = [dateFormatter dateFromString:ISO8601DateString]; | 63 // host.updatedTime = [dateFormatter dateFromString:ISO8601DateString]; |
| 64 } | 64 // } |
| 65 | 65 |
| 66 [hostList addObject:host]; | 66 [hostList addObject:host]; |
| 67 } | 67 } |
| 68 | 68 |
| 69 return hostList; | 69 return hostList; |
| 70 } | 70 } |
| 71 | 71 |
| 72 - (NSComparisonResult)compare:(HostInfo*)host { | 72 - (NSComparisonResult)compare:(HostInfo*)host { |
| 73 if (self.isOnline != host.isOnline) { | 73 if (self.isOnline != host.isOnline) { |
| 74 return self.isOnline ? NSOrderedAscending : NSOrderedDescending; | 74 return self.isOnline ? NSOrderedAscending : NSOrderedDescending; |
| 75 } else { | 75 } else { |
| 76 return [self.hostName localizedCaseInsensitiveCompare:host.hostName]; | 76 return [self.hostName localizedCaseInsensitiveCompare:host.hostName]; |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 | 79 |
| 80 - (NSString*)description { | 80 - (NSString*)description { |
| 81 return | 81 return |
| 82 [NSString stringWithFormat:@"HostInfo: name=%@ status=%@ updatedTime= %@", | 82 [NSString stringWithFormat:@"HostInfo: name=%@ status=%@ updatedTime= %@", |
| 83 _hostName, _status, _updatedTime]; | 83 _hostName, _status, _updatedTime]; |
| 84 } | 84 } |
| 85 | 85 |
| 86 @end | 86 @end |
| OLD | NEW |