Commit 45429021 authored by Gaël Bonithon's avatar Gaël Bonithon
Browse files

Fix compilation warnings

parent 6cf821a6
Pipeline #7158 passed with stages
in 2 minutes and 2 seconds
......@@ -324,6 +324,41 @@ xfdesktop_get_current_monitor_num(GdkDisplay *display)
void
xfdesktop_tree_path_free(gpointer data)
{
gtk_tree_path_free((GtkTreePath *) data);
}
void
xfdesktop_widget_unrealize(GtkWidget *widget,
gpointer data)
{
gtk_widget_unrealize(widget);
}
void
xfdesktop_object_ref(gpointer data,
gpointer user_data)
{
g_object_ref(data);
}
void
xfdesktop_object_unref(gpointer data,
GClosure *closure)
{
g_object_unref(data);
}
#ifdef G_ENABLE_DEBUG
/* With --enable-debug=full turn on debugging messages from the start */
static gboolean enable_debug = TRUE;
......
......@@ -117,6 +117,17 @@ gint xfdesktop_get_monitor_num(GdkDisplay *display,
gint xfdesktop_get_current_monitor_num(GdkDisplay *display);
void xfdesktop_tree_path_free(gpointer data);
void xfdesktop_widget_unrealize(GtkWidget *widget,
gpointer data);
void xfdesktop_object_ref(gpointer data,
gpointer user_data);
void xfdesktop_object_unref(gpointer data,
GClosure *closure);
#if defined(G_HAVE_ISO_VARARGS)
#define XF_DEBUG(...) xfdesktop_debug (__func__, __FILE__, __LINE__, __VA_ARGS__)
......
......@@ -42,8 +42,10 @@
#include "xfdesktop-common.h"
#include "tumbler.h"
static void xfdesktop_thumbnailer_init(GObject *);
static void xfdesktop_thumbnailer_class_init(GObjectClass *);
static void xfdesktop_thumbnailer_init(GTypeInstance *instance,
gpointer g_class);
static void xfdesktop_thumbnailer_class_init(gpointer g_class,
gpointer class_data);
static void xfdesktop_thumbnailer_dispose(GObject *object);
static void xfdesktop_thumbnailer_finalize(GObject *object);
......@@ -79,14 +81,14 @@ xfdesktop_thumbnailer_get_type(void)
static const GTypeInfo xfdesktop_thumbnailer_info =
{
sizeof (XfdesktopThumbnailerClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) xfdesktop_thumbnailer_class_init,
(GClassFinalizeFunc) NULL,
NULL,
NULL,
xfdesktop_thumbnailer_class_init,
NULL,
NULL,
sizeof (XfdesktopThumbnailer),
0,
(GInstanceInitFunc) xfdesktop_thumbnailer_init,
xfdesktop_thumbnailer_init,
NULL
};
......@@ -112,12 +114,13 @@ struct _XfdesktopThumbnailerPriv
};
static void
xfdesktop_thumbnailer_init(GObject *object)
xfdesktop_thumbnailer_init(GTypeInstance *instance,
gpointer g_class)
{
XfdesktopThumbnailer *thumbnailer;
GDBusConnection *connection;
thumbnailer = XFDESKTOP_THUMBNAILER(object);
thumbnailer = XFDESKTOP_THUMBNAILER(instance);
thumbnailer->priv = g_new0(XfdesktopThumbnailerPriv, 1);
......@@ -178,8 +181,10 @@ xfdesktop_thumbnailer_init(GObject *object)
}
static void
xfdesktop_thumbnailer_class_init (GObjectClass *object_class)
xfdesktop_thumbnailer_class_init (gpointer g_class,
gpointer class_data)
{
GObjectClass *object_class = g_class;
XfdesktopThumbnailerClass *thumbnailer_class = XFDESKTOP_THUMBNAILER_CLASS(object_class);
parent_class = g_type_class_peek_parent(thumbnailer_class);
......
......@@ -899,8 +899,7 @@ cb_image_selection_changed(GtkIconView *icon_view,
xfconf_channel_set_string(panel->channel, buf, filename);
}
g_list_foreach (selected_items, (GFunc)gtk_tree_path_free, NULL);
g_list_free(selected_items);
g_list_free_full(selected_items, xfdesktop_tree_path_free);
g_free(current_filename);
if(buf)
g_free(buf);
......
......@@ -458,9 +458,6 @@ backdrop_changed_cb(XfceBackdrop *backdrop, gpointer user_data)
GdkRectangle rect;
cairo_region_t *clip_region = NULL;
gint i, monitor = -1, current_workspace;
#ifdef G_ENABLE_DEBUG
gchar *monitor_name = NULL;
#endif
TRACE("entering");
......@@ -502,11 +499,8 @@ backdrop_changed_cb(XfceBackdrop *backdrop, gpointer user_data)
}
#ifdef G_ENABLE_DEBUG
monitor_name = gdk_screen_get_monitor_plug_name(gscreen, monitor);
XF_DEBUG("backdrop changed for workspace %d, monitor %d (%s)", current_workspace, monitor, monitor_name);
g_free(monitor_name);
XF_DEBUG("backdrop changed for workspace %d, monitor %d (%s)", current_workspace, monitor,
gdk_monitor_get_model(gdk_display_get_monitor(display, monitor)));
#endif
if(xfce_desktop_get_n_monitors(desktop) > 1
......@@ -1256,7 +1250,7 @@ xfce_desktop_unrealize(GtkWidget *widget)
gtk_widget_set_mapped(widget, FALSE);
gtk_container_forall(GTK_CONTAINER(widget),
(GtkCallback)gtk_widget_unrealize,
xfdesktop_widget_unrealize,
NULL);
g_signal_handlers_disconnect_by_func(G_OBJECT(desktop->priv->gscreen),
......
......@@ -66,8 +66,10 @@ enum
static void xfdesktop_clipboard_manager_class_init (XfdesktopClipboardManagerClass *klass);
static void xfdesktop_clipboard_manager_init (XfdesktopClipboardManager *manager);
static void xfdesktop_clipboard_manager_class_init (gpointer g_class,
gpointer class_data);
static void xfdesktop_clipboard_manager_init (GTypeInstance *instance,
gpointer g_class);
static void xfdesktop_clipboard_manager_finalize (GObject *object);
static void xfdesktop_clipboard_manager_get_property (GObject *object,
guint prop_id,
......@@ -154,12 +156,12 @@ xfdesktop_clipboard_manager_get_type (void)
sizeof (XfdesktopClipboardManagerClass),
NULL,
NULL,
(GClassInitFunc) xfdesktop_clipboard_manager_class_init,
xfdesktop_clipboard_manager_class_init,
NULL,
NULL,
sizeof (XfdesktopClipboardManager),
0,
(GInstanceInitFunc) xfdesktop_clipboard_manager_init,
xfdesktop_clipboard_manager_init,
NULL,
};
......@@ -172,14 +174,15 @@ xfdesktop_clipboard_manager_get_type (void)
static void
xfdesktop_clipboard_manager_class_init (XfdesktopClipboardManagerClass *klass)
xfdesktop_clipboard_manager_class_init (gpointer g_class,
gpointer class_data)
{
GObjectClass *gobject_class;
/* determine the parent type class */
xfdesktop_clipboard_manager_parent_class = g_type_class_peek_parent (klass);
xfdesktop_clipboard_manager_parent_class = g_type_class_peek_parent (g_class);
gobject_class = G_OBJECT_CLASS (klass);
gobject_class = G_OBJECT_CLASS (g_class);
gobject_class->finalize = xfdesktop_clipboard_manager_finalize;
gobject_class->get_property = xfdesktop_clipboard_manager_get_property;
......@@ -190,7 +193,7 @@ xfdesktop_clipboard_manager_class_init (XfdesktopClipboardManagerClass *klass)
* this #XfdesktopClipboardManager can be pasted into the desktop
* displayed by #XfdesktopIconView.
**/
g_object_class_install_property (gobject_class,
g_object_class_install_property (g_class,
PROP_CAN_PASTE,
g_param_spec_boolean ("can-paste", "can-pase", "can-paste",
FALSE,
......@@ -204,7 +207,7 @@ xfdesktop_clipboard_manager_class_init (XfdesktopClipboardManagerClass *klass)
**/
manager_signals[CHANGED] =
g_signal_new (I_("changed"),
G_TYPE_FROM_CLASS (klass),
G_TYPE_FROM_CLASS (g_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (XfdesktopClipboardManagerClass, changed),
NULL, NULL,
......@@ -215,8 +218,11 @@ xfdesktop_clipboard_manager_class_init (XfdesktopClipboardManagerClass *klass)
static void
xfdesktop_clipboard_manager_init (XfdesktopClipboardManager *manager)
xfdesktop_clipboard_manager_init (GTypeInstance *instance,
gpointer g_class)
{
XfdesktopClipboardManager *manager = XFDESKTOP_CLIPBOARD_MANAGER (instance);
manager->x_special_gnome_copied_files = gdk_atom_intern ("x-special/gnome-copied-files", FALSE);
}
......
......@@ -620,7 +620,7 @@ xfdesktop_file_icon_menu_open_all(GtkWidget *widget,
selected = xfdesktop_icon_view_get_selected_items(fmanager->priv->icon_view);
g_return_if_fail(selected);
g_list_foreach(selected, (GFunc)xfdesktop_icon_activated, NULL);
g_list_foreach(selected, xfdesktop_icon_activated_g_func, NULL);
g_list_free(selected);
}
......@@ -746,7 +746,7 @@ xfdesktop_file_icon_manager_delete_selected(XfdesktopFileIconManager *fmanager,
return;
/* make sure the icons don't get destroyed while we're working */
g_list_foreach(selected, (GFunc)g_object_ref, NULL);
g_list_foreach(selected, xfdesktop_object_ref, NULL);
if (!force_delete) {
xfdesktop_file_icon_manager_trash_files(fmanager, selected);
......@@ -754,8 +754,7 @@ xfdesktop_file_icon_manager_delete_selected(XfdesktopFileIconManager *fmanager,
xfdesktop_file_icon_manager_delete_files(fmanager, selected);
}
g_list_foreach(selected, (GFunc)g_object_unref, NULL);
g_list_free(selected);
g_list_free_full(selected, g_object_unref);
}
static void
......@@ -1058,8 +1057,7 @@ xfdesktop_file_icon_menu_free_icon_list_idled(gpointer user_data)
{
GList *icon_list = user_data;
g_list_foreach(icon_list, (GFunc)g_object_unref, NULL);
g_list_free(icon_list);
g_list_free_full(icon_list, g_object_unref);
return FALSE;
}
......@@ -1310,7 +1308,7 @@ xfdesktop_menu_create_menu_item_from_thunarx_menu_item (GObject *item)
g_signal_connect_data (mi, "activate",
G_CALLBACK (thunarx_action_callback),
g_object_ref (item),
(GClosureNotify) g_object_unref, 0);
xfdesktop_object_unref, 0);
g_free (label);
g_free (icon_str);
......@@ -1411,7 +1409,7 @@ xfdesktop_file_icon_manager_populate_context_menu(XfceDesktop *desktop,
}
/* make sure icons don't get destroyed while menu is open */
g_list_foreach(selected, (GFunc)g_object_ref, NULL);
g_list_foreach(selected, xfdesktop_object_ref, NULL);
g_object_set_data(G_OBJECT(menu), "--xfdesktop-icon-list", selected);
g_signal_connect(G_OBJECT(menu), "deactivate",
G_CALLBACK(xfdesktop_file_icon_menu_free_icon_list),
......@@ -1826,8 +1824,7 @@ xfdesktop_file_icon_manager_populate_context_menu(XfceDesktop *desktop,
if(menu_items) {
xfdesktop_menu_shell_append_thunarx_menu_item_list(GTK_MENU_SHELL(menu),
menu_items);
g_list_foreach(menu_items, (GFunc)g_object_unref, NULL);
g_list_free(menu_items);
g_list_free_full(menu_items, g_object_unref);
mi = gtk_separator_menu_item_new();
gtk_widget_show(mi);
......@@ -3341,8 +3338,7 @@ xfdesktop_file_icon_manager_fini(XfdesktopIconViewManager *manager)
/* Free anything left in the pending_icons queue */
if(fmanager->priv->pending_icons) {
g_queue_foreach(fmanager->priv->pending_icons, (GFunc)g_object_unref, NULL);
g_queue_free(fmanager->priv->pending_icons);
g_queue_free_full(fmanager->priv->pending_icons, g_object_unref);
fmanager->priv->pending_icons = NULL;
}
......@@ -3374,13 +3370,8 @@ xfdesktop_file_icon_manager_fini(XfdesktopIconViewManager *manager)
fmanager->priv->desktop_icon = NULL;
#ifdef HAVE_THUNARX
g_list_foreach(fmanager->priv->thunarx_menu_providers,
(GFunc)g_object_unref, NULL);
g_list_free(fmanager->priv->thunarx_menu_providers);
g_list_foreach(fmanager->priv->thunarx_properties_providers,
(GFunc)g_object_unref, NULL);
g_list_free(fmanager->priv->thunarx_properties_providers);
g_list_free_full(fmanager->priv->thunarx_menu_providers, g_object_unref);
g_list_free_full(fmanager->priv->thunarx_properties_providers, g_object_unref);
#endif
g_hash_table_destroy(fmanager->priv->special_icons);
......
......@@ -331,8 +331,7 @@ xfdesktop_file_utils_file_list_to_uri_array(GList *file_list)
void
xfdesktop_file_utils_file_list_free(GList *file_list)
{
g_list_foreach(file_list, (GFunc) g_object_unref, NULL);
g_list_free(file_list);
g_list_free_full(file_list, g_object_unref);
}
static GdkPixbuf *xfdesktop_fallback_icon = NULL;
......
......@@ -697,8 +697,7 @@ xfdesktop_icon_view_finalize(GObject *obj)
gtk_target_list_unref(icon_view->priv->source_targets);
gtk_target_list_unref(icon_view->priv->dest_targets);
g_list_foreach(icon_view->priv->pending_icons, (GFunc)g_object_unref, NULL);
g_list_free(icon_view->priv->pending_icons);
g_list_free_full(icon_view->priv->pending_icons, g_object_unref);
/* icon_view->priv->icons should be cleared in _unrealize() */
if (icon_view->priv->channel)
......@@ -2324,7 +2323,7 @@ xfdesktop_icon_view_real_activate_selected_items(XfdesktopIconView *icon_view)
return FALSE;
g_signal_emit(G_OBJECT(icon_view), __signals[SIG_ICON_ACTIVATED], 0, NULL);
g_list_foreach(icon_view->priv->selected_icons, (GFunc)xfdesktop_icon_activated, NULL);
g_list_foreach(icon_view->priv->selected_icons, xfdesktop_icon_activated_g_func, NULL);
return TRUE;
}
......@@ -4035,9 +4034,7 @@ xfdesktop_icon_view_remove_all(XfdesktopIconView *icon_view)
g_return_if_fail(XFDESKTOP_IS_ICON_VIEW(icon_view));
if(icon_view->priv->pending_icons) {
g_list_foreach(icon_view->priv->pending_icons, (GFunc)g_object_unref,
NULL);
g_list_free(icon_view->priv->pending_icons);
g_list_free_full(icon_view->priv->pending_icons, g_object_unref);
icon_view->priv->pending_icons = NULL;
}
......
......@@ -458,3 +458,10 @@ xfdesktop_icon_activated(XfdesktopIcon *icon)
return ret;
}
void
xfdesktop_icon_activated_g_func(gpointer data,
gpointer user_data)
{
xfdesktop_icon_activated(XFDESKTOP_ICON (data));
}
......@@ -134,6 +134,8 @@ void xfdesktop_icon_position_changed(XfdesktopIcon *icon);
void xfdesktop_icon_selected(XfdesktopIcon *icon);
gboolean xfdesktop_icon_activated(XfdesktopIcon *icon);
void xfdesktop_icon_activated_g_func(gpointer data,
gpointer user_data);
/*< private-ish; only for use by XfdesktopIconView >*/
void xfdesktop_icon_set_extents(XfdesktopIcon *icon,
......
......@@ -132,8 +132,6 @@ xfdesktop_special_file_icon_class_init(XfdesktopSpecialFileIconClass *klass)
file_icon_class->peek_file_info = xfdesktop_special_file_icon_peek_file_info;
file_icon_class->peek_filesystem_info = xfdesktop_special_file_icon_peek_filesystem_info;
file_icon_class->peek_file = xfdesktop_special_file_icon_peek_file;
file_icon_class->can_rename_file = (gboolean (*)(XfdesktopFileIcon *))gtk_false;
file_icon_class->can_delete_file = (gboolean (*)(XfdesktopFileIcon *))gtk_false;
}
static void
......
......@@ -146,8 +146,6 @@ xfdesktop_volume_icon_class_init(XfdesktopVolumeIconClass *klass)
file_icon_class->peek_filesystem_info = xfdesktop_volume_icon_peek_filesystem_info;
file_icon_class->peek_file = xfdesktop_volume_icon_peek_file;
file_icon_class->update_file_info = xfdesktop_volume_icon_update_file_info;
file_icon_class->can_rename_file = (gboolean (*)(XfdesktopFileIcon *))gtk_false;
file_icon_class->can_delete_file = (gboolean (*)(XfdesktopFileIcon *))gtk_false;
}
static void
......
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