[vlc-commits] macosx: info panel: remove dead code, clean up duplicate code

David Fuhrmann git at videolan.org
Sat Jan 2 22:36:47 CET 2016


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sat Jan  2 22:07:51 2016 +0100| [2588397b38210353e934484c904ee6f4ff4dddfb] | committer: David Fuhrmann

macosx: info panel: remove dead code, clean up duplicate code

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

 modules/gui/macosx/VLCPlaylistInfo.h |    6 +++---
 modules/gui/macosx/VLCPlaylistInfo.m |   33 +++------------------------------
 2 files changed, 6 insertions(+), 33 deletions(-)

diff --git a/modules/gui/macosx/VLCPlaylistInfo.h b/modules/gui/macosx/VLCPlaylistInfo.h
index 7b1ad64..e75eeae 100644
--- a/modules/gui/macosx/VLCPlaylistInfo.h
+++ b/modules/gui/macosx/VLCPlaylistInfo.h
@@ -27,7 +27,7 @@
  *****************************************************************************/
 
 
- at interface VLCInfo : NSWindowController<NSOutlineViewDataSource>
+ at interface VLCInfo : NSWindowController
 
 @property (readonly) input_item_t *item;
 
@@ -100,9 +100,9 @@
 - (IBAction)metaFieldChanged:(id)sender;
 - (IBAction)saveMetaData:(id)sender;
 - (IBAction)downloadCoverArt:(id)sender;
-- (void)initMediaPanelStats;
+
 - (void)updatePanelWithItem:(input_item_t *)_p_item;
-- (void)setMeta:(char *)meta forLabel:(id)theItem;
+
 - (void)updateMetadata;
 - (void)updateStatistics;
 
diff --git a/modules/gui/macosx/VLCPlaylistInfo.m b/modules/gui/macosx/VLCPlaylistInfo.m
index f3a9fbd..337c742 100644
--- a/modules/gui/macosx/VLCPlaylistInfo.m
+++ b/modules/gui/macosx/VLCPlaylistInfo.m
@@ -28,7 +28,7 @@
 #import "VLCPlaylist.h"
 #import <vlc_url.h>
 
- at interface VLCInfo () <NSOutlineViewDataSource, NSOutlineViewDelegate>
+ at interface VLCInfo () <NSOutlineViewDataSource>
 {
     VLCInfoTreeItem *rootItem;
 
@@ -59,7 +59,6 @@
     [self.window setTitle: _NS("Media Information")];
 
     _outlineView.dataSource = self;
-    _outlineView.delegate = self;
 
     [_uriLabel setStringValue: _NS("Location")];
     [_titleLabel setStringValue: _NS("Title")];
@@ -191,7 +190,7 @@
         if (!p_item) {
             /* Erase */
         #define SET( foo ) \
-            [self setMeta: "" forLabel: _##foo##TextField];
+            [_##foo##TextField setStringValue:@""];
             SET( uri );
             SET( title );
             SET( author );
@@ -225,7 +224,7 @@
 
         #define SET( foo, bar ) \
             char *psz_##foo = input_item_Get##bar ( p_item ); \
-            [self setMeta: psz_##foo forLabel: _##foo##TextField]; \
+            [_##foo##TextField setStringValue:toNSStr(psz_##foo)]; \
             FREENULL( psz_##foo );
 
             /* fill the other fields */
@@ -264,14 +263,6 @@
     }
 }
 
-- (void)setMeta: (char *)psz_meta forLabel: (id)theItem
-{
-    if (psz_meta != NULL && *psz_meta)
-        [theItem setStringValue: toNSStr(psz_meta)];
-    else
-        [theItem setStringValue: @""];
-}
-
 - (void)updateStatistics
 {
     if (!b_awakeFromNib || !b_stats)
@@ -399,26 +390,8 @@ error:
     if (p_item) libvlc_ArtRequest(VLCIntf->p_libvlc, p_item, META_REQUEST_OPTION_NONE);
 }
 
-- (input_item_t *)item
-{
-    if (p_item) vlc_gc_incref(p_item);
-    return p_item;
-}
-
 @end
 
- at implementation VLCInfo (NSMenuValidation)
-
-- (BOOL)validateMenuItem:(NSMenuItem *)mi
-{
-    if ([[mi title] isEqualToString: _NS("Information")]) {
-        return ![[[VLCMain sharedInstance] playlist] isSelectionEmpty];
-    }
-
-    return TRUE;
-}
-
- at end
 
 @implementation VLCInfo (NSTableDataSource)
 



More information about the vlc-commits mailing list