vlc/vlc-2.2 | branch: master | David Fuhrmann <dfuhrm...@videolan.org> | Sun 
Oct  9 00:41:02 2016 +0200| [4d863a4987c2d1bfd457eda251d6f0167746a74d] | 
committer: David Fuhrmann

macosx: clear resume points as well once the user clear recent items list

(cherry picked from commit a071bc7c4f91274cf78e57335ac7718851eac8c0)
Signed-off-by: David Fuhrmann <dfuhrm...@videolan.org>

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

 .../package/macosx/vlc.xcodeproj/project.pbxproj   |  4 ++
 modules/gui/macosx/Modules.am                      |  2 +
 modules/gui/macosx/VLCDocumentController.h         | 28 ++++++++++++++
 modules/gui/macosx/VLCDocumentController.m         | 44 ++++++++++++++++++++++
 4 files changed, 78 insertions(+)

diff --git a/extras/package/macosx/vlc.xcodeproj/project.pbxproj 
b/extras/package/macosx/vlc.xcodeproj/project.pbxproj
index 7e123fb..36b609b 100644
--- a/extras/package/macosx/vlc.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/vlc.xcodeproj/project.pbxproj
@@ -782,6 +782,8 @@
                1C4A192A1B52CF8D007833EC /* ResumeDialogController.h */ = {isa 
= PBXFileReference; lastKnownFileType = sourcecode.c.h; name = 
ResumeDialogController.h; path = 
../../../modules/gui/macosx/ResumeDialogController.h; sourceTree = "<group>"; };
                1C4A192B1B52CF8D007833EC /* ResumeDialogController.m */ = {isa 
= PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = 
ResumeDialogController.m; path = 
../../../modules/gui/macosx/ResumeDialogController.m; sourceTree = "<group>"; };
                1C57690D19DC93620099F5A6 /* topbar_background.png */ = {isa = 
PBXFileReference; lastKnownFileType = image.png; name = topbar_background.png; 
path = Resources/mainwindow/topbar_background.png; sourceTree = "<group>"; };
+               1C5E52351DB02CE100B8355C /* VLCDocumentController.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = 
VLCDocumentController.h; path = 
../../../modules/gui/macosx/VLCDocumentController.h; sourceTree = "<group>"; };
+               1C5E52361DB02CE100B8355C /* VLCDocumentController.m */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = 
VLCDocumentController.m; path = 
../../../modules/gui/macosx/VLCDocumentController.m; sourceTree = "<group>"; };
                1C88BA2419DC7B2200645190 /* yosemite-window-close-graphite.png 
*/ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 
"yosemite-window-close-graphite.png"; sourceTree = "<group>"; };
                1C88BA2519DC7B2200645190 /* 
yosemite-window-close-graph...@2x.png */ = {isa = PBXFileReference; 
lastKnownFileType = image.png; path = "yosemite-window-close-graph...@2x.png"; 
sourceTree = "<group>"; };
                1C88BA2619DC7B2200645190 /* 
yosemite-window-close-on-graphite.png */ = {isa = PBXFileReference; 
lastKnownFileType = image.png; path = "yosemite-window-close-on-graphite.png"; 
sourceTree = "<group>"; };
@@ -1733,6 +1735,8 @@
                                7DB65D5318ABD6380053B874 /* AddonManager.m */,
                                5CCED71414C0D4A90057F8D1 /* VLCUIWidgets.h */,
                                5CCED71514C0D4A90057F8D1 /* VLCUIWidgets.m */,
+                               1C5E52351DB02CE100B8355C /* 
VLCDocumentController.h */,
+                               1C5E52361DB02CE100B8355C /* 
VLCDocumentController.m */,
                                8E6BC6FA041684EC0059A3A7 /* controls.h */,
                                8ED6C27B03E2EB1C0059A3A7 /* controls.m */,
                                8E6BC6F6041643860059A3A7 /* applescript.h */,
diff --git a/modules/gui/macosx/Modules.am b/modules/gui/macosx/Modules.am
index 71f95c5..c6caefe 100644
--- a/modules/gui/macosx/Modules.am
+++ b/modules/gui/macosx/Modules.am
@@ -97,4 +97,6 @@ SOURCES_macosx = \
        Spotify.h \
        ResumeDialogController.h \
        ResumeDialogController.m \
+       VLCDocumentController.h \
+       VLCDocumentController.m \
        $(NULL)
diff --git a/modules/gui/macosx/VLCDocumentController.h 
b/modules/gui/macosx/VLCDocumentController.h
new file mode 100644
index 0000000..5756f17
--- /dev/null
+++ b/modules/gui/macosx/VLCDocumentController.h
@@ -0,0 +1,28 @@
+/*****************************************************************************
+ * VLCDocumentController.h
+ *****************************************************************************
+ * Copyright (C) 2016 VLC authors and VideoLAN
+ * $Id$
+ *
+ * Authors: David Fuhrmann <david dot fuhrmann at googlemail dot com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, 
USA.
+ *****************************************************************************/
+
+#import <Cocoa/Cocoa.h>
+
+@interface VLCDocumentController : NSDocumentController
+
+@end
diff --git a/modules/gui/macosx/VLCDocumentController.m 
b/modules/gui/macosx/VLCDocumentController.m
new file mode 100644
index 0000000..fd487c3
--- /dev/null
+++ b/modules/gui/macosx/VLCDocumentController.m
@@ -0,0 +1,44 @@
+/*****************************************************************************
+ * VLCDocumentController.m
+ ****************************************************************************
+ * Copyright (C) 2016 VLC authors and VideoLAN
+ * Authors: David Fuhrmann <david dot fuhrmann at googlemail dot com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, 
USA.
+ *****************************************************************************/
+
+#import "VLCDocumentController.h"
+
+#import "intf.h"
+
+@implementation VLCDocumentController
+
++ (void)load
+{
+    id controller = [[VLCDocumentController alloc] init];
+}
+
+- (IBAction)clearRecentDocuments:(id)sender
+{
+    msg_Dbg(VLCIntf, "Clear recent items list and resume points");
+    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+    [defaults setObject:[NSDictionary dictionary] 
forKey:@"recentlyPlayedMedia"];
+    [defaults setObject:[NSArray array] forKey:@"recentlyPlayedMediaList"];
+    [defaults synchronize];
+
+    [super clearRecentDocuments:sender];
+}
+
+@end

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to