diff options
| author | Richard Linden <none@none> | 2011-05-02 17:57:52 -0700 |
|---|---|---|
| committer | Richard Linden <none@none> | 2011-05-02 17:57:52 -0700 |
| commit | d5faa4f38d338777463b7ad6eb3239041d43fe28 (patch) | |
| tree | d57efbda59c9f677b2245bebc97fec129f3f9fad /indra/newview/llviewerinventory.cpp | |
| parent | 9a6f06687e5b467f0c049bfbf88c2131eee11ef3 (diff) | |
| parent | 78d76eb4b01e0bd6db41a67d1573a1b841cbe993 (diff) | |
Automated merge with ssh://hg.lindenlab.com/richard/viewer-experience
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
| -rw-r--r-- | indra/newview/llviewerinventory.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 68011ebf07..9e58acdcd3 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1456,6 +1456,9 @@ private: void saveFavoritesSLURLs(); + // Remove record of current user's favorites from file on disk. + void removeFavoritesRecordOfUser(); + void onLandmarkLoaded(const LLUUID& asset_id, LLLandmark* landmark); void storeFavoriteSLURL(const LLUUID& asset_id, std::string& slurl); @@ -1540,6 +1543,10 @@ void LLFavoritesOrderStorage::destroyClass() { LLFavoritesOrderStorage::instance().saveFavoritesSLURLs(); } + else + { + LLFavoritesOrderStorage::instance().removeFavoritesRecordOfUser(); + } } void LLFavoritesOrderStorage::load() @@ -1608,6 +1615,28 @@ void LLFavoritesOrderStorage::saveFavoritesSLURLs() LLSDSerialize::toPrettyXML(fav_llsd, file); } +void LLFavoritesOrderStorage::removeFavoritesRecordOfUser() +{ + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml"); + LLSD fav_llsd; + llifstream file; + file.open(filename); + if (!file.is_open()) return; + LLSDSerialize::fromXML(fav_llsd, file); + + LLAvatarName av_name; + LLAvatarNameCache::get( gAgentID, &av_name ); + if (fav_llsd.has(av_name.getLegacyName())) + { + fav_llsd.erase(av_name.getLegacyName()); + } + + llofstream out_file; + out_file.open(filename); + LLSDSerialize::toPrettyXML(fav_llsd, out_file); + +} + void LLFavoritesOrderStorage::onLandmarkLoaded(const LLUUID& asset_id, LLLandmark* landmark) { if (!landmark) return; |
