diff options
author | Justin Clarke Casey | 2008-04-23 17:04:15 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-04-23 17:04:15 +0000 |
commit | 4db839c3b84bed8a775074beb1ae0b526bc05e81 (patch) | |
tree | e412c914e674aa874ca22ddf99a44459d1811868 /OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | |
parent | * Adds llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z,TF) (diff) | |
download | opensim-SC_OLD-4db839c3b84bed8a775074beb1ae0b526bc05e81.zip opensim-SC_OLD-4db839c3b84bed8a775074beb1ae0b526bc05e81.tar.gz opensim-SC_OLD-4db839c3b84bed8a775074beb1ae0b526bc05e81.tar.bz2 opensim-SC_OLD-4db839c3b84bed8a775074beb1ae0b526bc05e81.tar.xz |
* Implement proper emptying of trashcan on standalone
* On standalone, folders (and their items) should now be persistently deleted on trash emptying, as well as immediate child items
* An implementation for grid mode will follow.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index e3f6815..61ec483 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | |||
@@ -496,6 +496,11 @@ namespace OpenSim.Framework.Communications.Cache | |||
496 | return new List<InventoryItemBase>(); | 496 | return new List<InventoryItemBase>(); |
497 | } | 497 | } |
498 | 498 | ||
499 | /// <summary> | ||
500 | /// This should delete all the items and folders in the given directory. | ||
501 | /// </summary> | ||
502 | /// <param name="remoteClient"></param> | ||
503 | /// <param name="folderID"></param> | ||
499 | public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, LLUUID folderID) | 504 | public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, LLUUID folderID) |
500 | { | 505 | { |
501 | // m_log.InfoFormat("[AGENT INVENTORY]: Purging folder {0} for {1} uuid {2}", | 506 | // m_log.InfoFormat("[AGENT INVENTORY]: Purging folder {0} for {1} uuid {2}", |
@@ -506,14 +511,28 @@ namespace OpenSim.Framework.Communications.Cache | |||
506 | { | 511 | { |
507 | if (userProfile.HasInventory) | 512 | if (userProfile.HasInventory) |
508 | { | 513 | { |
509 | InventoryFolderImpl subFolder = userProfile.RootFolder.HasSubFolder(folderID); | 514 | InventoryFolderImpl purgedFolder = userProfile.RootFolder.HasSubFolder(folderID); |
510 | if (subFolder != null) | 515 | if (purgedFolder != null) |
511 | { | 516 | { |
512 | List<InventoryItemBase> items = subFolder.RequestListOfItems(); | 517 | // XXX Nasty - have to create a new object to hold details we already have |
518 | InventoryFolderBase purgedBaseFolder = new InventoryFolderBase(); | ||
519 | purgedBaseFolder.Owner = purgedFolder.Owner; | ||
520 | purgedBaseFolder.ID = purgedFolder.ID; | ||
521 | purgedBaseFolder.Name = purgedFolder.Name; | ||
522 | purgedBaseFolder.ParentID = purgedFolder.ParentID; | ||
523 | purgedBaseFolder.Type = purgedFolder.Type; | ||
524 | purgedBaseFolder.Version = purgedFolder.Version; | ||
525 | |||
526 | m_commsManager.InventoryService.PurgeInventoryFolder(remoteClient.AgentId, purgedBaseFolder); | ||
527 | |||
528 | // XXX Remains temporarily so that we still delete items in the grid case. | ||
529 | List<InventoryItemBase> items = purgedFolder.RequestListOfItems(); | ||
513 | foreach (InventoryItemBase item in items) | 530 | foreach (InventoryItemBase item in items) |
514 | { | 531 | { |
515 | userProfile.DeleteItem(remoteClient.AgentId, item); | 532 | userProfile.DeleteItem(remoteClient.AgentId, item); |
516 | } | 533 | } |
534 | |||
535 | purgedFolder.Purge(); | ||
517 | } | 536 | } |
518 | } | 537 | } |
519 | else | 538 | else |