- added initial folder(s) and code to handle loading common data to save duplicated files space

This commit is contained in:
Mark Vejvoda
2011-05-05 06:17:34 +00:00
parent 6db2b394bf
commit 102363f151
4 changed files with 93 additions and 67 deletions

View File

@@ -106,7 +106,6 @@ void Properties::load(const string &path, bool clearCurrentProperties) {
bool Properties::applyTagsToValue(string &value) {
string originalValue = value;
char *homeDir = NULL;
#ifdef WIN32
homeDir = getenv("USERPROFILE");
@@ -144,11 +143,19 @@ bool Properties::applyTagsToValue(string &value) {
#if defined(CUSTOM_DATA_INSTALL_PATH)
replaceAll(value, "$APPLICATIONDATAPATH", CUSTOM_DATA_INSTALL_PATH);
replaceAll(value, "%%APPLICATIONDATAPATH%%", CUSTOM_DATA_INSTALL_PATH);
replaceAll(value, "$COMMONDATAPATH", string(CUSTOM_DATA_INSTALL_PATH) + "/commondata/");
replaceAll(value, "%%COMMONDATAPATH%%", string(CUSTOM_DATA_INSTALL_PATH) + "/commondata/");
#else
replaceAll(value, "$APPLICATIONDATAPATH", Properties::applicationPath);
replaceAll(value, "%%APPLICATIONDATAPATH%%", Properties::applicationPath);
replaceAll(value, "$COMMONDATAPATH", Properties::applicationPath + "/commondata/");
replaceAll(value, "%%COMMONDATAPATH%%", Properties::applicationPath + "/commondata/");
#endif
//printf("\nBEFORE SUBSTITUTE [%s] AFTER [%s]\n",originalValue.c_str(),value.c_str());
return (originalValue != value);
}