]> granicus.if.org Git - handbrake/commitdiff
MacGui: use the kvc accessor methods, so that the presets menu will update properly...
authorDamiano Galassi <damiog@gmail.com>
Wed, 9 Mar 2016 18:16:40 +0000 (19:16 +0100)
committerDamiano Galassi <damiog@gmail.com>
Wed, 9 Mar 2016 18:16:40 +0000 (19:16 +0100)
macosx/HBPresetsManager.m
macosx/HBTreeNode.h

index aa78455ff775332c338b7ace22b2613055e3af7d..f897742a11e0c4cf442c116576bc379a4dbbd4e0 100644 (file)
@@ -75,7 +75,7 @@ NSString *HBPresetsChangedNotification = @"HBPresetsChangedNotification";
 
     for (HBPreset *preset in oldPresets.children)
     {
-        [self.root.children addObject:preset];
+        [self.root insertObject:preset inChildrenAtIndex:self.root.countOfChildren];
     }
 }
 
@@ -209,7 +209,7 @@ typedef NS_ENUM(NSUInteger, HBPresetLoadingResult) {
     {
         for (NSDictionary *child in presetsDict[@"PresetList"])
         {
-            [self.root.children addObject:[[HBPreset alloc] initWithDictionary:child]];
+            [self.root insertObject:[[HBPreset alloc] initWithDictionary:child] inChildrenAtIndex:self.root.countOfChildren];
         }
 
         if (result == HBPresetLoadingResultOKUpgraded)
index be40a6125cffc3136faaa8e23515e9f1b6a19823..4b0afcb12bfe0af18df8e29f2448c8ab49015683 100644 (file)
@@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 /**
  *  Notify a delegate that something changed in the tree.
- *  KVO observing a tree looked complicated an expensive, so this is a lightweight
+ *  KVO observing a tree looks complicated and expensive, so this is a lightweight
  *  way to track the changes we need to know.
  */
 @protocol HBTreeNodeDelegate <NSObject>