summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndreyL ProductEngine <andreylproductengine@lindenlab.com>2015-10-26 18:07:34 +0200
committerAndreyL ProductEngine <andreylproductengine@lindenlab.com>2015-10-26 18:07:34 +0200
commitcf53c157fe46eb02568101a51c43a41ee2a4cd18 (patch)
tree5d3b9af45f887cf60156832906a23aa589991484 /indra/newview
parentb0b8d34b15350f44d76f253e6b69f1c4e8ad7f33 (diff)
parent7ea4303aa25960a3aa0971999725a0ca1bcfdec4 (diff)
Merge
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llfavoritesbar.cpp25
-rwxr-xr-xindra/newview/llfavoritesbar.h1
2 files changed, 21 insertions, 5 deletions
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 8f3eaaa207..d6b86cd746 100755
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -655,11 +655,12 @@ void LLFavoritesBarCtrl::changed(U32 mask)
LLInventoryModel::cat_array_t cats;
LLIsType is_type(LLAssetType::AT_LANDMARK);
gInventory.collectDescendentsIf(mFavoriteFolderId, cats, items, LLInventoryModel::EXCLUDE_TRASH, is_type);
-
+
for (LLInventoryModel::item_array_t::iterator i = items.begin(); i != items.end(); ++i)
{
LLFavoritesOrderStorage::instance().getSLURL((*i)->getAssetUUID());
}
+
updateButtons();
if (!mItemsChangedTimer.getStarted())
{
@@ -751,7 +752,11 @@ void LLFavoritesBarCtrl::updateButtons()
if(mGetPrevItems)
{
- LLFavoritesOrderStorage::instance().mPrevFavorites = mItems;
+ for (LLInventoryModel::item_array_t::iterator it = mItems.begin(); it != mItems.end(); it++)
+ {
+ LLFavoritesOrderStorage::instance().mFavoriteNames[(*it)->getUUID()]= (*it)->getName();
+ }
+ LLFavoritesOrderStorage::instance().mPrevFavorites = mItems;
mGetPrevItems = false;
}
@@ -778,7 +783,7 @@ void LLFavoritesBarCtrl::updateButtons()
const LLViewerInventoryItem *item = mItems[first_changed_item_index].get();
if (item)
{
- // an child's order and mItems should be same
+ // an child's order and mItems should be same
if (button->getLandmarkId() != item->getUUID() // sort order has been changed
|| button->getLabelSelected() != item->getName() // favorite's name has been changed
|| button->getRect().mRight < rightest_point) // favbar's width has been changed
@@ -1783,10 +1788,20 @@ BOOL LLFavoritesOrderStorage::saveFavoritesRecord(bool pref_changed)
gInventory.collectDescendentsIf(favorite_folder, cats, items, LLInventoryModel::EXCLUDE_TRASH, is_type);
std::sort(items.begin(), items.end(), LLFavoritesSort());
+ bool name_changed = false;
+
+ for (LLInventoryModel::item_array_t::iterator it = items.begin(); it != items.end(); it++)
+ {
+ if(mFavoriteNames[(*it)->getUUID()] != ((*it)->getName()))
+ {
+ mFavoriteNames[(*it)->getUUID()] = (*it)->getName();
+ name_changed = true;
+ }
+ }
- if((items != mPrevFavorites) || pref_changed)
+ if((items != mPrevFavorites) || name_changed || pref_changed)
{
- std::string filename = getStoredFavoritesFilename();
+ std::string filename = getStoredFavoritesFilename();
if (!filename.empty())
{
llifstream in_file;
diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h
index 66fc8b2ae7..846d62227a 100755
--- a/indra/newview/llfavoritesbar.h
+++ b/indra/newview/llfavoritesbar.h
@@ -218,6 +218,7 @@ public:
const static S32 NO_INDEX;
static bool mSaveOnExit;
bool mUpdateRequired;
+ std::map<LLUUID,std::string> mFavoriteNames;
private:
friend class LLSingleton<LLFavoritesOrderStorage>;