From 909146bd8395ec2c030ef2e8be3b33a52590931d Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Tue, 13 Dec 2005 14:37:52 +0000 Subject: [PATCH] make the GError argument in the callbacks const. 2005-12-13 Kristian Rietveld * gtk/gtkfilesystem.h: make the GError argument in the callbacks const. * gtk/gtkfilechooserbutton.c: update callbacks, * gtk/gtkfilechooserentry.c: likewise, * gtk/gtkfilechooserdefault.c: likewise, * gtk/gtkfilesystemmodel.c: likewise, * gtk/gtkpathbar.c: likewise. * gtk/gtkfilechooserdefault.c (edited_idle_create_folder_cb): copy the error which will be passed to error_creating_folder_dialog(), (action_create_folder_cb): likewise, (file_list_drag_data_received_get_info_cb): add forgotten GError declaration. --- ChangeLog | 17 +++++++++++++++++ ChangeLog.pre-2-10 | 17 +++++++++++++++++ gtk/gtkfilechooserbutton.c | 10 +++++----- gtk/gtkfilechooserdefault.c | 27 ++++++++++++++------------- gtk/gtkfilechooserentry.c | 2 +- gtk/gtkfilesystem.h | 8 ++++---- gtk/gtkfilesystemmodel.c | 6 +++--- gtk/gtkpathbar.c | 4 ++-- 8 files changed, 63 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index b5c561ad9e..319b0519c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2005-12-13 Kristian Rietveld + + * gtk/gtkfilesystem.h: make the GError argument in the callbacks + const. + + * gtk/gtkfilechooserbutton.c: update callbacks, + * gtk/gtkfilechooserentry.c: likewise, + * gtk/gtkfilechooserdefault.c: likewise, + * gtk/gtkfilesystemmodel.c: likewise, + * gtk/gtkpathbar.c: likewise. + + * gtk/gtkfilechooserdefault.c (edited_idle_create_folder_cb): copy + the error which will be passed to error_creating_folder_dialog(), + (action_create_folder_cb): likewise, + (file_list_drag_data_received_get_info_cb): add forgotten GError + declaration. + 2005-12-13 Kristian Rietveld * gtk/gtkpathbar.c (get_button_image), (set_button_image), diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index b5c561ad9e..319b0519c0 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,20 @@ +2005-12-13 Kristian Rietveld + + * gtk/gtkfilesystem.h: make the GError argument in the callbacks + const. + + * gtk/gtkfilechooserbutton.c: update callbacks, + * gtk/gtkfilechooserentry.c: likewise, + * gtk/gtkfilechooserdefault.c: likewise, + * gtk/gtkfilesystemmodel.c: likewise, + * gtk/gtkpathbar.c: likewise. + + * gtk/gtkfilechooserdefault.c (edited_idle_create_folder_cb): copy + the error which will be passed to error_creating_folder_dialog(), + (action_create_folder_cb): likewise, + (file_list_drag_data_received_get_info_cb): add forgotten GError + declaration. + 2005-12-13 Kristian Rietveld * gtk/gtkpathbar.c (get_button_image), (set_button_image), diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c index 56744b8357..65e435ca6d 100644 --- a/gtk/gtkfilechooserbutton.c +++ b/gtk/gtkfilechooserbutton.c @@ -913,7 +913,7 @@ struct DndSelectFolderData static void dnd_select_folder_get_info_cb (GtkFileSystemHandle *handle, GtkFileInfo *info, - GError *error, + const GError *error, gpointer user_data) { struct DndSelectFolderData *data = user_data; @@ -1105,7 +1105,7 @@ struct ChangeIconThemeData static void change_icon_theme_get_info_cb (GtkFileSystemHandle *handle, GtkFileInfo *info, - GError *error, + const GError *error, gpointer user_data) { GdkPixbuf *pixbuf; @@ -1288,7 +1288,7 @@ struct SetDisplayNameData static void set_info_get_info_cb (GtkFileSystemHandle *handle, GtkFileInfo *info, - GError *error, + const GError *error, gpointer callback_data) { GdkPixbuf *pixbuf; @@ -1417,7 +1417,7 @@ model_free_row_data (GtkFileChooserButton *button, static void model_add_special_get_info_cb (GtkFileSystemHandle *handle, GtkFileInfo *info, - GError *error, + const GError *error, gpointer user_data) { GdkPixbuf *pixbuf; @@ -1938,7 +1938,7 @@ update_combo_box (GtkFileChooserButton *button) static void update_label_get_info_cb (GtkFileSystemHandle *handle, GtkFileInfo *info, - GError *error, + const GError *error, gpointer data) { GdkPixbuf *pixbuf; diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index ee24dcbc7b..cff0cbb116 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -1097,7 +1097,7 @@ struct ReloadIconsData static void shortcuts_reload_icons_get_info_cb (GtkFileSystemHandle *handle, GtkFileInfo *info, - GError *error, + const GError *error, gpointer user_data) { GdkPixbuf *pixbuf; @@ -1272,7 +1272,7 @@ struct ShortcutsInsertRequest static void get_file_info_finished (GtkFileSystemHandle *handle, GtkFileInfo *info, - GError *error, + const GError *error, gpointer data) { gpointer item_data; @@ -1992,7 +1992,7 @@ new_folder_button_clicked (GtkButton *button, static void edited_idle_create_folder_cb (GtkFileSystemHandle *handle, const GtkFilePath *path, - GError *error, + const GError *error, gpointer data) { GtkFileChooserDefault *impl = data; @@ -2000,7 +2000,7 @@ edited_idle_create_folder_cb (GtkFileSystemHandle *handle, if (error) change_folder_and_display_error (impl, path); else - error_creating_folder_dialog (impl, path, error); + error_creating_folder_dialog (impl, path, g_error_copy (error)); } /* Idle handler for creating a new folder after editing its name cell, or for @@ -3568,7 +3568,7 @@ struct FileListDragData static void file_list_drag_data_received_get_info_cb (GtkFileSystemHandle *handle, GtkFileInfo *info, - GError *error, + const GError *error, gpointer user_data) { gint i; @@ -3599,6 +3599,7 @@ file_list_drag_data_received_get_info_cb (GtkFileSystemHandle *handle, if (data->impl->select_multiple) { GtkFilePath *path; + GError *error = NULL; for (i = 1; data->uris[i]; i++) { @@ -5354,7 +5355,7 @@ show_and_select_paths_finished_loading (GtkFileFolder *folder, static void show_and_select_paths_get_folder_cb (GtkFileSystemHandle *handle, GtkFileFolder *folder, - GError *error, + const GError *error, gpointer user_data) { if (error) @@ -5586,7 +5587,7 @@ struct UpdateCurrentFolderData static void update_current_folder_get_info_cb (GtkFileSystemHandle *handle, GtkFileInfo *info, - GError *error, + const GError *error, gpointer user_data) { struct UpdateCurrentFolderData *data = user_data; @@ -6145,7 +6146,7 @@ struct AddShortcutData static void add_shortcut_get_info_cb (GtkFileSystemHandle *handle, GtkFileInfo *info, - GError *error, + const GError *error, gpointer user_data) { int pos; @@ -6624,13 +6625,13 @@ should_respond_after_confirm_overwrite (GtkFileChooserDefault *impl, static void action_create_folder_cb (GtkFileSystemHandle *handle, const GtkFilePath *path, - GError *error, + const GError *error, gpointer data) { GtkFileChooserDefault *impl = data; if (error) - error_creating_folder_dialog (impl, path, error); + error_creating_folder_dialog (impl, path, g_error_copy (error)); } /* Implementation for GtkFileChooserEmbed::should_respond() */ @@ -6990,7 +6991,7 @@ check_preview_change (GtkFileChooserDefault *impl) static void shortcuts_activate_volume_mount_cb (GtkFileSystemHandle *handle, GtkFileSystemVolume *volume, - GError *error, + const GError *error, gpointer data) { GtkFilePath *path; @@ -7063,7 +7064,7 @@ struct ShortcutsActivateData static void shortcuts_activate_get_info_cb (GtkFileSystemHandle *handle, GtkFileInfo *info, - GError *error, + const GError *error, gpointer user_data) { struct ShortcutsActivateData *data = user_data; @@ -7553,7 +7554,7 @@ struct UpdateFromEntryData static void update_from_entry_get_info_cb (GtkFileSystemHandle *handle, GtkFileInfo *file_info, - GError *error, + const GError *error, gpointer data) { struct UpdateFromEntryData *update_data = data; diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c index 123bfe46dd..9a51f12e67 100644 --- a/gtk/gtkfilechooserentry.c +++ b/gtk/gtkfilechooserentry.c @@ -602,7 +602,7 @@ files_deleted_cb (GtkFileSystem *file_system, static void load_directory_get_folder_callback (GtkFileSystemHandle *handle, GtkFileFolder *folder, - GError *error, + const GError *error, gpointer data) { GtkFileChooserEntry *chooser_entry = data; diff --git a/gtk/gtkfilesystem.h b/gtk/gtkfilesystem.h index f406578e12..53bc5d6cd8 100644 --- a/gtk/gtkfilesystem.h +++ b/gtk/gtkfilesystem.h @@ -155,19 +155,19 @@ GType gtk_file_system_handle_get_type (void); typedef void (* GtkFileSystemGetInfoCallback) (GtkFileSystemHandle *handle, GtkFileInfo *file_info, - GError *error, + const GError *error, gpointer data); typedef void (* GtkFileSystemGetFolderCallback) (GtkFileSystemHandle *handle, GtkFileFolder *folder, - GError *error, + const GError *error, gpointer data); typedef void (* GtkFileSystemCreateFolderCallback) (GtkFileSystemHandle *handle, const GtkFilePath *path, - GError *error, + const GError *error, gpointer data); typedef void (* GtkFileSystemVolumeMountCallback) (GtkFileSystemHandle *handle, GtkFileSystemVolume *volume, - GError *error, + const GError *error, gpointer data); /* diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c index d38dd4bd33..f048f34aef 100644 --- a/gtk/gtkfilesystemmodel.c +++ b/gtk/gtkfilesystemmodel.c @@ -662,7 +662,7 @@ queue_finished_loading (GtkFileSystemModel *model) static void got_root_folder_cb (GtkFileSystemHandle *handle, GtkFileFolder *folder, - GError *error, + const GError *error, gpointer data) { GSList *roots = NULL; @@ -1041,7 +1041,7 @@ struct RefPathData static void ref_path_cb (GtkFileSystemHandle *handle, GtkFileFolder *folder, - GError *error, + const GError *error, gpointer data) { struct RefPathData *info = data; @@ -1477,7 +1477,7 @@ struct GetChildrenData static void get_children_get_folder_cb (GtkFileSystemHandle *handle, GtkFileFolder *folder, - GError *error, + const GError *error, gpointer callback_data) { GSList *child_paths, *tmp_list; diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c index ff48a92ecd..da4ee002e6 100644 --- a/gtk/gtkpathbar.c +++ b/gtk/gtkpathbar.c @@ -990,7 +990,7 @@ struct SetButtonImageData static void set_button_image_get_info_cb (GtkFileSystemHandle *handle, GtkFileInfo *info, - GError *error, + const GError *error, gpointer user_data) { GdkPixbuf *pixbuf; @@ -1417,7 +1417,7 @@ gtk_path_bar_set_path_finish (struct SetPathInfo *info, static void gtk_path_bar_get_info_callback (GtkFileSystemHandle *handle, GtkFileInfo *file_info, - GError *error, + const GError *error, gpointer data) { struct SetPathInfo *path_info = data;