add some duplicate filtering when adding a disk image to the recent list.

This commit is contained in:
Kelvin Sherlock 2020-09-15 21:56:10 -04:00
parent 0d88e3e93a
commit 59ce93bbc0
1 changed files with 13 additions and 0 deletions

View File

@ -108,6 +108,19 @@
// todo -- check if file is in the list already...
BOOL found = NO;
// should really compare the volume id / ino I suppose.
for (NSMutableDictionary *d in _content) {
NSString *s = [d objectForKey: @"path"];
if ([path compare: s] == NSOrderedSame) {
found = YES;
[d setObject: [NSDate new] forKey: @"date"];
_dirty = YES; // ?
break;
}
}
if (found) return NO;
NSFileManager *fm = [NSFileManager defaultManager];
NSError *error;