浏览代码

library: fix non-MLFile deletions on iPad

Felix Paul Kühne 11 年之前
父节点
当前提交
e1e2afb375
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      Sources/VLCPlaylistCollectionViewCell.m

+ 8 - 1
Sources/VLCPlaylistCollectionViewCell.m

@@ -114,8 +114,15 @@
 
 
 - (IBAction)removeMedia:(id)sender
 - (IBAction)removeMedia:(id)sender
 {
 {
+    NSString *title;
+    id mediaObject = self.mediaObject;
+    if ([mediaObject isKindOfClass:[MLAlbum class]] || [mediaObject isKindOfClass:[MLShowEpisode class]] || [mediaObject isKindOfClass:[MLShow class]])
+        title = [mediaObject name];
+    else
+        title = [mediaObject title];
+
     /* ask user if s/he really wants to delete the media file */
     /* ask user if s/he really wants to delete the media file */
-    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"DELETE_FILE", @"") message:[NSString stringWithFormat:NSLocalizedString(@"DELETE_FILE_LONG", @""), self.mediaObject.title] delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", @"") otherButtonTitles:NSLocalizedString(@"BUTTON_DELETE", @""), nil];
+    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"DELETE_FILE", @"") message:[NSString stringWithFormat:NSLocalizedString(@"DELETE_FILE_LONG", @""), title] delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", @"") otherButtonTitles:NSLocalizedString(@"BUTTON_DELETE", @""), nil];
     [alert show];
     [alert show];
 }
 }