Fixes Issue 2176 (SysConf on OSX), plus some initialization order warning fix in VolumeDirectory.cpp

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4985 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
j4ck.fr0st 2010-01-29 19:45:01 +00:00
parent 8b129fca0c
commit e282d5c7f2
4 changed files with 22 additions and 8 deletions

View File

@ -512,14 +512,23 @@ bool SetCurrentDir(const char *_rDirectory)
#if defined(__APPLE__)
//get the full config dir
char *GetConfigDirectory()
const char *GetConfigDirectory()
{
static char path[MAX_PATH] = {0};
if (strlen(path) > 0)
return path;
snprintf(path, sizeof(path), "%s" DIR_SEP CONFIG_FILE, GetUserDirectory());
return path;
}
//get the full SYSCONF dir
const char *GetSysConfDirectory()
{
static char path[MAX_PATH] = {0};
if (strlen(path) > 0)
return path;
snprintf(path, sizeof(path), "%s" DIR_SEP WII_SYSCONF_FILE, GetUserDirectory());
return path;
}

View File

@ -94,7 +94,8 @@ std::string GetSysDirectory();
#ifdef __APPLE__
char *GetConfigDirectory();
const char *GetConfigDirectory();
const char *GetSysConfDirectory();
std::string GetBundleDirectory();
#endif

View File

@ -21,7 +21,11 @@
SysConf::SysConf()
: m_IsValid(false)
{
#if defined(__APPLE__)
if (LoadFromFile(File::GetSysConfDirectory()))
#else
if (LoadFromFile(WII_SYSCONF_FILE))
#endif
m_IsValid = true;
}

View File

@ -35,14 +35,14 @@ static u64 DOL_ADDRESS = 0;
CVolumeDirectory::CVolumeDirectory(const std::string& _rDirectory, bool _bIsWii,
const std::string& _rApploader, const std::string& _rDOL)
: m_apploaderSize(0)
, m_apploader(NULL)
, m_DOLSize(0)
, m_DOL(NULL)
, m_totalNameSize(0)
: m_totalNameSize(0)
, m_dataStartAddress(-1)
, m_fstSize(0)
, m_FSTData(NULL)
, m_apploaderSize(0)
, m_apploader(NULL)
, m_DOLSize(0)
, m_DOL(NULL)
{
m_rootDirectory = ExtractDirectoryName(_rDirectory);