]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/playlist.m
macosx: Fix the info panel. Remove the use of maybe-freed-ptr. Make it display curren...
[vlc] / modules / gui / macosx / playlist.m
index 22d81f856617b8e8296406045dc0a90ec3f95a75..70eaaa806a77d31634967ba472890d9c0c7457ee 100644 (file)
     vlc_object_release( p_playlist );
 }
 
+- (void)outlineViewSelectionDidChange:(NSNotification *)notification
+{
+    // FIXME: unsafe
+    playlist_item_t * p_item = [[o_outline_view itemAtRow:[o_outline_view selectedRow]] pointerValue];
+
+    if( p_item )
+    {
+        /* update our info-panel to reflect the new item */
+        [[[VLCMain sharedInstance] getInfo] updatePanelWithItem:p_item->p_input];
+    }
+}
+
+- (BOOL)isSelectionEmpty
+{
+    return [o_outline_view selectedRow] == -1;
+}
+
 - (void)updateRowSelection
 {
     int i_row;
     unsigned int j;
 
+    // FIXME: unsafe
     playlist_t *p_playlist = pl_Yield( VLCIntf );
     playlist_item_t *p_item, *p_temp_item;
     NSMutableArray *o_array = [NSMutableArray array];
 
     }
 
+    /* update our info-panel to reflect the new item */
+    [[[VLCMain sharedInstance] getInfo] updatePanelWithItem:p_item->p_input];
+
     vlc_object_release( p_playlist );
 
-    /* update our info-panel to reflect the new item */
-    [[[VLCMain sharedInstance] getInfo] updatePanel];
 }
 
 /* Check if p_item is a child of p_node recursively. We need to check the item