[vlc-devel] [PATCH 2/2] macosx: fix auto play when adding a new file with file dialogs

David Fuhrmann david.fuhrmann at googlemail.com
Sun Jan 8 21:05:25 CET 2012


The issue was that we had 2 VLCPlaylist objects although they should be only one. Therefore this commit removes the wrong one in Open.xib
---
 .../macosx/Resources/English.lproj/Open.xib        |   33 --------------------
 modules/gui/macosx/open.h                          |    2 -
 modules/gui/macosx/open.m                          |    8 ++--
 3 files changed, 4 insertions(+), 39 deletions(-)

diff --git a/extras/package/macosx/Resources/English.lproj/Open.xib b/extras/package/macosx/Resources/English.lproj/Open.xib
index 072d061..f21b247 100644
--- a/extras/package/macosx/Resources/English.lproj/Open.xib
+++ b/extras/package/macosx/Resources/English.lproj/Open.xib
@@ -38,9 +38,6 @@
       <object class="NSCustomObject" id="436853527">
         <string key="NSClassName">NSApplication</string>
       </object>
-      <object class="NSCustomObject" id="752055462">
-        <string key="NSClassName">VLCPlaylist</string>
-      </object>
       <object class="NSCustomObject" id="609169471">
         <string key="NSClassName">VLCOpen</string>
       </object>
@@ -5178,14 +5175,6 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA</bytes>
       <object class="NSMutableArray" key="connectionRecords">
         <bool key="EncodedWithXMLCoder">YES</bool>
         <object class="IBConnectionRecord">
-          <object class="IBOutletConnection" key="connection">
-            <string key="label">o_playlist</string>
-            <reference key="source" ref="609169471"/>
-            <reference key="destination" ref="752055462"/>
-          </object>
-          <int key="connectionID">410</int>
-        </object>
-        <object class="IBConnectionRecord">
           <object class="IBActionConnection" key="connection">
             <string key="label">panelCancel:</string>
             <reference key="source" ref="609169471"/>
@@ -7662,12 +7651,6 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA</bytes>
             <string key="objectName">Application</string>
           </object>
           <object class="IBObjectRecord">
-            <int key="objectID">269</int>
-            <reference key="object" ref="752055462"/>
-            <reference key="parent" ref="0"/>
-            <string key="objectName">VLCPlaylist</string>
-          </object>
-          <object class="IBObjectRecord">
             <int key="objectID">408</int>
             <reference key="object" ref="609169471"/>
             <reference key="parent" ref="0"/>
@@ -12785,22 +12768,6 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA</bytes>
             <string key="minorKey"/>
           </object>
         </object>
-        <object class="IBPartialClassDescription">
-          <string key="className">VLCPlaylist</string>
-          <string key="superclassName">VLCPlaylistCommon</string>
-          <object class="IBClassDescriptionSource" key="sourceIdentifier">
-            <string key="majorKey">IBUserSource</string>
-            <string key="minorKey"/>
-          </object>
-        </object>
-        <object class="IBPartialClassDescription">
-          <string key="className">VLCPlaylistCommon</string>
-          <string key="superclassName">NSObject</string>
-          <object class="IBClassDescriptionSource" key="sourceIdentifier">
-            <string key="majorKey">IBUserSource</string>
-            <string key="minorKey"/>
-          </object>
-        </object>
       </object>
       <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.1+">
         <bool key="EncodedWithXMLCoder">YES</bool>
diff --git a/modules/gui/macosx/open.h b/modules/gui/macosx/open.h
index 0117876..8d7e4f7 100644
--- a/modules/gui/macosx/open.h
+++ b/modules/gui/macosx/open.h
@@ -29,8 +29,6 @@
  *****************************************************************************/
 @interface VLCOpen : NSObject
 {
-    IBOutlet id o_playlist;
-
     IBOutlet id o_panel;
 
     IBOutlet id o_mrl_fld;
diff --git a/modules/gui/macosx/open.m b/modules/gui/macosx/open.m
index 6f1f976..c370b7b 100644
--- a/modules/gui/macosx/open.m
+++ b/modules/gui/macosx/open.m
@@ -448,9 +448,9 @@ static VLCOpen *_o_sharedMainInstance = nil;
         /* apply the options to our item(s) */
         [o_dic setObject: (NSArray *)[o_options copy] forKey: @"ITEM_OPTIONS"];
         if( b_autoplay )
-            [o_playlist appendArray: [NSArray arrayWithObject: o_dic] atPos: -1 enqueue:NO];
+            [[[VLCMain sharedInstance] playlist] appendArray: [NSArray arrayWithObject: o_dic] atPos: -1 enqueue:NO];
         else
-            [o_playlist appendArray: [NSArray arrayWithObject: o_dic] atPos: -1 enqueue:YES];
+            [[[VLCMain sharedInstance] playlist] appendArray: [NSArray arrayWithObject: o_dic] atPos: -1 enqueue:YES];
     }
 }
 
@@ -1154,9 +1154,9 @@ static VLCOpen *_o_sharedMainInstance = nil;
             [o_array addObject: o_dic];
         }
         if( b_autoplay )
-            [o_playlist appendArray: o_array atPos: -1 enqueue:NO];
+            [[[VLCMain sharedInstance] playlist] appendArray: o_array atPos: -1 enqueue:NO];
         else
-            [o_playlist appendArray: o_array atPos: -1 enqueue:YES];
+            [[[VLCMain sharedInstance] playlist] appendArray: o_array atPos: -1 enqueue:YES];
     }
 }
 
-- 
1.7.5.4




More information about the vlc-devel mailing list