diff options
author | Justin Clark-Casey (justincc) | 2011-06-04 02:39:26 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-06-04 02:39:26 +0100 |
commit | 12b1cbf8bfc559e4da40abf518e8e99fac793870 (patch) | |
tree | ba588348ce68360372cf73a07fd3eb5057234b75 /OpenSim/Region/CoreModules | |
parent | insert an InventoryArchiveUtils.FindItemsByPath() to return multiple items ra... (diff) | |
download | opensim-SC-12b1cbf8bfc559e4da40abf518e8e99fac793870.zip opensim-SC-12b1cbf8bfc559e4da40abf518e8e99fac793870.tar.gz opensim-SC-12b1cbf8bfc559e4da40abf518e8e99fac793870.tar.bz2 opensim-SC-12b1cbf8bfc559e4da40abf518e8e99fac793870.tar.xz |
Fix give inventory tests to use different users rather than (accidentally) the same user. Extend TestGiveInventoryItem() to test giving back the same item.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs index e7fb43a..0d90a15 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs | |||
@@ -206,7 +206,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
206 | else | 206 | else |
207 | return null; | 207 | return null; |
208 | } | 208 | } |
209 | 209 | ||
210 | public static List<InventoryItemBase> FindItemsByPath( | ||
211 | IInventoryService inventoryService, UUID userId, string path) | ||
212 | { | ||
213 | InventoryFolderBase rootFolder = inventoryService.GetRootFolder(userId); | ||
214 | |||
215 | if (null == rootFolder) | ||
216 | return new List<InventoryItemBase>(); | ||
217 | |||
218 | return FindItemsByPath(inventoryService, rootFolder, path); | ||
219 | } | ||
220 | |||
210 | /// <summary> | 221 | /// <summary> |
211 | /// Find items that match a given PATH_DELIMITOR delimited path starting from this folder. | 222 | /// Find items that match a given PATH_DELIMITOR delimited path starting from this folder. |
212 | /// </summary> | 223 | /// </summary> |
@@ -239,11 +250,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
239 | if (components.Length == 1) | 250 | if (components.Length == 1) |
240 | { | 251 | { |
241 | // m_log.DebugFormat( | 252 | // m_log.DebugFormat( |
242 | // "FOUND SINGLE COMPONENT [{0}]. Looking for this in [{1}] {2}", | 253 | // "FOUND SINGLE COMPONENT [{0}]. Looking for this in [{1}] {2}", |
243 | // components[0], startFolder.Name, startFolder.ID); | 254 | // components[0], startFolder.Name, startFolder.ID); |
244 | 255 | ||
245 | List<InventoryItemBase> items = inventoryService.GetFolderItems(startFolder.Owner, startFolder.ID); | 256 | List<InventoryItemBase> items = inventoryService.GetFolderItems(startFolder.Owner, startFolder.ID); |
246 | 257 | ||
247 | // m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Found {0} items in FindItemByPath()", items.Count); | 258 | // m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Found {0} items in FindItemByPath()", items.Count); |
248 | 259 | ||
249 | foreach (InventoryItemBase item in items) | 260 | foreach (InventoryItemBase item in items) |
@@ -257,7 +268,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
257 | else | 268 | else |
258 | { | 269 | { |
259 | // m_log.DebugFormat("FOUND COMPONENTS [{0}] and [{1}]", components[0], components[1]); | 270 | // m_log.DebugFormat("FOUND COMPONENTS [{0}] and [{1}]", components[0], components[1]); |
260 | 271 | ||
261 | InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID); | 272 | InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID); |
262 | 273 | ||
263 | foreach (InventoryFolderBase folder in contents.Folders) | 274 | foreach (InventoryFolderBase folder in contents.Folders) |