DEV-43439: Added calls to query the viewer version.
Rather than copy/paste the same version string formatting pattern again, I added new string-based version routines: /// return the full viewer version as a string like "2.0.0.200030" const std::string &llGetViewerVersion(); /// return the viewer version as a string like "2.0.0" const std::string &llGetViewerShortVersion(); /// return the viewer build version as a string, e.g., "200130" const std::string &llGetViewerBuildVersion();master
parent
37c7e4059c
commit
de2f8212f0
|
|
@ -451,8 +451,9 @@ set(viewer_SOURCE_FILES
|
|||
llviewerassetstorage.cpp
|
||||
llviewerassettype.cpp
|
||||
llvieweraudio.cpp
|
||||
llviewerbuild.cpp
|
||||
llviewercamera.cpp
|
||||
llviewerchat.cpp
|
||||
llviewerchat.cpp
|
||||
llviewercontrol.cpp
|
||||
llviewercontrollistener.cpp
|
||||
llviewerdisplay.cpp
|
||||
|
|
@ -956,7 +957,7 @@ set(viewer_HEADER_FILES
|
|||
llvieweraudio.h
|
||||
llviewerbuild.h
|
||||
llviewercamera.h
|
||||
llviewerchat.h
|
||||
llviewerchat.h
|
||||
llviewercontrol.h
|
||||
llviewercontrollistener.h
|
||||
llviewerdisplay.h
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
|
||||
// Viewer includes
|
||||
#include "llversionviewer.h"
|
||||
#include "llviewerbuild.h"
|
||||
#include "llfeaturemanager.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "lltexteditor.h"
|
||||
|
|
@ -647,12 +648,9 @@ bool LLAppViewer::init()
|
|||
writeSystemInfo();
|
||||
|
||||
// Build a string representing the current version number.
|
||||
gCurrentVersion = llformat("%s %d.%d.%d.%d",
|
||||
gSavedSettings.getString("VersionChannelName").c_str(),
|
||||
LL_VERSION_MAJOR,
|
||||
LL_VERSION_MINOR,
|
||||
LL_VERSION_PATCH,
|
||||
LL_VERSION_BUILD );
|
||||
gCurrentVersion = llformat("%s %s",
|
||||
gSavedSettings.getString("VersionChannelName").c_str(),
|
||||
llGetViewerVersion().c_str());
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -2521,8 +2519,7 @@ void LLAppViewer::writeSystemInfo()
|
|||
|
||||
// Dump some debugging info
|
||||
LL_INFOS("SystemInfo") << LLTrans::getString("APP_NAME")
|
||||
<< " version " << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH
|
||||
<< LL_ENDL;
|
||||
<< " version " << llGetViewerShortVersion() << LL_ENDL;
|
||||
|
||||
// Dump the local time and time zone
|
||||
time_t now;
|
||||
|
|
|
|||
|
|
@ -217,10 +217,7 @@ LLSD LLFloaterAbout::getInfo()
|
|||
version.append(LL_VERSION_PATCH);
|
||||
version.append(LL_VERSION_BUILD);
|
||||
info["VIEWER_VERSION"] = version;
|
||||
info["VIEWER_VERSION_STR"] = STRINGIZE(version[0].asInteger() << '.' <<
|
||||
version[1].asInteger() << '.' <<
|
||||
version[2].asInteger() << '.' <<
|
||||
version[3].asInteger());
|
||||
info["VIEWER_VERSION_STR"] = llGetViewerVersion();
|
||||
info["BUILD_DATE"] = __DATE__;
|
||||
info["BUILD_TIME"] = __TIME__;
|
||||
info["CHANNEL"] = gSavedSettings.getString("VersionChannelName");
|
||||
|
|
@ -286,15 +283,9 @@ LLSD LLFloaterAbout::getInfo()
|
|||
|
||||
static std::string get_viewer_release_notes_url()
|
||||
{
|
||||
std::ostringstream version;
|
||||
version << LL_VERSION_MAJOR << "."
|
||||
<< LL_VERSION_MINOR << "."
|
||||
<< LL_VERSION_PATCH << "."
|
||||
<< LL_VERSION_BUILD;
|
||||
|
||||
LLSD query;
|
||||
query["channel"] = gSavedSettings.getString("VersionChannelName");
|
||||
query["version"] = version.str();
|
||||
query["version"] = llGetViewerVersion();
|
||||
|
||||
std::ostringstream url;
|
||||
url << LLTrans::getString("RELEASE_NOTES_BASE_URL") << LLURI::mapToQueryString(query);
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
#include "llnotificationsutil.h"
|
||||
#include "llstring.h"
|
||||
#include "llsys.h"
|
||||
#include "llversionviewer.h"
|
||||
#include "llviewerbuild.h"
|
||||
#include "message.h"
|
||||
#include "v3math.h"
|
||||
|
||||
|
|
@ -609,10 +609,7 @@ LLSD LLFloaterReporter::gatherReport()
|
|||
|
||||
std::ostringstream details;
|
||||
|
||||
details << "V" << LL_VERSION_MAJOR << "." // client version moved to body of email for abuse reports
|
||||
<< LL_VERSION_MINOR << "."
|
||||
<< LL_VERSION_PATCH << "."
|
||||
<< LL_VIEWER_BUILD << std::endl << std::endl;
|
||||
details << "V" << llGetViewerVersion() << std::endl << std::endl; // client version moved to body of email for abuse reports
|
||||
|
||||
std::string object_name = childGetText("object_name");
|
||||
if (!object_name.empty() && !mOwnerName.empty())
|
||||
|
|
@ -629,10 +626,8 @@ LLSD LLFloaterReporter::gatherReport()
|
|||
|
||||
std::string version_string;
|
||||
version_string = llformat(
|
||||
"%d.%d.%d %s %s %s %s",
|
||||
LL_VERSION_MAJOR,
|
||||
LL_VERSION_MINOR,
|
||||
LL_VERSION_PATCH,
|
||||
"%s %s %s %s %s",
|
||||
llGetViewerShortVersion().c_str(),
|
||||
platform,
|
||||
gSysCPU.getFamily().c_str(),
|
||||
gGLManager.mGLRenderer.c_str(),
|
||||
|
|
|
|||
|
|
@ -248,11 +248,8 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
|
|||
getChild<LLPanel>("login_widgets")->setDefaultBtn("connect_btn");
|
||||
|
||||
std::string channel = gSavedSettings.getString("VersionChannelName");
|
||||
std::string version = llformat("%d.%d.%d (%d)",
|
||||
LL_VERSION_MAJOR,
|
||||
LL_VERSION_MINOR,
|
||||
LL_VERSION_PATCH,
|
||||
LL_VIEWER_BUILD );
|
||||
std::string version = llformat("%s (%s)", llGetViewerShortVersion().c_str(),
|
||||
llGetViewerBuildVersion().c_str());
|
||||
LLTextBox* channel_text = getChild<LLTextBox>("channel_text");
|
||||
channel_text->setTextArg("[CHANNEL]", channel); // though not displayed
|
||||
channel_text->setTextArg("[VERSION]", version);
|
||||
|
|
@ -741,8 +738,8 @@ void LLPanelLogin::loadLoginPage()
|
|||
}
|
||||
|
||||
// Channel and Version
|
||||
std::string version = llformat("%d.%d.%d (%d)",
|
||||
LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD);
|
||||
std::string version = llformat("%s (%s)", llGetViewerShortVersion().c_str(),
|
||||
llGetViewerBuildVersion().c_str());
|
||||
|
||||
char* curl_channel = curl_escape(gSavedSettings.getString("VersionChannelName").c_str(), 0);
|
||||
char* curl_version = curl_escape(version.c_str(), 0);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llversionviewer.h"
|
||||
#include "llviewerbuild.h"
|
||||
|
||||
//#include "llfloaterhelpbrowser.h"
|
||||
//#include "llfloaterreg.h"
|
||||
|
|
@ -86,14 +87,7 @@ std::string LLViewerHelpUtil::buildHelpURL( const std::string &topic,
|
|||
|
||||
substitution["CHANNEL"] = helpURLEncode(savedSettings.getString("VersionChannelName"));
|
||||
|
||||
// *TODO: We should put this version pattern in a central place; this and near
|
||||
// equivalents are replicated in other code - what's a good location?
|
||||
std::ostringstream version;
|
||||
version << LL_VERSION_MAJOR << "."
|
||||
<< LL_VERSION_MINOR << "."
|
||||
<< LL_VERSION_PATCH << "."
|
||||
<< LL_VERSION_BUILD;
|
||||
substitution["VERSION"] = helpURLEncode(version.str());
|
||||
substitution["VERSION"] = helpURLEncode(llGetViewerVersion());
|
||||
substitution["VERSION_MAJOR"] = buildHelpVersion(LL_VERSION_MAJOR);
|
||||
substitution["VERSION_MINOR"] = buildHelpVersion(LL_VERSION_MINOR);
|
||||
substitution["VERSION_PATCH"] = buildHelpVersion(LL_VERSION_PATCH);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
#include "llui.h"
|
||||
#include "lluri.h"
|
||||
#include "llsd.h"
|
||||
#include "llversionviewer.h"
|
||||
#include "llviewerbuild.h"
|
||||
#include "llviewercontrol.h"
|
||||
|
||||
//static
|
||||
|
|
@ -47,16 +47,8 @@ std::string LLViewerHome::getHomeURL()
|
|||
// Return the URL to display in the Home side tray. We read
|
||||
// this value from settings.xml and support various substitutions
|
||||
|
||||
// *TODO: We should put this version pattern in a central place; this and near
|
||||
// equivalents are replicated in other code - what's a good location?
|
||||
std::ostringstream version;
|
||||
version << LL_VERSION_MAJOR << "."
|
||||
<< LL_VERSION_MINOR << "."
|
||||
<< LL_VERSION_PATCH << "."
|
||||
<< LL_VERSION_BUILD;
|
||||
|
||||
LLSD substitution;
|
||||
substitution["VERSION"] = version.str();
|
||||
substitution["VERSION"] = llGetViewerVersion();
|
||||
substitution["CHANNEL"] = LLURI::escape(gSavedSettings.getString("VersionChannelName"));
|
||||
substitution["LANGUAGE"] = LLUI::getLanguage();
|
||||
substitution["AUTH_KEY"] = LLURI::escape(getAuthKey());
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
#include "llviewertexture.h"
|
||||
#include "llviewerparcelmedia.h"
|
||||
#include "llviewerparcelmgr.h"
|
||||
#include "llversionviewer.h"
|
||||
#include "llviewerbuild.h"
|
||||
#include "llviewertexturelist.h"
|
||||
#include "llvovolume.h"
|
||||
#include "llpluginclassmedia.h"
|
||||
|
|
@ -446,7 +446,7 @@ std::string LLViewerMedia::getCurrentUserAgent()
|
|||
// http://www.mozilla.org/build/revised-user-agent-strings.html
|
||||
std::ostringstream codec;
|
||||
codec << "SecondLife/";
|
||||
codec << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH << "." << LL_VERSION_BUILD;
|
||||
codec << llGetViewerVersion();
|
||||
codec << " (" << channel << "; " << skin_name << " skin)";
|
||||
llinfos << codec.str() << llendl;
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
#include "../test/lltut.h"
|
||||
|
||||
#include "../llviewerhelputil.h"
|
||||
#include "../llviewerbuild.h"
|
||||
#include "llcontrol.h"
|
||||
#include "llsys.h"
|
||||
|
||||
|
|
@ -75,6 +76,12 @@ std::string LLControlGroup::getString(const std::string& name)
|
|||
return test_stringvec[name];
|
||||
}
|
||||
|
||||
const std::string &llGetViewerVersion()
|
||||
{
|
||||
static std::string version = "2.0.0.200099";
|
||||
return version;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
namespace tut
|
||||
|
|
|
|||
Loading…
Reference in New Issue