[virt-tools-list] [libosinfo 1/8] Add OsinfoMedia::os property

Zeeshan Ali (Khattak) zeeshanak at gnome.org
Wed Dec 5 16:24:43 UTC 2012


On Mon, Dec 3, 2012 at 1:23 PM, Christophe Fergeau <cfergeau at redhat.com> wrote:
> ---
>  osinfo/osinfo_media.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++-
>  osinfo/osinfo_media.h |  2 ++
>  2 files changed, 52 insertions(+), 1 deletion(-)
>
> diff --git a/osinfo/osinfo_media.c b/osinfo/osinfo_media.c
> index ffc37b7..6d0bdec 100644
> --- a/osinfo/osinfo_media.c
> +++ b/osinfo/osinfo_media.c
> @@ -136,7 +136,7 @@ G_DEFINE_TYPE (OsinfoMedia, osinfo_media, OSINFO_TYPE_ENTITY);
>
>  struct _OsinfoMediaPrivate
>  {
> -    gboolean unused;
> +    OsinfoOs *os;
>  };
>
>  enum {
> @@ -153,6 +153,7 @@ enum {
>      PROP_INSTALLER,
>      PROP_LIVE,
>      PROP_INSTALLER_REBOOTS,
> +    PROP_OS
>  };
>
>  static void
> @@ -219,6 +220,10 @@ osinfo_media_get_property (GObject    *object,
>                           osinfo_media_get_installer_reboots (media));
>          break;
>
> +    case PROP_OS:
> +        g_value_set_object (value, osinfo_media_get_os (media));
> +        break;
> +
>      default:
>          /* We don't have any other property... */
>          G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
> @@ -301,6 +306,10 @@ osinfo_media_set_property(GObject      *object,
>                                         g_value_get_int (value));
>          break;
>
> +    case PROP_OS:
> +        osinfo_media_set_os(media, g_value_get_object(value));
> +        break;
> +
>      default:
>          /* We don't have any other property... */
>          G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
> @@ -315,6 +324,16 @@ osinfo_media_finalize (GObject *object)
>      G_OBJECT_CLASS (osinfo_media_parent_class)->finalize (object);
>  }
>
> +static void osinfo_media_dispose(GObject *obj)
> +{
> +    OsinfoMedia *media = OSINFO_MEDIA(obj);
> +
> +    g_clear_object(&media->priv->os);
> +
> +    G_OBJECT_CLASS(osinfo_media_parent_class)->dispose(obj);
> +}
> +
> +
>  /* Init functions */
>  static void
>  osinfo_media_class_init (OsinfoMediaClass *klass)
> @@ -322,6 +341,7 @@ osinfo_media_class_init (OsinfoMediaClass *klass)
>      GObjectClass *g_klass = G_OBJECT_CLASS (klass);
>      GParamSpec *pspec;
>
> +    g_klass->dispose = osinfo_media_dispose;
>      g_klass->finalize = osinfo_media_finalize;
>      g_klass->get_property = osinfo_media_get_property;
>      g_klass->set_property = osinfo_media_set_property;
> @@ -480,6 +500,20 @@ osinfo_media_class_init (OsinfoMediaClass *klass)
>                                G_PARAM_READWRITE |
>                                G_PARAM_STATIC_STRINGS);
>      g_object_class_install_property (g_klass, PROP_INSTALLER_REBOOTS, pspec);
> +
> +    /**
> +     * OsinfoMedia::os:
> +     *
> +     * Os information for the current media. Won't get filled before a call
> +     * to osinfo_db_fill_media_info
> +     */

I don't think this is correct anymore.

ACK otherwise.

-- 
Regards,

Zeeshan Ali (Khattak)
FSF member#5124




More information about the virt-tools-list mailing list