[rygel/wip/track-changes] WIP
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel/wip/track-changes] WIP
- Date: Thu, 6 Dec 2012 15:55:15 +0000 (UTC)
commit aa996d5536c3d42c535320c241f7755d9a64c1d1
Author: Jens Georg <jensg openismus com>
Date: Thu Dec 6 16:55:07 2012 +0100
WIP
src/plugins/media-export/Makefile.am | 3 ++-
.../rygel-media-export-object-factory.vala | 2 +-
.../rygel-media-export-root-container.vala | 15 ++-------------
.../rygel-media-export-writable-db-container.vala | 10 ++++++----
4 files changed, 11 insertions(+), 19 deletions(-)
---
diff --git a/src/plugins/media-export/Makefile.am b/src/plugins/media-export/Makefile.am
index 013f42c..c7b394e 100644
--- a/src/plugins/media-export/Makefile.am
+++ b/src/plugins/media-export/Makefile.am
@@ -1,4 +1,4 @@
-include ../../../common.am
+include $(top_srcdir)/common.am
plugin_LTLIBRARIES = librygel-media-export.la
@@ -40,6 +40,7 @@ librygel_media_export_la_SOURCES = \
rygel-media-export-video-item.vala \
rygel-media-export-photo-item.vala \
rygel-media-export-playlist-item.vala \
+ rygel-media-export-trackable-db-container.vala \
rygel-media-export-collate.c
librygel_media_export_la_VALAFLAGS = \
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 3773bb4..a56c154 100644
--- a/src/plugins/media-export/rygel-media-export-object-factory.vala
+++ b/src/plugins/media-export/rygel-media-export-object-factory.vala
@@ -56,7 +56,7 @@ internal class Rygel.MediaExport.ObjectFactory : Object {
}
if (uri == null) {
- return new DBContainer (media_db, id, title);
+ return new TrackableDbContainer (media_db, id, title);
}
return new WritableDbContainer (media_db, id, title);
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 8bcbcfb..38670e2 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -40,8 +40,7 @@ const Rygel.MediaExport.FolderDefinition[] VIRTUAL_FOLDERS_MUSIC = {
/**
* Represents the root container.
*/
-public class Rygel.MediaExport.RootContainer : Rygel.TrackableContainer,
- Rygel.MediaExport.DBContainer {
+public class Rygel.MediaExport.RootContainer : TrackableDbContainer {
private DBusService service;
private Harvester harvester;
private Cancellable cancellable;
@@ -375,7 +374,7 @@ public class Rygel.MediaExport.RootContainer : Rygel.TrackableContainer,
} catch (Error error) { } // do nothing
try {
- this.filesystem_container = new DBContainer
+ this.filesystem_container = new TrackableDbContainer
(media_db,
FILESYSTEM_FOLDER_ID,
_(FILESYSTEM_FOLDER_NAME));
@@ -491,14 +490,4 @@ public class Rygel.MediaExport.RootContainer : Rygel.TrackableContainer,
container.updated ();
}
}
-
- public async void add_child (MediaObject object) {
- // TODO: Implement
- assert_not_reached ();
- }
-
- public async void remove_child (MediaObject object) {
- // TODO: Implement
- assert_not_reached ();
- }
}
diff --git a/src/plugins/media-export/rygel-media-export-writable-db-container.vala b/src/plugins/media-export/rygel-media-export-writable-db-container.vala
index 20746f0..2d16967 100644
--- a/src/plugins/media-export/rygel-media-export-writable-db-container.vala
+++ b/src/plugins/media-export/rygel-media-export-writable-db-container.vala
@@ -21,8 +21,8 @@
*/
using Gee;
-internal class Rygel.MediaExport.WritableDbContainer : DBContainer,
- Rygel.WritableContainer {
+internal class Rygel.MediaExport.WritableDbContainer : TrackableDbContainer,
+ Rygel.WritableContainer {
public ArrayList<string> create_classes { get; set; }
public WritableDbContainer (MediaCache media_db, string id, string title) {
@@ -46,11 +46,13 @@ internal class Rygel.MediaExport.WritableDbContainer : DBContainer,
item.modified = int64.MAX;
}
item.id = MediaCache.get_id (file);
- this.media_db.save_item (item);
+ yield this.add_child_tracked (item);
}
public async void remove_item (string id, Cancellable? cancellable)
throws Error {
- this.media_db.remove_by_id (id);
+ var object = this.media_db.get_object (id);
+
+ yield this.remove_child_tracked (object);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]