]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/playlistinfo.m
macosx: lock access to addon_entry_t
[vlc] / modules / gui / macosx / playlistinfo.m
index 227f5f661dd90489e84253f70abba330df5ce1cb..a818f3f6e420edfb403b830509da419938c868c0 100644 (file)
@@ -143,7 +143,7 @@ static VLCInfo *_o_sharedInstance = nil;
 
 - (void)initPanel
 {
-    b_stats = config_GetInt(VLCIntf, "stats");
+    b_stats = var_InheritBool(VLCIntf, "stats");
     if (!b_stats) {
         if ([o_tab_view numberOfTabViewItems] > 2)
             [o_tab_view removeTabViewItem: [o_tab_view tabViewItemAtIndex: 2]];
@@ -212,18 +212,18 @@ static VLCInfo *_o_sharedInstance = nil;
         [o_image_well setImage: [NSImage imageNamed: @"noart.png"]];
     } else {
         if (!input_item_IsPreparsed(p_item))
-            playlist_PreparseEnqueue(pl_Get(VLCIntf), p_item);
+            libvlc_MetaRequest(VLCIntf->p_libvlc, p_item);
 
         /* fill uri info */
         char * psz_url = decode_URI(input_item_GetURI(p_item));
-        [o_uri_txt setStringValue: @(psz_url ? psz_url : "")];
+        [o_uri_txt setStringValue: [NSString stringWithUTF8String:psz_url ? psz_url : ""]];
         free(psz_url);
 
         /* fill title info */
         char * psz_title = input_item_GetTitle(p_item);
         if (!psz_title)
             psz_title = input_item_GetName(p_item);
-        [o_title_txt setStringValue: @(psz_title ? : "")];
+        [o_title_txt setStringValue: [NSString stringWithUTF8String:psz_title ? : ""]];
         free(psz_title);
 
     #define SET( foo, bar ) \
@@ -252,7 +252,7 @@ static VLCInfo *_o_sharedInstance = nil;
 
         /* FIXME Can also be attachment:// */
         if (psz_meta && strncmp(psz_meta, "attachment://", 13))
-            o_image = [[NSImage alloc] initWithContentsOfURL: [NSURL URLWithString:@(psz_meta)]];
+            o_image = [[NSImage alloc] initWithContentsOfURL: [NSURL URLWithString:[NSString stringWithUTF8String:psz_meta]]];
         else
             o_image = [[NSImage imageNamed: @"noart.png"] retain];
         [o_image_well setImage: o_image];
@@ -263,6 +263,7 @@ static VLCInfo *_o_sharedInstance = nil;
     /* reload the advanced table */
     [rootItem refresh];
     [o_outline_view reloadData];
+    [o_outline_view expandItem:nil expandChildren:YES];
 
     /* update the stats once to display p_item change faster */
     [self updateStatistics];
@@ -272,7 +273,7 @@ static VLCInfo *_o_sharedInstance = nil;
 - (void)setMeta: (char *)psz_meta forLabel: (id)theItem
 {
     if (psz_meta != NULL && *psz_meta)
-        [theItem setStringValue: @(psz_meta)];
+        [theItem setStringValue: [NSString stringWithUTF8String:psz_meta]];
     else
         [theItem setStringValue: @""];
 }
@@ -357,14 +358,14 @@ static VLCInfo *_o_sharedInstance = nil;
 
 error:
     NSRunAlertPanel(_NS("Error while saving meta"),
-        _NS("VLC was unable to save the meta data."),
+        @"%@",_NS("VLC was unable to save the meta data."),
         _NS("OK"), nil, nil);
 }
 
 - (IBAction)downloadCoverArt:(id)sender
 {
     playlist_t * p_playlist = pl_Get(VLCIntf);
-    if (p_item) playlist_AskForArtEnqueue(p_playlist, p_item);
+    if (p_item) libvlc_ArtRequest(VLCIntf->p_libvlc, p_item);
 }
 
 - (input_item_t *)item
@@ -464,7 +465,7 @@ error:
             vlc_mutex_lock(&p_item->lock);
             o_children = [[NSMutableArray alloc] initWithCapacity: p_item->i_categories];
             for (int i = 0 ; i < p_item->i_categories ; i++) {
-                NSString * name = @(p_item->pp_categories[i]->psz_name);
+                NSString * name = [NSString stringWithUTF8String:p_item->pp_categories[i]->psz_name];
                 VLCInfoTreeItem * item = [[VLCInfoTreeItem alloc] initWithName:name value:@"" ID:i parent:self];
                 [item autorelease];
                 [o_children addObject:item];
@@ -476,8 +477,8 @@ error:
             info_category_t * cat = p_item->pp_categories[i_object_id];
             o_children = [[NSMutableArray alloc] initWithCapacity: cat->i_infos];
             for (int i = 0 ; i < cat->i_infos ; i++) {
-                NSString * name = @(cat->pp_infos[i]->psz_name);
-                NSString * value = @(cat->pp_infos[i]->psz_value ? : "");
+                NSString * name = [NSString stringWithUTF8String:cat->pp_infos[i]->psz_name];
+                NSString * value = [NSString stringWithUTF8String:cat->pp_infos[i]->psz_value ? : ""];
                 VLCInfoTreeItem * item = [[VLCInfoTreeItem alloc] initWithName:name value:value ID:i parent:self];
                 [item autorelease];
                 [o_children addObject:item];