From ff14e19552e7fb1406071c785dbe3fd4cd40b95e Mon Sep 17 00:00:00 2001 From: Oystein Eftevaag Date: Wed, 8 Nov 2006 21:31:47 +0000 Subject: The theme browser will now search through the bundle resource directory on OS X, fixing bug [ 1592294 ] MACOSX: Cannot Switch Back to Modern Theme svn-id: r24658 --- gui/themebrowser.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gui/themebrowser.cpp b/gui/themebrowser.cpp index 8809ed149a..233220fa34 100644 --- a/gui/themebrowser.cpp +++ b/gui/themebrowser.cpp @@ -26,6 +26,10 @@ #include "gui/theme.h" #include "common/fs.h" +#ifdef MACOSX +#include "CoreFoundation/CoreFoundation.h" +#endif + namespace GUI { enum { @@ -102,6 +106,18 @@ void ThemeBrowser::updateListing() { addDir(_themes, DATA_PATH); #endif +#ifdef MACOSX + CFURLRef resourceUrl = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle()); + if (resourceUrl) { + char buf[256]; + if (CFURLGetFileSystemRepresentation(resourceUrl, true, (UInt8 *)buf, 256)) { + Common::String resourcePath = buf; + addDir(_themes, resourcePath, 0); + } + CFRelease(resourceUrl); + } +#endif + if (ConfMan.hasKey("extrapath")) addDir(_themes, ConfMan.get("extrapath")); -- cgit v1.2.3