[rygel] media-export: Rename "Filesystem" folder
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] media-export: Rename "Filesystem" folder
- Date: Sun, 15 Aug 2010 21:39:56 +0000 (UTC)
commit e0b862d8582c8618a5e400e8dee2c1f0ccff1432
Author: Jens Georg <mail jensge org>
Date: Sun Aug 15 16:51:39 2010 +0300
media-export: Rename "Filesystem" folder
.../rygel-media-export-media-cache-upgrader.vala | 19 +++++++++++++------
.../rygel-media-export-query-container.vala | 4 ++--
.../rygel-media-export-root-container.vala | 9 ++++++---
3 files changed, 21 insertions(+), 11 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-media-cache-upgrader.vala b/src/plugins/media-export/rygel-media-export-media-cache-upgrader.vala
index 346a080..2c51ac1 100644
--- a/src/plugins/media-export/rygel-media-export-media-cache-upgrader.vala
+++ b/src/plugins/media-export/rygel-media-export-media-cache-upgrader.vala
@@ -293,13 +293,20 @@ internal class Rygel.MediaExport.MediaCacheUpgrader {
// keep meta-data although we're deleting loads of objects
this.database.exec ("DROP TRIGGER trgr_delete_metadata");
- this.database.exec ("INSERT INTO Object (parent, upnp_id, type_fk, " +
- "title, timestamp) VALUES ('0', 'Filesystem', " +
- "0, 'Filesystem', 0)");
- this.database.exec ("UPDATE Object SET parent = 'Filesystem' " +
- "WHERE parent = '0' AND upnp_id " +
+ this.database.exec ("INSERT INTO Object (parent, upnp_id, " +
+ "type_fk, title, timestamp) VALUES " +
+ "('0', '" +
+ RootContainer.FILESYSTEM_FOLDER_ID +
+ "', 0, '" +
+ RootContainer.FILESYSTEM_FOLDER_NAME +
+ "', 0)");
+ this.database.exec ("UPDATE Object SET parent = '" +
+ RootContainer.FILESYSTEM_FOLDER_ID +
+ "' WHERE parent = '0' AND upnp_id " +
"NOT LIKE 'virtual-%' AND upnp_id " +
- "<> 'Filesystem'");
+ "<> '" +
+ RootContainer.FILESYSTEM_FOLDER_ID +
+ "'");
this.database.exec ("ALTER TABLE Object RENAME TO _Object");
this.database.exec ("CREATE TABLE Object AS SELECT * FROM _Object");
this.database.exec ("DELETE FROM Object");
diff --git a/src/plugins/media-export/rygel-media-export-query-container.vala b/src/plugins/media-export/rygel-media-export-query-container.vala
index f3c66a6..c159936 100644
--- a/src/plugins/media-export/rygel-media-export-query-container.vala
+++ b/src/plugins/media-export/rygel-media-export-query-container.vala
@@ -85,7 +85,7 @@ internal class Rygel.MediaExport.QueryContainer : DBContainer {
if (this.pattern == "") {
return (int) this.media_db.get_object_count_by_search_expression (
this.expression,
- "Filesystem");
+ RootContainer.FILESYSTEM_FOLDER_ID);
} else {
var data = this.media_db.get_object_attribute_by_search_expression (
this.attribute,
@@ -123,7 +123,7 @@ internal class Rygel.MediaExport.QueryContainer : DBContainer {
try {
children = this.media_db.get_objects_by_search_expression (
combined_expression,
- "Filesystem",
+ RootContainer.FILESYSTEM_FOLDER_ID,
offset,
max_count,
out total_matches);
diff --git a/src/plugins/media-export/rygel-media-export-root-container.vala b/src/plugins/media-export/rygel-media-export-root-container.vala
index 792b8cf..bbbd7fa 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -48,6 +48,9 @@ public class Rygel.MediaExport.RootContainer : Rygel.MediaExport.DBContainer {
private static MediaContainer instance = null;
+ internal const string FILESYSTEM_FOLDER_NAME = "Files & Folders";
+ internal const string FILESYSTEM_FOLDER_ID = "Filesystem";
+
public static MediaContainer get_instance () {
if (RootContainer.instance == null) {
try {
@@ -303,14 +306,14 @@ public class Rygel.MediaExport.RootContainer : Rygel.MediaExport.DBContainer {
try {
this.filesystem_container = new NullContainer ();
this.filesystem_container.parent = this;
- this.filesystem_container.title = "Filesystem";
- this.filesystem_container.id = "Filesystem";
+ this.filesystem_container.title = FILESYSTEM_FOLDER_NAME;
+ this.filesystem_container.id = FILESYSTEM_FOLDER_ID;
this.media_db.save_container (this.filesystem_container);
} catch (Error error) { }
ArrayList<string> ids;
try {
- ids = media_db.get_child_ids ("Filesystem");
+ ids = media_db.get_child_ids (FILESYSTEM_FOLDER_ID);
} catch (DatabaseError e) {
ids = new ArrayList<string> ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]