aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.SQLite
diff options
context:
space:
mode:
authorBrian McBee2007-12-15 04:57:14 +0000
committerBrian McBee2007-12-15 04:57:14 +0000
commit8a8c89a0f32b528bd588715bdbfc875c852e7187 (patch)
treeb46cb20d03dfdb21a5cbdfa514a8e745070a3713 /OpenSim/Framework/Data.SQLite
parentSet svn:eol-style. Cleaned up set-eol-style.sh a bit. (diff)
downloadopensim-SC_OLD-8a8c89a0f32b528bd588715bdbfc875c852e7187.zip
opensim-SC_OLD-8a8c89a0f32b528bd588715bdbfc875c852e7187.tar.gz
opensim-SC_OLD-8a8c89a0f32b528bd588715bdbfc875c852e7187.tar.bz2
opensim-SC_OLD-8a8c89a0f32b528bd588715bdbfc875c852e7187.tar.xz
Grid Inventory feature upgrade: renaming folders should now be correct, subfolders work, moving folders works.
Tested only in MYSQL, but may work in MSSQL and sqlite. Probably not working in standalone mode.
Diffstat (limited to 'OpenSim/Framework/Data.SQLite')
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs32
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 *