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/InventoryServiceBase.cs | |
parent | * Adds llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z,TF) (diff) | |
download | opensim-SC-4db839c3b84bed8a775074beb1ae0b526bc05e81.zip opensim-SC-4db839c3b84bed8a775074beb1ae0b526bc05e81.tar.gz opensim-SC-4db839c3b84bed8a775074beb1ae0b526bc05e81.tar.bz2 opensim-SC-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 'OpenSim/Framework/Communications/InventoryServiceBase.cs')
-rw-r--r-- | OpenSim/Framework/Communications/InventoryServiceBase.cs | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index f614e7d..769c530 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs | |||
@@ -50,7 +50,7 @@ namespace OpenSim.Framework.Communications | |||
50 | { | 50 | { |
51 | if (!String.IsNullOrEmpty(FileName)) | 51 | if (!String.IsNullOrEmpty(FileName)) |
52 | { | 52 | { |
53 | m_log.Info("[AGENTINVENTORY]: Inventory storage: Attempting to load " + FileName); | 53 | m_log.Info("[AGENT INVENTORY]: Inventory storage: Attempting to load " + FileName); |
54 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); | 54 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); |
55 | 55 | ||
56 | foreach (Type pluginType in pluginAssembly.GetTypes()) | 56 | foreach (Type pluginType in pluginAssembly.GetTypes()) |
@@ -161,9 +161,19 @@ namespace OpenSim.Framework.Communications | |||
161 | // See IInventoryServices | 161 | // See IInventoryServices |
162 | public abstract void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback); | 162 | public abstract void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback); |
163 | 163 | ||
164 | // See IInventoryServices | ||
164 | public abstract void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder); | 165 | public abstract void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder); |
166 | |||
167 | // See IInventoryServices | ||
165 | public abstract void MoveExistingInventoryFolder(InventoryFolderBase folder); | 168 | public abstract void MoveExistingInventoryFolder(InventoryFolderBase folder); |
169 | |||
170 | // See IInventoryServices | ||
171 | public abstract void PurgeInventoryFolder(LLUUID userID, InventoryFolderBase folder); | ||
172 | |||
173 | // See IInventoryServices | ||
166 | public abstract void AddNewInventoryItem(LLUUID userID, InventoryItemBase item); | 174 | public abstract void AddNewInventoryItem(LLUUID userID, InventoryItemBase item); |
175 | |||
176 | // See IInventoryServices | ||
167 | public abstract void DeleteInventoryItem(LLUUID userID, InventoryItemBase item); | 177 | public abstract void DeleteInventoryItem(LLUUID userID, InventoryItemBase item); |
168 | 178 | ||
169 | #endregion | 179 | #endregion |
@@ -228,6 +238,36 @@ namespace OpenSim.Framework.Communications | |||
228 | } | 238 | } |
229 | } | 239 | } |
230 | 240 | ||
241 | /// <summary> | ||
242 | /// Purge a folder of all items items and subfolders. | ||
243 | /// | ||
244 | /// FIXME: Really nasty in a sense, because we have to query the database to get information we may | ||
245 | /// already know... Needs heavy refactoring. | ||
246 | /// </summary> | ||
247 | /// <param name="folder"></param> | ||
248 | protected void PurgeFolder(InventoryFolderBase folder) | ||
249 | { | ||
250 | List<InventoryFolderBase> subFolders = RequestSubFolders(folder.ID); | ||
251 | |||
252 | foreach (InventoryFolderBase subFolder in subFolders) | ||
253 | { | ||
254 | // m_log.DebugFormat("[AGENT INVENTORY]: Deleting folder {0} {1}", subFolder.Name, subFolder.ID); | ||
255 | |||
256 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | ||
257 | { | ||
258 | plugin.Value.deleteInventoryFolder(subFolder.ID); | ||
259 | } | ||
260 | } | ||
261 | |||
262 | // XXX Temporarily don't delete the items since UserProfileCacheService is still doing this | ||
263 | // List<InventoryItemBase> items = RequestFolderItems(folder.ID); | ||
264 | // | ||
265 | // foreach (InventoryItemBase item : items) | ||
266 | // { | ||
267 | // DeleteItem(item); | ||
268 | // } | ||
269 | } | ||
270 | |||
231 | private void AddNewInventorySet(UsersInventory inventory) | 271 | private void AddNewInventorySet(UsersInventory inventory) |
232 | { | 272 | { |
233 | foreach (InventoryFolderBase folder in inventory.Folders.Values) | 273 | foreach (InventoryFolderBase folder in inventory.Folders.Values) |
@@ -236,6 +276,9 @@ namespace OpenSim.Framework.Communications | |||
236 | } | 276 | } |
237 | } | 277 | } |
238 | 278 | ||
279 | /// <summary> | ||
280 | /// Used to create a new user inventory. | ||
281 | /// </summary> | ||
239 | private class UsersInventory | 282 | private class UsersInventory |
240 | { | 283 | { |
241 | public Dictionary<LLUUID, InventoryFolderBase> Folders = new Dictionary<LLUUID, InventoryFolderBase>(); | 284 | public Dictionary<LLUUID, InventoryFolderBase> Folders = new Dictionary<LLUUID, InventoryFolderBase>(); |