diff options
author | Justin Clarke Casey | 2009-02-25 18:32:39 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-02-25 18:32:39 +0000 |
commit | 50dcd66896aa9d2f03193fb13ce0e74a8d88726f (patch) | |
tree | 620b9d4c0b3c6b64c20ee3ad5634e56d3fa6cdf3 /OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |
parent | * Add InventoryArchiveConstants that I missed from last commit (diff) | |
download | opensim-SC_OLD-50dcd66896aa9d2f03193fb13ce0e74a8d88726f.zip opensim-SC_OLD-50dcd66896aa9d2f03193fb13ce0e74a8d88726f.tar.gz opensim-SC_OLD-50dcd66896aa9d2f03193fb13ce0e74a8d88726f.tar.bz2 opensim-SC_OLD-50dcd66896aa9d2f03193fb13ce0e74a8d88726f.tar.xz |
* Fix my own unit test
* Disable folder iar creation code for now (though this wasn't actually causing the test failure)
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 2090558..b61b524 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -222,6 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
222 | item.Creator = m_userInfo.UserProfile.ID; | 222 | item.Creator = m_userInfo.UserProfile.ID; |
223 | item.Owner = m_userInfo.UserProfile.ID; | 223 | item.Owner = m_userInfo.UserProfile.ID; |
224 | 224 | ||
225 | /* | ||
225 | filePath = filePath.Substring(InventoryArchiveConstants.INVENTORY_PATH.Length); | 226 | filePath = filePath.Substring(InventoryArchiveConstants.INVENTORY_PATH.Length); |
226 | string[] rawFolders = filePath.Split(new char[] { '/' }); | 227 | string[] rawFolders = filePath.Split(new char[] { '/' }); |
227 | 228 | ||
@@ -231,23 +232,33 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
231 | InventoryFolderImpl foundFolder = rootDestinationFolder; | 232 | InventoryFolderImpl foundFolder = rootDestinationFolder; |
232 | while (!noFolder && i < rawFolders.Length) | 233 | while (!noFolder && i < rawFolders.Length) |
233 | { | 234 | { |
234 | foundFolder = foundFolder.FindFolderByPath(rawFolders[i]); | 235 | InventoryFolderImpl folder = foundFolder.FindFolderByPath(rawFolders[i]); |
235 | if (null == foundFolder) | 236 | if (null != folder) |
236 | noFolder = true; | 237 | { |
237 | else | 238 | m_log.DebugFormat("[INVENTORY ARCHIVER]: Found folder {0}", folder.Name); |
239 | foundFolder = folder; | ||
238 | i++; | 240 | i++; |
241 | } | ||
242 | else | ||
243 | { | ||
244 | noFolder = true; | ||
245 | } | ||
239 | } | 246 | } |
240 | 247 | ||
241 | // Create any folders that did not previously exist | 248 | // Create any folders that did not previously exist |
242 | while (i < rawFolders.Length) | 249 | while (i < rawFolders.Length) |
243 | { | 250 | { |
244 | foundFolder.CreateChildFolder(UUID.Random(), rawFolders[i++], (ushort)AssetType.Folder); | 251 | m_log.DebugFormat("[INVENTORY ARCHIVER]: Creating folder {0}", rawFolders[i]); |
252 | foundFolder.CreateChildFolder(UUID.Random(), rawFolders[i++], (ushort)AssetType.Folder); | ||
245 | } | 253 | } |
246 | 254 | ||
247 | // Reset folder ID to the one in which we want to load it | 255 | // Reset folder ID to the one in which we want to load it |
248 | // TODO: Properly restore entire folder structure. At the moment all items are dumped in this | 256 | // TODO: Properly restore entire folder structure. At the moment all items are dumped in this |
249 | // single folder no matter where in the saved folder structure they are. | 257 | // single folder no matter where in the saved folder structure they are. |
250 | item.Folder = foundFolder.ID; | 258 | item.Folder = foundFolder.ID; |
259 | */ | ||
260 | |||
261 | item.Folder = rootDestinationFolder.ID; | ||
251 | 262 | ||
252 | m_userInfo.AddItem(item); | 263 | m_userInfo.AddItem(item); |
253 | successfulItemRestores++; | 264 | successfulItemRestores++; |