Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
403 results
Show changes
Commits on Source (8)
......@@ -28,14 +28,15 @@
- (void)appendInputNodePathControlItem:(VLCInputNodePathControlItem *)inputNodePathControlItem
{
NSParameterAssert(inputNodePathControlItem != nil);
NSParameterAssert(inputNodePathControlItem.image != nil);
NSParameterAssert(inputNodePathControlItem.image.name != nil);
NSParameterAssert(![inputNodePathControlItem.image.name isEqualToString:@""]);
if (_inputNodePathControlItems == nil) {
_inputNodePathControlItems = [NSMutableDictionary dictionary];
}
if ([inputNodePathControlItem.image.name isEqualToString:@""]) {
return;
}
[_inputNodePathControlItems setObject:inputNodePathControlItem forKey:inputNodePathControlItem.image.name];
NSMutableArray *pathItems = [NSMutableArray arrayWithArray:self.pathItems];
......
......@@ -36,16 +36,19 @@
VLCInputItem * const inputItem = inputNode.inputItem;
self.title = inputItem.name;
[VLCLibraryImageCache thumbnailForInputItem:inputItem withCompletion:^(NSImage * const thumbnail) {
self.image = thumbnail;
// HACK: We have no way when we get the clicked item from the path control
// of knowing specifically which input node this path item corresponds to,
// as the path control returns a copy for clickedPathItem that is not of
// this class. As a very awkward workaround, lets set the name of the image
// used here as the MRL of the node's input item
self.image.name = inputItem.MRL;
}];
self.image = [VLCLibraryImageCache thumbnailForInputItem:inputItem];;
// HACK: We have no way when we get the clicked item from the path control
// of knowing specifically which input node this path item corresponds to,
// as the path control returns a copy for clickedPathItem that is not of
// this class. As a very awkward workaround, lets set the name of the image
// used here as the MRL of the node's input item
self.image.name = inputItem.MRL;
} else if (inputNode == nil) {
NSLog(@"WARNING: Received nil input node, cannot create VLCInputNodePathControlItem");
} else if (inputNode.inputItem == nil) {
NSLog(@"WARNING: Received nil input node's input item, cannot create VLCInputNodePathControlItem");
}
return self;
}
......
......@@ -62,7 +62,7 @@ NSString *VLCMediaSourceTableViewCellIdentifier = @"VLCMediaSourceTableViewCellI
self = [super init];
if (self) {
_mediaSources = @[];
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
NSNotificationCenter * const notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self
selector:@selector(mediaSourceChildrenReset:)
name:VLCMediaSourceChildrenReset
......@@ -147,17 +147,20 @@ NSString *VLCMediaSourceTableViewCellIdentifier = @"VLCMediaSourceTableViewCellI
- (void)loadMediaSources
{
[self.pathControl clearInputNodePathControlItems];
NSArray *mediaSources;
if (self.mediaSourceMode == VLCMediaSourceModeLAN) {
mediaSources = [VLCMediaSourceProvider listOfLocalMediaSources];
} else {
mediaSources = [VLCMediaSourceProvider listOfMediaSourcesForCategory:SD_CAT_INTERNET];
}
NSUInteger count = mediaSources.count;
NSAssert(mediaSources != nil, @"Media sources array should not be nil");
const NSUInteger count = mediaSources.count;
if (count > 0) {
for (NSUInteger x = 0; x < count; x++) {
VLCMediaSource *mediaSource = mediaSources[x];
VLCInputNode *rootNode = [mediaSource rootNode];
VLCMediaSource * const mediaSource = mediaSources[x];
VLCInputNode * const rootNode = [mediaSource rootNode];
[mediaSource preparseInputNodeWithinTree:rootNode];
}
}
......@@ -187,8 +190,8 @@ NSString *VLCMediaSourceTableViewCellIdentifier = @"VLCMediaSourceTableViewCellI
numberOfItemsInSection:(NSInteger)section
{
if (_mediaSourceMode == VLCMediaSourceModeLAN) {
VLCMediaSource *mediaSource = _mediaSources[section];
VLCInputNode *rootNode = mediaSource.rootNode;
VLCMediaSource * const mediaSource = _mediaSources[section];
VLCInputNode * const rootNode = mediaSource.rootNode;
return rootNode.numberOfChildren;
}
......@@ -198,22 +201,22 @@ NSString *VLCMediaSourceTableViewCellIdentifier = @"VLCMediaSourceTableViewCellI
- (NSCollectionViewItem *)collectionView:(NSCollectionView *)collectionView
itemForRepresentedObjectAtIndexPath:(NSIndexPath *)indexPath
{
VLCMediaSourceDeviceCollectionViewItem *viewItem = [collectionView makeItemWithIdentifier:VLCMediaSourceDeviceCellIdentifier forIndexPath:indexPath];
VLCMediaSource *mediaSource = _mediaSources[indexPath.section];
VLCMediaSourceDeviceCollectionViewItem * const viewItem = [collectionView makeItemWithIdentifier:VLCMediaSourceDeviceCellIdentifier forIndexPath:indexPath];
VLCMediaSource * const mediaSource = _mediaSources[indexPath.section];
if (_mediaSourceMode == VLCMediaSourceModeLAN) {
VLCInputNode *rootNode = mediaSource.rootNode;
NSArray *nodeChildren = rootNode.children;
VLCInputNode *childNode = nodeChildren[indexPath.item];
VLCInputItem *childRootInput = childNode.inputItem;
VLCInputNode * const rootNode = mediaSource.rootNode;
NSArray * const nodeChildren = rootNode.children;
VLCInputNode * const childNode = nodeChildren[indexPath.item];
VLCInputItem * const childRootInput = childNode.inputItem;
viewItem.titleTextField.stringValue = childRootInput.name;
const enum input_item_type_e inputType = childRootInput.inputType;
const BOOL isStream = childRootInput.isStream;
NSURL *artworkURL = childRootInput.artworkURL;
NSImage *placeholder = nil;
NSURL * const artworkURL = childRootInput.artworkURL;
NSImage *placeholder;
if (mediaSource.category == SD_CAT_LAN) {
placeholder = [NSImage imageNamed:@"bw-Music"];
} else {
......@@ -237,6 +240,7 @@ NSString *VLCMediaSourceTableViewCellIdentifier = @"VLCMediaSourceTableViewCellI
break;
}
}
NSAssert(placeholder != nil, @"Placeholder image should not be nil");
if (artworkURL) {
[viewItem.mediaImageView setImageURL:artworkURL placeholderImage:placeholder];
......@@ -244,7 +248,7 @@ NSString *VLCMediaSourceTableViewCellIdentifier = @"VLCMediaSourceTableViewCellI
viewItem.mediaImageView.image = placeholder;
}
} else {
VLCMediaSource *mediaSource = _mediaSources[indexPath.item];
VLCMediaSource * const mediaSource = _mediaSources[indexPath.item];
viewItem.titleTextField.stringValue = mediaSource.mediaSourceDescription;
viewItem.mediaImageView.image = [NSImage imageNamed:@"bw-Music"];
}
......@@ -254,7 +258,7 @@ NSString *VLCMediaSourceTableViewCellIdentifier = @"VLCMediaSourceTableViewCellI
- (void)collectionView:(NSCollectionView *)collectionView didSelectItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths
{
NSIndexPath *indexPath = indexPaths.anyObject;
NSIndexPath * const indexPath = indexPaths.anyObject;
if (!indexPath) {
return;
}
......@@ -264,14 +268,17 @@ NSString *VLCMediaSourceTableViewCellIdentifier = @"VLCMediaSourceTableViewCellI
if (_mediaSourceMode == VLCMediaSourceModeLAN) {
mediaSource = _mediaSources[indexPath.section];
VLCInputNode *rootNode = mediaSource.rootNode;
NSArray *nodeChildren = rootNode.children;
VLCInputNode * const rootNode = mediaSource.rootNode;
NSArray * const nodeChildren = rootNode.children;
childNode = nodeChildren[indexPath.item];
} else {
mediaSource = _mediaSources[indexPath.item];
childNode = mediaSource.rootNode;
}
NSAssert(mediaSource != nil, @"Media source should not be nil");
NSAssert(childNode != nil, @"Child node should not be nil");
[self configureChildDataSourceWithNode:childNode andMediaSource:mediaSource];
[self reloadData];
}
......@@ -296,8 +303,8 @@ viewForSupplementaryElementOfKind:(NSCollectionViewSupplementaryElementKind)kind
referenceSizeForHeaderInSection:(NSInteger)section
{
if (_mediaSourceMode == VLCMediaSourceModeLAN) {
VLCMediaSource *mediaSource = _mediaSources[section];
VLCInputNode *rootNode = mediaSource.rootNode;
VLCMediaSource * const mediaSource = _mediaSources[section];
VLCInputNode * const rootNode = mediaSource.rootNode;
// Hide Section if no children under the root node are found.
return rootNode.numberOfChildren == 0 ? CGSizeZero : [VLCLibraryCollectionViewSupplementaryElementView defaultHeaderSize];
}
......@@ -309,7 +316,7 @@ referenceSizeForHeaderInSection:(NSInteger)section
layout:(NSCollectionViewLayout *)collectionViewLayout
sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
VLCLibraryCollectionViewFlowLayout *collectionViewFlowLayout = (VLCLibraryCollectionViewFlowLayout*)collectionViewLayout;
VLCLibraryCollectionViewFlowLayout * const collectionViewFlowLayout = (VLCLibraryCollectionViewFlowLayout*)collectionViewLayout;
NSAssert(collectionViewLayout, @"This should be a flow layout and thus a valid pointer");
return [VLCLibraryUIUnits adjustedCollectionViewItemSizeForCollectionView:collectionView
withLayout:collectionViewFlowLayout
......@@ -326,16 +333,20 @@ referenceSizeForHeaderInSection:(NSInteger)section
* as the truth to the table view. For collection view, we use sections which can be reloaded individually,
* so the problem is well hidden and does not need this work-around */
_discoveredLANdevices = nil;
NSMutableArray *currentDevices;
@synchronized (_mediaSources) {
NSInteger mediaSourceCount = _mediaSources.count;
const NSInteger mediaSourceCount = _mediaSources.count;
currentDevices = [[NSMutableArray alloc] initWithCapacity:mediaSourceCount];
for (NSUInteger x = 0; x < mediaSourceCount; x++) {
VLCMediaSource *mediaSource = _mediaSources[x];
VLCInputNode *rootNode = mediaSource.rootNode;
VLCMediaSource * const mediaSource = _mediaSources[x];
VLCInputNode * const rootNode = mediaSource.rootNode;
[currentDevices addObjectsFromArray:rootNode.children];
}
}
NSAssert(currentDevices != nil, @"Current devices should not be nil");
_discoveredLANdevices = [currentDevices copy];
return _discoveredLANdevices.count;
}
......@@ -351,16 +362,17 @@ referenceSizeForHeaderInSection:(NSInteger)section
cellView = [VLCLibraryTableCellView fromNibWithOwner:self];
cellView.identifier = VLCMediaSourceTableViewCellIdentifier;
}
cellView.primaryTitleTextField.hidden = YES;
cellView.secondaryTitleTextField.hidden = YES;
cellView.singlePrimaryTitleTextField.hidden = NO;
if (_mediaSourceMode == VLCMediaSourceModeLAN) {
VLCInputNode *currentNode = _discoveredLANdevices[row];
VLCInputItem *currentNodeInput = currentNode.inputItem;
VLCInputNode * const currentNode = _discoveredLANdevices[row];
VLCInputItem * const currentNodeInput = currentNode.inputItem;
NSURL *artworkURL = currentNodeInput.artworkURL;
NSImage *placeholder = [NSImage imageNamed:@"NXdefaultappicon"];
NSURL * const artworkURL = currentNodeInput.artworkURL;
NSImage * const placeholder = [NSImage imageNamed:@"NXdefaultappicon"];
if (artworkURL) {
[cellView.representedImageView setImageURL:artworkURL placeholderImage:placeholder];
} else {
......@@ -369,7 +381,7 @@ referenceSizeForHeaderInSection:(NSInteger)section
cellView.singlePrimaryTitleTextField.stringValue = currentNodeInput.name;
} else {
VLCMediaSource *mediaSource = _mediaSources[row];
VLCMediaSource * const mediaSource = _mediaSources[row];
cellView.singlePrimaryTitleTextField.stringValue = mediaSource.mediaSourceDescription;
cellView.representedImageView.image = [NSImage imageNamed:@"NXFollow"];
}
......@@ -379,20 +391,22 @@ referenceSizeForHeaderInSection:(NSInteger)section
- (void)tableViewSelectionDidChange:(NSNotification *)notification
{
NSInteger selectedRow = self.tableView.selectedRow;
const NSInteger selectedRow = self.tableView.selectedRow;
if (selectedRow < 0) {
return;
}
VLCMediaSource *mediaSource = _mediaSources[selectedRow];;
VLCMediaSource * const mediaSource = _mediaSources[selectedRow];
VLCInputNode *childNode;
if (_mediaSourceMode == VLCMediaSourceModeLAN) {
childNode = _discoveredLANdevices[selectedRow];
} else {
childNode = mediaSource.rootNode;
}
[self configureChildDataSourceWithNode:childNode andMediaSource:mediaSource];
NSAssert(childNode != nil, @"Child node should not be nil");
[self configureChildDataSourceWithNode:childNode andMediaSource:mediaSource];
[self reloadData];
}
......@@ -407,7 +421,7 @@ referenceSizeForHeaderInSection:(NSInteger)section
[mediaSource preparseInputNodeWithinTree:node];
VLCMediaSourceDataSource *newChildDataSource = [[VLCMediaSourceDataSource alloc] init];
VLCMediaSourceDataSource * const newChildDataSource = [[VLCMediaSourceDataSource alloc] init];
newChildDataSource.displayedMediaSource = mediaSource;
newChildDataSource.nodeToDisplay = node;
......@@ -416,7 +430,7 @@ referenceSizeForHeaderInSection:(NSInteger)section
newChildDataSource.tableView = self.tableView;
[self setChildDataSource:newChildDataSource];
[[VLCMain sharedInstance].libraryWindow.navigationStack appendCurrentLibraryState];
[VLCMain.sharedInstance.libraryWindow.navigationStack appendCurrentLibraryState];
[self togglePathControlVisibility:YES];
}
......@@ -435,8 +449,8 @@ referenceSizeForHeaderInSection:(NSInteger)section
_childDataSource = childDataSource;
if (_mediaSourceMode == VLCMediaSourceModeLAN) {
VLCInputNode *node = childDataSource.nodeToDisplay;
VLCInputNodePathControlItem *nodePathItem = [[VLCInputNodePathControlItem alloc] initWithInputNode:node];
VLCInputNode * const node = childDataSource.nodeToDisplay;
VLCInputNodePathControlItem * const nodePathItem = [[VLCInputNodePathControlItem alloc] initWithInputNode:node];
[self.pathControl appendInputNodePathControlItem:nodePathItem];
}
......@@ -479,7 +493,7 @@ referenceSizeForHeaderInSection:(NSInteger)section
- (void)homeButtonAction:(id)sender
{
[self returnHome];
VLCLibraryNavigationStack *mainNavStack = [VLCMain sharedInstance].libraryWindow.navigationStack;
VLCLibraryNavigationStack * const mainNavStack = [VLCMain sharedInstance].libraryWindow.navigationStack;
[mainNavStack clear];
}
......@@ -489,10 +503,10 @@ referenceSizeForHeaderInSection:(NSInteger)section
return;
}
NSPathControlItem *selectedItem = _pathControl.clickedPathItem;
NSString *itemNodeMrl = selectedItem.image.name;
NSPathControlItem * const selectedItem = _pathControl.clickedPathItem;
NSString * const itemNodeMrl = selectedItem.image.name;
VLCInputNodePathControlItem *matchingItem = [_pathControl.inputNodePathControlItems objectForKey:itemNodeMrl];
VLCInputNodePathControlItem * const matchingItem = [_pathControl.inputNodePathControlItems objectForKey:itemNodeMrl];
if (matchingItem != nil) {
_childDataSource.nodeToDisplay = matchingItem.inputNode;
[_pathControl clearPathControlItemsAheadOf:selectedItem];
......@@ -529,7 +543,7 @@ referenceSizeForHeaderInSection:(NSInteger)section
{
if (_gridViewMode) {
if (self.collectionView.dataSource == self) {
NSInteger index = [_mediaSources indexOfObject:aNotification.object];
const NSInteger index = [_mediaSources indexOfObject:aNotification.object];
if (self.collectionView.numberOfSections > index) {
[self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:index]];
} else {
......