LindenUserDir fixes.
Patch from 2010-10-20/22. Didn't apply cleanly so I redid it manually and tested/checked it. There was only one difference with imprudence: for some reason Singularity tries to see if the "teleport history" floater is visible while initializing the menu's, something that imprudence doesn't do. For the rest the patch is basically the same. Nevertheless, I left all code exactly as it was in Singularity (the only thing that this commit changes is the intend of the original patch: in debug mode, fail with an assertion when LindenUserDir is called while it is not initialized; and then fix everything to make it work again. Original commit message: The LindenUserDir (~/.imprudence/first_last/) cannot be initialized before the user logged in. However, several singletons (that only can be initialized once) depend on this directory for initialization. Therefore we have to take care not to instantiate those singletons until after the user logged in. With regard to webit, this fixes the browser_profile (cache and cookies) directory that the builtin browser uses.
This commit is contained in:
@@ -58,6 +58,7 @@
|
||||
#include "llimagegl.h"
|
||||
#include "llwindow.h"
|
||||
#include "lltextparser.h"
|
||||
#include "lldir.h"
|
||||
#include <queue>
|
||||
#include "llmenugl.h"
|
||||
#include "../newview/lgghunspell_wrapper.h"
|
||||
@@ -4004,7 +4005,10 @@ void LLTextEditor::appendColoredText(const std::string &new_text,
|
||||
const std::string& font_name)
|
||||
{
|
||||
LLColor4 lcolor=color;
|
||||
if (mParseHighlights)
|
||||
// If LindenUserDir is empty then we didn't login yet.
|
||||
// In that case we can't instantiate LLTextParser, which
|
||||
// is initialized per user.
|
||||
if (mParseHighlights && !gDirUtilp->getLindenUserDir(true).empty())
|
||||
{
|
||||
LLTextParser* highlight = LLTextParser::getInstance();
|
||||
highlight->parseFullLineHighlights(new_text, &lcolor);
|
||||
@@ -4082,7 +4086,10 @@ void LLTextEditor::appendHighlightedText(const std::string &new_text,
|
||||
S32 highlight_part,
|
||||
LLStyleSP stylep)
|
||||
{
|
||||
if (mParseHighlights)
|
||||
// If LindenUserDir is empty then we didn't login yet.
|
||||
// In that case we can't instantiate LLTextParser, which
|
||||
// is initialized per user.
|
||||
if (mParseHighlights && !gDirUtilp->getLindenUserDir(true).empty())
|
||||
{
|
||||
LLTextParser* highlight = LLTextParser::getInstance();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user