From 66f5f2b922e21a1b7618a4038a5f53e3de97e4df Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 18 Jan 2010 14:07:03 -0800 Subject: EXT-4470 Several bad assumptions that LL_PATH_PER_SL_ACCOUNT is always good (which it isn't until after login) To be reviewed by Soft! --- indra/newview/llappviewer.cpp | 11 +++++++++-- indra/newview/llavatariconctrl.cpp | 4 ++-- indra/newview/lllocationhistory.cpp | 6 ++++++ indra/newview/llmutelist.cpp | 2 +- indra/newview/llpanelmaininventory.cpp | 6 ++++-- indra/newview/llstartup.cpp | 6 +++--- indra/newview/llurlhistory.cpp | 2 +- indra/newview/llurlwhitelist.cpp | 6 ++++++ indra/newview/llviewertexturelist.cpp | 2 +- 9 files changed, 33 insertions(+), 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 4a61096ad8..704198aff5 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1480,8 +1480,15 @@ bool LLAppViewer::cleanup() // PerAccountSettingsFile should be empty if no use has been logged on. // *FIX:Mani This should get really saved in a "logoff" mode. - gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE); - llinfos << "Saved settings" << llendflush; + if (gSavedSettings.getString("PerAccountSettingsFile").empty()) + { + llinfos << "Not saving per-account settings; don't know the account name yet." << llendl; + } + else + { + gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE); + llinfos << "Saved settings" << llendflush; + } std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); // save all settings, even if equals defaults diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp index 42ae122ff9..87b8d807c4 100644 --- a/indra/newview/llavatariconctrl.cpp +++ b/indra/newview/llavatariconctrl.cpp @@ -64,7 +64,7 @@ void LLAvatarIconIDCache::load () llinfos << "Loading avatar icon id cache." << llendl; // build filename for each user - std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, mFilename); + std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, mFilename); llifstream file(resolved_filename); if (!file.is_open()) @@ -97,7 +97,7 @@ void LLAvatarIconIDCache::load () void LLAvatarIconIDCache::save () { - std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, mFilename); + std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, mFilename); // open a file for writing llofstream file (resolved_filename); diff --git a/indra/newview/lllocationhistory.cpp b/indra/newview/lllocationhistory.cpp index d910dbf718..ae1b8f8540 100644 --- a/indra/newview/lllocationhistory.cpp +++ b/indra/newview/lllocationhistory.cpp @@ -123,6 +123,12 @@ void LLLocationHistory::save() const // build filename for each user std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, mFilename); + if (resolved_filename.empty()) + { + llinfos << "can't get path to location history filename - probably not logged in yet." << llendl; + return; + } + // open a file for writing llofstream file (resolved_filename); if (!file.is_open()) diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index b520bc1c2d..af66b6e3de 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -258,7 +258,7 @@ LLMuteList::~LLMuteList() { // If we quit from the login screen we will not have an SL account // name. Don't try to save, otherwise we'll dump a file in - // C:\Program Files\SecondLife\ JC + // C:\Program Files\SecondLife\ or similar. JC std::string user_dir = gDirUtilp->getLindenUserDir(); if (!user_dir.empty()) { diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index e74a39c85c..a5a61f0c7b 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -51,6 +51,8 @@ #include "llviewermenu.h" #include "llviewertexturelist.h" +const std::string FILTERS_FILENAME("filters.xml"); + static LLRegisterPanelClassWrapper t_inventory("panel_main_inventory"); void on_file_loaded_for_save(BOOL success, @@ -160,7 +162,7 @@ BOOL LLPanelMainInventory::postBuild() // Now load the stored settings from disk, if available. std::ostringstream filterSaveName; - filterSaveName << gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "filters.xml"); + filterSaveName << gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, FILTERS_FILENAME); llinfos << "LLPanelMainInventory::init: reading from " << filterSaveName << llendl; llifstream file(filterSaveName.str()); LLSD savedFilterState; @@ -230,7 +232,7 @@ LLPanelMainInventory::~LLPanelMainInventory( void ) } std::ostringstream filterSaveName; - filterSaveName << gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "filters.xml"); + filterSaveName << gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, FILTERS_FILENAME); llofstream filtersFile(filterSaveName.str()); if(!LLSDSerialize::toPrettyXML(filterRoot, filtersFile)) { diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index fbc98b7691..ad88534a5d 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -920,9 +920,9 @@ bool idle_startup() // create necessary directories // *FIX: these mkdir's should error check gDirUtilp->setLindenUserDir(gFirstname, gLastname); - LLFile::mkdir(gDirUtilp->getLindenUserDir()); - - // Set PerAccountSettingsFile to the default value. + LLFile::mkdir(gDirUtilp->getLindenUserDir()); + + // Set PerAccountSettingsFile to the default value. gSavedSettings.setString("PerAccountSettingsFile", gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, LLAppViewer::instance()->getSettingsFilename("Default", "PerAccount"))); diff --git a/indra/newview/llurlhistory.cpp b/indra/newview/llurlhistory.cpp index e8b5aa7c74..08dd82ab86 100644 --- a/indra/newview/llurlhistory.cpp +++ b/indra/newview/llurlhistory.cpp @@ -77,7 +77,7 @@ bool LLURLHistory::saveFile(const std::string& filename) std::string temp_str = gDirUtilp->getLindenUserDir(); if( temp_str.empty() ) { - llwarns << "Can't save. No user directory set." << llendl; + llinfos << "Can't save URL history - no user directory set yet." << llendl; return false; } diff --git a/indra/newview/llurlwhitelist.cpp b/indra/newview/llurlwhitelist.cpp index da69039cf9..46bc9276c1 100644 --- a/indra/newview/llurlwhitelist.cpp +++ b/indra/newview/llurlwhitelist.cpp @@ -121,6 +121,12 @@ bool LLUrlWhiteList::save () // build filename for each user std::string resolvedFilename = gDirUtilp->getExpandedFilename ( LL_PATH_PER_SL_ACCOUNT, mFilename ); + if (resolvedFilename.empty()) + { + llinfos << "No per-user dir for saving URL whitelist - presumably not logged in yet. Skipping." << llendl; + return false; + } + // open a file for writing llofstream file ( resolvedFilename ); if ( file.is_open () ) diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 8252b7df00..6bb547373c 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -178,7 +178,7 @@ static std::string get_texture_list_name() void LLViewerTextureList::doPrefetchImages() { - if (LLAppViewer::instance()->getPurgeCache()) + if (LLAppViewer::instance()->getPurgeCache()) { // cache was purged, no point return; -- cgit v1.2.3 From d8c6e5b31550f5f494a8fd70236b99d19b5e1d94 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 18 Jan 2010 14:22:32 -0800 Subject: trivial comment fix. --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 704198aff5..c78c0ca803 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1478,7 +1478,7 @@ bool LLAppViewer::cleanup() LLUIColorTable::instance().saveUserSettings(); - // PerAccountSettingsFile should be empty if no use has been logged on. + // PerAccountSettingsFile should be empty if no user has been logged on. // *FIX:Mani This should get really saved in a "logoff" mode. if (gSavedSettings.getString("PerAccountSettingsFile").empty()) { -- cgit v1.2.3 From c3ee66d60aa716512fc30830c5062658f46ab3e1 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 18 Jan 2010 14:52:55 -0800 Subject: Some trivial comment/logging typos that were bothering me more than they needed to. --- indra/newview/llappviewer.cpp | 2 +- indra/newview/llpanelobjectinventory.cpp | 2 +- indra/newview/llviewerwindow.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index c78c0ca803..2060df0b88 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1376,7 +1376,7 @@ bool LLAppViewer::cleanup() if( gViewerWindow) gViewerWindow->shutdownViews(); - llinfos << "Cleaning up Inevntory" << llendflush; + llinfos << "Cleaning up Inventory" << llendflush; // Cleanup Inventory after the UI since it will delete any remaining observers // (Deleted observers should have already removed themselves) diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 43366ef814..d4376550d6 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -445,7 +445,7 @@ bool remove_task_inventory_callback(const LLSD& notification, const LLSD& respon } // helper for remove -// ! REFACTOR ! two_uuids_list_t is also defined in llinevntorybridge.h, but differently. +// ! REFACTOR ! two_uuids_list_t is also defined in llinventorybridge.h, but differently. typedef std::pair > panel_two_uuids_list_t; typedef std::pair remove_data_t; BOOL LLTaskInvFVBridge::removeItem() diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index ddaf4a221c..769344d183 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1638,7 +1638,7 @@ void LLViewerWindow::shutdownGL() LLViewerTextureManager::cleanup() ; LLImageGL::cleanupClass() ; - llinfos << "All texturs and llimagegl images are destroyed!" << llendl ; + llinfos << "All textures and llimagegl images are destroyed!" << llendl ; llinfos << "Cleaning up select manager" << llendl; LLSelectMgr::getInstance()->cleanup(); -- cgit v1.2.3 From 62ab590b166b88a80b00c0a4fde1ef87c3bf0b38 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 18 Jan 2010 15:41:12 -0800 Subject: trivial comment fix. --- indra/newview/llinventorymodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 4f38fdbde4..e44adfb511 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -3649,7 +3649,7 @@ void LLInventoryModel::updateItemsOrder(LLInventoryModel::item_array_t& items, c LLViewerInventoryItem* src_item = *it_src; items.erase(it_src); - // target iterator can nt be valid due to container was changed, so update it. + // target iterator can not be valid because the container was changed, so update it. it_dest = find_item_iter_by_uuid(items, dest_item_id); items.insert(it_dest, src_item); } -- cgit v1.2.3 From a8cc535f544bb9b9941e0c45276db12d9c8e885d Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 18 Jan 2010 19:55:16 -0700 Subject: temporarily disable the texture fetching thread again to avoid mutex deadlocks. --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 2060df0b88..638a8f759d 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1683,7 +1683,7 @@ bool LLAppViewer::initThreads() // Image decoding LLAppViewer::sImageDecodeThread = new LLImageDecodeThread(enable_threads && true); LLAppViewer::sTextureCache = new LLTextureCache(enable_threads && true); - LLAppViewer::sTextureFetch = new LLTextureFetch(LLAppViewer::getTextureCache(), sImageDecodeThread, enable_threads && true); + LLAppViewer::sTextureFetch = new LLTextureFetch(LLAppViewer::getTextureCache(), sImageDecodeThread, enable_threads && false); LLImage::initClass(); if (LLFastTimer::sLog || LLFastTimer::sMetricLog) -- cgit v1.2.3