From 4577ba3edc17df13629eb6df1c6e8dd8b440bd64 Mon Sep 17 00:00:00 2001
From: Claudio Cambra <developer@claudiocambra.com>
Date: Sat, 25 May 2024 23:58:45 +0800
Subject: [PATCH] macosx: Provide debug output when no matching input item
 found for clicked path item

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
---
 .../media-source/VLCMediaSourceBaseDataSource.m    | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m b/modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m
index a96b5c291a6d..748cb69c7bb7 100644
--- a/modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m
+++ b/modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m
@@ -503,17 +503,19 @@ referenceSizeForHeaderInSection:(NSInteger)section
 
 - (void)pathControlAction:(id)sender
 {
-    if (_pathControl.clickedPathItem == nil || _childDataSource == nil) {
+    if (self.pathControl.clickedPathItem == nil || self.childDataSource == nil) {
         return;
     }
 
-    NSPathControlItem * const selectedItem = _pathControl.clickedPathItem;
-    NSString * const itemNodeMrl = selectedItem.image.name;
+    NSPathControlItem * const selectedItem = self.pathControl.clickedPathItem;
+    NSString * const itemNodeMrl = selectedItem.image.accessibilityDescription;
 
-    VLCInputNodePathControlItem * const matchingItem = [_pathControl.inputNodePathControlItems objectForKey:itemNodeMrl];
+    VLCInputNodePathControlItem * const matchingItem = [self.pathControl.inputNodePathControlItems objectForKey:itemNodeMrl];
     if (matchingItem != nil) {
-        _childDataSource.nodeToDisplay = matchingItem.inputNode;
-        [_pathControl clearPathControlItemsAheadOf:selectedItem];
+        self.childDataSource.nodeToDisplay = matchingItem.inputNode;
+        [self.pathControl clearPathControlItemsAheadOf:selectedItem];
+    } else {
+        NSLog(@"Could not find matching item for clicked path item: %@", selectedItem);
     }
 }
 
-- 
GitLab