aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/SQLite/SQLiteXInventoryData.cs')
-rw-r--r--OpenSim/Data/SQLite/SQLiteXInventoryData.cs30
1 files changed, 27 insertions, 3 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
index 1f36986..75f8c87 100644
--- a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
+++ b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Data.SQLite
47 { 47 {
48// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 49
50 private SQLiteGenericTableHandler<XInventoryFolder> m_Folders; 50 private SqliteFolderHandler m_Folders;
51 private SqliteItemHandler m_Items; 51 private SqliteItemHandler m_Items;
52 52
53 public SQLiteXInventoryData(string conn, string realm) 53 public SQLiteXInventoryData(string conn, string realm)
@@ -55,7 +55,7 @@ namespace OpenSim.Data.SQLite
55 if (Util.IsWindows()) 55 if (Util.IsWindows())
56 Util.LoadArchSpecificWindowsDll("sqlite3.dll"); 56 Util.LoadArchSpecificWindowsDll("sqlite3.dll");
57 57
58 m_Folders = new SQLiteGenericTableHandler<XInventoryFolder>( 58 m_Folders = new SqliteFolderHandler(
59 conn, "inventoryfolders", "XInventoryStore"); 59 conn, "inventoryfolders", "XInventoryStore");
60 m_Items = new SqliteItemHandler( 60 m_Items = new SqliteItemHandler(
61 conn, "inventoryitems", String.Empty); 61 conn, "inventoryitems", String.Empty);
@@ -114,6 +114,11 @@ namespace OpenSim.Data.SQLite
114 return m_Items.MoveItem(id, newParent); 114 return m_Items.MoveItem(id, newParent);
115 } 115 }
116 116
117 public bool MoveFolder(string id, string newParent)
118 {
119 return m_Folders.MoveFolder(id, newParent);
120 }
121
117 public XInventoryItem[] GetActiveGestures(UUID principalID) 122 public XInventoryItem[] GetActiveGestures(UUID principalID)
118 { 123 {
119 return m_Items.GetActiveGestures(principalID); 124 return m_Items.GetActiveGestures(principalID);
@@ -177,4 +182,23 @@ namespace OpenSim.Data.SQLite
177 return perms; 182 return perms;
178 } 183 }
179 } 184 }
180} 185
186 public class SqliteFolderHandler : SQLiteGenericTableHandler<XInventoryFolder>
187 {
188 public SqliteFolderHandler(string c, string t, string m) :
189 base(c, t, m)
190 {
191 }
192
193 public bool MoveFolder(string id, string newParentFolderID)
194 {
195 SqliteCommand cmd = new SqliteCommand();
196
197 cmd.CommandText = String.Format("update {0} set parentFolderID = :ParentFolderID where folderID = :FolderID", m_Realm);
198 cmd.Parameters.Add(new SqliteParameter(":ParentFolderID", newParentFolderID));
199 cmd.Parameters.Add(new SqliteParameter(":FolderID", id));
200
201 return ExecuteNonQuery(cmd, m_Connection) == 0 ? false : true;
202 }
203 }
204} \ No newline at end of file