bool LLWaterParamManager::removeParamSet(const std::string& name, bool delete_from_disk)
{
	// remove from param list
	preset_map_t::iterator it = mParamList.find(name);
	if (it == mParamList.end())
	{
		LL_WARNS("WindLight") << "No water preset named " << name << LL_ENDL;
		return false;
	}

	mParamList.erase(it);

	// remove from file system if requested
	if (delete_from_disk)
	{
		// <FS:Ansariel> FIRE-10861: Fix Windlight settings order
		//if (gDirUtilp->deleteFilesInDir(getUserDir(), LLURI::escape(name) + ".xml") < 1)
		if (gDirUtilp->deleteFilesInDir(getUserDir(), escapeString(name) + ".xml") < 1)
		// </FS:Ansariel>
		{
			LL_WARNS("WindLight") << "Error removing water preset " << name << " from disk" << LL_ENDL;
		}
	}

	// signal interested parties
	mPresetListChangeSignal();
	return true;
}
bool LLWaterParamManager::addParamSet(const std::string& name, LLWaterParamSet& param)
{
	// add a new one if not one there already
	preset_map_t::iterator mIt = mParamList.find(name);
	if(mIt == mParamList.end()) 
	{	
		mParamList[name] = param;
		mPresetListChangeSignal();
		return true;
	}

	return false;
}
bool LLWLParamManager::addParamSet(const LLWLParamKey& key, LLWLParamSet& param)
{
	// add a new one if not one there already
	std::map<LLWLParamKey, LLWLParamSet>::iterator mIt = mParamList.find(key);
	if(mIt == mParamList.end()) 
	{	
		llassert(!key.name.empty());
		// *TODO: validate params
		mParamList[key] = param;
		mPresetListChangeSignal();
		return true;
	}

	return false;
}
bool LLWLParamManager::removeParamSet(const LLWLParamKey& key, bool delete_from_disk)
{
	// *NOTE: Removing a sky preset invalidates day cycles that refer to it.

	if (key.scope == LLEnvKey::SCOPE_REGION)
	{
		llwarns << "Removing region skies not supported" << llendl;
		llassert(key.scope == LLEnvKey::SCOPE_LOCAL);
		return false;
	}

	// remove from param list
	std::map<LLWLParamKey, LLWLParamSet>::iterator it = mParamList.find(key);
	if (it == mParamList.end())
	{
		LL_WARNS("WindLight") << "No sky preset named " << key.name << LL_ENDL;
		return false;
	}

	mParamList.erase(it);
	mDay.removeReferencesTo(key);

	// remove from file system if requested
	if (delete_from_disk)
	{
		std::string path_name(getUserDir());
		std::string escaped_name = LLWeb::curlEscape(key.name);

		if(gDirUtilp->deleteFilesInDir(path_name, escaped_name + ".xml") < 1)
		{
			LL_WARNS("WindLight") << "Error removing sky preset " << key.name << " from disk" << LL_ENDL;
		}
	}

	// signal interested parties
	mPresetListChangeSignal();

	return true;
}