Browse Source

Added a clearRecentFilesNatively() method to RecentlyOpenedFilesList

tags/2021-05-28
ed 7 years ago
parent
commit
1355e1d1f3
2 changed files with 18 additions and 0 deletions
  1. +10
    -0
      modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.cpp
  2. +8
    -0
      modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.h

+ 10
- 0
modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.cpp View File

@@ -149,4 +149,14 @@ void RecentlyOpenedFilesList::registerRecentFileNatively (const File& file)
#endif #endif
} }
void RecentlyOpenedFilesList::clearRecentFilesNatively()
{
#if JUCE_MAC
JUCE_AUTORELEASEPOOL
{
[[NSDocumentController sharedDocumentController] clearRecentDocuments: nil];
}
#endif
}
} // namespace juce } // namespace juce

+ 8
- 0
modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.h View File

@@ -103,11 +103,19 @@ public:
void removeNonExistentFiles(); void removeNonExistentFiles();
/** Tells the OS to add a file to the OS-managed list of recent documents for this app. /** 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 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. function will have no effect on some OSes. Currently it's just implemented for OSX.
*/ */
static void registerRecentFileNatively (const File& file); 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. /** Adds entries to a menu, representing each of the files in the list.


Loading…
Cancel
Save