From f43681510725f5b95fcb864a1f3e4b744fcaf992 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 7 Apr 2008 23:15:35 +0000 Subject: Refactor InventoryItemBase to do the following: * wrap fields as Properties * rename some fields/properties to more sensible names * set style to PropName to match more standard C# approach --- .../Communications/Cache/LibraryRootFolder.cs | 60 +++++++++++----------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs') diff --git a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs index b624b15..12a07eb 100644 --- a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs +++ b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs @@ -116,19 +116,19 @@ namespace OpenSim.Framework.Communications.Cache int assetType, int invType, LLUUID parentFolderID) { InventoryItemBase item = new InventoryItemBase(); - item.avatarID = libOwner; - item.creatorsID = libOwner; - item.inventoryID = inventoryID; - item.assetID = assetID; - item.inventoryDescription = description; - item.inventoryName = name; - item.assetType = assetType; - item.invType = invType; - item.parentFolderID = parentFolderID; - item.inventoryBasePermissions = 0x7FFFFFFF; - item.inventoryEveryOnePermissions = 0x7FFFFFFF; - item.inventoryCurrentPermissions = 0x7FFFFFFF; - item.inventoryNextPermissions = 0x7FFFFFFF; + item.Owner = libOwner; + item.Creator = libOwner; + item.ID = inventoryID; + item.AssetID = assetID; + item.Description = description; + item.Name = name; + item.AssetType = assetType; + item.InvType = invType; + item.Folder = parentFolderID; + item.BasePermissions = 0x7FFFFFFF; + item.EveryOnePermissions = 0x7FFFFFFF; + item.CurrentPermissions = 0x7FFFFFFF; + item.NextPermissions = 0x7FFFFFFF; return item; } @@ -204,31 +204,31 @@ namespace OpenSim.Framework.Communications.Cache private void ReadItemFromConfig(IConfig config) { InventoryItemBase item = new InventoryItemBase(); - item.avatarID = libOwner; - item.creatorsID = libOwner; - item.inventoryID = new LLUUID(config.GetString("inventoryID", folderID.ToString())); - item.assetID = new LLUUID(config.GetString("assetID", LLUUID.Random().ToString())); - item.parentFolderID = new LLUUID(config.GetString("folderID", folderID.ToString())); - item.inventoryDescription = config.GetString("description", System.String.Empty); - item.inventoryName = config.GetString("name", System.String.Empty); - item.assetType = config.GetInt("assetType", 0); - item.invType = config.GetInt("inventoryType", 0); - item.inventoryCurrentPermissions = (uint)config.GetLong("currentPermissions", 0x7FFFFFFF); - item.inventoryNextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF); - item.inventoryEveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF); - item.inventoryBasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF); + item.Owner = libOwner; + item.Creator = libOwner; + item.ID = new LLUUID(config.GetString("inventoryID", folderID.ToString())); + item.AssetID = new LLUUID(config.GetString("assetID", LLUUID.Random().ToString())); + item.Folder = new LLUUID(config.GetString("folderID", folderID.ToString())); + item.Description = config.GetString("description", System.String.Empty); + item.Name = config.GetString("name", System.String.Empty); + item.AssetType = config.GetInt("assetType", 0); + item.InvType = config.GetInt("inventoryType", 0); + item.CurrentPermissions = (uint)config.GetLong("currentPermissions", 0x7FFFFFFF); + item.NextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF); + item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF); + item.BasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF); - if (libraryFolders.ContainsKey(item.parentFolderID)) + if (libraryFolders.ContainsKey(item.Folder)) { - InventoryFolderImpl parentFolder = libraryFolders[item.parentFolderID]; + InventoryFolderImpl parentFolder = libraryFolders[item.Folder]; - parentFolder.Items.Add(item.inventoryID, item); + parentFolder.Items.Add(item.ID, item); } else { m_log.WarnFormat( "[LIBRARY INVENTORY]: Couldn't add item {0} ({1}) since parent folder with ID {2} does not exist!", - item.inventoryName, item.inventoryID, item.parentFolderID); + item.Name, item.ID, item.Folder); } } -- cgit v1.1