[rygel] media-export: add curstom object factory



commit 33fa24015b22fdc1a7815f1bdecacb8317611219
Author: Jens Georg <mail jensge org>
Date:   Mon Feb 8 11:10:07 2010 +0100

    media-export: add curstom object factory

 src/plugins/media-export/Makefile.am               |    3 +-
 .../rygel-media-export-object-factory.vala         |   24 ++++++++++++++++++++
 .../rygel-media-export-root-container.vala         |    4 ++-
 3 files changed, 29 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/media-export/Makefile.am b/src/plugins/media-export/Makefile.am
index bfd83e3..aec8ee7 100644
--- a/src/plugins/media-export/Makefile.am
+++ b/src/plugins/media-export/Makefile.am
@@ -21,7 +21,8 @@ librygel_media_export_la_SOURCES = rygel-media-export-plugin.vala \
 				   rygel-media-export-dbus-service.vala \
 				   rygel-media-export-recursive-file-monitor.vala \
 				   rygel-media-export-harvester.vala \
-				   rygel-media-export-item.vala
+				   rygel-media-export-item.vala \
+				   rygel-media-export-object-factory.vala
 
 librygel_media_export_la_VALAFLAGS = --vapidir=$(top_srcdir)/src/rygel \
 				     --pkg dbus-glib-1 \
diff --git a/src/plugins/media-export/rygel-media-export-object-factory.vala b/src/plugins/media-export/rygel-media-export-object-factory.vala
new file mode 100644
index 0000000..9fd3d02
--- /dev/null
+++ b/src/plugins/media-export/rygel-media-export-object-factory.vala
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2010 Jens Georg <mail jensge org>.
+ *
+ * Author: Jens Georg <mail jensge org>
+ *
+ * This file is part of Rygel.
+ *
+ * Rygel is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Rygel is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+internal class Rygel.MediaExportObjectFactory : MediaDBObjectFactory {
+}
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 ad58baa..d21dd4d 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -95,7 +95,9 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer {
     public static MediaContainer get_instance() {
         if (MediaExportRootContainer.instance == null) {
             try {
-                var db = MediaDB.create ("media-export");
+                var db = MediaDB.create_with_factory (
+                                        "media-export",
+                                        new MediaExportObjectFactory ());
                 MediaExportRootContainer.instance =
                                              new MediaExportRootContainer (db);
             } catch (MediaDBError err) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]