summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerinventory.cpp
diff options
context:
space:
mode:
authorAndrew Productengine <adyukov@productengine.com>2010-12-09 19:54:40 +0200
committerAndrew Productengine <adyukov@productengine.com>2010-12-09 19:54:40 +0200
commit32750132db47eb335c56f6c880902cf7195e1825 (patch)
tree078d1d5eb506af695f1ff2098c1b960aa440835b /indra/newview/llviewerinventory.cpp
parentd6f8efae246db921b8d52fc1f86bbf667931dd93 (diff)
STORM-34 ADDITIONAL_FIX Implemented storing of multi-user favorites and showing them on login screen.
- Changed the way SLURLs are cached a little, because previous one introduced problems with theit order. - Also allowed saving of favorites to disk even if not all of them received SLURL info - this is done to avoid favorites not saving when there is at least one "dead" landmark among them. - "Username" field on login screen is now not a lineeditor, but combobox (to enable autocompletion), but without button (Esbee asked for this in ticket for security reasons, and perhaps for visual consistency). - Elements of this combobox are names of users whose favorites we have saved in file. - Contents of "Start at:" combobox are changed depending on changes in "Username"- if username is present in favorites file, favorites for this user are added there. - New callback was added to LLCombobox and used in this fix, because present ones weren't enough to easily track changes in text entry.
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
-rw-r--r--indra/newview/llviewerinventory.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 941e81d36f..4fa79b1855 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -1562,6 +1562,13 @@ void LLFavoritesOrderStorage::saveFavoritesSLURLs()
if (user_dir.empty()) return;
std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
+ llifstream in_file;
+ in_file.open(filename);
+ LLSD fav_llsd;
+ if (in_file.is_open())
+ {
+ LLSDSerialize::fromXML(fav_llsd, in_file);
+ }
const LLUUID fav_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
LLInventoryModel::cat_array_t cats;
@@ -1579,18 +1586,10 @@ void LLFavoritesOrderStorage::saveFavoritesSLURLs()
if (slurl_iter != mSLURLs.end())
{
value["slurl"] = slurl_iter->second;
+ user_llsd[(*it)->getSortField()] = value;
}
- else
- {
- llwarns << "Fetching SLURLs for \"Favorites\" is not complete!" << llendl;
- return;
- }
-
- user_llsd[(*it)->getSortField()] = value;
}
- LLSD fav_llsd;
- // this level in LLSD is not needed now and is just a stub, but will be needed later when implementing save of multiple users favorites in one file.
LLAvatarName av_name;
LLAvatarNameCache::get( gAgentID, &av_name );
fav_llsd[av_name.getLegacyName()] = user_llsd;
@@ -1680,6 +1679,11 @@ S32 LLViewerInventoryItem::getSortField() const
void LLViewerInventoryItem::setSortField(S32 sortField)
{
LLFavoritesOrderStorage::instance().setSortIndex(mUUID, sortField);
+ getSLURL();
+}
+
+void LLViewerInventoryItem::getSLURL()
+{
LLFavoritesOrderStorage::instance().getSLURL(mAssetUUID);
}