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
This commit is contained in:
Oystein Eftevaag 2006-11-08 21:31:47 +00:00
parent a7950182f5
commit ff14e19552

View file

@ -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"));