diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c index eeaf6e4326..a52ca9920f 100644 --- a/gtk/gtkpathbar.c +++ b/gtk/gtkpathbar.c @@ -38,7 +38,7 @@ #include "gtkwidgetprivate.h" #include "gtkeventcontrollerscroll.h" -struct _GtkPathBarPrivate +typedef struct { GtkFileSystem *file_system; GFile *root_file; @@ -82,7 +82,7 @@ struct _GtkPathBarPrivate GtkWidget *down_slider_button; guint settings_signal_id; gint16 slider_width; -}; +} GtkPathBarPrivate; enum { PATH_CLICKED, @@ -166,20 +166,23 @@ static void add_cancellable (GtkPathBar *path_bar, GCancellable *cancellable) { - g_assert (g_list_find (path_bar->priv->cancellables, cancellable) == NULL); - path_bar->priv->cancellables = g_list_prepend (path_bar->priv->cancellables, cancellable); + GtkPathBarPrivate *priv = gtk_path_bar_get_instance_private (path_bar); + + g_assert (g_list_find (priv->cancellables, cancellable) == NULL); + priv->cancellables = g_list_prepend (priv->cancellables, cancellable); } static void drop_node_for_cancellable (GtkPathBar *path_bar, GCancellable *cancellable) { + GtkPathBarPrivate *priv = gtk_path_bar_get_instance_private (path_bar); GList *node; - node = g_list_find (path_bar->priv->cancellables, cancellable); + node = g_list_find (priv->cancellables, cancellable); g_assert (node != NULL); node->data = NULL; - path_bar->priv->cancellables = g_list_delete_link (path_bar->priv->cancellables, node); + priv->cancellables = g_list_delete_link (priv->cancellables, node); } static void @@ -201,9 +204,11 @@ cancellable_async_done (GtkPathBar *path_bar, static void cancel_all_cancellables (GtkPathBar *path_bar) { - while (path_bar->priv->cancellables) + GtkPathBarPrivate *priv = gtk_path_bar_get_instance_private (path_bar); + + while (priv->cancellables) { - GCancellable *cancellable = path_bar->priv->cancellables->data; + GCancellable *cancellable = priv->cancellables->data; cancel_cancellable (path_bar, cancellable); } } @@ -211,25 +216,26 @@ cancel_all_cancellables (GtkPathBar *path_bar) static void gtk_path_bar_init (GtkPathBar *path_bar) { + GtkPathBarPrivate *priv = gtk_path_bar_get_instance_private (path_bar); GtkStyleContext *context; GtkEventController *controller; - path_bar->priv = gtk_path_bar_get_instance_private (path_bar); + priv = gtk_path_bar_get_instance_private (path_bar); gtk_widget_init_template (GTK_WIDGET (path_bar)); /* Add the children manually because GtkPathBar derives from an abstract class, * Glade cannot edit a