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

Re: [virt-tools-list] [libosinfo PATCHv3 5/9] media: Add OsinfoMedia::languages property



On Wed, Dec 12, 2012 at 4:26 PM, Christophe Fergeau <cfergeau redhat com> wrote:
> This lists all the languages a given media can show its UI in.
> ---
>  osinfo/libosinfo.syms         |  1 +
>  osinfo/osinfo_media.c         | 65 ++++++++++++++++++++++++++++++++++++++++++-
>  osinfo/osinfo_media.h         |  2 ++
>  osinfo/osinfo_media_private.h |  1 +
>  4 files changed, 68 insertions(+), 1 deletion(-)
>
> diff --git a/osinfo/libosinfo.syms b/osinfo/libosinfo.syms
> index 4d886f6..767a1fc 100644
> --- a/osinfo/libosinfo.syms
> +++ b/osinfo/libosinfo.syms
> @@ -397,6 +397,7 @@ LIBOSINFO_0.2.3 {
>
>         osinfo_install_script_get_config_params;
>
> +       osinfo_media_get_languages;
>         osinfo_media_get_os;
>  } LIBOSINFO_0.2.2;
>
> diff --git a/osinfo/osinfo_media.c b/osinfo/osinfo_media.c
> index d891615..abf449d 100644
> --- a/osinfo/osinfo_media.c
> +++ b/osinfo/osinfo_media.c
> @@ -154,7 +154,8 @@ enum {
>      PROP_INSTALLER,
>      PROP_LIVE,
>      PROP_INSTALLER_REBOOTS,
> -    PROP_OS
> +    PROP_OS,
> +    PROP_LANGUAGES,
>  };
>
>  static void
> @@ -225,6 +226,10 @@ osinfo_media_get_property (GObject    *object,
>          g_value_take_object (value, osinfo_media_get_os (media));
>          break;
>
> +    case PROP_LANGUAGES:
> +        g_value_set_pointer (value, osinfo_media_get_languages (media));
> +        break;
> +
>      default:
>          /* We don't have any other property... */
>          G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
> @@ -311,6 +316,10 @@ osinfo_media_set_property(GObject      *object,
>          osinfo_media_set_os(media, g_value_get_object(value));
>          break;
>
> +    case PROP_LANGUAGES:
> +        osinfo_media_set_languages(media, g_value_get_pointer(value));
> +        break;
> +
>      default:
>          /* We don't have any other property... */
>          G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
> @@ -517,6 +526,24 @@ osinfo_media_class_init (OsinfoMediaClass *klass)
>                                    G_PARAM_READWRITE |
>                                    G_PARAM_STATIC_STRINGS);
>      g_object_class_install_property (g_klass, PROP_OS, pspec);
> +
> +    /*
> +     * OsinfoMedia::languages:
> +     *
> +     * If media is an installer, this property indicates the languages that
> +     * can be used during automatic installations.
> +     *
> +     * On media that are not installers, this property will indicate the
> +     * languages that the user interface can be displayed in.
> +     * Use #osinfo_media_get_installer (or OsinfoMedia::installer) to know
> +     * if the media is an installer or not.

You need type and transfer annotation here. You can check
osinfo_avatar_format_class_init() for example.

-- 
Regards,

Zeeshan Ali (Khattak)
FSF member#5124


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