From 6b23ce36cb8d3f1b010774e08ba1bb03bf0d0d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 26 Mar 2025 18:57:38 +0100 Subject: [PATCH] Mac buildfix --- SDL/CocoaBarItems.mm | 13 +++++++------ UI/PSPNSApplicationDelegate.mm | 3 ++- b.sh | 2 ++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/SDL/CocoaBarItems.mm b/SDL/CocoaBarItems.mm index afb51a7886..9f6aa9c801 100644 --- a/SDL/CocoaBarItems.mm +++ b/SDL/CocoaBarItems.mm @@ -20,9 +20,10 @@ #include "Common/System/System.h" #include "Common/System/Request.h" #include "Common/System/NativeApp.h" -#include "Core/Config.h" #include "Common/Data/Text/I18n.h" #include "Common/StringUtils.h" +#include "Core/Config.h" +#include "Core/Util/RecentFiles.h" #ifdef __cplusplus extern "C" { @@ -622,14 +623,14 @@ TOGGLE_METHOD(FullScreen, g_Config.bFullScreen, System_MakeRequest(SystemRequest std::shared_ptr mainmenuLocalization = GetI18NCategory(I18NCat::MAINMENU); #define MAINMENU_LOCALIZED(key) @(mainmenuLocalization->T_cstr(key)) - std::vector recentIsos = g_Config.RecentIsos(); + std::vector recentFiles = g_recentFiles.GetRecentFiles(); NSMenuItem *openRecent = [[NSMenuItem alloc] initWithTitle:MAINMENU_LOCALIZED("Recent") action:nil keyEquivalent:@""]; NSMenu *recentsMenu = [[NSMenu alloc] init]; - if (recentIsos.empty()) + if (recentFiles.empty()) openRecent.enabled = NO; - for (int i = 0; i < recentIsos.size(); i++) { - std::string filename = Path(recentIsos[i]).GetFilename(); + for (const auto &file : recentFiles) { + std::string filename = Path(file).GetFilename(); NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:@(filename.c_str()) action:@selector(openRecentItem:) keyEquivalent:@""]; item.target = self; [recentsMenu addItem:item]; @@ -640,7 +641,7 @@ TOGGLE_METHOD(FullScreen, g_Config.bFullScreen, System_MakeRequest(SystemRequest } -(void)openRecentItem: (NSMenuItem *)item { - System_PostUIMessage(UIMessage::REQUEST_GAME_BOOT, g_Config.RecentIsos()[item.tag].c_str()); + System_PostUIMessage(UIMessage::REQUEST_GAME_BOOT, g_recentFiles.GetRecentFiles()[item.tag].c_str()); } -(void)openSystemFileBrowser { diff --git a/UI/PSPNSApplicationDelegate.mm b/UI/PSPNSApplicationDelegate.mm index 29497097d2..ebdc2feba9 100644 --- a/UI/PSPNSApplicationDelegate.mm +++ b/UI/PSPNSApplicationDelegate.mm @@ -10,6 +10,7 @@ #import "PSPNSApplicationDelegate.h" #include "Common/System/System.h" +#include "Core/Util/RecentFiles.h" #include "Core/SaveState.h" #include "Core/Config.h" @@ -33,7 +34,7 @@ - (NSMenu *)applicationDockMenu:(NSApplication *)sender { // TODO: Actually implement a dock menu thingy. - for (std::string iso : g_Config.RecentIsos()) { + for (std::string iso : g_recentFiles.GetRecentFiles()) { // printf("%s\n", iso.c_str()); } diff --git a/b.sh b/b.sh index cf7490d030..da262c46e4 100755 --- a/b.sh +++ b/b.sh @@ -111,6 +111,8 @@ fi # Strict errors. Any non-zero return exits this script set -e +echo Building with $CORES_COUNT threads + mkdir -p ${BUILD_DIR} pushd ${BUILD_DIR}