[rygel] media-export: Rename some functions for clarity.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] media-export: Rename some functions for clarity.
- Date: Fri, 18 Jan 2013 12:25:51 +0000 (UTC)
commit 5fbd13031656edd9106bbf0ba4b8ef8b13a44361
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Jan 18 13:25:07 2013 +0100
media-export: Rename some functions for clarity.
.../rygel-media-export-node-query-container.vala | 8 ++++----
.../rygel-media-export-object-factory.vala | 2 +-
...rygel-media-export-query-container-factory.vala | 18 +++++++++---------
.../rygel-media-export-root-container.vala | 10 +++++-----
4 files changed, 19 insertions(+), 19 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-node-query-container.vala b/src/plugins/media-export/rygel-media-export-node-query-container.vala
index 8cea8d0..c0b14bc 100644
--- a/src/plugins/media-export/rygel-media-export-node-query-container.vala
+++ b/src/plugins/media-export/rygel-media-export-node-query-container.vala
@@ -53,8 +53,8 @@ internal class Rygel.MediaExport.NodeQueryContainer : QueryContainer {
if (this.add_all_container ()) {
var id = this.template.replace (",upnp:album,%s","");
- var container = factory.create_from_description (id,
- _("All"));
+ var container = factory.create_from_description_id (id,
+ _("All"));
container.parent = this;
children.add (container);
}
@@ -71,8 +71,8 @@ internal class Rygel.MediaExport.NodeQueryContainer : QueryContainer {
// template contains URL escaped text. This means it might
// contain '%' chars which will makes sprintf crash
new_id = this.template.replace ("%s", new_id);
- var container = factory.create_from_description (new_id,
- meta_data);
+ var container = factory.create_from_description_id (new_id,
+ meta_data);
container.parent = this;
children.add (container);
}
diff --git a/src/plugins/media-export/rygel-media-export-object-factory.vala b/src/plugins/media-export/rygel-media-export-object-factory.vala
index 11c82a4..4570f04 100644
--- a/src/plugins/media-export/rygel-media-export-object-factory.vala
+++ b/src/plugins/media-export/rygel-media-export-object-factory.vala
@@ -51,7 +51,7 @@ internal class Rygel.MediaExport.ObjectFactory : Object {
if (id.has_prefix (QueryContainer.PREFIX)) {
var factory = QueryContainerFactory.get_default ();
- return factory.create_from_id (id, title);
+ return factory.create_from_hashed_id (id, title);
}
if (uri == null) {
diff --git a/src/plugins/media-export/rygel-media-export-query-container-factory.vala b/src/plugins/media-export/rygel-media-export-query-container-factory.vala
index 6107325..1dabc5b 100644
--- a/src/plugins/media-export/rygel-media-export-query-container-factory.vala
+++ b/src/plugins/media-export/rygel-media-export-query-container-factory.vala
@@ -86,14 +86,14 @@ internal class Rygel.MediaExport.QueryContainerFactory : Object {
* container
* @return A new instance of QueryContainer or null if id does not exist
*/
- public QueryContainer? create_from_id (string id,
- string name = "") {
- var definition = this.get_virtual_container_definition (id);
- if (definition == null) {
+ public QueryContainer? create_from_hashed_id (string id,
+ string name = "") {
+ var definition_id = this.get_virtual_container_definition (id);
+ if (definition_id == null) {
return null;
}
- return this.create_from_description (definition, name);
+ return this.create_from_description_id (definition_id, name);
}
/**
@@ -107,18 +107,18 @@ internal class Rygel.MediaExport.QueryContainerFactory : Object {
* the container
* @return A new instance of QueryContainer
*/
- public QueryContainer create_from_description (string definition,
- string name = "") {
+ public QueryContainer create_from_description_id (string definition_id,
+ string name = "") {
var title = name;
string attribute = null;
string pattern = null;
string upnp_class = null;
- var id = definition;
QueryContainer container;
+ var id = definition_id;
this.register_id (ref id);
- var expression = this.parse_description (definition,
+ var expression = this.parse_description (id,
out pattern,
out attribute,
out upnp_class,
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 398a3c8..e903b85 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -100,7 +100,7 @@ public class Rygel.MediaExport.RootContainer : TrackableDbContainer {
if (id.has_prefix (QueryContainer.PREFIX)) {
var factory = QueryContainerFactory.get_default ();
- var container = factory.create_from_id (id);
+ var container = factory.create_from_hashed_id (id);
if (container != null) {
container.parent = this;
}
@@ -124,7 +124,7 @@ public class Rygel.MediaExport.RootContainer : TrackableDbContainer {
var factory = QueryContainerFactory.get_default ();
var container_id = QueryContainer.PREFIX + parts[0];
- var container = factory.create_from_id (container_id);
+ var container = factory.create_from_hashed_id (container_id);
if (container == null) {
return null;
}
@@ -266,7 +266,7 @@ public class Rygel.MediaExport.RootContainer : TrackableDbContainer {
var factory = QueryContainerFactory.get_default ();
- return factory.create_from_description (id);
+ return factory.create_from_description_id (id);
}
return null;
@@ -334,7 +334,7 @@ public class Rygel.MediaExport.RootContainer : TrackableDbContainer {
escaped_detail,
last_argument);
- container = factory.create_from_description (new_id);
+ container = factory.create_from_description_id (new_id);
return true;
}
@@ -493,7 +493,7 @@ public class Rygel.MediaExport.RootContainer : TrackableDbContainer {
}
var factory = QueryContainerFactory.get_default ();
- var query_container = factory.create_from_description
+ var query_container = factory.create_from_description_id
(id,
_(definition.title));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]