MAINT-5760 Save the favorite in file with empty slurl string if it points to location that is no longer valid

Mon, 29 Feb 2016 14:00:04 +0200

author
Mnikolenko ProductEngine <mnikolenko@productengine.com>
date
Mon, 29 Feb 2016 14:00:04 +0200
changeset 48918
ca9da6367c91
parent 48914
9951ebb842b6
child 48919
e9d350764dfb

MAINT-5760 Save the favorite in file with empty slurl string if it points to location that is no longer valid

indra/newview/llfavoritesbar.cpp file | annotate | diff | revisions
indra/newview/llfavoritesbar.h file | annotate | diff | revisions
     1.1 --- a/indra/newview/llfavoritesbar.cpp	Mon Mar 07 18:42:17 2016 +0200
     1.2 +++ b/indra/newview/llfavoritesbar.cpp	Mon Feb 29 14:00:04 2016 +0200
     1.3 @@ -1800,6 +1800,16 @@
     1.4  	    }
     1.5  	}
     1.6  
     1.7 +	for (std::set<LLUUID>::iterator it = mMissingSLURLs.begin(); it != mMissingSLURLs.end(); it++)
     1.8 +	{
     1.9 +		slurls_map_t::iterator slurl_iter = mSLURLs.find(*it);
    1.10 +		if (slurl_iter != mSLURLs.end())
    1.11 +		{
    1.12 +			pref_changed = true;
    1.13 +			break;
    1.14 +		}
    1.15 +	}
    1.16 +
    1.17  	if((items != mPrevFavorites) || name_changed || pref_changed)
    1.18  	{
    1.19  	    std::string filename = getStoredFavoritesFilename();
    1.20 @@ -1820,6 +1830,7 @@
    1.21  
    1.22  			LLSD user_llsd;
    1.23  			S32 fav_iter = 0;
    1.24 +			mMissingSLURLs.clear();
    1.25  			for (LLInventoryModel::item_array_t::iterator it = items.begin(); it != items.end(); it++)
    1.26  			{
    1.27  				LLSD value;
    1.28 @@ -1837,8 +1848,10 @@
    1.29  					else
    1.30  					{
    1.31  						getSLURL((*it)->getAssetUUID());
    1.32 +						value["slurl"] = "";
    1.33 +						user_llsd[fav_iter] = value;
    1.34  						mUpdateRequired = true;
    1.35 -						return FALSE;
    1.36 +						mMissingSLURLs.insert((*it)->getAssetUUID());
    1.37  					}
    1.38  				}
    1.39  				else
    1.40 @@ -1869,7 +1882,6 @@
    1.41  												<< "' at '" << filename << "' " << LL_ENDL;
    1.42  			}
    1.43  		}
    1.44 -
    1.45  		mPrevFavorites = items;
    1.46  	}
    1.47  
     2.1 --- a/indra/newview/llfavoritesbar.h	Mon Mar 07 18:42:17 2016 +0200
     2.2 +++ b/indra/newview/llfavoritesbar.h	Mon Feb 29 14:00:04 2016 +0200
     2.3 @@ -245,7 +245,7 @@
     2.4  
     2.5  	typedef std::map<LLUUID, std::string> slurls_map_t;
     2.6  	slurls_map_t mSLURLs;
     2.7 -
     2.8 +	std::set<LLUUID> mMissingSLURLs;
     2.9  	bool mIsDirty;
    2.10  
    2.11  	struct IsNotInFavorites

mercurial