diff options
author | Mike Antipov <mantipov@productengine.com> | 2010-01-29 12:34:23 +0200 |
---|---|---|
committer | Mike Antipov <mantipov@productengine.com> | 2010-01-29 12:34:23 +0200 |
commit | 4666636cdc67beb3cbb1c81107ce1f1f368385e1 (patch) | |
tree | 1ce8705b7c762369953cb05b3955fd487db3a877 /indra/newview | |
parent | 72b2cf291d67ae7a271b5745e50290d174a088b6 (diff) |
Work on major bug EXT-3985 ([BSI] Landmarks created in Viewer 2.0 show up with 1@ in Viewer 1.23.x)
-- improvements: for now sort indexes are cleaned & saved only if something was changed amont them.
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llviewerinventory.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 1b141532ef..bcfb8ecbbd 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1208,7 +1208,7 @@ public: const static S32 NO_INDEX; private: friend class LLSingleton<LLFavoritesOrderStorage>; - LLFavoritesOrderStorage() { load(); } + LLFavoritesOrderStorage() : mIsDirty(false) { load(); } ~LLFavoritesOrderStorage() { save(); } /** @@ -1224,6 +1224,8 @@ private: typedef std::map<LLUUID, S32> sort_index_map_t; sort_index_map_t mSortIndexes; + bool mIsDirty; + struct IsNotInFavorites { IsNotInFavorites(const LLInventoryModel::item_array_t& items) @@ -1257,6 +1259,7 @@ const S32 LLFavoritesOrderStorage::NO_INDEX = -1; void LLFavoritesOrderStorage::setSortIndex(const LLUUID& inv_item_id, S32 sort_index) { mSortIndexes[inv_item_id] = sort_index; + mIsDirty = true; } S32 LLFavoritesOrderStorage::getSortIndex(const LLUUID& inv_item_id) @@ -1272,6 +1275,7 @@ S32 LLFavoritesOrderStorage::getSortIndex(const LLUUID& inv_item_id) void LLFavoritesOrderStorage::removeSortIndex(const LLUUID& inv_item_id) { mSortIndexes.erase(inv_item_id); + mIsDirty = true; } // static @@ -1302,6 +1306,9 @@ void LLFavoritesOrderStorage::load() void LLFavoritesOrderStorage::save() { + // nothing to save if clean + if (!mIsDirty) return; + // If we quit from the login screen we will not have an SL account // name. Don't try to save, otherwise we'll dump a file in // C:\Program Files\SecondLife\ or similar. JC @@ -1324,6 +1331,9 @@ void LLFavoritesOrderStorage::save() void LLFavoritesOrderStorage::cleanup() { + // nothing to clean + if (!mIsDirty) return; + const LLUUID fav_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE); LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; |