[vlc-commits] macosx: Initialize VLCDocumentController in run method

David Fuhrmann git at videolan.org
Fri Oct 14 15:40:54 CEST 2016


vlc/vlc-2.2 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Fri Oct 14 15:40:04 2016 +0200| [653111fb7d354e98365a85e658f72635d30c2183] | committer: David Fuhrmann

macosx: Initialize VLCDocumentController in run method

Unfortunately, the way we init in vlc.git does not work.

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=653111fb7d354e98365a85e658f72635d30c2183
---

 modules/gui/macosx/VLCDocumentController.m | 5 -----
 modules/gui/macosx/intf.m                  | 6 ++++++
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/gui/macosx/VLCDocumentController.m b/modules/gui/macosx/VLCDocumentController.m
index fd487c3..5d4e602 100644
--- a/modules/gui/macosx/VLCDocumentController.m
+++ b/modules/gui/macosx/VLCDocumentController.m
@@ -25,11 +25,6 @@
 
 @implementation VLCDocumentController
 
-+ (void)load
-{
-    id controller = [[VLCDocumentController alloc] init];
-}
-
 - (IBAction)clearRecentDocuments:(id)sender
 {
     msg_Dbg(VLCIntf, "Clear recent items list and resume points");
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 9f78d16..d7e1b63 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -64,6 +64,7 @@
 #import "BWQuincyManager.h"
 #import "ControlsBar.h"
 #import "ResumeDialogController.h"
+#import "VLCDocumentController.h"
 
 #import "VideoEffects.h"
 #import "AudioEffects.h"
@@ -104,6 +105,8 @@ static bool b_intf_starting = false;
 static vlc_mutex_t start_mutex = VLC_STATIC_MUTEX;
 static vlc_cond_t  start_cond = VLC_STATIC_COND;
 
+static VLCDocumentController *documentController = nil;
+
 /*****************************************************************************
  * OpenIntf: initialize interface
  *****************************************************************************/
@@ -111,11 +114,14 @@ int OpenIntf (vlc_object_t *p_this)
 {
     NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
     [VLCApplication sharedApplication];
+    // Register subclass for recent items controller
+    documentController = [[VLCDocumentController alloc] init];
 
     intf_thread_t *p_intf = (intf_thread_t*) p_this;
     msg_Dbg(p_intf, "Starting macosx interface");
     Run(p_intf);
 
+    [documentController release];
     [o_pool release];
     return VLC_SUCCESS;
 }



More information about the vlc-commits mailing list