From 3508298ddf5df94574c37c04fd59c3df579e42a2 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 30 Apr 2008 20:04:06 +0000 Subject: * Refactor: Rename InventoryFolderImpl.HasSubFolder() to GetDescendentFolder() --- OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | 4 ++-- .../Framework/Communications/Cache/InventoryFolderImpl.cs | 8 ++++---- .../Communications/Cache/UserProfileCacheService.cs | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index 847909a..7902240 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs @@ -229,7 +229,7 @@ namespace OpenSim.Framework.Communications.Cache } else { - InventoryFolderImpl folder = RootFolder.HasSubFolder(folderInfo.ParentID); + InventoryFolderImpl folder = RootFolder.GetDescendentFolder(folderInfo.ParentID); lock (folder.SubFolders) { if (folder != null) @@ -283,7 +283,7 @@ namespace OpenSim.Framework.Communications.Cache } else { - InventoryFolderImpl folder = RootFolder.HasSubFolder(itemInfo.Folder); + InventoryFolderImpl folder = RootFolder.GetDescendentFolder(itemInfo.Folder); if (folder != null) { lock (folder.Items) diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs index f55f323..4dcf755 100644 --- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs +++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs @@ -168,10 +168,10 @@ namespace OpenSim.Framework.Communications.Cache } /// - /// Does this folder contain the given subfolder? + /// Returns the folder requested if it exists as a descendent of this folder /// - /// - public InventoryFolderImpl HasSubFolder(LLUUID folderID) + /// The requested folder if it exists, null if it does not. + public InventoryFolderImpl GetDescendentFolder(LLUUID folderID) { InventoryFolderImpl returnFolder = null; @@ -185,7 +185,7 @@ namespace OpenSim.Framework.Communications.Cache { foreach (InventoryFolderImpl folder in SubFolders.Values) { - returnFolder = folder.HasSubFolder(folderID); + returnFolder = folder.GetDescendentFolder(folderID); if (returnFolder != null) { break; diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 4627f75..049b4a1 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -193,7 +193,7 @@ namespace OpenSim.Framework.Communications.Cache } else { - InventoryFolderImpl folder = userProfile.RootFolder.HasSubFolder(parentID); + InventoryFolderImpl folder = userProfile.RootFolder.GetDescendentFolder(parentID); if (folder != null) { InventoryFolderImpl createdFolder = folder.CreateNewSubFolder(folderID, folderName, folderType); @@ -336,7 +336,7 @@ namespace OpenSim.Framework.Communications.Cache return; } - if ((fold = libraryRoot.HasSubFolder(folderID)) != null) + if ((fold = libraryRoot.GetDescendentFolder(folderID)) != null) { remoteClient.SendInventoryFolderDetails( libraryRoot.Owner, folderID, fold.RequestListOfItems(), @@ -385,7 +385,7 @@ namespace OpenSim.Framework.Communications.Cache } else { - if ((fold = userProfile.RootFolder.HasSubFolder(folderID)) != null) + if ((fold = userProfile.RootFolder.GetDescendentFolder(folderID)) != null) { // m_log.DebugFormat( // "[AGENT INVENTORY]: Found folder {0} for client {1}", @@ -446,7 +446,7 @@ namespace OpenSim.Framework.Communications.Cache return libraryRoot.RequestListOfItems(); } - if ((fold = libraryRoot.HasSubFolder(folderID)) != null) + if ((fold = libraryRoot.GetDescendentFolder(folderID)) != null) { return fold.RequestListOfItems(); } @@ -487,7 +487,7 @@ namespace OpenSim.Framework.Communications.Cache } else { - if ((fold = userProfile.RootFolder.HasSubFolder(folderID)) != null) + if ((fold = userProfile.RootFolder.GetDescendentFolder(folderID)) != null) { return fold.RequestListOfItems(); } @@ -533,7 +533,7 @@ namespace OpenSim.Framework.Communications.Cache { if (userProfile.HasInventory) { - InventoryFolderImpl purgedFolder = userProfile.RootFolder.HasSubFolder(folderID); + InventoryFolderImpl purgedFolder = userProfile.RootFolder.GetDescendentFolder(folderID); if (purgedFolder != null) { // XXX Nasty - have to create a new object to hold details we already have -- cgit v1.1