[vlc-commits] macosx/bookmarks: remove explicit singleton

Felix Paul Kühne git at videolan.org
Tue Jul 21 19:47:17 CEST 2015


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Jul 21 18:16:26 2015 +0200| [985ad1a4aade235e5fab716299b42c656df38264] | committer: Felix Paul Kühne

macosx/bookmarks: remove explicit singleton

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=985ad1a4aade235e5fab716299b42c656df38264
---

 modules/gui/macosx/MainMenu.m                |    1 -
 modules/gui/macosx/VLCVoutWindowController.m |    6 +++---
 modules/gui/macosx/bookmarks.h               |    2 --
 modules/gui/macosx/bookmarks.m               |   12 ------------
 4 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/modules/gui/macosx/MainMenu.m b/modules/gui/macosx/MainMenu.m
index aea7a8a..8967ea7 100644
--- a/modules/gui/macosx/MainMenu.m
+++ b/modules/gui/macosx/MainMenu.m
@@ -65,7 +65,6 @@
     VLCVideoEffects *_videoEffectsWindowController;
     VLCAudioEffects *_audioEffectsWindowController;
     VLCTrackSynchronization *_trackSynchronizationWindowController;
-    VLCBookmarks *_bookmarksWindowController;
     VLCConvertAndSave *_convertAndSaveWindowController;
     AddonsWindowController *_addonsController;
 
diff --git a/modules/gui/macosx/VLCVoutWindowController.m b/modules/gui/macosx/VLCVoutWindowController.m
index 46937fe..f000486 100644
--- a/modules/gui/macosx/VLCVoutWindowController.m
+++ b/modules/gui/macosx/VLCVoutWindowController.m
@@ -599,14 +599,14 @@ void WindowClose(vout_window_t *p_wnd)
 
     NSInteger currentStatusWindowLevel = self.currentStatusWindowLevel;
 
+    VLCMain *main = [VLCMain sharedInstance];
     [[VLCMainWindow sharedInstance] setWindowLevel:i_level];
-
     [[VLCVideoEffects sharedInstance] updateCocoaWindowLevel:currentStatusWindowLevel];
     [[VLCAudioEffects sharedInstance] updateCocoaWindowLevel:currentStatusWindowLevel];
     [[VLCInfo sharedInstance] updateCocoaWindowLevel:currentStatusWindowLevel];
-    [[VLCBookmarks sharedInstance] updateCocoaWindowLevel:currentStatusWindowLevel];
+    [[main bookmarks] updateCocoaWindowLevel:currentStatusWindowLevel];
     [[VLCTrackSynchronization sharedInstance] updateCocoaWindowLevel:currentStatusWindowLevel];
-    [[[VLCMain sharedInstance] resumeDialog] updateCocoaWindowLevel:currentStatusWindowLevel];
+    [[main resumeDialog] updateCocoaWindowLevel:currentStatusWindowLevel];
 }
 
 @end
diff --git a/modules/gui/macosx/bookmarks.h b/modules/gui/macosx/bookmarks.h
index 036d7b0..a38170c 100644
--- a/modules/gui/macosx/bookmarks.h
+++ b/modules/gui/macosx/bookmarks.h
@@ -27,8 +27,6 @@
 
 @interface VLCBookmarks : NSObject
 
-+ (VLCBookmarks *)sharedInstance;
-
 /* main window */
 @property (readwrite, weak) IBOutlet NSWindow *bookmarksWindow;
 @property (readwrite, weak) IBOutlet NSButton *addButton;
diff --git a/modules/gui/macosx/bookmarks.m b/modules/gui/macosx/bookmarks.m
index ec2eba7..309657d 100644
--- a/modules/gui/macosx/bookmarks.m
+++ b/modules/gui/macosx/bookmarks.m
@@ -45,18 +45,6 @@
 
 @implementation VLCBookmarks
 
-+ (VLCBookmarks *)sharedInstance
-{
-    static VLCBookmarks *sharedInstance = nil;
-    static dispatch_once_t pred;
-
-    dispatch_once(&pred, ^{
-        sharedInstance = [VLCBookmarks new];
-    });
-
-    return sharedInstance;
-}
-
 /*****************************************************************************
  * GUI methods
  *****************************************************************************/



More information about the vlc-commits mailing list