From 9d25ba2b998caadea8bdf279e7f768c21440d903 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 18 Jul 2014 12:21:09 +0200 Subject: [PATCH] Add a constant for the app name to prevent duplication of strings all over the place --- indra/llcommon/indra_constants.h | 3 +++ indra/llvfs/lldir.cpp | 11 +++++++---- indra/newview/llappviewer.cpp | 14 +++++++------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index 02f063f5e8..b484b18d4f 100755 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -31,6 +31,9 @@ class LLUUID; +// Centralize definition of application name +const std::string APP_NAME = "Firestorm"; + static const F32 REGION_WIDTH_METERS = 256.f; static const S32 REGION_WIDTH_UNITS = 256; static const U32 REGION_WIDTH_U32 = 256; diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index 551d4910b7..1228708af3 100755 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -51,6 +51,8 @@ #include #include +#include "indra_constants.h" + using boost::assign::list_of; using boost::assign::map_list_of; @@ -381,15 +383,16 @@ std::string LLDir::buildSLOSCacheDir() const // FIRE-8226 - Different flavoured cache directories. #ifdef OPENSIM #ifdef ND_BUILD64BIT_ARCH - res = add(getOSCacheDir(), "FirestormOS_x64"); + res = add(getOSCacheDir(), APP_NAME + "OS_x64"); #else - res = add(getOSCacheDir(), "FirestormOS"); + + res = add(getOSCacheDir(), APP_NAME + "OS"); #endif #else #ifdef ND_BUILD64BIT_ARCH - res = add(getOSCacheDir(), "Firestorm_x64"); + res = add(getOSCacheDir(), APP_NAME + "_x64"); #else - res = add(getOSCacheDir(), "Firestorm"); + res = add(getOSCacheDir(), APP_NAME); #endif #endif // OPENSIM // diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ddc8d861cd..8245a8a3fb 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -407,7 +407,7 @@ std::string SafeFileName(std::string filename) // LL_VERSION_MINOR, // LL_VERSION_PATCH, // LL_VERSION_BUILD ))); -const std::string SAFE_FILE_NAME_PREFIX(SafeFileName("Firestorm")); +const std::string SAFE_FILE_NAME_PREFIX(SafeFileName(APP_NAME)); static std::string gArgs; const int MAX_MARKER_LENGTH = 1024; const std::string MARKER_FILE_NAME(SAFE_FILE_NAME_PREFIX + ".exec_marker"); //FS orig modified LL @@ -781,9 +781,9 @@ LLAppViewer::LLAppViewer() // gDirUtilp->initAppDirs("SecondLife"); #ifdef ND_BUILD64BIT_ARCH - gDirUtilp->initAppDirs("Firestorm_x64"); + gDirUtilp->initAppDirs(APP_NAME + "_x64"); #else - gDirUtilp->initAppDirs("Firestorm"); + gDirUtilp->initAppDirs(APP_NAME); #endif // @@ -2614,12 +2614,12 @@ void LLAppViewer::initLoggingAndGetLastDuration() // Remove the last ".old" log file. std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, - "Firestorm.old"); + APP_NAME + ".old"); LLFile::remove(old_log_file); // Get name of the log file std::string log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, - "Firestorm.log"); + APP_NAME + ".log"); /* * Before touching any log files, compute the duration of the last run * by comparing the ctime of the previous start marker file with the ctime @@ -4175,10 +4175,10 @@ void LLAppViewer::writeSystemInfo() // #endif #if LL_WINDOWS - gDebugInfo["SLLog"] = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,"Firestorm.log"); + gDebugInfo["SLLog"] = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, APP_NAME + ".log"); #else //Not ideal but sufficient for good reporting. - gDebugInfo["SLLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"Firestorm.old"); //LLError::logFileName(); + gDebugInfo["SLLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, APP_NAME + ".old"); //LLError::logFileName(); #endif //