Commit d795b927 authored by Gaël Bonithon's avatar Gaël Bonithon Committed by Landry Breuil

Fix compilation warnings

parent 7da3afb3
Pipeline #6875 passed with stages
in 57 seconds
......@@ -316,8 +316,7 @@ static void mount_volume_changed_cb(GVolumeMonitor *vm, G_GNUC_UNUSED GMount *mn
g_object_unref(file);
g_object_unref(icon);
}
g_list_foreach(mounts, (GFunc) g_object_unref, NULL);
g_list_free(mounts);
g_list_free_full(mounts, g_object_unref);
/* list volumes */
volumes = g_volume_monitor_get_volumes(vm);
......@@ -349,8 +348,7 @@ static void mount_volume_changed_cb(GVolumeMonitor *vm, G_GNUC_UNUSED GMount *mn
else
g_object_unref(mount);
}
g_list_foreach(volumes, (GFunc) g_object_unref, NULL);
g_list_free(volumes);
g_list_free_full(volumes, g_object_unref);
g_signal_emit(backend, signals[MOUNTS_CHANGED], 0);
}
......@@ -875,9 +873,7 @@ static void browse_host_real(BrowseData *bd)
/* propagate our results */
g_signal_emit(bd->self, signals[BROWSE_HOST_FINISHED], 0, list);
g_slist_foreach(list, (GFunc) g_free, NULL);
g_slist_free(list);
g_slist_free_full(list, g_free);
g_object_unref(file);
g_free(bd->uri);
g_free(bd);
......
......@@ -475,7 +475,6 @@ static void setup_for_type(GigoloBookmarkEditDialog *dialog)
{
struct MethodInfo *meth;
guint idx;
GtkWidget *table;
GtkTreeIter iter;
GigoloBookmarkEditDialogPrivate *priv = gigolo_bookmark_edit_dialog_get_instance_private(dialog);
......@@ -904,7 +903,7 @@ static GtkWidget *make_frame (const gchar *label)
}
static GtkWidget *make_table ()
static GtkWidget *make_table (void)
{
GtkWidget *table = gtk_grid_new ();
gtk_grid_set_row_spacing (GTK_GRID (table), 6);
......@@ -927,7 +926,6 @@ static GtkWidget *make_label (const gchar *text, GtkSizeGroup *sg)
static void gigolo_bookmark_edit_dialog_init(GigoloBookmarkEditDialog *dialog)
{
GtkWidget *label;
GtkWidget *label_tmp;
GtkWidget *table;
GtkWidget *combo;
GtkWidget *entry;
......
......@@ -55,15 +55,20 @@ static void delegate_item_activated(GtkMenuItem *item, GigoloMenubuttonAction *a
}
static void gigolo_widget_destroy(GtkWidget *widget, gpointer data)
{
gtk_widget_destroy(widget);
}
static void update_menus(GigoloMenubuttonAction *menu, GigoloSettings *settings)
{
GSList *l;
guint i;
GtkWidget *item;
GigoloBookmark *bm;
GigoloBookmarkList *bml = gigolo_settings_get_bookmarks(settings);
gtk_container_foreach(GTK_CONTAINER(menu), (GtkCallback) gtk_widget_destroy, NULL);
gtk_container_foreach(GTK_CONTAINER(menu), gigolo_widget_destroy, NULL);
for (i = 0; i < bml->len; i++)
{
......
......@@ -542,7 +542,6 @@ static void gigolo_settings_finalize(GObject* object)
g_free(priv->geometry);
g_ptr_array_foreach(priv->bookmarks, (GFunc) g_object_unref, NULL);
g_ptr_array_free(priv->bookmarks, TRUE);
g_free(priv->config_filename);
......@@ -715,7 +714,7 @@ static void gigolo_settings_init(GigoloSettings *self)
priv->config_filename = g_build_filename(priv->config_path, "config", NULL);
priv->bookmarks_filename = g_build_filename(priv->config_path, "bookmarks", NULL);
priv->bookmarks = g_ptr_array_new();
priv->bookmarks = g_ptr_array_new_with_free_func(g_object_unref);
check_for_old_dir(priv);
......
......@@ -200,6 +200,12 @@ static void systray_icon_popup_menu_cb(G_GNUC_UNUSED GtkStatusIcon *status_icon,
}
static void gigolo_tree_path_free(gpointer data)
{
gtk_tree_path_free((GtkTreePath *) data);
}
/* Convenience function to get the selected GtkTreeIter from the icon view or the treeview
* whichever is currently used for display. */
static void get_selected_iter(GigoloWindow *window, GtkTreeIter *iter)
......@@ -225,8 +231,7 @@ static void get_selected_iter(GigoloWindow *window, GtkTreeIter *iter)
* and we simply choose the first item */
gtk_tree_model_get_iter(model, iter, items->data);
}
g_list_foreach(items, (GFunc) gtk_tree_path_free, NULL);
g_list_free(items);
g_list_free_full(items, gigolo_tree_path_free);
}
}
......@@ -813,8 +818,7 @@ static void iconview_selection_changed_cb(GtkIconView *view, GigoloWindow *windo
if (items == NULL)
update_sensitive_buttons(window, model, NULL);
g_list_foreach(items, (GFunc) gtk_tree_path_free, NULL);
g_list_free(items);
g_list_free_full(items, gigolo_tree_path_free);
}
......@@ -918,8 +922,7 @@ static gboolean iconview_button_press_event_cb(GtkWidget *widget, GdkEventButton
items = gtk_icon_view_get_selected_items(GTK_ICON_VIEW(widget));
have_sel = (items != NULL) && (g_list_length(items) > 0);
g_list_foreach(items, (GFunc) gtk_tree_path_free, NULL);
g_list_free(items);
g_list_free_full(items, gigolo_tree_path_free);
if (have_sel)
gtk_menu_popup_at_pointer (GTK_MENU(priv->tree_popup_menu),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment