summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerinventory.cpp
diff options
context:
space:
mode:
authorSeth ProductEngine <slitovchuk@productengine.com>2011-04-12 02:09:37 +0300
committerSeth ProductEngine <slitovchuk@productengine.com>2011-04-12 02:09:37 +0300
commit73cfc64bee057d0f76ab2ca574681dd3fc18e7a8 (patch)
treef07b12873660c3a1dc5115cadfec2402b66127d4 /indra/newview/llviewerinventory.cpp
parent0f785cef5751b0cf9428592ee9ddc9c991aaf7ec (diff)
STORM-1145 ADDITIONAL FIX Fixed removing the record of user favorites available at login location menu when user switches off this feature.
User favorite locations record is removed from the settings file each time when user exits the viewer with "ShowFavoritesOnLogin" setting off and his name is found on the record.
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
-rw-r--r--indra/newview/llviewerinventory.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 519514d99c..42750f8b3f 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -1450,6 +1450,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);
@@ -1534,6 +1537,10 @@ void LLFavoritesOrderStorage::destroyClass()
{
LLFavoritesOrderStorage::instance().saveFavoritesSLURLs();
}
+ else
+ {
+ LLFavoritesOrderStorage::instance().removeFavoritesRecordOfUser();
+ }
}
void LLFavoritesOrderStorage::load()
@@ -1602,6 +1609,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;