diff options
| author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2021-09-24 15:28:25 +0300 | 
|---|---|---|
| committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2021-09-24 15:28:25 +0300 | 
| commit | f3a43c74f9e5aae506814af2460507b6879a9bd5 (patch) | |
| tree | eceec5302d54d95db3398508bf68a153c7e6d59a /indra | |
| parent | 1c3d2876ac2b5212976bde9cd4fdea485a366ab9 (diff) | |
SL-16063 FIXED The favorite landmark does not change after editing from another machine
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llfavoritesbar.cpp | 32 | ||||
| -rw-r--r-- | indra/newview/llfavoritesbar.h | 6 | 
2 files changed, 32 insertions, 6 deletions
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 83b5bf3f25..2879d18577 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -763,6 +763,14 @@ void LLFavoritesBarCtrl::updateButtons()  	    }  	    LLFavoritesOrderStorage::instance().mPrevFavorites = mItems;  		mGetPrevItems = false; + +		if (LLFavoritesOrderStorage::instance().isStorageUpdateNeeded()) +		{ +			if (!mItemsChangedTimer.getStarted()) +			{ +				mItemsChangedTimer.start(); +			} +		}  	}  	const LLButton::Params& button_params = getButtonParams(); @@ -1640,7 +1648,6 @@ void LLFavoritesOrderStorage::load()  			llifstream in_file;  			in_file.open(filename.c_str());  			LLSD fav_llsd; -			LLSD user_llsd;  			if (in_file.is_open())  			{  				LLSDSerialize::fromXML(fav_llsd, in_file); @@ -1650,12 +1657,12 @@ void LLFavoritesOrderStorage::load()  				in_file.close();  				if (fav_llsd.isMap() && fav_llsd.has(gAgentUsername))  				{ -					user_llsd = fav_llsd[gAgentUsername]; +					mStorageFavorites = fav_llsd[gAgentUsername];  					S32 index = 0;  					bool needs_validation = gSavedPerAccountSettings.getBOOL("ShowFavoritesOnLogin"); -					for (LLSD::array_iterator iter = user_llsd.beginArray(); -						iter != user_llsd.endArray(); ++iter) +					for (LLSD::array_iterator iter = mStorageFavorites.beginArray(); +						iter != mStorageFavorites.endArray(); ++iter)  					{  						// Validation  						LLUUID fv_id = iter->get("id").asUUID(); @@ -2040,6 +2047,23 @@ void LLFavoritesOrderStorage::showFavoritesOnLoginChanged(BOOL show)  	}  } +bool LLFavoritesOrderStorage::isStorageUpdateNeeded() +{ +	if (!mRecreateFavoriteStorage) +	{ +		for (LLSD::array_iterator iter = mStorageFavorites.beginArray(); +			iter != mStorageFavorites.endArray(); ++iter) +		{ +			if (mFavoriteNames[iter->get("id").asUUID()] != iter->get("name").asString()) +			{ +				mRecreateFavoriteStorage = true; +				return true; +			} +		} +	} +	return false; +} +  void AddFavoriteLandmarkCallback::fire(const LLUUID& inv_item_id)  {  	if (mTargetLandmarkId.isNull()) return; diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index 3bb940948b..ad315b7dc7 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -226,8 +226,11 @@ public:  	BOOL saveFavoritesRecord(bool pref_changed = false);  	void showFavoritesOnLoginChanged(BOOL show); -	LLInventoryModel::item_array_t mPrevFavorites; +	bool isStorageUpdateNeeded(); +	LLInventoryModel::item_array_t mPrevFavorites; +	LLSD mStorageFavorites; +	bool mRecreateFavoriteStorage;  	const static S32 NO_INDEX;  	static bool mSaveOnExit; @@ -254,7 +257,6 @@ private:  	slurls_map_t mSLURLs;  	std::set<LLUUID> mMissingSLURLs;  	bool mIsDirty; -	bool mRecreateFavoriteStorage;  	struct IsNotInFavorites  	{  | 
