[vlc-commits] macosx: remove useless singleton for resume dialog controller

Felix Paul Kühne git at videolan.org
Tue Jul 16 12:40:38 CEST 2019


vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Tue Jul 16 12:21:23 2019 +0200| [010abb4ab9e5ffd1b37ae2e994f3524dbc0dc667] | committer: Felix Paul Kühne

macosx: remove useless singleton for resume dialog controller

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

 modules/gui/macosx/main/VLCMain.h                             |  2 --
 modules/gui/macosx/main/VLCMain.m                             | 10 ----------
 modules/gui/macosx/panels/dialogs/VLCResumeDialogController.m |  1 -
 modules/gui/macosx/playlist/VLCPlaybackContinuityController.m | 10 ++++++----
 modules/gui/macosx/windows/video/VLCVideoOutputProvider.m     |  1 -
 5 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/modules/gui/macosx/main/VLCMain.h b/modules/gui/macosx/main/VLCMain.h
index 1e38fdd8cd..7ade11f8d3 100644
--- a/modules/gui/macosx/main/VLCMain.h
+++ b/modules/gui/macosx/main/VLCMain.h
@@ -45,7 +45,6 @@ extern NSString *VLCConfigurationChangedNotification;
  *****************************************************************************/
 @class VLCExtensionsManager;
 @class VLCMainMenu;
- at class VLCResumeDialogController;
 @class VLCSimplePrefsController;
 @class VLCPrefs;
 @class VLCCoreDialogProvider;
@@ -82,7 +81,6 @@ extern NSString *VLCConfigurationChangedNotification;
 @property (readonly) VLCOpenWindowController *open;
 @property (readonly) VLCPlaylistController *playlistController;
 @property (readonly) VLCPrefs *preferences;
- at property (readonly) VLCResumeDialogController *resumeDialog;
 @property (readonly) VLCSimplePrefsController *simplePreferences;
 @property (readonly) VLCTrackSynchronizationWindowController *trackSyncPanel;
 @property (readonly) VLCVideoEffectsWindowController *videoEffectsPanel;
diff --git a/modules/gui/macosx/main/VLCMain.m b/modules/gui/macosx/main/VLCMain.m
index dff44584ff..85468ca789 100644
--- a/modules/gui/macosx/main/VLCMain.m
+++ b/modules/gui/macosx/main/VLCMain.m
@@ -55,7 +55,6 @@
 
 #import "os-integration/VLCClickerManager.h"
 
-#import "panels/dialogs/VLCResumeDialogController.h"
 #import "panels/dialogs/VLCCoreDialogProvider.h"
 #import "panels/VLCAudioEffectsWindowController.h"
 #import "panels/VLCBookmarksWindowController.h"
@@ -106,7 +105,6 @@ NSString *VLCConfigurationChangedNotification = @"VLCConfigurationChangedNotific
     VLCOpenWindowController *_open;
     VLCCoreDialogProvider *_coredialogs;
     VLCBookmarksWindowController *_bookmarks;
-    VLCResumeDialogController *_resume_dialog;
     VLCPlaybackContinuityController *_continuityController;
     VLCLogWindowController *_messagePanelController;
     VLCStatusBarIcon *_statusBarIcon;
@@ -506,12 +504,4 @@ static VLCMain *sharedInstance = nil;
     return _coredialogs;
 }
 
-- (VLCResumeDialogController *)resumeDialog
-{
-    if (!_resume_dialog)
-        _resume_dialog = [[VLCResumeDialogController alloc] init];
-
-    return _resume_dialog;
-}
-
 @end
diff --git a/modules/gui/macosx/panels/dialogs/VLCResumeDialogController.m b/modules/gui/macosx/panels/dialogs/VLCResumeDialogController.m
index fe2bc5cb4e..1c7d93b3e8 100644
--- a/modules/gui/macosx/panels/dialogs/VLCResumeDialogController.m
+++ b/modules/gui/macosx/panels/dialogs/VLCResumeDialogController.m
@@ -47,7 +47,6 @@
                                                      name:VLCWindowShouldUpdateLevel
                                                    object:nil];
     }
-
     return self;
 }
 
diff --git a/modules/gui/macosx/playlist/VLCPlaybackContinuityController.m b/modules/gui/macosx/playlist/VLCPlaybackContinuityController.m
index 975922909d..53f47aee91 100644
--- a/modules/gui/macosx/playlist/VLCPlaybackContinuityController.m
+++ b/modules/gui/macosx/playlist/VLCPlaybackContinuityController.m
@@ -35,6 +35,7 @@
 @interface VLCPlaybackContinuityController()
 {
     VLCInputItem *_currentInput;
+    VLCResumeDialogController *_resumeDialogController;
 }
 @end
 
@@ -63,6 +64,7 @@
                                selector:@selector(playbackStatusUpdated:)
                                    name:VLCPlayerStateChanged
                                  object:nil];
+        _resumeDialogController = [[VLCResumeDialogController alloc] init];
     }
     return self;
 }
@@ -83,7 +85,7 @@
 {
     VLCMain *mainInstance = [VLCMain sharedInstance];
     // Cancel pending resume dialogs
-    [[mainInstance resumeDialog] cancel];
+    [_resumeDialogController cancel];
 
     // object is hold here and released then it is dead
     _currentInput = [[mainInstance playlistController] currentlyPlayingInputItem];
@@ -185,9 +187,9 @@
         return;
     }
 
-    [[[VLCMain sharedInstance] resumeDialog] showWindowWithItem:inputItem
-                                               withLastPosition:lastPosition.intValue
-                                                completionBlock:completionBlock];
+    [_resumeDialogController showWindowWithItem:inputItem
+                               withLastPosition:lastPosition.intValue
+                                completionBlock:completionBlock];
 
 }
 
diff --git a/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m b/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
index 2d8a5b799e..9544c3e168 100644
--- a/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
+++ b/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
@@ -36,7 +36,6 @@
 #import "library/VLCLibraryWindow.h"
 #import "os-integration/VLCKeyboardBacklightControl.h"
 
-#import "panels/dialogs/VLCResumeDialogController.h"
 #import "panels/VLCVideoEffectsWindowController.h"
 #import "panels/VLCAudioEffectsWindowController.h"
 #import "panels/VLCBookmarksWindowController.h"



More information about the vlc-commits mailing list