[vlc-commits] macosx: adapt setter for freetype settings

David Fuhrmann git at videolan.org
Sun May 26 19:51:25 CEST 2013


vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Sun May 26 19:49:24 2013 +0200| [13397571a6cdd93d2a405a65509e1d6a79de73fe] | committer: David Fuhrmann

macosx: adapt setter for freetype settings

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=13397571a6cdd93d2a405a65509e1d6a79de73fe
---

 modules/gui/macosx/MainMenu.m |   27 +++++++--------------------
 1 file changed, 7 insertions(+), 20 deletions(-)

diff --git a/modules/gui/macosx/MainMenu.m b/modules/gui/macosx/MainMenu.m
index bee7d91..9e68545 100644
--- a/modules/gui/macosx/MainMenu.m
+++ b/modules/gui/macosx/MainMenu.m
@@ -955,34 +955,21 @@ static VLCMainMenu *_o_sharedInstance = nil;
 
 - (IBAction)switchSubtitleOption:(id)sender
 {
-    vlc_object_t *p_freetype;
-    p_freetype = (vlc_object_t *) vlc_object_find_name(pl_Get(VLCIntf), "freetype");
     int intValue = [sender tag];
     NSString *representedObject = [sender representedObject];
 
-    if (p_freetype) {
-        var_SetInteger(p_freetype, [representedObject UTF8String], intValue);
-        NSMenu *menu = [sender menu];
-        NSUInteger count = [menu numberOfItems];
-        for (NSUInteger x = 0; x < count; x++)
-            [[menu itemAtIndex:x] setState:NSOffState];
-        [[menu itemWithTag:intValue] setState:NSOnState];
-        vlc_object_release(p_freetype);
-    }
     config_PutInt(p_intf, [representedObject UTF8String], intValue);
+
+    NSMenu *menu = [sender menu];
+    NSUInteger count = [menu numberOfItems];
+    for (NSUInteger x = 0; x < count; x++)
+        [[menu itemAtIndex:x] setState:NSOffState];
+    [[menu itemWithTag:intValue] setState:NSOnState];
 }
 
 - (IBAction)switchSubtitleBackgroundOpacity:(id)sender
 {
-    vlc_object_t *p_freetype;
-    p_freetype = (vlc_object_t *) vlc_object_find_name(pl_Get(VLCIntf), "freetype");
-    int intValue = [sender intValue];
-
-    if (p_freetype) {
-        var_SetInteger(p_freetype, "freetype-background-opacity", intValue);
-        vlc_object_release(p_freetype);
-    }
-    config_PutInt(p_intf, "freetype-background-opacity", intValue);
+    config_PutInt(p_intf, "freetype-background-opacity", [sender intValue]);
 }
 
 - (IBAction)telxTransparent:(id)sender



More information about the vlc-commits mailing list