[rygel] media-export: Fix warnings
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [rygel] media-export: Fix warnings
- Date: Tue, 15 Sep 2009 15:00:48 +0000 (UTC)
commit 28e17d59da7305bed3e9e212eb4f32fc98dcbe2a
Author: Jens Georg <mail jensge org>
Date: Sat Sep 12 13:42:35 2009 +0200
media-export: Fix warnings
.../rygel-media-export-root-container.vala | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
---
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 c42f1cf..5a6d739 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -89,9 +89,7 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer {
try {
this.media_db.delete_by_id (id);
} catch (MediaDBError e) {
- warning ("Failed to remove item %s: %s",
- file.get_uri(),
- e.message);
+ warning ("Failed to remove uri: %s", e.message);
}
}
@@ -115,10 +113,17 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer {
try {
media_db.save_object (this);
} catch (Error error) {
+ // do nothing
+ }
+
+ ArrayList<string> ids;
+ try {
+ ids = media_db.get_child_ids ("0");
+ } catch (MediaDBError e) {
+ ids = new ArrayList<string>();
}
try {
- var ids = media_db.get_child_ids ("0");
var uris = get_uris ();
foreach (var uri in uris) {
var file = File.new_for_commandline_arg (uri);
@@ -132,7 +137,11 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer {
foreach (var id in ids) {
debug ("Id %s no longer in config, deleting...",
id);
+ try {
this.media_db.delete_by_id (id);
+ } catch (MediaDBError e) {
+ warning ("Failed to remove entry: %s", e.message);
+ }
}
this.updated ();
} catch (MediaDBError e) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]