* Refactor: Rename InventoryFolderImpl.HasSubFolder() to GetDescendentFolder()

0.6.0-stable
Justin Clarke Casey 2008-04-30 20:04:06 +00:00
parent 3984a7fda1
commit 3508298ddf
3 changed files with 12 additions and 12 deletions

View File

@ -229,7 +229,7 @@ namespace OpenSim.Framework.Communications.Cache
} }
else else
{ {
InventoryFolderImpl folder = RootFolder.HasSubFolder(folderInfo.ParentID); InventoryFolderImpl folder = RootFolder.GetDescendentFolder(folderInfo.ParentID);
lock (folder.SubFolders) lock (folder.SubFolders)
{ {
if (folder != null) if (folder != null)
@ -283,7 +283,7 @@ namespace OpenSim.Framework.Communications.Cache
} }
else else
{ {
InventoryFolderImpl folder = RootFolder.HasSubFolder(itemInfo.Folder); InventoryFolderImpl folder = RootFolder.GetDescendentFolder(itemInfo.Folder);
if (folder != null) if (folder != null)
{ {
lock (folder.Items) lock (folder.Items)

View File

@ -168,10 +168,10 @@ namespace OpenSim.Framework.Communications.Cache
} }
/// <summary> /// <summary>
/// Does this folder contain the given subfolder? /// Returns the folder requested if it exists as a descendent of this folder
/// </summary> /// </summary>
/// <returns></returns> /// <returns>The requested folder if it exists, null if it does not.</returns>
public InventoryFolderImpl HasSubFolder(LLUUID folderID) public InventoryFolderImpl GetDescendentFolder(LLUUID folderID)
{ {
InventoryFolderImpl returnFolder = null; InventoryFolderImpl returnFolder = null;
@ -185,7 +185,7 @@ namespace OpenSim.Framework.Communications.Cache
{ {
foreach (InventoryFolderImpl folder in SubFolders.Values) foreach (InventoryFolderImpl folder in SubFolders.Values)
{ {
returnFolder = folder.HasSubFolder(folderID); returnFolder = folder.GetDescendentFolder(folderID);
if (returnFolder != null) if (returnFolder != null)
{ {
break; break;

View File

@ -193,7 +193,7 @@ namespace OpenSim.Framework.Communications.Cache
} }
else else
{ {
InventoryFolderImpl folder = userProfile.RootFolder.HasSubFolder(parentID); InventoryFolderImpl folder = userProfile.RootFolder.GetDescendentFolder(parentID);
if (folder != null) if (folder != null)
{ {
InventoryFolderImpl createdFolder = folder.CreateNewSubFolder(folderID, folderName, folderType); InventoryFolderImpl createdFolder = folder.CreateNewSubFolder(folderID, folderName, folderType);
@ -336,7 +336,7 @@ namespace OpenSim.Framework.Communications.Cache
return; return;
} }
if ((fold = libraryRoot.HasSubFolder(folderID)) != null) if ((fold = libraryRoot.GetDescendentFolder(folderID)) != null)
{ {
remoteClient.SendInventoryFolderDetails( remoteClient.SendInventoryFolderDetails(
libraryRoot.Owner, folderID, fold.RequestListOfItems(), libraryRoot.Owner, folderID, fold.RequestListOfItems(),
@ -385,7 +385,7 @@ namespace OpenSim.Framework.Communications.Cache
} }
else else
{ {
if ((fold = userProfile.RootFolder.HasSubFolder(folderID)) != null) if ((fold = userProfile.RootFolder.GetDescendentFolder(folderID)) != null)
{ {
// m_log.DebugFormat( // m_log.DebugFormat(
// "[AGENT INVENTORY]: Found folder {0} for client {1}", // "[AGENT INVENTORY]: Found folder {0} for client {1}",
@ -446,7 +446,7 @@ namespace OpenSim.Framework.Communications.Cache
return libraryRoot.RequestListOfItems(); return libraryRoot.RequestListOfItems();
} }
if ((fold = libraryRoot.HasSubFolder(folderID)) != null) if ((fold = libraryRoot.GetDescendentFolder(folderID)) != null)
{ {
return fold.RequestListOfItems(); return fold.RequestListOfItems();
} }
@ -487,7 +487,7 @@ namespace OpenSim.Framework.Communications.Cache
} }
else else
{ {
if ((fold = userProfile.RootFolder.HasSubFolder(folderID)) != null) if ((fold = userProfile.RootFolder.GetDescendentFolder(folderID)) != null)
{ {
return fold.RequestListOfItems(); return fold.RequestListOfItems();
} }
@ -533,7 +533,7 @@ namespace OpenSim.Framework.Communications.Cache
{ {
if (userProfile.HasInventory) if (userProfile.HasInventory)
{ {
InventoryFolderImpl purgedFolder = userProfile.RootFolder.HasSubFolder(folderID); InventoryFolderImpl purgedFolder = userProfile.RootFolder.GetDescendentFolder(folderID);
if (purgedFolder != null) if (purgedFolder != null)
{ {
// XXX Nasty - have to create a new object to hold details we already have // XXX Nasty - have to create a new object to hold details we already have