From 08e338979062268aa6c82fbe83903de5bcd77f30 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Tue, 29 Jun 2010 04:38:15 -0700
Subject: Buglet fix in HG inventory. Make sure that GetRootFolder for non-HG
 xinventory is the folder "My Inventory". Also changed the Suitcase folder
 name to "My Suitcase".

---
 OpenSim/Services/InventoryService/HGInventoryService.cs | 4 ++--
 OpenSim/Services/InventoryService/XInventoryService.cs  | 9 ++++++++-
 2 files changed, 10 insertions(+), 3 deletions(-)

(limited to 'OpenSim/Services/InventoryService')

diff --git a/OpenSim/Services/InventoryService/HGInventoryService.cs b/OpenSim/Services/InventoryService/HGInventoryService.cs
index 061effe..6e6b019 100644
--- a/OpenSim/Services/InventoryService/HGInventoryService.cs
+++ b/OpenSim/Services/InventoryService/HGInventoryService.cs
@@ -108,13 +108,13 @@ namespace OpenSim.Services.InventoryService
             // Warp! Root folder for travelers
             XInventoryFolder[] folders = m_Database.GetFolders(
                     new string[] { "agentID", "folderName"},
-                    new string[] { principalID.ToString(), "Suitcase" });
+                    new string[] { principalID.ToString(), "My Suitcase" });
 
             if (folders.Length > 0)
                 return ConvertToOpenSim(folders[0]);
             
             // make one
-            XInventoryFolder suitcase = CreateFolder(principalID, UUID.Zero, (int)AssetType.Folder, "Suitcase");
+            XInventoryFolder suitcase = CreateFolder(principalID, UUID.Zero, (int)AssetType.Folder, "My Suitcase");
             return ConvertToOpenSim(suitcase);
         }
 
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs
index af831fd..f48bf60 100644
--- a/OpenSim/Services/InventoryService/XInventoryService.cs
+++ b/OpenSim/Services/InventoryService/XInventoryService.cs
@@ -200,7 +200,14 @@ namespace OpenSim.Services.InventoryService
             if (folders.Length == 0)
                 return null;
 
-            return ConvertToOpenSim(folders[0]);
+            XInventoryFolder root = null;
+            foreach (XInventoryFolder folder in folders)
+                if (folder.folderName == "My Inventory")
+                    root = folder;
+            if (folders == null) // oops
+                root = folders[0];
+
+            return ConvertToOpenSim(root);
         }
 
         public virtual InventoryFolderBase GetFolderForType(UUID principalID, AssetType type)
-- 
cgit v1.1