diff options
Diffstat (limited to 'OpenSim/Framework/Data.SQLite')
-rw-r--r-- | OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs b/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs index b9a1daa..fe27e32 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs | |||
@@ -141,6 +141,24 @@ namespace OpenSim.Framework.Data.SQLite | |||
141 | invFoldersDa.Update(ds, "inventoryfolders"); | 141 | invFoldersDa.Update(ds, "inventoryfolders"); |
142 | } | 142 | } |
143 | 143 | ||
144 | private void moveFolder(InventoryFolderBase folder) | ||
145 | { | ||
146 | DataTable inventoryFolderTable = ds.Tables["inventoryfolders"]; | ||
147 | |||
148 | DataRow inventoryRow = inventoryFolderTable.Rows.Find(folder.folderID); | ||
149 | if (inventoryRow == null) | ||
150 | { | ||
151 | inventoryRow = inventoryFolderTable.NewRow(); | ||
152 | fillFolderRow(inventoryRow, folder); | ||
153 | inventoryFolderTable.Rows.Add(inventoryRow); | ||
154 | } | ||
155 | else | ||
156 | { | ||
157 | moveFolderRow(inventoryRow, folder); | ||
158 | } | ||
159 | |||
160 | invFoldersDa.Update(ds, "inventoryfolders"); | ||
161 | } | ||
144 | private void addItem(InventoryItemBase item) | 162 | private void addItem(InventoryItemBase item) |
145 | { | 163 | { |
146 | DataTable inventoryItemTable = ds.Tables["inventoryitems"]; | 164 | DataTable inventoryItemTable = ds.Tables["inventoryitems"]; |
@@ -404,6 +422,15 @@ namespace OpenSim.Framework.Data.SQLite | |||
404 | } | 422 | } |
405 | 423 | ||
406 | /// <summary> | 424 | /// <summary> |
425 | /// Moves a folder based on its ID with folder | ||
426 | /// </summary> | ||
427 | /// <param name="folder">The inventory folder</param> | ||
428 | public void moveInventoryFolder(InventoryFolderBase folder) | ||
429 | { | ||
430 | moveFolder(folder); | ||
431 | } | ||
432 | |||
433 | /// <summary> | ||
407 | /// Delete a folder | 434 | /// Delete a folder |
408 | /// </summary> | 435 | /// </summary> |
409 | /// <remarks> | 436 | /// <remarks> |
@@ -534,6 +561,11 @@ namespace OpenSim.Framework.Data.SQLite | |||
534 | row["version"] = folder.version; | 561 | row["version"] = folder.version; |
535 | } | 562 | } |
536 | 563 | ||
564 | private void moveFolderRow(DataRow row, InventoryFolderBase folder) | ||
565 | { | ||
566 | row["UUID"] = folder.folderID; | ||
567 | row["parentID"] = folder.parentID; | ||
568 | } | ||
537 | 569 | ||
538 | /*********************************************************************** | 570 | /*********************************************************************** |
539 | * | 571 | * |