diff options
author | Aleric Inglewood | 2010-10-20 18:31:42 +0200 |
---|---|---|
committer | Aleric Inglewood | 2010-10-20 18:31:42 +0200 |
commit | 2f4e17af336c9a399a0274b7836f40fc7ff56e21 (patch) | |
tree | 1c5c9d83bab4a602b58b439ffccd758ebca54836 /linden | |
parent | Update WebKit Version in About floater. (diff) | |
download | meta-impy-2f4e17af336c9a399a0274b7836f40fc7ff56e21.zip meta-impy-2f4e17af336c9a399a0274b7836f40fc7ff56e21.tar.gz meta-impy-2f4e17af336c9a399a0274b7836f40fc7ff56e21.tar.bz2 meta-impy-2f4e17af336c9a399a0274b7836f40fc7ff56e21.tar.xz |
LindenUserDir fixes.
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.
Diffstat (limited to 'linden')
-rw-r--r-- | linden/indra/llui/lltexteditor.cpp | 11 | ||||
-rw-r--r-- | linden/indra/llvfs/lldir.cpp | 3 | ||||
-rw-r--r-- | linden/indra/llvfs/lldir.h | 2 | ||||
-rw-r--r-- | linden/indra/llvfs/lldir_linux.cpp | 2 | ||||
-rw-r--r-- | linden/indra/llvfs/lldir_solaris.cpp | 2 | ||||
-rw-r--r-- | linden/indra/newview/llappviewer.cpp | 20 | ||||
-rw-r--r-- | linden/indra/newview/llimview.cpp | 2 | ||||
-rw-r--r-- | linden/indra/newview/llmutelist.cpp | 2 | ||||
-rw-r--r-- | linden/indra/newview/llstartup.cpp | 6 | ||||
-rw-r--r-- | linden/indra/newview/llurlhistory.cpp | 2 | ||||
-rw-r--r-- | linden/indra/newview/llviewermedia.cpp | 2 | ||||
-rw-r--r-- | linden/indra/newview/llviewerwindow.cpp | 70 | ||||
-rw-r--r-- | linden/indra/newview/llviewerwindow.h | 1 |
13 files changed, 75 insertions, 50 deletions
diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index fdf8bcf..004d063 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp | |||
@@ -57,6 +57,7 @@ | |||
57 | #include "llimagegl.h" | 57 | #include "llimagegl.h" |
58 | #include "llwindow.h" | 58 | #include "llwindow.h" |
59 | #include "lltextparser.h" | 59 | #include "lltextparser.h" |
60 | #include "lldir.h" | ||
60 | #include <queue> | 61 | #include <queue> |
61 | 62 | ||
62 | #include "llmenugl.h" | 63 | #include "llmenugl.h" |
@@ -4205,7 +4206,10 @@ void LLTextEditor::appendColoredText(const std::string &new_text, | |||
4205 | const std::string& font_name) | 4206 | const std::string& font_name) |
4206 | { | 4207 | { |
4207 | LLColor4 lcolor=color; | 4208 | LLColor4 lcolor=color; |
4208 | if (mParseHighlights) | 4209 | // If LindenUserDir is empty then we didn't login yet. |
4210 | // In that case we can't instantiate LLTextParser, which | ||
4211 | // is initialized per user. | ||
4212 | if (mParseHighlights && !gDirUtilp->getLindenUserDir(true).empty()) | ||
4209 | { | 4213 | { |
4210 | LLTextParser* highlight = LLTextParser::getInstance(); | 4214 | LLTextParser* highlight = LLTextParser::getInstance(); |
4211 | highlight->parseFullLineHighlights(new_text, &lcolor); | 4215 | highlight->parseFullLineHighlights(new_text, &lcolor); |
@@ -4285,7 +4289,10 @@ void LLTextEditor::appendHighlightedText(const std::string &new_text, | |||
4285 | S32 highlight_part, | 4289 | S32 highlight_part, |
4286 | LLStyleSP stylep) | 4290 | LLStyleSP stylep) |
4287 | { | 4291 | { |
4288 | if (mParseHighlights) | 4292 | // If LindenUserDir is empty then we didn't login yet. |
4293 | // In that case we can't instantiate LLTextParser, which | ||
4294 | // is initialized per user. | ||
4295 | if (mParseHighlights && !gDirUtilp->getLindenUserDir(true).empty()) | ||
4289 | { | 4296 | { |
4290 | LLTextParser* highlight = LLTextParser::getInstance(); | 4297 | LLTextParser* highlight = LLTextParser::getInstance(); |
4291 | 4298 | ||
diff --git a/linden/indra/llvfs/lldir.cpp b/linden/indra/llvfs/lldir.cpp index 5567fdd..cd1e98d 100644 --- a/linden/indra/llvfs/lldir.cpp +++ b/linden/indra/llvfs/lldir.cpp | |||
@@ -192,8 +192,9 @@ const std::string &LLDir::getOSUserAppDir() const | |||
192 | return mOSUserAppDir; | 192 | return mOSUserAppDir; |
193 | } | 193 | } |
194 | 194 | ||
195 | const std::string &LLDir::getLindenUserDir() const | 195 | const std::string &LLDir::getLindenUserDir(bool empty_ok) const |
196 | { | 196 | { |
197 | llassert(empty_ok || !mLindenUserDir.empty()); | ||
197 | return mLindenUserDir; | 198 | return mLindenUserDir; |
198 | } | 199 | } |
199 | 200 | ||
diff --git a/linden/indra/llvfs/lldir.h b/linden/indra/llvfs/lldir.h index 55574d6..766f351 100644 --- a/linden/indra/llvfs/lldir.h +++ b/linden/indra/llvfs/lldir.h | |||
@@ -92,7 +92,7 @@ class LLDir | |||
92 | const std::string &getAppRODataDir() const; // Location of read-only data files | 92 | const std::string &getAppRODataDir() const; // Location of read-only data files |
93 | const std::string &getOSUserDir() const; // Location of the os-specific user dir | 93 | const std::string &getOSUserDir() const; // Location of the os-specific user dir |
94 | const std::string &getOSUserAppDir() const; // Location of the os-specific user app dir | 94 | const std::string &getOSUserAppDir() const; // Location of the os-specific user app dir |
95 | const std::string &getLindenUserDir() const; // Location of the Linden user dir. | 95 | const std::string &getLindenUserDir(bool empty_ok = false) const; // Location of the Linden user dir. |
96 | const std::string &getChatLogsDir() const; // Location of the chat logs dir. | 96 | const std::string &getChatLogsDir() const; // Location of the chat logs dir. |
97 | const std::string &getPerAccountChatLogsDir() const; // Location of the per account chat logs dir. | 97 | const std::string &getPerAccountChatLogsDir() const; // Location of the per account chat logs dir. |
98 | const std::string &getTempDir() const; // Common temporary directory | 98 | const std::string &getTempDir() const; // Common temporary directory |
diff --git a/linden/indra/llvfs/lldir_linux.cpp b/linden/indra/llvfs/lldir_linux.cpp index ec0a4f4..5f1eabb 100644 --- a/linden/indra/llvfs/lldir_linux.cpp +++ b/linden/indra/llvfs/lldir_linux.cpp | |||
@@ -97,7 +97,7 @@ LLDir_Linux::LLDir_Linux() | |||
97 | mAppRODataDir = tmp_str; | 97 | mAppRODataDir = tmp_str; |
98 | mOSUserDir = getCurrentUserHome(tmp_str); | 98 | mOSUserDir = getCurrentUserHome(tmp_str); |
99 | mOSUserAppDir = ""; | 99 | mOSUserAppDir = ""; |
100 | mLindenUserDir = tmp_str; | 100 | mLindenUserDir = ""; |
101 | 101 | ||
102 | char path [32]; /* Flawfinder: ignore */ | 102 | char path [32]; /* Flawfinder: ignore */ |
103 | 103 | ||
diff --git a/linden/indra/llvfs/lldir_solaris.cpp b/linden/indra/llvfs/lldir_solaris.cpp index c647e2b..5132455 100644 --- a/linden/indra/llvfs/lldir_solaris.cpp +++ b/linden/indra/llvfs/lldir_solaris.cpp | |||
@@ -100,7 +100,7 @@ LLDir_Solaris::LLDir_Solaris() | |||
100 | mAppRODataDir = strdup(tmp_str); | 100 | mAppRODataDir = strdup(tmp_str); |
101 | mOSUserDir = getCurrentUserHome(tmp_str); | 101 | mOSUserDir = getCurrentUserHome(tmp_str); |
102 | mOSUserAppDir = ""; | 102 | mOSUserAppDir = ""; |
103 | mLindenUserDir = tmp_str; | 103 | mLindenUserDir = ""; |
104 | 104 | ||
105 | char path [LL_MAX_PATH]; /* Flawfinder: ignore */ | 105 | char path [LL_MAX_PATH]; /* Flawfinder: ignore */ |
106 | 106 | ||
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index 9fad9f1..1d45575 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp | |||
@@ -1205,7 +1205,10 @@ bool LLAppViewer::cleanup() | |||
1205 | 1205 | ||
1206 | //reset balance for not playing the UI-Sound | 1206 | //reset balance for not playing the UI-Sound |
1207 | //when relogging into another account | 1207 | //when relogging into another account |
1208 | gStatusBar->clearBalance(); | 1208 | if (gStatusBar) |
1209 | { | ||
1210 | gStatusBar->clearBalance(); | ||
1211 | } | ||
1209 | 1212 | ||
1210 | if (mQuitRequested) | 1213 | if (mQuitRequested) |
1211 | { | 1214 | { |
@@ -3282,12 +3285,15 @@ void LLAppViewer::saveFinalSnapshot() | |||
3282 | gSavedSettings.setBOOL("ShowParcelOwners", FALSE); | 3285 | gSavedSettings.setBOOL("ShowParcelOwners", FALSE); |
3283 | idle(); | 3286 | idle(); |
3284 | 3287 | ||
3285 | std::string snap_filename = gDirUtilp->getLindenUserDir(); | 3288 | std::string snap_filename = gDirUtilp->getLindenUserDir(true); |
3286 | snap_filename += gDirUtilp->getDirDelimiter(); | 3289 | if (!snap_filename.empty()) |
3287 | snap_filename += SCREEN_LAST_FILENAME; | 3290 | { |
3288 | // use full pixel dimensions of viewer window (not post-scale dimensions) | 3291 | snap_filename += gDirUtilp->getDirDelimiter(); |
3289 | gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight(), FALSE, TRUE); | 3292 | snap_filename += SCREEN_LAST_FILENAME; |
3290 | mSavedFinalSnapshot = TRUE; | 3293 | // use full pixel dimensions of viewer window (not post-scale dimensions) |
3294 | gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight(), FALSE, TRUE); | ||
3295 | mSavedFinalSnapshot = TRUE; | ||
3296 | } | ||
3291 | } | 3297 | } |
3292 | } | 3298 | } |
3293 | 3299 | ||
diff --git a/linden/indra/newview/llimview.cpp b/linden/indra/newview/llimview.cpp index a6eaeb3..0b71030 100644 --- a/linden/indra/newview/llimview.cpp +++ b/linden/indra/newview/llimview.cpp | |||
@@ -1360,7 +1360,7 @@ void LLIMMgr::saveIgnoreGroup() | |||
1360 | { | 1360 | { |
1361 | // llinfos << "saving ignore_groups.xml" << llendl; | 1361 | // llinfos << "saving ignore_groups.xml" << llendl; |
1362 | 1362 | ||
1363 | std::string user_dir = gDirUtilp->getLindenUserDir(); | 1363 | std::string user_dir = gDirUtilp->getLindenUserDir(true); |
1364 | if (!user_dir.empty()) | 1364 | if (!user_dir.empty()) |
1365 | { | 1365 | { |
1366 | std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "ignore_groups.xml"); | 1366 | std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "ignore_groups.xml"); |
diff --git a/linden/indra/newview/llmutelist.cpp b/linden/indra/newview/llmutelist.cpp index 0e03509..fff5558 100644 --- a/linden/indra/newview/llmutelist.cpp +++ b/linden/indra/newview/llmutelist.cpp | |||
@@ -265,7 +265,7 @@ LLMuteList::~LLMuteList() | |||
265 | // If we quit from the login screen we will not have an SL account | 265 | // If we quit from the login screen we will not have an SL account |
266 | // name. Don't try to save, otherwise we'll dump a file in | 266 | // name. Don't try to save, otherwise we'll dump a file in |
267 | // C:\Program Files\SecondLife\ JC | 267 | // C:\Program Files\SecondLife\ JC |
268 | std::string user_dir = gDirUtilp->getLindenUserDir(); | 268 | std::string user_dir = gDirUtilp->getLindenUserDir(true); |
269 | if (!user_dir.empty()) | 269 | if (!user_dir.empty()) |
270 | { | 270 | { |
271 | std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "volume_settings.xml"); | 271 | std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "volume_settings.xml"); |
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 7bd5fff..fad3df2 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp | |||
@@ -839,7 +839,7 @@ bool idle_startup() | |||
839 | LLToolMgr::getInstance()->initTools(); | 839 | LLToolMgr::getInstance()->initTools(); |
840 | 840 | ||
841 | // Quickly get something onscreen to look at. | 841 | // Quickly get something onscreen to look at. |
842 | gViewerWindow->initWorldUI(); | 842 | gViewerWindow->pre_initWorldUI(); |
843 | } | 843 | } |
844 | 844 | ||
845 | gViewerWindow->setNormalControlsVisible( FALSE ); | 845 | gViewerWindow->setNormalControlsVisible( FALSE ); |
@@ -1823,6 +1823,10 @@ bool idle_startup() | |||
1823 | { | 1823 | { |
1824 | LL_DEBUGS("AppInitStartupState") << "STATE_WORLD_INIT" << LL_ENDL; | 1824 | LL_DEBUGS("AppInitStartupState") << "STATE_WORLD_INIT" << LL_ENDL; |
1825 | set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD); | 1825 | set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD); |
1826 | |||
1827 | // Initialize the rest of the world. | ||
1828 | gViewerWindow->initWorldUI(); | ||
1829 | |||
1826 | gDisconnected=FALSE; | 1830 | gDisconnected=FALSE; |
1827 | display_startup(); | 1831 | display_startup(); |
1828 | // We should have an agent id by this point. | 1832 | // We should have an agent id by this point. |
diff --git a/linden/indra/newview/llurlhistory.cpp b/linden/indra/newview/llurlhistory.cpp index fbd14bc..b187f3b 100644 --- a/linden/indra/newview/llurlhistory.cpp +++ b/linden/indra/newview/llurlhistory.cpp | |||
@@ -74,7 +74,7 @@ bool LLURLHistory::loadFile(const std::string& filename) | |||
74 | // static | 74 | // static |
75 | bool LLURLHistory::saveFile(const std::string& filename) | 75 | bool LLURLHistory::saveFile(const std::string& filename) |
76 | { | 76 | { |
77 | std::string temp_str = gDirUtilp->getLindenUserDir(); | 77 | std::string temp_str = gDirUtilp->getLindenUserDir(true); |
78 | if( temp_str.empty() ) | 78 | if( temp_str.empty() ) |
79 | { | 79 | { |
80 | llwarns << "Can't save " << filename | 80 | llwarns << "Can't save " << filename |
diff --git a/linden/indra/newview/llviewermedia.cpp b/linden/indra/newview/llviewermedia.cpp index 57c2111..5c01b25 100644 --- a/linden/indra/newview/llviewermedia.cpp +++ b/linden/indra/newview/llviewermedia.cpp | |||
@@ -471,7 +471,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ | |||
471 | // at the login page displaying login Web page or Web browser test via Develop menu. | 471 | // at the login page displaying login Web page or Web browser test via Develop menu. |
472 | // In this case we just use whatever gDirUtilp->getOSUserAppDir() gives us (this | 472 | // In this case we just use whatever gDirUtilp->getOSUserAppDir() gives us (this |
473 | // is what we always used before this change) | 473 | // is what we always used before this change) |
474 | std::string linden_user_dir = gDirUtilp->getLindenUserDir(); | 474 | std::string linden_user_dir = gDirUtilp->getLindenUserDir(true); |
475 | if ( ! linden_user_dir.empty() ) | 475 | if ( ! linden_user_dir.empty() ) |
476 | { | 476 | { |
477 | // gDirUtilp->getLindenUserDir() is whole path, not just Linden name | 477 | // gDirUtilp->getLindenUserDir() is whole path, not just Linden name |
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp index 5cd730a..07fef53 100644 --- a/linden/indra/newview/llviewerwindow.cpp +++ b/linden/indra/newview/llviewerwindow.cpp | |||
@@ -1652,7 +1652,7 @@ void LLViewerWindow::adjustControlRectanglesForFirstUse(const LLRect& window) | |||
1652 | adjust_rect_top_center("FloaterCameraRect3", window); | 1652 | adjust_rect_top_center("FloaterCameraRect3", window); |
1653 | } | 1653 | } |
1654 | 1654 | ||
1655 | void LLViewerWindow::initWorldUI() | 1655 | void LLViewerWindow::pre_initWorldUI() |
1656 | { | 1656 | { |
1657 | pre_init_menus(); | 1657 | pre_init_menus(); |
1658 | 1658 | ||
@@ -1672,9 +1672,45 @@ void LLViewerWindow::initWorldUI() | |||
1672 | gHoverView = new LLHoverView(std::string("gHoverView"), full_window); | 1672 | gHoverView = new LLHoverView(std::string("gHoverView"), full_window); |
1673 | gHoverView->setVisible(TRUE); | 1673 | gHoverView->setVisible(TRUE); |
1674 | mRootView->addChild(gHoverView); | 1674 | mRootView->addChild(gHoverView); |
1675 | 1675 | ||
1676 | gIMMgr = LLIMMgr::getInstance(); | 1676 | gIMMgr = LLIMMgr::getInstance(); |
1677 | 1677 | ||
1678 | // Make sure we only create menus once per session -- MC | ||
1679 | if (!gMenuHolder) | ||
1680 | { | ||
1681 | init_menus(); | ||
1682 | } | ||
1683 | |||
1684 | if (!gFloaterTools) | ||
1685 | { | ||
1686 | gFloaterTools = new LLFloaterTools(); | ||
1687 | gFloaterTools->setVisible(FALSE); | ||
1688 | } | ||
1689 | |||
1690 | // menu holder appears on top to get first pass at all mouse events | ||
1691 | |||
1692 | mRootView->sendChildToFront(gMenuHolder); | ||
1693 | |||
1694 | if ( gHUDView == NULL ) | ||
1695 | { | ||
1696 | LLRect hud_rect = full_window; | ||
1697 | hud_rect.mBottom += 50; | ||
1698 | if (gMenuBarView) | ||
1699 | { | ||
1700 | hud_rect.mTop -= gMenuBarView->getRect().getHeight(); | ||
1701 | } | ||
1702 | gHUDView = new LLHUDView(hud_rect); | ||
1703 | // put behind everything else in the UI | ||
1704 | mRootView->addChildAtEnd(gHUDView); | ||
1705 | } | ||
1706 | } | ||
1707 | |||
1708 | void LLViewerWindow::initWorldUI() | ||
1709 | { | ||
1710 | S32 height = mRootView->getRect().getHeight(); | ||
1711 | S32 width = mRootView->getRect().getWidth(); | ||
1712 | LLRect full_window(0, height, width, 0); | ||
1713 | |||
1678 | if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) | 1714 | if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) |
1679 | { | 1715 | { |
1680 | LLFloaterChat::getInstance(LLSD())->loadHistory(); | 1716 | LLFloaterChat::getInstance(LLSD())->loadHistory(); |
@@ -1715,18 +1751,6 @@ void LLViewerWindow::initWorldUI() | |||
1715 | 1751 | ||
1716 | // Toolbox floater | 1752 | // Toolbox floater |
1717 | 1753 | ||
1718 | // Make sure we only create menus once per session -- MC | ||
1719 | if (!gMenuHolder) | ||
1720 | { | ||
1721 | init_menus(); | ||
1722 | } | ||
1723 | |||
1724 | if (!gFloaterTools) | ||
1725 | { | ||
1726 | gFloaterTools = new LLFloaterTools(); | ||
1727 | gFloaterTools->setVisible(FALSE); | ||
1728 | } | ||
1729 | |||
1730 | if (!gStatusBar) | 1754 | if (!gStatusBar) |
1731 | { | 1755 | { |
1732 | // Status bar | 1756 | // Status bar |
@@ -1744,24 +1768,6 @@ void LLViewerWindow::initWorldUI() | |||
1744 | } | 1768 | } |
1745 | 1769 | ||
1746 | LLFloaterChatterBox::createInstance(LLSD()); | 1770 | LLFloaterChatterBox::createInstance(LLSD()); |
1747 | |||
1748 | |||
1749 | // menu holder appears on top to get first pass at all mouse events | ||
1750 | |||
1751 | mRootView->sendChildToFront(gMenuHolder); | ||
1752 | |||
1753 | if ( gHUDView == NULL ) | ||
1754 | { | ||
1755 | LLRect hud_rect = full_window; | ||
1756 | hud_rect.mBottom += 50; | ||
1757 | if (gMenuBarView) | ||
1758 | { | ||
1759 | hud_rect.mTop -= gMenuBarView->getRect().getHeight(); | ||
1760 | } | ||
1761 | gHUDView = new LLHUDView(hud_rect); | ||
1762 | // put behind everything else in the UI | ||
1763 | mRootView->addChildAtEnd(gHUDView); | ||
1764 | } | ||
1765 | } | 1771 | } |
1766 | 1772 | ||
1767 | // Destroy the UI | 1773 | // Destroy the UI |
diff --git a/linden/indra/newview/llviewerwindow.h b/linden/indra/newview/llviewerwindow.h index 85cdc52..ee8f3fe 100644 --- a/linden/indra/newview/llviewerwindow.h +++ b/linden/indra/newview/llviewerwindow.h | |||
@@ -143,6 +143,7 @@ public: | |||
143 | void initBase(); | 143 | void initBase(); |
144 | void adjustRectanglesForFirstUse(const LLRect& window); | 144 | void adjustRectanglesForFirstUse(const LLRect& window); |
145 | void adjustControlRectanglesForFirstUse(const LLRect& window); | 145 | void adjustControlRectanglesForFirstUse(const LLRect& window); |
146 | void pre_initWorldUI(); | ||
146 | void initWorldUI(); | 147 | void initWorldUI(); |
147 | 148 | ||
148 | // | 149 | // |