Add a constant for the app name to prevent duplication of strings all over the place

Ansariel 2014-07-18 12:21:09 +02:00
parent 287a8b0d3b
commit 9d25ba2b99
3 changed files with 17 additions and 11 deletions

View File

@ -31,6 +31,9 @@
class LLUUID;
// <FS:Ansariel> 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;

View File

@ -51,6 +51,8 @@
#include <boost/ref.hpp>
#include <algorithm>
#include "indra_constants.h"
using boost::assign::list_of;
using boost::assign::map_list_of;
@ -381,15 +383,16 @@ std::string LLDir::buildSLOSCacheDir() const
// <FS:CR> 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
// </FS:CR>

View File

@ -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
// </FS:ND>
@ -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
// </FS:ND>