aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-07-31 18:23:17 +0000
committerJustin Clarke Casey2008-07-31 18:23:17 +0000
commit900a6564203b69851cf43fc87eb7190c82acec38 (patch)
tree2d2fcc2735003b55b7f2b0846ab28339d5726411 /OpenSim/Region
parent* refactor: eliminate unused SubFoldersCount (diff)
downloadopensim-SC-900a6564203b69851cf43fc87eb7190c82acec38.zip
opensim-SC-900a6564203b69851cf43fc87eb7190c82acec38.tar.gz
opensim-SC-900a6564203b69851cf43fc87eb7190c82acec38.tar.bz2
opensim-SC-900a6564203b69851cf43fc87eb7190c82acec38.tar.xz
* refactor: rearrange path inventory manipulation so that input tidying can be used for item paths as well
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs36
1 files changed, 23 insertions, 13 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 0d471d8..828abcb 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -698,27 +698,37 @@ namespace OpenSim
698 } 698 }
699 699
700 InventoryFolderImpl inventoryFolder = null; 700 InventoryFolderImpl inventoryFolder = null;
701 //InventoryItemBase inventoryItem = null;
701 702
702 if (userInfo.HasReceivedInventory) 703 if (userInfo.HasReceivedInventory)
703 { 704 {
704 if (invPath == InventoryFolderImpl.PATH_DELIMITER) 705 // Eliminate double slashes and any leading / on the path. This might be better done within InventoryFolderImpl
706 // itself (possibly at a small loss in efficiency).
707 string[] components
708 = invPath.Split(new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries);
709 invPath = String.Empty;
710 foreach (string c in components)
711 {
712 invPath += c + InventoryFolderImpl.PATH_DELIMITER;
713 }
714
715 invPath = invPath.Remove(invPath.LastIndexOf(InventoryFolderImpl.PATH_DELIMITER));
716
717 // Annoyingly Split actually returns the original string if the input string consists only of delimiters
718 // Therefore if we still start with a / after the split, then we need the root folder
719 if (invPath.StartsWith(InventoryFolderImpl.PATH_DELIMITER))
705 { 720 {
706 inventoryFolder = userInfo.RootFolder; 721 inventoryFolder = userInfo.RootFolder;
707 } 722 }
708 else 723 else
709 { 724 {
710 // Eliminate double slashes and any leading / on the path. This might be better done within InventoryFolderImpl 725 inventoryFolder = userInfo.RootFolder.FindFolderByPath(invPath);
711 // itself (possibly at a small loss in efficiency). 726 }
712 string[] components
713 = invPath.Split(new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries);
714 invPath = String.Empty;
715 foreach (string c in components)
716 {
717 invPath += c + InventoryFolderImpl.PATH_DELIMITER;
718 }
719 727
720 inventoryFolder = userInfo.RootFolder.FindFolderByPath(invPath); 728// if (inventoryFolder == null)
721 } 729// {
730//
731// }
722 } 732 }
723 else 733 else
724 { 734 {