summaryrefslogtreecommitdiff
path: root/indra/newview/llversioninfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llversioninfo.cpp')
-rw-r--r--indra/newview/llversioninfo.cpp107
1 files changed, 51 insertions, 56 deletions
diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp
index 4e07223784..4720a989b0 100644
--- a/indra/newview/llversioninfo.cpp
+++ b/indra/newview/llversioninfo.cpp
@@ -26,9 +26,10 @@
*/
#include "llviewerprecompiledheaders.h"
-#include <iostream>
-#include <sstream>
+#include "llevents.h"
+#include "lleventfilter.h"
#include "llversioninfo.h"
+#include "stringize.h"
#include <boost/regex.hpp>
#if ! defined(LL_VIEWER_CHANNEL) \
@@ -43,100 +44,90 @@
// Set the version numbers in indra/VIEWER_VERSION
//
-//static
+LLVersionInfo::LLVersionInfo():
+ short_version(STRINGIZE(LL_VIEWER_VERSION_MAJOR << "."
+ << LL_VIEWER_VERSION_MINOR << "."
+ << LL_VIEWER_VERSION_PATCH)),
+ // LL_VIEWER_CHANNEL is a macro defined on the compiler command line. The
+ // macro expands to the string name of the channel, but without quotes. We
+ // need to turn it into a quoted string. LL_TO_STRING() does that.
+ mWorkingChannelName(LL_TO_STRING(LL_VIEWER_CHANNEL)),
+ build_configuration(LLBUILD_CONFIG), // set in indra/cmake/BuildVersion.cmake
+ // instantiate an LLEventMailDrop with canonical name to listen for news
+ // from SLVersionChecker
+ mPump{new LLEventMailDrop("relnotes")},
+ // immediately listen on mPump, store arriving URL into mReleaseNotes
+ mStore{new LLStoreListener<std::string>(*mPump, mReleaseNotes)}
+{
+}
+
+void LLVersionInfo::initSingleton()
+{
+ // We override initSingleton() not because we have dependencies on other
+ // LLSingletons, but because certain initializations call other member
+ // functions. We should refrain from calling methods until this object is
+ // fully constructed; such calls don't really belong in the constructor.
+
+ // cache the version string
+ version = STRINGIZE(getShortVersion() << "." << getBuild());
+}
+
+LLVersionInfo::~LLVersionInfo()
+{
+}
+
S32 LLVersionInfo::getMajor()
{
return LL_VIEWER_VERSION_MAJOR;
}
-//static
S32 LLVersionInfo::getMinor()
{
return LL_VIEWER_VERSION_MINOR;
}
-//static
S32 LLVersionInfo::getPatch()
{
return LL_VIEWER_VERSION_PATCH;
}
-//static
S32 LLVersionInfo::getBuild()
{
return LL_VIEWER_VERSION_BUILD;
}
-//static
-const std::string &LLVersionInfo::getVersion()
+std::string LLVersionInfo::getVersion()
{
- static std::string version("");
- if (version.empty())
- {
- std::ostringstream stream;
- stream << LLVersionInfo::getShortVersion() << "." << LLVersionInfo::getBuild();
- // cache the version string
- version = stream.str();
- }
return version;
}
-//static
-const std::string &LLVersionInfo::getShortVersion()
+std::string LLVersionInfo::getShortVersion()
{
- static std::string short_version("");
- if(short_version.empty())
- {
- // cache the version string
- std::ostringstream stream;
- stream << LL_VIEWER_VERSION_MAJOR << "."
- << LL_VIEWER_VERSION_MINOR << "."
- << LL_VIEWER_VERSION_PATCH;
- short_version = stream.str();
- }
return short_version;
}
-namespace
-{
- // LL_VIEWER_CHANNEL is a macro defined on the compiler command line. The
- // macro expands to the string name of the channel, but without quotes. We
- // need to turn it into a quoted string. LL_TO_STRING() does that.
- /// Storage of the channel name the viewer is using.
- // The channel name is set by hardcoded constant,
- // or by calling LLVersionInfo::resetChannel()
- std::string sWorkingChannelName(LL_TO_STRING(LL_VIEWER_CHANNEL));
-
- // Storage for the "version and channel" string.
- // This will get reset too.
- std::string sVersionChannel("");
-}
-
-//static
-const std::string &LLVersionInfo::getChannelAndVersion()
+std::string LLVersionInfo::getChannelAndVersion()
{
- if (sVersionChannel.empty())
+ if (mVersionChannel.empty())
{
// cache the version string
- sVersionChannel = LLVersionInfo::getChannel() + " " + LLVersionInfo::getVersion();
+ mVersionChannel = getChannel() + " " + getVersion();
}
- return sVersionChannel;
+ return mVersionChannel;
}
-//static
-const std::string &LLVersionInfo::getChannel()
+std::string LLVersionInfo::getChannel()
{
- return sWorkingChannelName;
+ return mWorkingChannelName;
}
void LLVersionInfo::resetChannel(const std::string& channel)
{
- sWorkingChannelName = channel;
- sVersionChannel.clear(); // Reset version and channel string til next use.
+ mWorkingChannelName = channel;
+ mVersionChannel.clear(); // Reset version and channel string til next use.
}
-//static
LLVersionInfo::ViewerMaturity LLVersionInfo::getViewerMaturity()
{
ViewerMaturity maturity;
@@ -175,8 +166,12 @@ LLVersionInfo::ViewerMaturity LLVersionInfo::getViewerMaturity()
}
-const std::string &LLVersionInfo::getBuildConfig()
+std::string LLVersionInfo::getBuildConfig()
{
- static const std::string build_configuration(LLBUILD_CONFIG); // set in indra/cmake/BuildVersion.cmake
return build_configuration;
}
+
+std::string LLVersionInfo::getReleaseNotes()
+{
+ return mReleaseNotes;
+}