summaryrefslogtreecommitdiff
path: root/indra/newview/llfavoritesbar.cpp
diff options
context:
space:
mode:
authorDave Houlton <euclid@lindenlab.com>2020-08-18 20:23:57 +0000
committerDave Houlton <euclid@lindenlab.com>2020-08-18 20:23:57 +0000
commitc2c5e672e25d3272db0b062c3831abded6db9141 (patch)
treefa6ba40f4609073d96f20460fcc8e38f8b8e1bf7 /indra/newview/llfavoritesbar.cpp
parent456968de657f17de4757e95b87350b2564e54f71 (diff)
parent4e94745139ea116b1779035e1b303a9fcc92f315 (diff)
Merged in DV510-merge-6.4.8 (pull request #243)
Merge master 6.4.8 into DRTVWR-510
Diffstat (limited to 'indra/newview/llfavoritesbar.cpp')
-rw-r--r--indra/newview/llfavoritesbar.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 17952349dc..347997a69a 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -1590,14 +1590,29 @@ void LLFavoritesOrderStorage::load()
<< (fav_llsd.isMap() ? "" : "un") << "successfully"
<< LL_ENDL;
in_file.close();
- user_llsd = fav_llsd[gAgentUsername];
+ if (fav_llsd.isMap() && fav_llsd.has(gAgentUsername))
+ {
+ user_llsd = fav_llsd[gAgentUsername];
- S32 index = 0;
- for (LLSD::array_iterator iter = user_llsd.beginArray();
+ S32 index = 0;
+ bool needs_validation = gSavedPerAccountSettings.getBOOL("ShowFavoritesOnLogin");
+ for (LLSD::array_iterator iter = user_llsd.beginArray();
iter != user_llsd.endArray(); ++iter)
- {
- mSortIndexes.insert(std::make_pair(iter->get("id").asUUID(), index));
- index++;
+ {
+ // Validation
+ LLUUID fv_id = iter->get("id").asUUID();
+ if (needs_validation
+ && (fv_id.isNull()
+ || iter->get("asset_id").asUUID().isNull()
+ || iter->get("name").asString().empty()
+ || iter->get("slurl").asString().empty()))
+ {
+ mRecreateFavoriteStorage = true;
+ }
+
+ mSortIndexes.insert(std::make_pair(fv_id, index));
+ index++;
+ }
}
}
else
@@ -1841,6 +1856,8 @@ void LLFavoritesOrderStorage::rearrangeFavoriteLandmarks(const LLUUID& source_it
BOOL LLFavoritesOrderStorage::saveFavoritesRecord(bool pref_changed)
{
+ pref_changed |= mRecreateFavoriteStorage;
+ mRecreateFavoriteStorage = false;
LLUUID favorite_folder= gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
if (favorite_folder.isNull())