From 1c591c06b72d222cff7775ef3aa067cba9c52cd3 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Fri, 6 Nov 2009 12:08:15 +0000 Subject: EXT-2232: Arghhh! Code Duplication == Bugs. Apparently, pre-login notifications use LLAlertDialog, but post-login notifications use LLToastAlertPanel. The latter is basically a copy and paste of the former, with some local modifications. However, the person who copy/pasted the code did not initialize the URLLoader callback, so all notifications that tried to open a web page on a button click after login were failing. I've added comments that this code should be refactored, preferably as a subclass of LLAlertDialog. In the meantime, I've tried to clean it up a bit by not duplicating the nested URLLoader class (which would've required further duplication to reimplement the exact same loader class that LLAlertDialog uses). This let me then initialize the URLLoader callback for LLToastAlertPanel, to fix this specific bug. Again... arghhh!! --- indra/newview/llweb.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llweb.cpp') diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 3204c2d264..72431bd22f 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -43,8 +43,9 @@ #include "llfloatermediabrowser.h" #include "llfloaterreg.h" #include "llalertdialog.h" +#include "lltoastalertpanel.h" -class URLLoader : public LLAlertDialog::URLLoader +class URLLoader : public LLAlertURLLoader { virtual void load(const std::string& url , bool force_open_externally) { @@ -65,6 +66,7 @@ static URLLoader sAlertURLLoader; void LLWeb::initClass() { LLAlertDialog::setURLLoader(&sAlertURLLoader); + LLToastAlertPanel::setURLLoader(&sAlertURLLoader); } -- cgit v1.2.3