diff --git a/indra/llcommon/llsys.h b/indra/llcommon/llsys.h index 962367f69fe37a5af9af741e73d8f7017611218e..294d0066ca53ed93bb9d940bf6c7daa82cd39fcf 100644 --- a/indra/llcommon/llsys.h +++ b/indra/llcommon/llsys.h @@ -37,13 +37,14 @@ // #include "llsd.h" +#include "llsingleton.h" #include <iosfwd> #include <string> -class LL_COMMON_API LLOSInfo +class LL_COMMON_API LLOSInfo : public LLSingleton<LLOSInfo> { + LLSINGLETON(LLOSInfo); public: - LLOSInfo(); void stream(std::ostream& s) const; const std::string& getOSString() const; diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 958876fb0a9573f20ecb4f416d322791308efdda..51d7ad113880503ca896528973ae287a68d0a878 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -733,7 +733,7 @@ LLAppViewer::LLAppViewer() // LLLoginInstance::instance().setUpdaterService(mUpdater.get()); - LLLoginInstance::instance().setPlatformInfo(gPlatform, getOSInfo().getOSVersionString()); + LLLoginInstance::instance().setPlatformInfo(gPlatform, LLOSInfo::instance().getOSVersionString()); } LLAppViewer::~LLAppViewer() @@ -3110,7 +3110,7 @@ void LLAppViewer::initUpdater() mUpdater->initialize(channel, version, gPlatform, - getOSInfo().getOSVersionString(), + LLOSInfo::instance().getOSVersionString(), unique_id, willing_to_test ); @@ -3192,10 +3192,13 @@ bool LLAppViewer::initWindow() #ifdef LL_DARWIN - //Satisfy both MAINT-3135 (OSX 10.6 and earlier) MAINT-3288 (OSX 10.7 and later) - if (getOSInfo().mMajorVer == 10 && getOSInfo().mMinorVer < 7) - if ( getOSInfo().mMinorVer == 6 && getOSInfo().mBuild < 8 ) - gViewerWindow->getWindow()->setOldResize(true); + //Satisfy both MAINT-3135 (OSX 10.6 and earlier) MAINT-3288 (OSX 10.7 and later) + LLOSInfo& os_info = LLOSInfo::instance(); + if (os_info.mMajorVer == 10 && os_info.mMinorVer < 7) + { + if ( os_info.mMinorVer == 6 && os_info.mBuild < 8 ) + gViewerWindow->getWindow()->setOldResize(true); + } #endif if (gSavedSettings.getBOOL("WindowMaximized")) @@ -3337,7 +3340,7 @@ LLSD LLAppViewer::getViewerInfo() const info["CPU"] = gSysCPU.getCPUString(); info["MEMORY_MB"] = LLSD::Integer(gSysMemory.getPhysicalMemoryKB().valueInUnits<LLUnits::Megabytes>()); // Moved hack adjustment to Windows memory size into llsys.cpp - info["OS_VERSION"] = LLAppViewer::instance()->getOSInfo().getOSString(); + info["OS_VERSION"] = LLOSInfo::instance().getOSString(); info["GRAPHICS_CARD_VENDOR"] = (const char*)(glGetString(GL_VENDOR)); info["GRAPHICS_CARD"] = (const char*)(glGetString(GL_RENDERER)); @@ -3659,7 +3662,7 @@ void LLAppViewer::writeSystemInfo() gDebugInfo["RAMInfo"]["Physical"] = (LLSD::Integer)(gSysMemory.getPhysicalMemoryKB().value()); gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer)(gMemoryAllocated.valueInUnits<LLUnits::Kilobytes>()); - gDebugInfo["OSInfo"] = getOSInfo().getOSStringSimple(); + gDebugInfo["OSInfo"] = LLOSInfo::instance().getOSStringSimple(); // The user is not logged on yet, but record the current grid choice login url // which may have been the intended grid. @@ -3701,8 +3704,8 @@ void LLAppViewer::writeSystemInfo() // query some system information LL_INFOS("SystemInfo") << "CPU info:\n" << gSysCPU << LL_ENDL; LL_INFOS("SystemInfo") << "Memory info:\n" << gSysMemory << LL_ENDL; - LL_INFOS("SystemInfo") << "OS: " << getOSInfo().getOSStringSimple() << LL_ENDL; - LL_INFOS("SystemInfo") << "OS info: " << getOSInfo() << LL_ENDL; + LL_INFOS("SystemInfo") << "OS: " << LLOSInfo::instance().getOSStringSimple() << LL_ENDL; + LL_INFOS("SystemInfo") << "OS info: " << LLOSInfo::instance() << LL_ENDL; gDebugInfo["SettingsFilename"] = gSavedSettings.getString("ClientSettingsFile"); gDebugInfo["ViewerExePath"] = gDirUtilp->getExecutablePathAndName(); diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index c36d8cd9fd1ee044df6e391ea532d463867126b5..520ff68a02727d268274d4cdd4bb9d612086ad19 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -98,8 +98,6 @@ class LLAppViewer : public LLApp void writeDebugInfo(bool isStatic=true); - const LLOSInfo& getOSInfo() const { return mSysOSInfo; } - void setServerReleaseNotesURL(const std::string& url) { mServerReleaseNotesURL = url; } LLSD getViewerInfo() const; std::string getViewerInfoString() const; @@ -270,8 +268,6 @@ class LLAppViewer : public LLApp std::string mLogoutMarkerFileName; LLAPRFile mLogoutMarkerFile; // A file created to indicate the app is running. - - LLOSInfo mSysOSInfo; bool mReportedCrash; std::string mServerReleaseNotesURL; diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index d4ba230feb24e60ead6609a40c539e332fef5657..ae4ce298a0a1b92dc406d4bcf30dd6c7c208c38d 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -486,7 +486,7 @@ void LLFeatureManager::fetchFeatureTableCoro(std::string tableName) #if LL_WINDOWS - std::string os_string = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); + std::string os_string = LLOSInfo::instance().getOSStringSimple(); std::string filename; if (os_string.find("Microsoft Windows XP") == 0) @@ -767,7 +767,7 @@ void LLFeatureManager::applyBaseMasks() } #if LL_DARWIN - const LLOSInfo& osInfo = LLAppViewer::instance()->getOSInfo(); + const LLOSInfo& osInfo = LLOSInfo::instance(); if (osInfo.mMajorVer == 10 && osInfo.mMinorVer < 7) { maskFeatures("OSX_10_6_8"); diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index f8a5bbb036f363154d9feb1d124307af8c68acaa..a88c10521c4f2f3ee05b2d71f80bbde4afbb9b44 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -791,7 +791,7 @@ void LLPanelLogin::loadLoginPage() params["grid"] = LLGridManager::getInstance()->getGridId(); // add OS info - params["os"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); + params["os"] = LLOSInfo::instance().getOSStringSimple(); // sourceid params["sourceid"] = gSavedSettings.getString("sourceid"); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index fcde03244ae3e7019320424d6b144eb610d074c1..8295ce029bff987435603144d2433bf4cffce5d1 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -345,7 +345,7 @@ bool idle_startup() const std::string delims (" "); std::string system; int begIdx, endIdx; - std::string osString = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); + std::string osString = LLOSInfo::instance().getOSStringSimple(); begIdx = osString.find_first_not_of (delims); endIdx = osString.find_first_of (delims, begIdx); diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index dd44697dcd432960f1f4c3963d256c15d0c67061..7f88d5e30f5925cc8e55e31a749a8a3776a7937a 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -489,7 +489,7 @@ void send_stats() LLSD &system = body["system"]; system["ram"] = (S32) gSysMemory.getPhysicalMemoryKB().value(); - system["os"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); + system["os"] = LLOSInfo::instance().getOSStringSimple(); system["cpu"] = gSysCPU.getCPUString(); unsigned char MACAddress[MAC_ADDRESS_BYTES]; LLUUID::getNodeID(MACAddress); diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index ec82765b962bae847643791bd298196ca90c8897..b816225b072517bc51de2ba1392be260be4575e5 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -192,7 +192,7 @@ std::string LLWeb::expandURLSubstitutions(const std::string &url, substitution["CHANNEL"] = LLVersionInfo::getChannel(); substitution["GRID"] = LLGridManager::getInstance()->getGridId(); substitution["GRID_LOWERCASE"] = utf8str_tolower(LLGridManager::getInstance()->getGridId()); - substitution["OS"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); + substitution["OS"] = LLOSInfo::instance().getOSStringSimple(); substitution["SESSION_ID"] = gAgent.getSessionID(); substitution["FIRST_LOGIN"] = gAgent.isFirstLogin();