[packagekit] Media Change Enums

Richard Hughes hughsient at gmail.com
Thu Apr 2 04:23:17 PDT 2009


On Wed, 2009-04-01 at 10:36 -0700, Daniel Nicoletti wrote:
> +       g_signal_emit (client, signals [PK_CLIENT_MEDIA_CHANGE_REQUIRED], 0,
> +                      media_type_text, media_id, media_text);

You want to convert the media_type_text to media_type and send the uint,
not the string. The PkClient does all the conversion work to save the
application from doing it.

...

> +       signals [PK_CLIENT_MEDIA_CHANGE_REQUIRED] =
> +               g_signal_new ("media_change_required",
> +                             G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
> +                             G_STRUCT_OFFSET (PkClientClass, media_change_required),
> +                             NULL, NULL, g_cclosure_marshal_VOID__POINTER,
> +                             G_TYPE_NONE, 1, G_TYPE_POINTER);

I think you want:

		g_signal_new ("media-change-required",
			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
			      G_STRUCT_OFFSET (PkClientClass, media_change_required),
			      NULL, NULL, pk_marshal_VOID__UINT_STRING_STRING,
			      G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING);

i.e. uss and dashes rather than underscores. Other than that it looks
great, thanks. Please commit after you've fixed the signal.

Richard.





More information about the PackageKit mailing list