refactor: rename DeleteToInventory() to CopyToInventory()

DeleteToInventory() is misleading - it is the caller that decides whether to delete or not
bulletsim
Justin Clark-Casey (justincc) 2011-04-18 21:34:26 +01:00
parent 5a404a9ab1
commit 71114d4ad1
3 changed files with 20 additions and 3 deletions

View File

@ -222,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
/// <param name="folderID"></param> /// <param name="folderID"></param>
/// <param name="objectGroup"></param> /// <param name="objectGroup"></param>
/// <param name="remoteClient"> </param> /// <param name="remoteClient"> </param>
public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, public virtual UUID CopyToInventory(DeRezAction action, UUID folderID,
List<SceneObjectGroup> objectGroups, IClientAPI remoteClient) List<SceneObjectGroup> objectGroups, IClientAPI remoteClient)
{ {
Dictionary<UUID, List<SceneObjectGroup>> deletes = new Dictionary<UUID, List<SceneObjectGroup>>(); Dictionary<UUID, List<SceneObjectGroup>> deletes = new Dictionary<UUID, List<SceneObjectGroup>>();

View File

@ -38,7 +38,23 @@ namespace OpenSim.Region.Framework.Interfaces
public interface IInventoryAccessModule public interface IInventoryAccessModule
{ {
UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data); UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data);
UUID DeleteToInventory(DeRezAction action, UUID folderID, List<SceneObjectGroup> objectGroups, IClientAPI remoteClient);
/// <summary>
/// Copy objects to a user's inventory.
/// </summary>
/// <remarks>
/// Is it left to the caller to delete them from the scene if required.
/// </remarks>
/// <param name="action"></param>
/// <param name="folderID"></param>
/// <param name="objectGroups"></param>
/// <param name="remoteClient"></param>
/// <returns>
/// Returns the UUID of the newly created item asset (not the item itself).
/// FIXME: This is not very useful. It would be far more useful to return a list of items instead.
/// </returns>
UUID CopyToInventory(DeRezAction action, UUID folderID, List<SceneObjectGroup> objectGroups, IClientAPI remoteClient);
SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart, SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart,
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment); bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment);

View File

@ -143,7 +143,8 @@ namespace OpenSim.Region.Framework.Scenes
{ {
IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
if (invAccess != null) if (invAccess != null)
invAccess.DeleteToInventory(x.action, x.folderID, x.objectGroups, x.remoteClient); invAccess.CopyToInventory(x.action, x.folderID, x.objectGroups, x.remoteClient);
if (x.permissionToDelete) if (x.permissionToDelete)
{ {
foreach (SceneObjectGroup g in x.objectGroups) foreach (SceneObjectGroup g in x.objectGroups)