mirror of https://code.videolan.org/videolan/vlc
macosx: Use actual filetype icons in browse collection view items
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
This commit is contained in:
parent
d641b2b25d
commit
aad3a0a227
|
@ -37,6 +37,9 @@
|
||||||
#import "views/VLCImageView.h"
|
#import "views/VLCImageView.h"
|
||||||
#import "views/VLCTrackingView.h"
|
#import "views/VLCTrackingView.h"
|
||||||
|
|
||||||
|
#import <vlc_input.h>
|
||||||
|
#import <vlc_url.h>
|
||||||
|
|
||||||
NSString *VLCMediaSourceCellIdentifier = @"VLCLibraryCellIdentifier";
|
NSString *VLCMediaSourceCellIdentifier = @"VLCLibraryCellIdentifier";
|
||||||
|
|
||||||
@interface VLCMediaSourceCollectionViewItem()
|
@interface VLCMediaSourceCollectionViewItem()
|
||||||
|
@ -174,8 +177,17 @@ NSString *VLCMediaSourceCellIdentifier = @"VLCLibraryCellIdentifier";
|
||||||
- (NSImage *)imageForInputItem
|
- (NSImage *)imageForInputItem
|
||||||
{
|
{
|
||||||
NSImage *image;
|
NSImage *image;
|
||||||
if (_representedInputItem.inputType == ITEM_TYPE_DIRECTORY) {
|
if (!_representedInputItem.isStream && _representedInputItem.vlcInputItem) {
|
||||||
image = [NSImage imageNamed:NSImageNameFolder];
|
char *psz_url = input_item_GetURI(_representedInputItem.vlcInputItem);
|
||||||
|
if (psz_url) {
|
||||||
|
char *psz_path = vlc_uri2path(psz_url);
|
||||||
|
NSString *path = toNSStr(psz_path);
|
||||||
|
|
||||||
|
free(psz_url);
|
||||||
|
free(psz_path);
|
||||||
|
|
||||||
|
image = [[NSWorkspace sharedWorkspace] iconForFile:path];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!image) {
|
if (!image) {
|
||||||
|
|
Loading…
Reference in New Issue