1
0
Fork 0

Compare commits

...

2 Commits

3 changed files with 8 additions and 20 deletions

View File

@ -84,6 +84,8 @@ static bool IsValidSearchPath(Searchpath sp)
static void FillValidSearchPaths(bool only_local_path)
{
_valid_searchpaths.clear();
std::set<std::string> seen{};
for (Searchpath sp = SP_FIRST_DIR; sp < NUM_SEARCHPATHS; sp++) {
if (only_local_path) {
switch (sp) {
@ -97,7 +99,11 @@ static void FillValidSearchPaths(bool only_local_path)
}
}
if (IsValidSearchPath(sp)) _valid_searchpaths.emplace_back(sp);
if (IsValidSearchPath(sp)) {
if (seen.count(_searchpaths[sp]) != 0) continue;
seen.insert(_searchpaths[sp]);
_valid_searchpaths.emplace_back(sp);
}
}
}

View File

@ -93,21 +93,7 @@ void GetMacOSVersion(int *return_major, int *return_minor, int *return_bugfix)
#endif
}
#ifdef WITH_SDL
/**
* Show the system dialogue message (SDL on MacOSX).
*
* @param title Window title.
* @param message Message text.
* @param buttonLabel Button text.
*/
void ShowMacDialog(const char *title, const char *message, const char *buttonLabel)
{
NSRunAlertPanel([ NSString stringWithUTF8String:title ], [ NSString stringWithUTF8String:message ], [ NSString stringWithUTF8String:buttonLabel ], nil, nil);
}
#elif defined WITH_COCOA
#ifdef WITH_COCOA
extern void CocoaDialog(const char *title, const char *message, const char *buttonLabel);

View File

@ -16,10 +16,6 @@
#include <time.h>
#include <signal.h>
#if defined(WITH_SDL)
/* the mac implementation needs this file included in the same file as main() */
# include <SDL.h>
#endif
#include "macos.h"
#include "../../safeguards.h"