Skip to content

Commit

Permalink
[src] fix some incompatible pointer type warnings
Browse files Browse the repository at this point in the history
including a silly mistake in caja-window where destroy function's return type
was accidently ommitted during the addition of gtk version checks.
  • Loading branch information
Jasmine Hassan committed Nov 23, 2012
1 parent b00cccb commit ae06676
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
6 changes: 5 additions & 1 deletion src/caja-application.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,11 @@ check_required_directories (CajaApplication *application)

dialog = eel_show_error_dialog (error_string, detail_string, NULL);
/* We need the main event loop so the user has a chance to see the dialog. */
#if GTK_CHECK_VERSION (3, 0, 0)
caja_main_event_loop_register (GTK_WIDGET (dialog));
#else
caja_main_event_loop_register (GTK_OBJECT (dialog));
#endif

g_string_free (directories_as_string, TRUE);
g_free (error_string);
Expand Down Expand Up @@ -1171,7 +1175,7 @@ caja_application_close_desktop (void)
{
if (caja_application_desktop_windows != NULL)
{
g_list_free_full (caja_application_desktop_windows, gtk_widget_destroy);
g_list_free_full (caja_application_desktop_windows, (GDestroyNotify) gtk_widget_destroy);
caja_application_desktop_windows = NULL;
}
}
Expand Down
12 changes: 7 additions & 5 deletions src/caja-window.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,13 @@ caja_window_init (CajaWindow *window)

#if GTK_CHECK_VERSION(3, 0, 0)
gtk_quit_add_destroy (1, GTK_WIDGET (window));
#else
gtk_quit_add_destroy (1, GTK_OBJECT (window));
#endif

/* Keep the main event loop alive as long as the window exists */
caja_main_event_loop_register (GTK_WIDGET (window));
#else
gtk_quit_add_destroy (1, GTK_OBJECT (window));
caja_main_event_loop_register (GTK_OBJECT (window));
#endif
}

/* Unconditionally synchronize the GtkUIManager of WINDOW. */
Expand Down Expand Up @@ -613,6 +614,7 @@ free_stored_viewers (CajaWindow *window)
window->details->extra_viewer = NULL;
}

static void
#if GTK_CHECK_VERSION (3, 0, 0)
caja_window_destroy (GtkWidget *object)
#else
Expand All @@ -626,7 +628,7 @@ caja_window_destroy (GtkObject *object)

/* close all panes safely */
panes_copy = g_list_copy (window->details->panes);
g_list_free_full (panes_copy, caja_window_close_pane);
g_list_free_full (panes_copy, (GDestroyNotify) caja_window_close_pane);

/* the panes list should now be empty */
g_assert (window->details->panes == NULL);
Expand Down Expand Up @@ -2156,7 +2158,7 @@ caja_window_class_init (CajaWindowClass *class)
#endif

GTK_WIDGET_CLASS (class)->show = caja_window_show;
#if GTK_CHECK_VERSION(3,0,0)
#if GTK_CHECK_VERSION (3,0,0)
GTK_WIDGET_CLASS (class)->get_preferred_width = caja_window_get_preferred_width;
GTK_WIDGET_CLASS (class)->get_preferred_height = caja_window_get_preferred_height;
#else
Expand Down
2 changes: 1 addition & 1 deletion src/file-manager/fm-list-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ get_filtered_selection_refs (GtkTreeView *tree_view)
static void
ref_list_free (GList *ref_list)
{
g_list_free_full (ref_list, gtk_tree_row_reference_free);
g_list_free_full (ref_list, (GDestroyNotify) gtk_tree_row_reference_free);
}

static void
Expand Down
2 changes: 1 addition & 1 deletion src/file-manager/fm-properties-window.c
Original file line number Diff line number Diff line change
Expand Up @@ -3425,7 +3425,7 @@ get_initial_emblems (GList *files)
ret = g_hash_table_new_full (g_direct_hash,
g_direct_equal,
NULL,
(GFunc) g_free);
(GDestroyNotify) g_free);

for (l = files; l != NULL; l = l->next) {
CajaFile *file;
Expand Down

0 comments on commit ae06676

Please sign in to comment.