summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMnikolenko ProductEngine <mnikolenko@productengine.com>2016-02-29 14:00:04 +0200
committerMnikolenko ProductEngine <mnikolenko@productengine.com>2016-02-29 14:00:04 +0200
commited608e2d5b4923764043f2223da84c74983ded92 (patch)
tree77fbd057f024687bbc8faa20d82829cc08f6d9fa /indra/newview
parentc01d1f5a20cffddcd61dd4a2dc45673175023642 (diff)
MAINT-5760 Save the favorite in file with empty slurl string if it points to location that is no longer valid
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llfavoritesbar.cpp16
-rwxr-xr-xindra/newview/llfavoritesbar.h2
2 files changed, 15 insertions, 3 deletions
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index efabcf6056..d614d612ff 100755
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -1800,6 +1800,16 @@ BOOL LLFavoritesOrderStorage::saveFavoritesRecord(bool pref_changed)
}
}
+ for (std::set<LLUUID>::iterator it = mMissingSLURLs.begin(); it != mMissingSLURLs.end(); it++)
+ {
+ slurls_map_t::iterator slurl_iter = mSLURLs.find(*it);
+ if (slurl_iter != mSLURLs.end())
+ {
+ pref_changed = true;
+ break;
+ }
+ }
+
if((items != mPrevFavorites) || name_changed || pref_changed)
{
std::string filename = getStoredFavoritesFilename();
@@ -1820,6 +1830,7 @@ BOOL LLFavoritesOrderStorage::saveFavoritesRecord(bool pref_changed)
LLSD user_llsd;
S32 fav_iter = 0;
+ mMissingSLURLs.clear();
for (LLInventoryModel::item_array_t::iterator it = items.begin(); it != items.end(); it++)
{
LLSD value;
@@ -1837,8 +1848,10 @@ BOOL LLFavoritesOrderStorage::saveFavoritesRecord(bool pref_changed)
else
{
getSLURL((*it)->getAssetUUID());
+ value["slurl"] = "";
+ user_llsd[fav_iter] = value;
mUpdateRequired = true;
- return FALSE;
+ mMissingSLURLs.insert((*it)->getAssetUUID());
}
}
else
@@ -1869,7 +1882,6 @@ BOOL LLFavoritesOrderStorage::saveFavoritesRecord(bool pref_changed)
<< "' at '" << filename << "' " << LL_ENDL;
}
}
-
mPrevFavorites = items;
}
diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h
index 846d62227a..2115f77cf3 100755
--- a/indra/newview/llfavoritesbar.h
+++ b/indra/newview/llfavoritesbar.h
@@ -245,7 +245,7 @@ private:
typedef std::map<LLUUID, std::string> slurls_map_t;
slurls_map_t mSLURLs;
-
+ std::set<LLUUID> mMissingSLURLs;
bool mIsDirty;
struct IsNotInFavorites