diff options
author | dynaflash <[email protected]> | 2007-05-15 20:33:42 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2007-05-15 20:33:42 +0000 |
commit | e9d56113d05a2e24a6bc90ccd1dec682db4f3d1b (patch) | |
tree | 09c9de9c3381ca8bdfe011bbe718f275447883f4 /macosx | |
parent | 2cf831aa6215005f9e151398672735555acd0e8b (diff) |
macGui: fix bug in Advanced x264 option widgets
Modify the test to see if an optName already exists to avoid conflict with similar name patterns in the -X264AdvancedOptionsChanged: method where we test for the presence of the optNameToChange in the existing string.
This change starts on line 2215.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@583 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/Controller.mm | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 58c9750c0..06c460f8b 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -2210,9 +2210,17 @@ the user is using "Custom" settings by determining the sender*/ /*verify there is an occurrence of the opt specified by the sender to change */ /*take care of any multi-value opt names here. This is extremely kludgy, but test for functionality - and worry about pretty later */ - NSRange currentOptRange = [currentOptString rangeOfString:optNameToChange]; - if (currentOptRange.location != NSNotFound) + and worry about pretty later */ + + /*First, we create a pattern to check for ":"optNameToChange"=" to modify the option if the name falls after + the first character of the opt string (hence the ":") */ + NSString *checkOptNameToChange = [NSString stringWithFormat:@":%@=",optNameToChange]; + NSRange currentOptRange = [currentOptString rangeOfString:checkOptNameToChange]; + /*Then we create a pattern to check for "<beginning of line>"optNameToChange"=" to modify the option to + see if the name falls at the beginning of the line, where we would not have the ":" as a pattern to test against*/ + NSString *checkOptNameToChangeBeginning = [NSString stringWithFormat:@"%@=",optNameToChange]; + NSRange currentOptRangeBeginning = [currentOptString rangeOfString:checkOptNameToChangeBeginning]; + if (currentOptRange.location != NSNotFound || currentOptRangeBeginning.location == 0) { /* Create new empty opt string*/ NSString *changedOptString = @""; |