mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
tutorial: Stop referring to ->priv
for example class
The class has used `G_DECLARE_FINAL_TYPE` for a while now, so doesn’t have a `priv` struct. Private members are declared inline. Signed-off-by: Philip Withnall <withnall@endlessm.com> Fixes: #1858
This commit is contained in:
parent
61912bffb5
commit
22b59c91ad
@ -485,14 +485,14 @@ viewer_file_set_property (GObject *object,
|
||||
switch ((ViewerFileProperty) property_id)
|
||||
{
|
||||
case PROP_FILENAME:
|
||||
g_free (self->priv->filename);
|
||||
self->priv->filename = g_value_dup_string (value);
|
||||
g_print ("filename: %s\n", self->priv->filename);
|
||||
g_free (self->filename);
|
||||
self->filename = g_value_dup_string (value);
|
||||
g_print ("filename: %s\n", self->filename);
|
||||
break;
|
||||
|
||||
case PROP_ZOOM_LEVEL:
|
||||
self->priv->zoom_level = g_value_get_uint (value);
|
||||
g_print ("zoom level: %u\n", self->priv->zoom_level);
|
||||
self->zoom_level = g_value_get_uint (value);
|
||||
g_print ("zoom level: %u\n", self->zoom_level);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -513,11 +513,11 @@ viewer_file_get_property (GObject *object,
|
||||
switch ((ViewerFileProperty) property_id)
|
||||
{
|
||||
case PROP_FILENAME:
|
||||
g_value_set_string (value, self->priv->filename);
|
||||
g_value_set_string (value, self->filename);
|
||||
break;
|
||||
|
||||
case PROP_ZOOM_LEVEL:
|
||||
g_value_set_uint (value, self->priv->zoom_level);
|
||||
g_value_set_uint (value, self->zoom_level);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user