diff options
Diffstat (limited to 'OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs')
-rw-r--r-- | OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs index 3de2330..4416995 100644 --- a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs | |||
@@ -122,7 +122,7 @@ namespace OpenSim.Services.HypergridService | |||
122 | } | 122 | } |
123 | 123 | ||
124 | List<XInventoryFolder> tree = GetFolderTree(principalID, suitcase.folderID); | 124 | List<XInventoryFolder> tree = GetFolderTree(principalID, suitcase.folderID); |
125 | if (tree == null || (tree != null && tree.Count == 0)) | 125 | if (tree.Count == 0) |
126 | return null; | 126 | return null; |
127 | 127 | ||
128 | List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); | 128 | List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); |
@@ -537,13 +537,13 @@ namespace OpenSim.Services.HypergridService | |||
537 | 537 | ||
538 | private List<XInventoryFolder> GetFolderTree(UUID principalID, UUID folder) | 538 | private List<XInventoryFolder> GetFolderTree(UUID principalID, UUID folder) |
539 | { | 539 | { |
540 | List<XInventoryFolder> t = null; | 540 | List<XInventoryFolder> t; |
541 | if (m_SuitcaseTrees.TryGetValue(principalID, out t)) | 541 | if (m_SuitcaseTrees.TryGetValue(principalID, out t)) |
542 | return t; | 542 | return t; |
543 | 543 | ||
544 | // Get the tree of the suitcase folder | 544 | // Get the tree of the suitcase folder |
545 | t = GetFolderTreeRecursive(folder); | 545 | t = GetFolderTreeRecursive(folder); |
546 | m_SuitcaseTrees.AddOrUpdate(principalID, t, 5*60); // 5minutes | 546 | m_SuitcaseTrees.AddOrUpdate(principalID, t, 5*60); // 5 minutes |
547 | return t; | 547 | return t; |
548 | } | 548 | } |
549 | 549 | ||
@@ -554,8 +554,10 @@ namespace OpenSim.Services.HypergridService | |||
554 | new string[] { "parentFolderID" }, | 554 | new string[] { "parentFolderID" }, |
555 | new string[] { root.ToString() }); | 555 | new string[] { root.ToString() }); |
556 | 556 | ||
557 | if (folders == null || (folders != null && folders.Length == 0)) | 557 | if (folders == null || folders.Length == 0) |
558 | { | ||
558 | return tree; // empty tree | 559 | return tree; // empty tree |
560 | } | ||
559 | else | 561 | else |
560 | { | 562 | { |
561 | foreach (XInventoryFolder f in folders) | 563 | foreach (XInventoryFolder f in folders) |
@@ -588,17 +590,18 @@ namespace OpenSim.Services.HypergridService | |||
588 | List<XInventoryFolder> tree = new List<XInventoryFolder>(); | 590 | List<XInventoryFolder> tree = new List<XInventoryFolder>(); |
589 | tree.Add(suitcase); // Warp! the tree is the real root folder plus the children of the suitcase folder | 591 | tree.Add(suitcase); // Warp! the tree is the real root folder plus the children of the suitcase folder |
590 | tree.AddRange(GetFolderTree(principalID, suitcase.folderID)); | 592 | tree.AddRange(GetFolderTree(principalID, suitcase.folderID)); |
593 | |||
591 | // Also add the Current Outfit folder to the list of available folders | 594 | // Also add the Current Outfit folder to the list of available folders |
592 | tree.Add(GetCurrentOutfitXFolder(principalID)); | 595 | XInventoryFolder folder = GetCurrentOutfitXFolder(principalID); |
596 | if (folder != null) | ||
597 | tree.Add(folder); | ||
593 | 598 | ||
594 | XInventoryFolder f = tree.Find(delegate(XInventoryFolder fl) | 599 | XInventoryFolder f = tree.Find(delegate(XInventoryFolder fl) |
595 | { | 600 | { |
596 | if (fl.folderID == folderID) return true; | 601 | return (fl.folderID == folderID); |
597 | else return false; | ||
598 | }); | 602 | }); |
599 | 603 | ||
600 | if (f == null) return false; | 604 | return (f != null); |
601 | else return true; | ||
602 | } | 605 | } |
603 | #endregion | 606 | #endregion |
604 | 607 | ||