LLInventoryFilter& LLInventoryFilter::operator=( const  LLInventoryFilter&  other )
{
	setFilterObjectTypes(other.getFilterObjectTypes());
	setDateRange(other.getMinDate(), other.getMaxDate());
	setHoursAgo(other.getHoursAgo());
	setDateSearchDirection(other.getDateSearchDirection());
	setShowFolderState(other.getShowFolderState());
	setFilterPermissions(other.getFilterPermissions());
	setFilterSubString(other.getFilterSubString());
	setDateRangeLastLogoff(other.isSinceLogoff());
	setFilterWorn(other.getFilterWorn());
	return *this;
}
void LLInventoryFilter::fromLLSD(LLSD& data)
{
	if(data.has("filter_types"))
	{
		setFilterObjectTypes((U64)data["filter_types"].asInteger());
	}

	if(data.has("min_date") && data.has("max_date"))
	{
		setDateRange(data["min_date"].asInteger(), data["max_date"].asInteger());
	}

	if(data.has("hours_ago"))
	{
		setHoursAgo((U32)data["hours_ago"].asInteger());
	}

	if(data.has("show_folder_state"))
	{
		setShowFolderState((EFolderShow)data["show_folder_state"].asInteger());
	}

	if(data.has("permissions"))
	{
		setFilterPermissions((PermissionMask)data["permissions"].asInteger());
	}

	if(data.has("substring"))
	{
		setFilterSubString(std::string(data["substring"].asString()));
	}

	if(data.has("sort_order"))
	{
		setSortOrder((U32)data["sort_order"].asInteger());
	}

	if(data.has("since_logoff"))
	{
		setDateRangeLastLogoff((bool)data["since_logoff"].asBoolean());
	}
}
void LLInventoryFilter::fromParams(const Params& params)
{
	if (!params.validateBlock())
	{
		return;
	}

	// <FS:Ansariel> FIRE-12418: Only apply filter params if they are really provided
	//setFilterObjectTypes(params.filter_ops.types);
	//setFilterCategoryTypes(params.filter_ops.category_types);
	//setFilterWearableTypes(params.filter_ops.wearable_types);
	//setDateRange(params.filter_ops.date_range.min_date,   params.filter_ops.date_range.max_date);
	//setHoursAgo(params.filter_ops.hours_ago);
	//setDateSearchDirection(params.filter_ops.date_search_direction);
	//setShowFolderState(params.filter_ops.show_folder_state);
	//setFilterPermissions(params.filter_ops.permissions);
	//setFilterSubString(params.substring);
	//setDateRangeLastLogoff(params.since_logoff);
	if (params.filter_ops.types.isProvided())
	{
		setFilterObjectTypes(params.filter_ops.types);
	}
	if (params.filter_ops.category_types.isProvided())
	{
		setFilterCategoryTypes(params.filter_ops.category_types);
	}
	if (params.filter_ops.wearable_types.isProvided())
	{
		setFilterWearableTypes(params.filter_ops.wearable_types);
	}
	if (params.filter_ops.date_range.min_date.isProvided() && params.filter_ops.date_range.max_date.isProvided())
	{
		setDateRange(params.filter_ops.date_range.min_date,   params.filter_ops.date_range.max_date);
	}
	if (params.filter_ops.hours_ago.isProvided())
	{
		setHoursAgo(params.filter_ops.hours_ago);
	}
	if (params.filter_ops.date_search_direction.isProvided())
	{
		setDateSearchDirection(params.filter_ops.date_search_direction);
	}
	if (params.filter_ops.show_folder_state.isProvided())
	{
		setShowFolderState(params.filter_ops.show_folder_state);
	}
	if (params.filter_ops.permissions.isProvided())
	{
		setFilterPermissions(params.filter_ops.permissions);
	}
	// <FS:Ansariel> FIRE-8947: Don't restore filter string on relog
	//if (params.substring.isProvided())
	//{
	//	setFilterSubString(params.substring);
	//}
	if (params.since_logoff.isProvided())
	{
		setDateRangeLastLogoff(params.since_logoff);
	}
	// </FS:Ansariel>
}