Commit 2588397b authored by David Fuhrmann's avatar David Fuhrmann

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

parent a0d04a2f
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
*****************************************************************************/ *****************************************************************************/
@interface VLCInfo : NSWindowController<NSOutlineViewDataSource> @interface VLCInfo : NSWindowController
@property (readonly) input_item_t *item; @property (readonly) input_item_t *item;
...@@ -100,9 +100,9 @@ ...@@ -100,9 +100,9 @@
- (IBAction)metaFieldChanged:(id)sender; - (IBAction)metaFieldChanged:(id)sender;
- (IBAction)saveMetaData:(id)sender; - (IBAction)saveMetaData:(id)sender;
- (IBAction)downloadCoverArt:(id)sender; - (IBAction)downloadCoverArt:(id)sender;
- (void)initMediaPanelStats;
- (void)updatePanelWithItem:(input_item_t *)_p_item; - (void)updatePanelWithItem:(input_item_t *)_p_item;
- (void)setMeta:(char *)meta forLabel:(id)theItem;
- (void)updateMetadata; - (void)updateMetadata;
- (void)updateStatistics; - (void)updateStatistics;
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#import "VLCPlaylist.h" #import "VLCPlaylist.h"
#import <vlc_url.h> #import <vlc_url.h>
@interface VLCInfo () <NSOutlineViewDataSource, NSOutlineViewDelegate> @interface VLCInfo () <NSOutlineViewDataSource>
{ {
VLCInfoTreeItem *rootItem; VLCInfoTreeItem *rootItem;
...@@ -59,7 +59,6 @@ ...@@ -59,7 +59,6 @@
[self.window setTitle: _NS("Media Information")]; [self.window setTitle: _NS("Media Information")];
_outlineView.dataSource = self; _outlineView.dataSource = self;
_outlineView.delegate = self;
[_uriLabel setStringValue: _NS("Location")]; [_uriLabel setStringValue: _NS("Location")];
[_titleLabel setStringValue: _NS("Title")]; [_titleLabel setStringValue: _NS("Title")];
...@@ -191,7 +190,7 @@ ...@@ -191,7 +190,7 @@
if (!p_item) { if (!p_item) {
/* Erase */ /* Erase */
#define SET( foo ) \ #define SET( foo ) \
[self setMeta: "" forLabel: _##foo##TextField]; [_##foo##TextField setStringValue:@""];
SET( uri ); SET( uri );
SET( title ); SET( title );
SET( author ); SET( author );
...@@ -225,7 +224,7 @@ ...@@ -225,7 +224,7 @@
#define SET( foo, bar ) \ #define SET( foo, bar ) \
char *psz_##foo = input_item_Get##bar ( p_item ); \ 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 ); FREENULL( psz_##foo );
/* fill the other fields */ /* fill the other fields */
...@@ -264,14 +263,6 @@ ...@@ -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 - (void)updateStatistics
{ {
if (!b_awakeFromNib || !b_stats) if (!b_awakeFromNib || !b_stats)
...@@ -399,26 +390,8 @@ error: ...@@ -399,26 +390,8 @@ error:
if (p_item) libvlc_ArtRequest(VLCIntf->p_libvlc, p_item, META_REQUEST_OPTION_NONE); 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 @end
@implementation VLCInfo (NSMenuValidation)
- (BOOL)validateMenuItem:(NSMenuItem *)mi
{
if ([[mi title] isEqualToString: _NS("Information")]) {
return ![[[VLCMain sharedInstance] playlist] isSelectionEmpty];
}
return TRUE;
}
@end
@implementation VLCInfo (NSTableDataSource) @implementation VLCInfo (NSTableDataSource)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment