mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 07:56:17 +01:00
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:
parent
c4ec302932
commit
b96e318f3a
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user