diff options
Diffstat (limited to 'libcaja-private/caja-icon-container.c')
-rw-r--r-- | libcaja-private/caja-icon-container.c | 44 |
1 files changed, 12 insertions, 32 deletions
diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index c33868dd..5db10601 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -52,8 +52,6 @@ #include <stdio.h> #include <string.h> -#include <src/glibcompat.h> /* for g_list_free_full */ - #if !GTK_CHECK_VERSION(3, 0, 0) #define gtk_scrollable_get_hadjustment gtk_layout_get_hadjustment #define gtk_scrollable_get_vadjustment gtk_layout_get_vadjustment @@ -300,7 +298,7 @@ typedef struct gboolean tight; } PlacementGrid; -static guint signals[LAST_SIGNAL]; +static guint signals[LAST_SIGNAL] = { 0 }; /* Functions dealing with CajaIcons. */ @@ -2060,6 +2058,7 @@ align_icons (CajaIconContainer *container) if (!grid) { + g_list_free (unplaced_icons); return; } @@ -10000,7 +9999,6 @@ caja_icon_container_accessible_add_selection (AtkSelection *accessible, { GtkWidget *widget; CajaIconContainer *container; - GList *l; GList *selection; CajaIcon *icon; @@ -10012,11 +10010,9 @@ caja_icon_container_accessible_add_selection (AtkSelection *accessible, container = CAJA_ICON_CONTAINER (widget); - l = g_list_nth (container->details->icons, i); - if (l) + icon = g_list_nth_data (container->details->icons, i); + if (icon) { - icon = l->data; - selection = caja_icon_container_get_selection (container); selection = g_list_prepend (selection, icon->data); @@ -10054,17 +10050,14 @@ caja_icon_container_accessible_ref_selection (AtkSelection *accessible, { AtkObject *atk_object; CajaIconContainerAccessiblePrivate *priv; - GList *item; CajaIcon *icon; caja_icon_container_accessible_update_selection (ATK_OBJECT (accessible)); priv = accessible_get_priv (ATK_OBJECT (accessible)); - item = (g_list_nth (priv->selection, i)); - - if (item) + icon = g_list_nth_data (priv->selection, i); + if (icon) { - icon = item->data; atk_object = atk_gobject_accessible_for_object (G_OBJECT (icon->item)); if (atk_object) { @@ -10098,7 +10091,6 @@ caja_icon_container_accessible_is_child_selected (AtkSelection *accessible, int i) { CajaIconContainer *container; - GList *l; CajaIcon *icon; GtkWidget *widget; @@ -10110,13 +10102,8 @@ caja_icon_container_accessible_is_child_selected (AtkSelection *accessible, container = CAJA_ICON_CONTAINER (widget); - l = g_list_nth (container->details->icons, i); - if (l) - { - icon = l->data; - return icon->is_selected; - } - return FALSE; + icon = g_list_nth_data (container->details->icons, i); + return icon ? icon->is_selected : FALSE; } static gboolean @@ -10125,7 +10112,6 @@ caja_icon_container_accessible_remove_selection (AtkSelection *accessible, { CajaIconContainer *container; CajaIconContainerAccessiblePrivate *priv; - GList *l; GList *selection; CajaIcon *icon; GtkWidget *widget; @@ -10141,11 +10127,9 @@ caja_icon_container_accessible_remove_selection (AtkSelection *accessible, container = CAJA_ICON_CONTAINER (widget); - l = g_list_nth (priv->selection, i); - if (l) + icon = g_list_nth_data (priv->selection, i); + if (icon) { - icon = l->data; - selection = caja_icon_container_get_selection (container); selection = g_list_remove (selection, icon->data); caja_icon_container_set_selection (container, selection); @@ -10238,7 +10222,6 @@ caja_icon_container_accessible_ref_child (AtkObject *accessible, int i) { AtkObject *atk_object; CajaIconContainer *container; - GList *item; CajaIcon *icon; GtkWidget *widget; @@ -10250,12 +10233,9 @@ caja_icon_container_accessible_ref_child (AtkObject *accessible, int i) container = CAJA_ICON_CONTAINER (widget); - item = (g_list_nth (container->details->icons, i)); - - if (item) + icon = g_list_nth_data (container->details->icons, i); + if (icon) { - icon = item->data; - atk_object = atk_gobject_accessible_for_object (G_OBJECT (icon->item)); g_object_ref (atk_object); |