updateinfo: Use GStringChunks
authorTomas Mlcoch <tmlcoch@redhat.com>
Fri, 1 Aug 2014 11:45:26 +0000 (13:45 +0200)
committerTomas Mlcoch <tmlcoch@redhat.com>
Fri, 1 Aug 2014 11:45:26 +0000 (13:45 +0200)
src/updateinfo.c
src/updateinfo.h

index c68422b..c097330 100644 (file)
@@ -35,6 +35,7 @@ cr_UpdateCollectionPackage *
 cr_updatecollectionpackage_new(void)
 {
     cr_UpdateCollectionPackage *pkg = g_malloc0(sizeof(*pkg));
+    pkg->chunk = g_string_chunk_new(0);
     return pkg;
 }
 
@@ -56,6 +57,7 @@ cr_UpdateCollection *
 cr_updatecollection_new(void)
 {
     cr_UpdateCollection *collection = g_malloc0(sizeof(*collection));
+    collection->chunk = g_string_chunk_new(0);
     return collection;
 }
 
@@ -87,6 +89,7 @@ cr_UpdateReference *
 cr_updatereference_new(void)
 {
     cr_UpdateReference *ref = g_malloc0(sizeof(*ref));
+    ref->chunk = g_string_chunk_new(0);
     return ref;
 }
 
@@ -108,6 +111,7 @@ cr_UpdateRecord *
 cr_updaterecord_new(void)
 {
     cr_UpdateRecord *rec = g_malloc0(sizeof(*rec));
+    rec->chunk = g_string_chunk_new(0);
     return rec;
 }
 
@@ -135,7 +139,7 @@ cr_updaterecord_append_collection(cr_UpdateRecord *record,
                                   cr_UpdateCollection *collection)
 {
     if (!record || !collection) return;
-    record->collections = g_slist_append(record->collections, record);
+    record->collections = g_slist_append(record->collections, collection);
 }
 
 
index ebe6e1d..3cdb2f4 100644 (file)
@@ -58,8 +58,8 @@ typedef struct {
 } cr_UpdateCollection;
 
 typedef struct {
-    gchar *id;      /*!< id (e.g. 1035288, NULL for errata, ...) */
     gchar *href;    /*!< URL (e.g. to related bugzilla, errata, ...) */
+    gchar *id;      /*!< id (e.g. 1035288, NULL for errata, ...) */
     gchar *type;    /*!< reference type ("self" for errata, "bugzilla", ...) */
     gchar *title;   /*!< Name of errata, name of bug, etc. */
     GStringChunk *chunk;
@@ -67,11 +67,11 @@ typedef struct {
 
 typedef struct {
     gchar *from;        /*!< Source of the update (e.g. security@redhat.com) */
-    gchar *type;        /*!< Update type ("enhancement", "bugfix", ...) */
-    gchar *title;       /*!< Update name */
     gchar *status;      /*!< Update status ("final", ...) */
+    gchar *type;        /*!< Update type ("enhancement", "bugfix", ...) */
     gchar *version;     /*!< Update version (probably always an integer number) */
     gchar *id;          /*!< Update id (short update name, e.g. RHEA-2013:1777) */
+    gchar *title;       /*!< Update name */
     gchar *issued_date; /*!< Date string (e.g. "2013-12-02 00:00:00") */
     gchar *updated_date;/*!< Date string */
     gchar *rights;      /*!< Copyright */
@@ -81,7 +81,6 @@ typedef struct {
     gchar *summary;     /*!< Short summary */
     gchar *description; /*!< Update description */
     gchar *solution;    /*!< Solution */
-    gboolean *reboot_suggested;/*!< Reboot suggested */
 
     GSList *references; /*!< List of cr_UpdateReference */
     GSList *collections;/*!< List of cr_UpdateCollection */