[libdmapsharing] Adjust documentation for increased use of GError
- From: W. Michael Petullo <wmpetullo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdmapsharing] Adjust documentation for increased use of GError
- Date: Sun, 25 Mar 2018 23:18:58 +0000 (UTC)
commit 8abdf2187f9278ca750f63228eed1e96228ea8e6
Author: W. Michael Petullo <mike flyn org>
Date: Sun Mar 25 19:18:48 2018 -0400
Adjust documentation for increased use of GError
Signed-off-by: W. Michael Petullo <mike flyn org>
doc/shareapi.xml | 19 ++++++++++++-------
1 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/doc/shareapi.xml b/doc/shareapi.xml
index 2932200..fa90dc0 100644
--- a/doc/shareapi.xml
+++ b/doc/shareapi.xml
@@ -30,26 +30,31 @@ the share API; it serves up a media database made up of a single record.
DmapRecordFactory *factory;
DmapRecord *record;
DmapDb *db;
-DmapShare *share;
gboolean ok;
+DmapShare *share;
+GError *error = NULL;
factory = DMAP_RECORD_FACTORY (my_dmap_av_record_factory_new ());
-record = DMAP_RECORD (dmap_record_factory_create (factory, path_to_media_file));
+
+record = DMAP_RECORD (dmap_record_factory_create (factory, path_to_media_file, &error));
+if (record == NULL) {
+ g_error("Error reading record: %s\n", error->messaage);
+}
db = DMAP_DB (my_dmap_db_new ());
-dmap_db_add (db, record);
+dmap_db_add (db, record, &error);
g_object_unref (record);
share = DMAP_SHARE(dmap_av_share_new (name, NULL, db, dmap_container_db, NULL);
-ok = dmap_share_serve(share);
+ok = dmap_share_serve(share, &error);
if (!ok) {
- g_error("Error sharing");
+ g_error("Error sharing: %s", error->message);
}
-ok = dmap_share_publish(share);
+ok = dmap_share_publish(share, &errro);
if (!ok) {
- g_error("Error publishing");
+ g_error("Error publishing: %s", error->message);
}
g_main_loop_run(loop);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]