From 08f3ea28f5681bbbd755947ec09970c11410bd0a Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 11 Sep 2009 22:12:34 -0400 Subject: QAR-1619: Remove unneeded llfloatertos.h #includes. Neither lllogininstance.cpp nor lllogininstance_test.cpp need llfloatertos.h any more, since LLLoginInstance talks to LLFloaterTOS only via LLFloaterReg and LLEventPumps. However, both sources depended on llfloatertos.h dragging in llnotifications.h, so include that explicitly instead of llfloatertos.h. --- indra/newview/lllogininstance.cpp | 2 +- indra/newview/tests/lllogininstance_test.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index e56d28e066..8bf769a132 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -50,7 +50,7 @@ #include "llviewercontrol.h" #include "llurlsimstring.h" #include "llfloaterreg.h" -#include "llfloatertos.h" +#include "llnotifications.h" #include "llwindow.h" #if LL_LINUX || LL_SOLARIS #include "lltrans.h" diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index a84e796159..75db76df27 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -91,7 +91,7 @@ LLURLSimString LLURLSimString::sInstance; bool LLURLSimString::parse() { return true; } //----------------------------------------------------------------------------- -#include "../llfloatertos.h" +#include "llnotifications.h" #include "llfloaterreg.h" static std::string gTOSType; static LLEventPump * gTOSReplyPump = NULL; -- cgit v1.2.3 From 8e0128c493bce16555b3a9132bd71b670c322d63 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 11 Sep 2009 22:14:57 -0400 Subject: QAR-1619: Reconcile LLFloaterTOS::onCancel() with viewer-2 version. The viewer-2 onCancel() pops up a "MustAgreeToLogIn" notification. Make ours do the same. --- indra/newview/llfloatertos.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index d8aea2770f..8d2d48f1af 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -48,6 +48,7 @@ #include "lluictrlfactory.h" #include "llvfile.h" #include "message.h" +#include "llstartup.h" // login_alert_done LLFloaterTOS::LLFloaterTOS(const LLSD& data) @@ -206,6 +207,7 @@ void LLFloaterTOS::onCancel( void* userdata ) { LLFloaterTOS* self = (LLFloaterTOS*) userdata; llinfos << "User disagrees with TOS." << llendl; + LLNotifications::instance().add("MustAgreeToLogIn", LLSD(), LLSD(), login_alert_done); if(self->mReplyPumpName != "") { -- cgit v1.2.3 From d40d745cba1de0df4ada7d4d2cf9f1632279ae12 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 11 Sep 2009 22:24:30 -0400 Subject: DEV-38598, QAR-1619: Ensure we remove LLFloaterTOS from LLFloaterReg registry. LLFloater's destructor calls LLFloaterReg::removeInstance() with its own name and key. But for the new LLFloaterTOS invocation, we pass a key that's an LLSD map. removeInstance() critically depends on LLFloater::KeyCompare::equate() -- but equate() never considered a non-scalar LLSD key value. Fortunately llsdutil.h already provides a deep-equality function for LLSD: llsd_equals(). Making equate() trivially call llsd_equals() fixes the crash on TOS cancel. --- indra/llui/llfloater.cpp | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'indra') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index ca3829e1bd..786340b468 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -60,6 +60,7 @@ #include "v2math.h" #include "lltrans.h" #include "llmultifloater.h" +#include "llsdutil.h" // use this to control "jumping" behavior when Ctrl-Tabbing const S32 TABBED_FLOATER_OFFSET = 0; @@ -175,29 +176,7 @@ bool LLFloater::KeyCompare::compare(const LLSD& a, const LLSD& b) bool LLFloater::KeyCompare::equate(const LLSD& a, const LLSD& b) { - if (a.type() != b.type()) - { - //llerrs << "Mismatched LLSD types: (" << a << ") mismatches (" << b << ")" << llendl; - return false; - } - else if (a.isUndefined()) - return true; - else if (a.isInteger()) - return a.asInteger() == b.asInteger(); - else if (a.isReal()) - return a.asReal() == b.asReal(); - else if (a.isString()) - return a.asString() == b.asString(); - else if (a.isUUID()) - return a.asUUID() == b.asUUID(); - else if (a.isDate()) - return a.asDate() == b.asDate(); - else if (a.isURI()) - return a.asString() == b.asString(); // compare URIs as strings - else if (a.isBoolean()) - return a.asBoolean() == b.asBoolean(); - else - return false; // no valid operation for Binary + return llsd_equals(a, b); } //************************************ -- cgit v1.2.3 From 689af4b32948e2d2a07b60adcc318668c4d55585 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 12 Sep 2009 09:11:32 -0400 Subject: DEV-38598: remove dangerous compare-LLSD-less-than operation --- indra/llui/llfloater.cpp | 11 +++++++++++ indra/llui/llfloater.h | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 786340b468..a372bac497 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -146,6 +146,16 @@ LLFloater::handle_map_t LLFloater::sFloaterMap; LLFloaterView* gFloaterView = NULL; +/*==========================================================================*| +// DEV-38598: The fundamental problem with this operation is that it can only +// support a subset of LLSD values. While it's plausible to compare two arrays +// lexicographically, what strict ordering can you impose on maps? +// (LLFloaterTOS's current key is an LLSD map.) + +// Of course something like this is necessary if you want to build a std::set +// or std::map with LLSD keys. Fortunately we're getting by with other +// container types for now. + //static bool LLFloater::KeyCompare::compare(const LLSD& a, const LLSD& b) { @@ -173,6 +183,7 @@ bool LLFloater::KeyCompare::compare(const LLSD& a, const LLSD& b) else return false; // no valid operation for Binary } +|*==========================================================================*/ bool LLFloater::KeyCompare::equate(const LLSD& a, const LLSD& b) { diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index ee066317e0..cace13939f 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -87,12 +87,14 @@ friend class LLMultiFloater; public: struct KeyCompare { - static bool compare(const LLSD& a, const LLSD& b); +// static bool compare(const LLSD& a, const LLSD& b); static bool equate(const LLSD& a, const LLSD& b); +/*==========================================================================*| bool operator()(const LLSD& a, const LLSD& b) const { return compare(a, b); } +|*==========================================================================*/ }; enum EFloaterButtons -- cgit v1.2.3