diff --git a/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.cpp b/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.cpp index 580b79aa74..ee88a8aab2 100644 --- a/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.cpp +++ b/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.cpp @@ -149,4 +149,14 @@ void RecentlyOpenedFilesList::registerRecentFileNatively (const File& file) #endif } +void RecentlyOpenedFilesList::clearRecentFilesNatively() +{ + #if JUCE_MAC + JUCE_AUTORELEASEPOOL + { + [[NSDocumentController sharedDocumentController] clearRecentDocuments: nil]; + } + #endif +} + } // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.h b/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.h index 02a24fe00b..8861c980e3 100644 --- a/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.h +++ b/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.h @@ -103,11 +103,19 @@ public: void removeNonExistentFiles(); /** Tells the OS to add a file to the OS-managed list of recent documents for this app. + Not all OSes maintain a list of recent files for an application, so this function will have no effect on some OSes. Currently it's just implemented for OSX. */ static void registerRecentFileNatively (const File& file); + /** Tells the OS to clear the OS-managed list of recent documents for this app. + + Not all OSes maintain a list of recent files for an application, so this + function will have no effect on some OSes. Currently it's just implemented for OSX. + */ + static void clearRecentFilesNatively(); + //============================================================================== /** Adds entries to a menu, representing each of the files in the list.