diff options
author | Sean Dague | 2008-04-07 23:15:35 +0000 |
---|---|---|
committer | Sean Dague | 2008-04-07 23:15:35 +0000 |
commit | f43681510725f5b95fcb864a1f3e4b744fcaf992 (patch) | |
tree | 2d34caa75488d1c608d1a21b4888cb0f264a6cba /OpenSim/Data/SQLite/SQLiteInventoryStore.cs | |
parent | needed to add 4 characters to support the dashes (diff) | |
download | opensim-SC-f43681510725f5b95fcb864a1f3e4b744fcaf992.zip opensim-SC-f43681510725f5b95fcb864a1f3e4b744fcaf992.tar.gz opensim-SC-f43681510725f5b95fcb864a1f3e4b744fcaf992.tar.bz2 opensim-SC-f43681510725f5b95fcb864a1f3e4b744fcaf992.tar.xz |
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
Diffstat (limited to 'OpenSim/Data/SQLite/SQLiteInventoryStore.cs')
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteInventoryStore.cs | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs index 1554aa3..f0ff7c9 100644 --- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs | |||
@@ -91,39 +91,39 @@ namespace OpenSim.Data.SQLite | |||
91 | public InventoryItemBase buildItem(DataRow row) | 91 | public InventoryItemBase buildItem(DataRow row) |
92 | { | 92 | { |
93 | InventoryItemBase item = new InventoryItemBase(); | 93 | InventoryItemBase item = new InventoryItemBase(); |
94 | item.inventoryID = new LLUUID((string) row["UUID"]); | 94 | item.ID = new LLUUID((string) row["UUID"]); |
95 | item.assetID = new LLUUID((string) row["assetID"]); | 95 | item.AssetID = new LLUUID((string) row["assetID"]); |
96 | item.assetType = Convert.ToInt32(row["assetType"]); | 96 | item.AssetType = Convert.ToInt32(row["assetType"]); |
97 | item.invType = Convert.ToInt32(row["invType"]); | 97 | item.InvType = Convert.ToInt32(row["invType"]); |
98 | item.parentFolderID = new LLUUID((string) row["parentFolderID"]); | 98 | item.Folder = new LLUUID((string) row["parentFolderID"]); |
99 | item.avatarID = new LLUUID((string) row["avatarID"]); | 99 | item.Owner = new LLUUID((string) row["avatarID"]); |
100 | item.creatorsID = new LLUUID((string) row["creatorsID"]); | 100 | item.Creator = new LLUUID((string) row["creatorsID"]); |
101 | item.inventoryName = (string) row["inventoryName"]; | 101 | item.Name = (string) row["inventoryName"]; |
102 | item.inventoryDescription = (string) row["inventoryDescription"]; | 102 | item.Description = (string) row["inventoryDescription"]; |
103 | 103 | ||
104 | item.inventoryNextPermissions = Convert.ToUInt32(row["inventoryNextPermissions"]); | 104 | item.NextPermissions = Convert.ToUInt32(row["inventoryNextPermissions"]); |
105 | item.inventoryCurrentPermissions = Convert.ToUInt32(row["inventoryCurrentPermissions"]); | 105 | item.CurrentPermissions = Convert.ToUInt32(row["inventoryCurrentPermissions"]); |
106 | item.inventoryBasePermissions = Convert.ToUInt32(row["inventoryBasePermissions"]); | 106 | item.BasePermissions = Convert.ToUInt32(row["inventoryBasePermissions"]); |
107 | item.inventoryEveryOnePermissions = Convert.ToUInt32(row["inventoryEveryOnePermissions"]); | 107 | item.EveryOnePermissions = Convert.ToUInt32(row["inventoryEveryOnePermissions"]); |
108 | return item; | 108 | return item; |
109 | } | 109 | } |
110 | 110 | ||
111 | private void fillItemRow(DataRow row, InventoryItemBase item) | 111 | private void fillItemRow(DataRow row, InventoryItemBase item) |
112 | { | 112 | { |
113 | row["UUID"] = Util.ToRawUuidString(item.inventoryID); | 113 | row["UUID"] = Util.ToRawUuidString(item.ID); |
114 | row["assetID"] = Util.ToRawUuidString(item.assetID); | 114 | row["assetID"] = Util.ToRawUuidString(item.AssetID); |
115 | row["assetType"] = item.assetType; | 115 | row["assetType"] = item.AssetType; |
116 | row["invType"] = item.invType; | 116 | row["invType"] = item.InvType; |
117 | row["parentFolderID"] = Util.ToRawUuidString(item.parentFolderID); | 117 | row["parentFolderID"] = Util.ToRawUuidString(item.Folder); |
118 | row["avatarID"] = Util.ToRawUuidString(item.avatarID); | 118 | row["avatarID"] = Util.ToRawUuidString(item.Owner); |
119 | row["creatorsID"] = Util.ToRawUuidString(item.creatorsID); | 119 | row["creatorsID"] = Util.ToRawUuidString(item.Creator); |
120 | row["inventoryName"] = item.inventoryName; | 120 | row["inventoryName"] = item.Name; |
121 | row["inventoryDescription"] = item.inventoryDescription; | 121 | row["inventoryDescription"] = item.Description; |
122 | 122 | ||
123 | row["inventoryNextPermissions"] = item.inventoryNextPermissions; | 123 | row["inventoryNextPermissions"] = item.NextPermissions; |
124 | row["inventoryCurrentPermissions"] = item.inventoryCurrentPermissions; | 124 | row["inventoryCurrentPermissions"] = item.CurrentPermissions; |
125 | row["inventoryBasePermissions"] = item.inventoryBasePermissions; | 125 | row["inventoryBasePermissions"] = item.BasePermissions; |
126 | row["inventoryEveryOnePermissions"] = item.inventoryEveryOnePermissions; | 126 | row["inventoryEveryOnePermissions"] = item.EveryOnePermissions; |
127 | } | 127 | } |
128 | 128 | ||
129 | private void addFolder(InventoryFolderBase folder, bool add) | 129 | private void addFolder(InventoryFolderBase folder, bool add) |
@@ -182,11 +182,11 @@ namespace OpenSim.Data.SQLite | |||
182 | { | 182 | { |
183 | DataTable inventoryItemTable = ds.Tables["inventoryitems"]; | 183 | DataTable inventoryItemTable = ds.Tables["inventoryitems"]; |
184 | 184 | ||
185 | DataRow inventoryRow = inventoryItemTable.Rows.Find(Util.ToRawUuidString(item.inventoryID)); | 185 | DataRow inventoryRow = inventoryItemTable.Rows.Find(Util.ToRawUuidString(item.ID)); |
186 | if (inventoryRow == null) | 186 | if (inventoryRow == null) |
187 | { | 187 | { |
188 | if (! add) | 188 | if (! add) |
189 | m_log.ErrorFormat("Interface Misuse: Attempting to Update non-existant inventory item: {0}", item.inventoryID); | 189 | m_log.ErrorFormat("Interface Misuse: Attempting to Update non-existant inventory item: {0}", item.ID); |
190 | 190 | ||
191 | inventoryRow = inventoryItemTable.NewRow(); | 191 | inventoryRow = inventoryItemTable.NewRow(); |
192 | fillItemRow(inventoryRow, item); | 192 | fillItemRow(inventoryRow, item); |
@@ -195,7 +195,7 @@ namespace OpenSim.Data.SQLite | |||
195 | else | 195 | else |
196 | { | 196 | { |
197 | if (add) | 197 | if (add) |
198 | m_log.ErrorFormat("Interface Misuse: Attempting to Add inventory item that already exists: {0}", item.inventoryID); | 198 | m_log.ErrorFormat("Interface Misuse: Attempting to Add inventory item that already exists: {0}", item.ID); |
199 | 199 | ||
200 | fillItemRow(inventoryRow, item); | 200 | fillItemRow(inventoryRow, item); |
201 | } | 201 | } |
@@ -439,7 +439,7 @@ namespace OpenSim.Data.SQLite | |||
439 | List<InventoryItemBase> items = getInventoryInFolder(Util.ToRawUuidString(folderId)); | 439 | List<InventoryItemBase> items = getInventoryInFolder(Util.ToRawUuidString(folderId)); |
440 | 440 | ||
441 | foreach (InventoryItemBase i in items) | 441 | foreach (InventoryItemBase i in items) |
442 | deleteInventoryItem(Util.ToRawUuidString(i.inventoryID)); | 442 | deleteInventoryItem(Util.ToRawUuidString(i.ID)); |
443 | } | 443 | } |
444 | 444 | ||
445 | /// <summary> | 445 | /// <summary> |