Age | Commit message (Collapse) | Author |
|
This changeset is meant to exemplify how to convert a "namespace" class whose
methods are static -- and whose data are module-static -- to an LLSingleton.
LLVersionInfo has no initClass() or cleanupClass() methods, but the general
idea is the same.
* Derive the class from LLSingleton<T>:
class LLSomeSingleton: public LLSingleton<LLSomeSingleton> { ... };
* Add LLSINGLETON(LLSomeSingleton); in the private section of the class. This
usage implies a separate LLSomeSingleton::LLSomeSingleton() definition, as
described in indra/llcommon/llsingleton.h.
* Move module-scope data in the .cpp file to non-static class members. Change
any sVariableName to mVariableName to avoid being outright misleading.
* Make static class methods non-static. Remove '//static' comments from method
definitions as needed.
* For LLVersionInfo specifically, the 'const std::string&' return type was
replaced with 'std::string'. Returning a reference to a static or a member,
const or otherwise, is an anti-pattern: the interface constrains the
implementation, prohibiting possibly later returning a temporary (an
expression).
* For LLVersionInfo specifically, 'const S32' return type was replaced with
simple 'S32'. 'const' is just noise in that usage.
* Simple member initialization (e.g. the original initializer expressions for
static variables) can be done with member{ value } initializers (no examples
here though).
* Delete initClass() method.
* LLSingleton's forté is of course lazy initialization. It might work to
simply delete any calls to initClass(). But if there are side effects that
must happen at that moment, replace LLSomeSingleton::initClass() with
(void)LLSomeSingleton::instance();
* Most initClass() initialization can be done in the constructor, as would
normally be the case.
* Initialization that might cause a circular LLSingleton reference should be
moved to initSingleton(). Override 'void initSingleton();' should be private.
* For LLVersionInfo specifically, certain initialization that used to be
lazily performed was made unconditional, due to its low cost.
* For LLVersionInfo specifically, certain initialization involved calling
methods that have become non-static. This was moved to initSingleton()
because, in a constructor body, 'this' does not yet point to the enclosing
class.
* Delete cleanupClass() method.
* There is already a generic LLSingletonBase::deleteAll() call in
LLAppViewer::cleanup(). It might work to let this new LLSingleton be cleaned
up with all the rest. But if there are side effects that must happen at that
moment, replace LLSomeSingleton::cleanupClass() with
LLSomeSingleton::deleteSingleton(). That said, much of the benefit of
converting to LLSingleton is deleteAll()'s guarantee that cross-LLSingleton
dependencies will be properly honored: we're trying to migrate the code base
away from the present fragile manual cleanup sequence.
* Most cleanupClass() cleanup can be done in the destructor, as would normally
be the case.
* Cleanup that might throw an exception should be moved to cleanupSingleton().
Override 'void cleanupSingleton();' should be private.
* Within LLSomeSingleton methods, remove any existing
LLSomeSingleton::methodName() qualification: simple methodName() is better.
* In the rest of the code base, convert most LLSomeSingleton::methodName()
references to LLSomeSingleton::instance().methodName(). (Prefer instance() to
getInstance() because a reference does not admit the possibility of NULL.)
* Of course, LLSomeSingleton::ENUM_VALUE can remain unchanged.
In general, for many successive references to an LLSingleton instance, it
can be useful to capture the instance() as in:
auto& versionInfo{LLVersionInfo::instance()};
// ... versionInfo.getVersion() ...
We did not do that here only to simplify the code review.
The STRINGIZE(expression) macro encapsulates:
std::ostringstream out;
out << expression;
return out.str();
We used that in a couple places.
For LLVersionInfo specifically, lllogininstance_test.cpp used to dummy out a
couple specific static methods. It's harder to dummy out
LLSingleton::instance() references, so we add the real class to that test.
|
|
|
|
|
|
and unit tests. Reviewed by brad.
|
|
Land).
|
|
back-out the back-out for this branch. yay.
|
|
Backing out this merge that I pushed (prematurely) to the wrong place.
|
|
|
|
|
|
|
|
Changes in the Buy L$ floater:
* Set system locale before formatting currency.
* Made money format configurable (via strings.xml).
* Placed the "L$" label to the right of the line editor in FR locale.
Details:
Actually, the proper way to fix this and similar number formatting bugs would be to set the system locale at startup, but:
1. That triggers assertions when parsing locale-agnostic XML files like avatar_skeleton.xml.
2. I'm wary of making such global changes so close to the 2.1 release.
Therefore I just temporarily override current locale before formatting a number and restore the previous locale afterwards.
Reviewed by Tofu at https://codereview.productengine.com/secondlife/r/751/
--HG--
branch : product-engine
|
|
|
|
|
|
|
|
EXT-4547 [BSI] it is possible to highlight multiple layers of chat
EXT-3844 Mouse wheel camera zoom is not reflected on View popup slider
EXT-3103 Add an option to restrict entering non-ascii symbols in text editor.
reviewed by Leyla
|
|
Renamed llviewerversion to llversioninfo, to avoid confusion with
llversionviewer in llcommon (llversion is already used by llwindow).
Created new LLVersionInfo class with the following methods:
static S32 getMajor();
static S32 getMinor();
static S32 getPatch();
static S32 getBuild();
static const std::string &getVersion();
static const std::string &getShortVersion();
static const std::string &getChannel();
All viewer code has been updated to use this API. Viewer code no
longer directly includes llversionviewer.h from llcommon.
|
|
The international billing links and labels in the Buy L$ floater are
now hidden by default. They will only be displayed once we get an
estimate from the server that includes an "estimatedLocalCost" token,
i.e., we are connected to a server that has the international billing
functionality enabled.
This is done so that the new functionality in Viewer 2.0 is not
exposed to the user until the international billing features are live
(which is scheduled to happen after the Viewer 2.0 release date).
|
|
and Buy Land floaters.
We now check for a new estimatedLocalCost key from the XML-RPC server,
which provides the estimated cost in the user's local currency, e.g.,
"US$ 10.00" or "10.00 Euros". Note: the server is not currently
sending this information.
The previous codepath still exists and should be unaffected. That is,
we will continue to check for an estimatedCost key from the server with
a value specified in US cents. We give precedence to estimatedLocalCost
though and may want to remove this code once the international billing
server changes go live.
<lynx@lindenlab.com> HG: branch 'default' HG: changed
indra/newview/llcurrencyuimanager.cpp HG: changed
indra/newview/llcurrencyuimanager.h HG: changed
indra/newview/llfloaterbuyland.cpp HG: changed
indra/newview/skins/default/xui/en/floater_buy_land.xml
|
|
requests to the XML-RPC server, including the channel name and the
major, minor, patch, and build version numbers. This information is
needed by the international billing guys to determine whether an
international customer is trying to use a 1.23 viewer to buy L$.
|
|
Erica's design. Now any errors during the L$ purchase process will
give you a nice prompt to visit the SL website.
Replaced all user-visible references to the illegal term "currency"
with the term "L$".
Also fixed an outstanding bug with this floater: if you clicked the
Buy button but then cancelled the confirmation dialog, then the Buy
button would remain disabled. Now the Buy button is only disabled
during periods when you actually cannot buy.
Added initial support for local currencies, with the use of a new
[LOCALAMOUNT] field in the XUI files. When the XML-RPC server can
actually return local currency details, we can hook this up by just
changing llcurrencyuimanager.cpp.
Discussed XML-RPC interaction with Morpheus. Thanks to Erica for
the images and first cut at the XUI.
|
|
secapi stuff as well as certificate handling stuff.
Grid manager as well
|
|
ignore-dead-branch
|
|
svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-1.23.onetwo-merge-1
QAR-1531 viewer 1.23rc1+1.23rc2 merge to trunk
|
|
svn+ssh://svn/svn/user/phoenix/license_2009_merge into trunk. QAR-1165
|
|
dataserver-is-deprecated
|
|
merge release@88802 Branch_1-20-Viewer-2-merge-1@89178 -> release
|
|
svn merge -r 79616:82632 svn+ssh://svn/svn/linden/branches/maintenance/maintenance-7 into release
svn merge -r 83211:87215 svn+ssh://svn/svn/linden/branches/php-framework-3 into release
ACTUAL MERGE: svn merge -r 87631:87698 svn+ssh://svn/svn/linden/qa/combo-merge-maintenance-7-php-framework-3 into release
dataserver-is-deprecated
|
|
svn+ssh://svn.lindenlab.com/svn/linden/release dataserver-is-deprecated
|
|
svn+ssh://svn.lindenlab.com/svn/linden/qa/maintenance-7-sandbox-84884 -- dataserver-is-deprecated
|
|
QAR-424
|
|
svn+ssh://svn.lindenlab.com/svn/linden/branches/maint-ui-8-merge
QAR-343 - merge maint-ui-7 and maint-ui-8 to release
|
|
|
|
|
|
svn+ssh://svn/svn/linden/branches/new-license into release. only changes files which are not deployed or the comments section of code.
|
|
svn+ssh://svn/svn/linden/branches/os-patches.001 into release.
|
|
|