diff options
author | ritsuka <[email protected]> | 2015-02-28 11:30:45 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2015-02-28 11:30:45 +0000 |
commit | daf605e2fdf69a1a3c2ae5558e6d5a9699d1ca53 (patch) | |
tree | bfa0c26915b4376fd980b0ffa3f9bb17294b575f /macosx | |
parent | 90a6fc70ae14396334ab8a3ffcb734b7c5f29661 (diff) |
MacGui: check for duplicated file names when adding a batch of jobs.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6946 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/HBController.m | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/macosx/HBController.m b/macosx/HBController.m index 270b40186..85d0fd12e 100644 --- a/macosx/HBController.m +++ b/macosx/HBController.m @@ -1212,13 +1212,29 @@ job.title = nil; [jobs addObject:job]; [job release]; + } + } - if ([[NSFileManager defaultManager] fileExistsAtPath:job.destURL.path] || [fQueueController jobExistAtURL:job.destURL]) - { - fileExists = YES; - } + NSMutableSet *destinations = [[NSMutableSet alloc] init]; + for (HBJob *job in jobs) + { + if ([destinations containsObject:job.destURL]) + { + fileExists = YES; + break; + } + else + { + [destinations addObject:job.destURL]; + } + + if ([[NSFileManager defaultManager] fileExistsAtPath:job.destURL.path] || [fQueueController jobExistAtURL:job.destURL]) + { + fileExists = YES; + break; } } + [destinations release]; if (fileExists) { |