[gnome-online-accounts/wip/jfelder/owncloud-music: 1/14] backend: Add a goa_object_skeleton_attach_music helper



commit e13072c8bfa75fd42833b9adc6ef035ae5d366b3
Author: Jean Felder <jfelder src gnome org>
Date:   Fri Dec 13 19:10:47 2019 +0100

    backend: Add a goa_object_skeleton_attach_music helper
    
    https://bugzilla.gnome.org/show_bug.cgi?id=753415

 src/goabackend/goaobjectskeletonutils.c | 23 +++++++++++++++++++++++
 src/goabackend/goaobjectskeletonutils.h |  3 +++
 2 files changed, 26 insertions(+)
---
diff --git a/src/goabackend/goaobjectskeletonutils.c b/src/goabackend/goaobjectskeletonutils.c
index 657bffd7..5d5b5860 100644
--- a/src/goabackend/goaobjectskeletonutils.c
+++ b/src/goabackend/goaobjectskeletonutils.c
@@ -132,6 +132,29 @@ goa_object_skeleton_attach_documents (GoaObjectSkeleton *object,
   g_clear_object (&documents);
 }
 
+void
+goa_object_skeleton_attach_music (GoaObjectSkeleton *object,
+                                  gboolean           music_enabled)
+{
+  GoaMusic *music;
+
+  music = goa_object_get_music (GOA_OBJECT (object));
+  if (music_enabled)
+    {
+      if (music == NULL)
+        {
+          music = goa_music_skeleton_new ();
+          goa_object_skeleton_set_music (object, music);
+        }
+    }
+  else
+    {
+      if (music != NULL)
+        goa_object_skeleton_set_music (object, NULL);
+    }
+  g_clear_object (&music);
+}
+
 void
 goa_object_skeleton_attach_photos (GoaObjectSkeleton *object,
                                    gboolean           photos_enabled)
diff --git a/src/goabackend/goaobjectskeletonutils.h b/src/goabackend/goaobjectskeletonutils.h
index 69969528..5a391bfb 100644
--- a/src/goabackend/goaobjectskeletonutils.h
+++ b/src/goabackend/goaobjectskeletonutils.h
@@ -49,6 +49,9 @@ void             goa_object_skeleton_attach_files          (GoaObjectSkeleton *o
 void             goa_object_skeleton_attach_maps           (GoaObjectSkeleton *object,
                                                             gboolean           maps_enabled);
 
+void             goa_object_skeleton_attach_music          (GoaObjectSkeleton *object,
+                                                            gboolean           music_enabled);
+
 void             goa_object_skeleton_attach_photos         (GoaObjectSkeleton *object,
                                                             gboolean           photos_enabled);
 


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