docs: Remove priv pointers from the tutorial example

We define `ViewerFile` as a final type with fields directly in the
instance structure. This means we don't have a `priv` pointer to
dereference.
This commit is contained in:
Emmanuele Bassi 2019-07-31 15:27:06 +01:00 committed by Philip Withnall
parent c4ec302932
commit b96e318f3a

View File

@ -485,14 +485,14 @@ viewer_file_set_property (GObject *object,
switch (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 (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: