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.
This commit is contained in:
Brian McBee
2007-12-15 04:57:14 +00:00
parent 53b5fa4974
commit 8a8c89a0f3
16 changed files with 281 additions and 21 deletions

View File

@@ -529,6 +529,28 @@ namespace OpenSim.Framework.Data.MySQL
addInventoryFolder(folder);
}
/// Creates a new inventory folder
/// </summary>
/// <param name="folder">Folder to create</param>
public void moveInventoryFolder(InventoryFolderBase folder)
{
string sql =
"UPDATE inventoryfolders SET parentFolderID=?parentFolderID WHERE folderID=?folderID";
MySqlCommand cmd = new MySqlCommand(sql, database.Connection);
cmd.Parameters.AddWithValue("?folderID", folder.folderID.ToStringHyphenated());
cmd.Parameters.AddWithValue("?parentFolderID", folder.parentID.ToStringHyphenated());
try
{
cmd.ExecuteNonQuery();
}
catch (Exception e)
{
MainLog.Instance.Error(e.ToString());
}
}
/// <summary>
/// Append a list of all the child folders of a parent folder