diff options
Diffstat (limited to 'thunar')
-rw-r--r-- | thunar/Makefile.am | 10 | ||||
-rw-r--r-- | thunar/sexy-url-label.c | 6 | ||||
-rw-r--r-- | thunar/thunar-application.c | 8 | ||||
-rw-r--r-- | thunar/thunar-chooser-dialog.c | 4 | ||||
-rw-r--r-- | thunar/thunar-column-editor.c | 8 | ||||
-rw-r--r-- | thunar/thunar-column-model.c | 19 | ||||
-rw-r--r-- | thunar/thunar-dbus-service.c | 3 | ||||
-rw-r--r-- | thunar/thunar-dnd.c | 6 | ||||
-rw-r--r-- | thunar/thunar-file.c | 14 | ||||
-rw-r--r-- | thunar/thunar-file.h | 2 | ||||
-rw-r--r-- | thunar/thunar-gio-extensions.c | 2 | ||||
-rw-r--r-- | thunar/thunar-io-jobs-util.c | 3 | ||||
-rw-r--r-- | thunar/thunar-io-jobs-util.h | 2 | ||||
-rw-r--r-- | thunar/thunar-io-jobs.c | 49 | ||||
-rw-r--r-- | thunar/thunar-shortcuts-model.c | 80 | ||||
-rw-r--r-- | thunar/thunar-standard-view.c | 44 | ||||
-rw-r--r-- | thunar/thunar-transfer-job.c | 16 | ||||
-rw-r--r-- | thunar/thunar-tree-model.c | 5 | ||||
-rw-r--r-- | thunar/thunar-tree-view.c | 30 |
19 files changed, 158 insertions, 153 deletions
diff --git a/thunar/Makefile.am b/thunar/Makefile.am index e6c34a39..241c7395 100644 --- a/thunar/Makefile.am +++ b/thunar/Makefile.am @@ -373,15 +373,21 @@ thunar-window-ui.h: Makefile $(srcdir)/thunar-window-ui.xml thunar-marshal.h: stamp-thunar-marshal.h @true stamp-thunar-marshal.h: thunar-marshal.list Makefile - ( cd $(srcdir) && glib-genmarshal \ + cd $(srcdir) \ + && echo "#ifndef __THUNAR_MARSHAL_H__" > xgen-tmh \ + && echo "#define __THUNAR_MARSHAL_H__" >> xgen-tmh \ + && ( glib-genmarshal \ --prefix=_thunar_marshal \ --header thunar-marshal.list ) >> xgen-tmh \ + && echo "#endif /* !__THUNAR_MARSHAL_H__ */" >> xgen-tmh \ && ( cmp -s xgen-tmh thunar-marshal.h || cp xgen-tmh thunar-marshal.h ) \ && rm -f xgen-tmh \ && echo timestamp > $(@F) thunar-marshal.c: thunar-marshal.list Makefile - ( cd $(srcdir) && glib-genmarshal \ + cd $(srcdir) \ + && echo "#include <thunar/thunar-marshal.h>" > xgen-tmc \ + && ( glib-genmarshal \ --prefix=_thunar_marshal \ --body thunar-marshal.list ) >> xgen-tmc \ && cp xgen-tmc thunar-marshal.c \ diff --git a/thunar/sexy-url-label.c b/thunar/sexy-url-label.c index b69fc9a3..0830b415 100644 --- a/thunar/sexy-url-label.c +++ b/thunar/sexy-url-label.c @@ -218,7 +218,7 @@ sexy_url_label_motion_notify_event(GtkWidget *widget, GdkEventMotion *event) GdkModifierType state; gboolean found = FALSE; GList *l; - int index, trailing; + int idx, trailing; int x, y; SexyUrlLabelLink *link = NULL; @@ -234,13 +234,13 @@ sexy_url_label_motion_notify_event(GtkWidget *widget, GdkEventMotion *event) if (pango_layout_xy_to_index(layout, (x - priv->layout_x) * PANGO_SCALE, (y - priv->layout_y) * PANGO_SCALE, - &index, &trailing)) + &idx, &trailing)) { for (l = priv->links; l != NULL; l = l->next) { link = (SexyUrlLabelLink *)l->data; - if (index >= link->start && index <= link->end) + if (idx >= link->start && idx <= link->end) { found = TRUE; break; diff --git a/thunar/thunar-application.c b/thunar/thunar-application.c index 0d64a1dc..239f4da9 100644 --- a/thunar/thunar-application.c +++ b/thunar/thunar-application.c @@ -356,7 +356,7 @@ thunar_application_collect_and_launch (ThunarApplication *application, GError *err = NULL; GList *target_file_list = NULL; GList *lp; - gchar *basename; + gchar *base_name; /* check if we have anything to operate on */ if (G_UNLIKELY (source_file_list == NULL)) @@ -373,9 +373,9 @@ thunar_application_collect_and_launch (ThunarApplication *application, } else { - basename = g_file_get_basename (lp->data); - file = g_file_resolve_relative_path (target_file, basename); - g_free (basename); + base_name = g_file_get_basename (lp->data); + file = g_file_resolve_relative_path (target_file, base_name); + g_free (base_name); /* add to the target file list */ target_file_list = thunar_g_file_list_prepend (target_file_list, file); diff --git a/thunar/thunar-chooser-dialog.c b/thunar/thunar-chooser-dialog.c index 081bf1f1..d1a29b85 100644 --- a/thunar/thunar-chooser-dialog.c +++ b/thunar/thunar-chooser-dialog.c @@ -569,7 +569,7 @@ thunar_chooser_dialog_selection_func (GtkTreeSelection *selection, static gboolean thunar_chooser_dialog_context_menu (ThunarChooserDialog *dialog, guint button, - guint32 time) + guint32 timestamp) { GtkTreeSelection *selection; GtkTreeModel *model; @@ -607,7 +607,7 @@ thunar_chooser_dialog_context_menu (ThunarChooserDialog *dialog, gtk_widget_show (image); /* run the menu on the dialog's screen (takes over the floating of menu) */ - thunar_gtk_menu_run (GTK_MENU (menu), GTK_WIDGET (dialog), NULL, NULL, button, time); + thunar_gtk_menu_run (GTK_MENU (menu), GTK_WIDGET (dialog), NULL, NULL, button, timestamp); /* clean up */ g_object_unref (app_info); diff --git a/thunar/thunar-column-editor.c b/thunar/thunar-column-editor.c index f09e1d6d..3b6fa0a8 100644 --- a/thunar/thunar-column-editor.c +++ b/thunar/thunar-column-editor.c @@ -474,7 +474,7 @@ thunar_column_editor_update_buttons (ThunarColumnEditor *column_editor) GtkTreeIter iter; gboolean mutable; gboolean visible; - gint index; + gint idx; /* determine the selected row */ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (column_editor->tree_view)); @@ -486,9 +486,9 @@ thunar_column_editor_update_buttons (ThunarColumnEditor *column_editor) return; /* update the "Move Up"/"Move Down" buttons */ - index = gtk_tree_path_get_indices (path)[0]; - gtk_widget_set_sensitive (column_editor->up_button, (index > 0)); - gtk_widget_set_sensitive (column_editor->down_button, (index + 1 < gtk_tree_model_iter_n_children (model, NULL))); + idx = gtk_tree_path_get_indices (path)[0]; + gtk_widget_set_sensitive (column_editor->up_button, (idx > 0)); + gtk_widget_set_sensitive (column_editor->down_button, (idx + 1 < gtk_tree_model_iter_n_children (model, NULL))); /* update the "Show"/"Hide" buttons */ gtk_tree_model_get (model, &iter, THUNAR_COLUMN_MODEL_COLUMN_MUTABLE, &mutable, THUNAR_COLUMN_MODEL_COLUMN_VISIBLE, &visible, -1); diff --git a/thunar/thunar-column-model.c b/thunar/thunar-column-model.c index c12a5cb1..3961ce47 100644 --- a/thunar/thunar-column-model.c +++ b/thunar/thunar-column-model.c @@ -47,7 +47,7 @@ static void thunar_column_model_finalize (GObject static GtkTreeModelFlags thunar_column_model_get_flags (GtkTreeModel *tree_model); static gint thunar_column_model_get_n_columns (GtkTreeModel *tree_model); static GType thunar_column_model_get_column_type (GtkTreeModel *tree_model, - gint index); + gint idx); static gboolean thunar_column_model_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath *path); @@ -55,7 +55,7 @@ static GtkTreePath *thunar_column_model_get_path (GtkTreeMo GtkTreeIter *iter); static void thunar_column_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, - gint index, + gint idx, GValue *value); static gboolean thunar_column_model_iter_next (GtkTreeModel *tree_model, GtkTreeIter *iter); @@ -272,9 +272,9 @@ thunar_column_model_get_n_columns (GtkTreeModel *tree_model) static GType thunar_column_model_get_column_type (GtkTreeModel *tree_model, - gint index) + gint idx) { - switch (index) + switch (idx) { case THUNAR_COLUMN_MODEL_COLUMN_NAME: return G_TYPE_STRING; @@ -331,14 +331,14 @@ thunar_column_model_get_path (GtkTreeModel *tree_model, static void thunar_column_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, - gint index, + gint idx, GValue *value) { ThunarColumnModel *column_model = THUNAR_COLUMN_MODEL (tree_model); ThunarColumn column; _thunar_return_if_fail (THUNAR_IS_COLUMN_MODEL (column_model)); - _thunar_return_if_fail (index < THUNAR_COLUMN_MODEL_N_COLUMNS); + _thunar_return_if_fail (idx < THUNAR_COLUMN_MODEL_N_COLUMNS); _thunar_return_if_fail (iter->stamp == column_model->stamp); /* determine the column from the iterator */ @@ -347,7 +347,7 @@ thunar_column_model_get_value (GtkTreeModel *tree_model, /* resolve the column according to the order */ column = column_model->order[column]; - switch (index) + switch (idx) { case THUNAR_COLUMN_MODEL_COLUMN_NAME: g_value_init (value, G_TYPE_STRING); @@ -899,7 +899,6 @@ thunar_column_model_get_column_name (ThunarColumnModel *column_model, _thunar_return_val_if_fail (THUNAR_IS_COLUMN_MODEL (column_model), NULL); _thunar_return_val_if_fail (column < THUNAR_N_VISIBLE_COLUMNS, NULL); - _thunar_return_val_if_fail (column >= 0, NULL); /* determine the column name from the ThunarColumn enum type */ klass = g_type_class_ref (THUNAR_TYPE_COLUMN); @@ -929,7 +928,6 @@ thunar_column_model_get_column_visible (ThunarColumnModel *column_model, { _thunar_return_val_if_fail (THUNAR_IS_COLUMN_MODEL (column_model), FALSE); _thunar_return_val_if_fail (column < THUNAR_N_VISIBLE_COLUMNS, FALSE); - _thunar_return_val_if_fail (column >= 0, FALSE); return column_model->visible[column]; } @@ -955,7 +953,6 @@ thunar_column_model_set_column_visible (ThunarColumnModel *column_model, _thunar_return_if_fail (THUNAR_IS_COLUMN_MODEL (column_model)); _thunar_return_if_fail (column < THUNAR_N_VISIBLE_COLUMNS); - _thunar_return_if_fail (column >= 0); /* cannot change the visibility of the name column */ if (G_UNLIKELY (column == THUNAR_COLUMN_NAME)) @@ -1010,7 +1007,6 @@ thunar_column_model_get_column_width (ThunarColumnModel *column_model, { _thunar_return_val_if_fail (THUNAR_IS_COLUMN_MODEL (column_model), -1); _thunar_return_val_if_fail (column < THUNAR_N_VISIBLE_COLUMNS, -1); - _thunar_return_val_if_fail (column >= 0, -1); return column_model->width[column]; } @@ -1032,7 +1028,6 @@ thunar_column_model_set_column_width (ThunarColumnModel *column_model, { _thunar_return_if_fail (THUNAR_IS_COLUMN_MODEL (column_model)); _thunar_return_if_fail (column < THUNAR_N_VISIBLE_COLUMNS); - _thunar_return_if_fail (column >= 0); _thunar_return_if_fail (width >= 0); /* check if we have a new width */ diff --git a/thunar/thunar-dbus-service.c b/thunar/thunar-dbus-service.c index a1dfc5f2..8a332fe2 100644 --- a/thunar/thunar-dbus-service.c +++ b/thunar/thunar-dbus-service.c @@ -176,7 +176,8 @@ thunar_dbus_service_class_init (ThunarDBusServiceClass *klass) gobject_class->finalize = thunar_dbus_service_finalize; /* install the D-BUS info for our class */ - dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), &dbus_glib_thunar_dbus_service_object_info); + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), + &dbus_glib_thunar_dbus_service_object_info); /** * ThunarDBusService::trash-changed: diff --git a/thunar/thunar-dnd.c b/thunar/thunar-dnd.c index a64cf5d1..6d605016 100644 --- a/thunar/thunar-dnd.c +++ b/thunar/thunar-dnd.c @@ -46,7 +46,7 @@ dnd_action_selected (GtkWidget *item, * @widget : the widget on which the drop was performed. * @folder : the #ThunarFile to which the @path_list is being dropped. * @path_list : the #GFile<!---->s of the files being dropped to @file. - * @time : the time of the drop event. + * @timestamp : the time of the drop event. * @actions : the list of actions supported for the drop. * * Pops up a menu that asks the user to choose one of the @@ -64,7 +64,7 @@ GdkDragAction thunar_dnd_ask (GtkWidget *widget, ThunarFile *folder, GList *path_list, - guint time, + guint timestamp, GdkDragAction dnd_actions) { static const GdkDragAction dnd_action_items[] = { GDK_ACTION_COPY, GDK_ACTION_MOVE, GDK_ACTION_LINK }; @@ -175,7 +175,7 @@ thunar_dnd_ask (GtkWidget *widget, gtk_widget_show (item); /* run the menu on the widget's screen (takes over the floating reference of menu) */ - thunar_gtk_menu_run (GTK_MENU (menu), widget, NULL, NULL, 3, time); + thunar_gtk_menu_run (GTK_MENU (menu), widget, NULL, NULL, 3, timestamp); /* cleanup */ g_object_unref (G_OBJECT (factory)); diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c index bc3722ec..cdd2efb6 100644 --- a/thunar/thunar-file.c +++ b/thunar/thunar-file.c @@ -739,7 +739,7 @@ thunar_file_load (ThunarFile *file, GKeyFile *key_file; GError *err = NULL; GFile *thumbnail_dir; - gchar *basename; + gchar *base_name; gchar *md5_hash; gchar *thumbnail_dir_path; gchar *uri = NULL; @@ -899,10 +899,10 @@ thunar_file_load (ThunarFile *file, /* determine thumbnail path */ uri = g_file_get_uri (file->gfile); md5_hash = g_compute_checksum_for_string (G_CHECKSUM_MD5, uri, -1); - basename = g_strdup_printf ("%s.png", md5_hash); + base_name = g_strdup_printf ("%s.png", md5_hash); file->thumbnail_path = g_build_filename (xfce_get_homedir (), ".thumbnails", - "normal", basename, NULL); - g_free (basename); + "normal", base_name, NULL); + g_free (base_name); g_free (md5_hash); g_free (uri); @@ -2266,7 +2266,7 @@ thunar_file_get_deletion_date (const ThunarFile *file, ThunarDateStyle date_style) { const gchar *date; - time_t time; + time_t deletion_time; _thunar_return_val_if_fail (THUNAR_IS_FILE (file), NULL); _thunar_return_val_if_fail (G_IS_FILE_INFO (file->info), NULL); @@ -2276,10 +2276,10 @@ thunar_file_get_deletion_date (const ThunarFile *file, return NULL; /* try to parse the DeletionDate (RFC 3339 string) */ - time = thunar_util_time_from_rfc3339 (date); + deletion_time = thunar_util_time_from_rfc3339 (date); /* humanize the time value */ - return thunar_util_humanize_file_time (time, date_style); + return thunar_util_humanize_file_time (deletion_time, date_style); } diff --git a/thunar/thunar-file.h b/thunar/thunar-file.h index 683b8887..1a760e0d 100644 --- a/thunar/thunar-file.h +++ b/thunar/thunar-file.h @@ -160,8 +160,6 @@ GdkDragAction thunar_file_accepts_drop (ThunarFile *file GdkDragContext *context, GdkDragAction *suggested_action_return); -const gchar *thunar_file_get_display_name (const ThunarFile *file); - guint64 thunar_file_get_date (const ThunarFile *file, ThunarFileDateType date_type); diff --git a/thunar/thunar-gio-extensions.c b/thunar/thunar-gio-extensions.c index 7b8714a3..f26e4ce2 100644 --- a/thunar/thunar-gio-extensions.c +++ b/thunar/thunar-gio-extensions.c @@ -69,7 +69,7 @@ thunar_g_file_new_for_user_special_dir (GUserDirectory dir) { const gchar *path; - _thunar_return_val_if_fail (dir >= 0 && dir < G_USER_N_DIRECTORIES, NULL); + _thunar_return_val_if_fail (dir < G_USER_N_DIRECTORIES, NULL); path = g_get_user_special_dir (dir); if (path == NULL) diff --git a/thunar/thunar-io-jobs-util.c b/thunar/thunar-io-jobs-util.c index 8367df8b..bd577f71 100644 --- a/thunar/thunar-io-jobs-util.c +++ b/thunar/thunar-io-jobs-util.c @@ -25,6 +25,7 @@ #include <gio/gio.h> #include <thunar/thunar-gio-extensions.h> +#include <thunar/thunar-io-jobs-util.h> #include <thunar/thunar-job.h> #include <thunar/thunar-private.h> @@ -72,7 +73,7 @@ GFile * thunar_io_jobs_util_next_duplicate_file (ThunarJob *job, GFile *file, gboolean copy, - gint n, + guint n, GError **error) { GFileInfo *info; diff --git a/thunar/thunar-io-jobs-util.h b/thunar/thunar-io-jobs-util.h index d5eb11d4..2ff28960 100644 --- a/thunar/thunar-io-jobs-util.h +++ b/thunar/thunar-io-jobs-util.h @@ -28,7 +28,7 @@ G_BEGIN_DECLS GFile *thunar_io_jobs_util_next_duplicate_file (ThunarJob *job, GFile *file, gboolean copy, - gint n, + guint n, GError **error) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; G_END_DECLS diff --git a/thunar/thunar-io-jobs.c b/thunar/thunar-io-jobs.c index 27b77253..cea44cef 100644 --- a/thunar/thunar-io-jobs.c +++ b/thunar/thunar-io-jobs.c @@ -27,6 +27,7 @@ #include <thunar/thunar-enum-types.h> #include <thunar/thunar-gio-extensions.h> #include <thunar/thunar-io-scan-directory.h> +#include <thunar/thunar-io-jobs.h> #include <thunar/thunar-job.h> #include <thunar/thunar-private.h> #include <thunar/thunar-simple-job.h> @@ -89,7 +90,7 @@ _thunar_io_jobs_create (ThunarJob *job, GError *err = NULL; GList *file_list; GList *lp; - gchar *basename; + gchar *base_name; gchar *display_name; _thunar_return_val_if_fail (THUNAR_IS_JOB (job), FALSE); @@ -150,9 +151,9 @@ again: } else { - basename = g_file_get_basename (lp->data); - display_name = g_filename_display_name (basename); - g_free (basename); + base_name = g_file_get_basename (lp->data); + display_name = g_filename_display_name (base_name); + g_free (base_name); } /* ask the user whether he wants to overwrite the existing file */ @@ -174,9 +175,9 @@ again: else { /* determine display name of the file */ - basename = g_file_get_basename (lp->data); - display_name = g_filename_display_basename (basename); - g_free (basename); + base_name = g_file_get_basename (lp->data); + display_name = g_filename_display_basename (base_name); + g_free (base_name); /* ask the user whether to skip/retry this path (cancels the job if not) */ response = thunar_job_ask_skip (THUNAR_JOB (job), @@ -233,7 +234,7 @@ _thunar_io_jobs_mkdir (ThunarJob *job, GError *err = NULL; GList *file_list; GList *lp; - gchar *basename; + gchar *base_name; gchar *display_name; _thunar_return_val_if_fail (THUNAR_IS_JOB (job), FALSE); @@ -287,9 +288,9 @@ again: } else { - basename = g_file_get_basename (lp->data); - display_name = g_filename_display_name (basename); - g_free (basename); + base_name = g_file_get_basename (lp->data); + display_name = g_filename_display_name (base_name); + g_free (base_name); } /* ask the user whether he wants to overwrite the existing file */ @@ -311,9 +312,9 @@ again: else { /* determine the display name of the file */ - basename = g_file_get_basename (lp->data); - display_name = g_filename_display_basename (basename); - g_free (basename); + base_name = g_file_get_basename (lp->data); + display_name = g_filename_display_basename (base_name); + g_free (base_name); /* ask the user whether to skip/retry this path (cancels the job if not) */ response = thunar_job_ask_skip (THUNAR_JOB (job), @@ -369,7 +370,7 @@ _thunar_io_jobs_unlink (ThunarJob *job, GError *err = NULL; GList *file_list; GList *lp; - gchar *basename; + gchar *base_name; gchar *display_name; _thunar_return_val_if_fail (THUNAR_IS_JOB (job), FALSE); @@ -436,9 +437,9 @@ again: } else { - basename = g_file_get_basename (lp->data); - display_name = g_filename_display_name (basename); - g_free (basename); + base_name = g_file_get_basename (lp->data); + display_name = g_filename_display_name (base_name); + g_free (base_name); } /* ask the user whether he wants to skip this file */ @@ -524,7 +525,7 @@ _thunar_io_jobs_link (ThunarJob *job, GList *sp; GList *target_file_list; GList *tp; - gchar *basename; + gchar *base_name; gchar *display_name; gchar *source_path; @@ -588,13 +589,13 @@ again: } else { - basename = g_file_get_basename (sp->data); - display_name = g_filename_display_name (basename); + base_name = g_file_get_basename (sp->data); + display_name = g_filename_display_name (base_name); g_set_error (&err, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, _("Could not create symbolic link to \"%s\" " "because it is not a local file"), display_name); g_free (display_name); - g_free (basename); + g_free (base_name); } } @@ -1090,7 +1091,7 @@ thunar_io_jobs_list_directory (GFile *directory) -gboolean +static gboolean _thunar_io_jobs_rename_notify (ThunarFile *file) { _thunar_return_val_if_fail (THUNAR_IS_FILE (file), FALSE); @@ -1106,7 +1107,7 @@ _thunar_io_jobs_rename_notify (ThunarFile *file) -gboolean +static gboolean _thunar_io_jobs_rename (ThunarJob *job, GValueArray *param_values, GError **error) diff --git a/thunar/thunar-shortcuts-model.c b/thunar/thunar-shortcuts-model.c index 5ef7eb70..e442afc7 100644 --- a/thunar/thunar-shortcuts-model.c +++ b/thunar/thunar-shortcuts-model.c @@ -75,7 +75,7 @@ static void thunar_shortcuts_model_finalize (GObject static GtkTreeModelFlags thunar_shortcuts_model_get_flags (GtkTreeModel *tree_model); static gint thunar_shortcuts_model_get_n_columns (GtkTreeModel *tree_model); static GType thunar_shortcuts_model_get_column_type (GtkTreeModel *tree_model, - gint index); + gint idx); static gboolean thunar_shortcuts_model_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath *path); @@ -457,9 +457,9 @@ thunar_shortcuts_model_get_n_columns (GtkTreeModel *tree_model) static GType thunar_shortcuts_model_get_column_type (GtkTreeModel *tree_model, - gint index) + gint idx) { - switch (index) + switch (idx) { case THUNAR_SHORTCUTS_MODEL_COLUMN_NAME: return G_TYPE_STRING; @@ -512,15 +512,15 @@ thunar_shortcuts_model_get_path (GtkTreeModel *tree_model, GtkTreeIter *iter) { ThunarShortcutsModel *model = THUNAR_SHORTCUTS_MODEL (tree_model); - gint index; + gint idx; _thunar_return_val_if_fail (THUNAR_IS_SHORTCUTS_MODEL (model), NULL); _thunar_return_val_if_fail (iter->stamp == model->stamp, NULL); /* lookup the list item in the shortcuts list */ - index = g_list_position (model->shortcuts, iter->user_data); - if (G_LIKELY (index >= 0)) - return gtk_tree_path_new_from_indices (index, -1); + idx = g_list_position (model->shortcuts, iter->user_data); + if (G_LIKELY (idx >= 0)) + return gtk_tree_path_new_from_indices (idx, -1); return NULL; } @@ -779,17 +779,17 @@ thunar_shortcuts_model_remove_shortcut (ThunarShortcutsModel *model, ThunarShortcut *shortcut) { GtkTreePath *path; - gint index; + gint idx; /* determine the index of the shortcut */ - index = g_list_index (model->shortcuts, shortcut); - if (G_LIKELY (index >= 0)) + idx = g_list_index (model->shortcuts, shortcut); + if (G_LIKELY (idx >= 0)) { /* unlink the shortcut from the model */ model->shortcuts = g_list_remove (model->shortcuts, shortcut); /* tell everybody that we have lost a shortcut */ - path = gtk_tree_path_new_from_indices (index, -1); + path = gtk_tree_path_new_from_indices (idx, -1); gtk_tree_model_row_deleted (GTK_TREE_MODEL (model), path); gtk_tree_path_free (path); @@ -1004,13 +1004,13 @@ thunar_shortcuts_model_monitor (GFileMonitor *monitor, ThunarShortcut *shortcut; GtkTreePath *path; GList *lp; - gint index; + gint idx; _thunar_return_if_fail (THUNAR_IS_SHORTCUTS_MODEL (model)); _thunar_return_if_fail (model->monitor == monitor); /* drop all existing user-defined shortcuts from the model */ - for (index = 0, lp = model->shortcuts; lp != NULL; ) + for (idx = 0, lp = model->shortcuts; lp != NULL; ) { /* grab the shortcut */ shortcut = THUNAR_SHORTCUT (lp->data); @@ -1025,7 +1025,7 @@ thunar_shortcuts_model_monitor (GFileMonitor *monitor, model->shortcuts = g_list_remove (model->shortcuts, shortcut); /* tell everybody that we have lost a shortcut */ - path = gtk_tree_path_new_from_indices (index, -1); + path = gtk_tree_path_new_from_indices (idx, -1); gtk_tree_model_row_deleted (GTK_TREE_MODEL (model), path); gtk_tree_path_free (path); @@ -1034,7 +1034,7 @@ thunar_shortcuts_model_monitor (GFileMonitor *monitor, } else { - ++index; + ++idx; } } @@ -1111,7 +1111,7 @@ thunar_shortcuts_model_file_changed (ThunarFile *file, GtkTreePath *path; GtkTreeIter iter; GList *lp; - gint index; + gint idx; _thunar_return_if_fail (THUNAR_IS_FILE (file)); _thunar_return_if_fail (THUNAR_IS_SHORTCUTS_MODEL (model)); @@ -1126,14 +1126,14 @@ thunar_shortcuts_model_file_changed (ThunarFile *file, return; } - for (index = 0, lp = model->shortcuts; lp != NULL; ++index, lp = lp->next) + for (idx = 0, lp = model->shortcuts; lp != NULL; ++idx, lp = lp->next) { shortcut = THUNAR_SHORTCUT (lp->data); if (shortcut->file == file) { GTK_TREE_ITER_INIT (iter, model->stamp, lp); - path = gtk_tree_path_new_from_indices (index, -1); + path = gtk_tree_path_new_from_indices (idx, -1); gtk_tree_model_row_changed (GTK_TREE_MODEL (model), path, &iter); gtk_tree_path_free (path); break; @@ -1180,7 +1180,7 @@ thunar_shortcuts_model_volume_changed (GVolumeMonitor *volume_monitor, GtkTreePath *path; GtkTreeIter iter; GList *lp; - gint index; + gint idx; _thunar_return_if_fail (G_IS_VOLUME_MONITOR (volume_monitor)); _thunar_return_if_fail (model->volume_monitor == volume_monitor); @@ -1198,7 +1198,7 @@ thunar_shortcuts_model_volume_changed (GVolumeMonitor *volume_monitor, model->hidden_volumes = g_list_delete_link (model->hidden_volumes, lp); /* find the insert position */ - for (index = 0, lp = model->shortcuts; lp != NULL; ++index, lp = lp->next) + for (idx = 0, lp = model->shortcuts; lp != NULL; ++idx, lp = lp->next) { shortcut = THUNAR_SHORTCUT (lp->data); if (shortcut->type == THUNAR_SHORTCUT_SEPARATOR @@ -1212,7 +1212,7 @@ thunar_shortcuts_model_volume_changed (GVolumeMonitor *volume_monitor, shortcut->volume = volume; /* the volume is present now, so we have to display it */ - path = gtk_tree_path_new_from_indices (index, -1); + path = gtk_tree_path_new_from_indices (idx, -1); thunar_shortcuts_model_add_shortcut (model, shortcut, path); gtk_tree_path_free (path); } @@ -1220,9 +1220,9 @@ thunar_shortcuts_model_volume_changed (GVolumeMonitor *volume_monitor, else { /* lookup the shortcut that contains the given volume */ - for (index = 0, lp = model->shortcuts; + for (idx = 0, lp = model->shortcuts; shortcut == NULL && lp != NULL; - ++index, lp = lp->next) + ++idx, lp = lp->next) { if (THUNAR_SHORTCUT (lp->data)->volume == volume) shortcut = lp->data; @@ -1248,7 +1248,7 @@ thunar_shortcuts_model_volume_changed (GVolumeMonitor *volume_monitor, GTK_TREE_ITER_INIT (iter, model->stamp, lp); /* tell the view that the volume has changed in some way */ - path = gtk_tree_path_new_from_indices (index, -1); + path = gtk_tree_path_new_from_indices (idx, -1); gtk_tree_model_row_changed (GTK_TREE_MODEL (model), path, &iter); gtk_tree_path_free (path); } @@ -1536,7 +1536,7 @@ thunar_shortcuts_model_move (ThunarShortcutsModel *model, gint *order; gint index_src; gint index_dst; - gint index; + gint idx; _thunar_return_if_fail (THUNAR_IS_SHORTCUTS_MODEL (model)); _thunar_return_if_fail (gtk_tree_path_get_depth (src_path) > 0); @@ -1553,47 +1553,47 @@ thunar_shortcuts_model_move (ThunarShortcutsModel *model, /* generate the order for the rows prior the dst/src rows */ order = g_newa (gint, g_list_length (model->shortcuts)); - for (index = 0, lp = model->shortcuts; index < index_src && index < index_dst; ++index, lp = lp->next) - order[index] = index; + for (idx = 0, lp = model->shortcuts; idx < index_src && idx < index_dst; ++idx, lp = lp->next) + order[idx] = idx; - if (index == index_src) + if (idx == index_src) { shortcut = THUNAR_SHORTCUT (lp->data); - for (; index < index_dst; ++index, lp = lp->next) + for (; idx < index_dst; ++idx, lp = lp->next) { lp->data = lp->next->data; - order[index] = index + 1; + order[idx] = idx + 1; } lp->data = shortcut; - order[index++] = index_src; + order[idx++] = index_src; } else { - for (; index < index_src; ++index, lp = lp->next) + for (; idx < index_src; ++idx, lp = lp->next) ; - _thunar_assert (index == index_src); + _thunar_assert (idx == index_src); shortcut = THUNAR_SHORTCUT (lp->data); - for (; index > index_dst; --index, lp = lp->prev) + for (; idx > index_dst; --idx, lp = lp->prev) { lp->data = lp->prev->data; - order[index] = index - 1; + order[idx] = idx - 1; } - _thunar_assert (index == index_dst); + _thunar_assert (idx == index_dst); lp->data = shortcut; - order[index] = index_src; - index = index_src + 1; + order[idx] = index_src; + idx = index_src + 1; } /* generate the remaining order */ - for (; index < (gint) g_list_length (model->shortcuts); ++index) - order[index] = index; + for (; idx < (gint) g_list_length (model->shortcuts); ++idx) + order[idx] = idx; /* tell all listeners about the reordering just performed */ path = gtk_tree_path_new (); diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c index f30d66c5..28aa848b 100644 --- a/thunar/thunar-standard-view.c +++ b/thunar/thunar-standard-view.c @@ -149,7 +149,7 @@ static GdkDragAction thunar_standard_view_get_dest_actions (Thu GdkDragContext *context, gint x, gint y, - guint time, + guint timestamp, ThunarFile **file_return); static ThunarFile *thunar_standard_view_get_drop_file (ThunarStandardView *standard_view, gint x, @@ -211,7 +211,7 @@ static gboolean thunar_standard_view_drag_drop (Gtk GdkDragContext *context, gint x, gint y, - guint time, + guint timestamp, ThunarStandardView *standard_view); static void thunar_standard_view_drag_data_received (GtkWidget *view, GdkDragContext *context, @@ -219,17 +219,17 @@ static void thunar_standard_view_drag_data_received (Gtk gint y, GtkSelectionData *selection_data, guint info, - guint time, + guint timestamp, ThunarStandardView *standard_view); static void thunar_standard_view_drag_leave (GtkWidget *view, GdkDragContext *context, - guint time, + guint timestamp, ThunarStandardView *standard_view); static gboolean thunar_standard_view_drag_motion (GtkWidget *view, GdkDragContext *context, gint x, gint y, - guint time, + guint timestamp, ThunarStandardView *standard_view); static void thunar_standard_view_drag_begin (GtkWidget *view, GdkDragContext *context, @@ -238,7 +238,7 @@ static void thunar_standard_view_drag_data_get (Gtk GdkDragContext *context, GtkSelectionData *selection_data, guint info, - guint time, + guint timestamp, ThunarStandardView *standard_view); static void thunar_standard_view_drag_data_delete (GtkWidget *view, GdkDragContext *context, @@ -2526,7 +2526,7 @@ thunar_standard_view_drag_drop (GtkWidget *view, GdkDragContext *context, gint x, gint y, - guint time, + guint timestamp, ThunarStandardView *standard_view) { ThunarFile *file = NULL; @@ -2605,7 +2605,7 @@ thunar_standard_view_drag_drop (GtkWidget *view, /* request the drag data from the source (initiates * saving in case of XdndDirectSave). */ - gtk_drag_get_data (view, context, target, time); + gtk_drag_get_data (view, context, target, timestamp); /* we'll call gtk_drag_finish() later */ return TRUE; @@ -2644,7 +2644,7 @@ thunar_standard_view_drag_data_received (GtkWidget *view, gint y, GtkSelectionData *selection_data, guint info, - guint time, + guint timestamp, ThunarStandardView *standard_view) { GdkDragAction actions; @@ -2782,12 +2782,12 @@ thunar_standard_view_drag_data_received (GtkWidget *view, else if (G_LIKELY (info == TARGET_TEXT_URI_LIST)) { /* determine the drop position */ - actions = thunar_standard_view_get_dest_actions (standard_view, context, x, y, time, &file); + actions = thunar_standard_view_get_dest_actions (standard_view, context, x, y, timestamp, &file); if (G_LIKELY ((actions & (GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK)) != 0)) { /* ask the user what to do with the drop data */ action = (context->action == GDK_ACTION_ASK) - ? thunar_dnd_ask (GTK_WIDGET (standard_view), file, standard_view->priv->drop_file_list, time, actions) + ? thunar_dnd_ask (GTK_WIDGET (standard_view), file, standard_view->priv->drop_file_list, timestamp, actions) : context->action; /* perform the requested action */ @@ -2804,10 +2804,10 @@ thunar_standard_view_drag_data_received (GtkWidget *view, } /* tell the peer that we handled the drop */ - gtk_drag_finish (context, succeed, FALSE, time); + gtk_drag_finish (context, succeed, FALSE, timestamp); /* disable the highlighting and release the drag data */ - thunar_standard_view_drag_leave (view, context, time, standard_view); + thunar_standard_view_drag_leave (view, context, timestamp, standard_view); } } @@ -2816,7 +2816,7 @@ thunar_standard_view_drag_data_received (GtkWidget *view, static void thunar_standard_view_drag_leave (GtkWidget *widget, GdkDragContext *context, - guint time, + guint timestamp, ThunarStandardView *standard_view) { /* reset the drop-file for the icon renderer */ @@ -2852,7 +2852,7 @@ thunar_standard_view_drag_motion (GtkWidget *view, GdkDragContext *context, gint x, gint y, - guint time, + guint timestamp, ThunarStandardView *standard_view) { GdkDragAction action = 0; @@ -2908,16 +2908,16 @@ thunar_standard_view_drag_motion (GtkWidget *view, else { /* request the drag data from the source */ - gtk_drag_get_data (view, context, target, time); + gtk_drag_get_data (view, context, target, timestamp); } /* tell Gdk whether we can drop here */ - gdk_drag_status (context, action, time); + gdk_drag_status (context, action, timestamp); } else { /* check whether we can drop at (x,y) */ - thunar_standard_view_get_dest_actions (standard_view, context, x, y, time, NULL); + thunar_standard_view_get_dest_actions (standard_view, context, x, y, timestamp, NULL); } /* start the drag autoscroll timer if not already running */ @@ -2972,7 +2972,7 @@ thunar_standard_view_drag_data_get (GtkWidget *view, GdkDragContext *context, GtkSelectionData *selection_data, guint info, - guint time, + guint timestamp, ThunarStandardView *standard_view) { gchar *uri_string; @@ -3252,7 +3252,7 @@ thunar_standard_view_drag_timer_destroy (gpointer user_data) * @standard_view : a #ThunarStandardView instance. * @button : the mouse button which triggered the context menu or %0 if * the event wasn't triggered by a pointer device. - * @time : the event time. + * @timestamp : the event time. * * Invoked by derived classes (and only by derived classes!) whenever the user * requests to open a context menu, e.g. by right-clicking on a file/folder or by @@ -3261,7 +3261,7 @@ thunar_standard_view_drag_timer_destroy (gpointer user_data) void thunar_standard_view_context_menu (ThunarStandardView *standard_view, guint button, - guint32 time) + guint32 timestamp) { GtkWidget *menu; GList *selected_items; @@ -3279,7 +3279,7 @@ thunar_standard_view_context_menu (ThunarStandardView *standard_view, /* run the menu on the view's screen (figuring out whether to use the file or the folder context menu) */ menu = gtk_ui_manager_get_widget (standard_view->ui_manager, (selected_items != NULL) ? "/file-context-menu" : "/folder-context-menu"); - thunar_gtk_menu_run (GTK_MENU (menu), GTK_WIDGET (standard_view), NULL, NULL, button, time); + thunar_gtk_menu_run (GTK_MENU (menu), GTK_WIDGET (standard_view), NULL, NULL, button, timestamp); /* release the additional reference on the view */ g_object_unref (G_OBJECT (standard_view)); diff --git a/thunar/thunar-transfer-job.c b/thunar/thunar-transfer-job.c index 0fbc5de1..6d5a5f79 100644 --- a/thunar/thunar-transfer-job.c +++ b/thunar/thunar-transfer-job.c @@ -495,7 +495,7 @@ thunar_transfer_job_copy_node (ThunarTransferJob *job, GFileInfo *info; GError *err = NULL; GFile *real_target_file = NULL; - gchar *basename; + gchar *base_name; _thunar_return_if_fail (THUNAR_IS_TRANSFER_JOB (job)); _thunar_return_if_fail (node != NULL && G_IS_FILE (node->source_file)); @@ -513,9 +513,9 @@ thunar_transfer_job_copy_node (ThunarTransferJob *job, /* guess the target file for this node (unless already provided) */ if (G_LIKELY (target_file == NULL)) { - basename = g_file_get_basename (node->source_file); - target_file = g_file_get_child (target_parent_file, basename); - g_free (basename); + base_name = g_file_get_basename (node->source_file); + target_file = g_file_get_child (target_parent_file, base_name); + g_free (base_name); } else target_file = g_object_ref (target_file); @@ -636,7 +636,7 @@ thunar_transfer_job_execute (ExoJob *job, GList *tnext; GList *tp; GFile *target_parent; - gchar *basename; + gchar *base_name; gchar *parent_display_name; _thunar_return_val_if_fail (THUNAR_IS_TRANSFER_JOB (job), FALSE); @@ -691,9 +691,9 @@ thunar_transfer_job_execute (ExoJob *job, if (G_LIKELY (!parent_exists)) { /* determine the display name of the parent */ - basename = g_file_get_basename (target_parent); - parent_display_name = g_filename_display_name (basename); - g_free (basename); + base_name = g_file_get_basename (target_parent); + parent_display_name = g_filename_display_name (base_name); + g_free (base_name); /* ask the user whether he wants to create the parent folder because its gone */ response = thunar_job_ask_create (THUNAR_JOB (job), diff --git a/thunar/thunar-tree-model.c b/thunar/thunar-tree-model.c index 0ae40822..e52c8c5d 100644 --- a/thunar/thunar-tree-model.c +++ b/thunar/thunar-tree-model.c @@ -1503,12 +1503,15 @@ thunar_tree_model_item_load_idle (gpointer user_data) GMount *mount; GFile *mount_point; GList *files; +#ifndef NDEBUG + GNode *node; +#endif _thunar_return_val_if_fail (item->folder == NULL, FALSE); #ifndef NDEBUG /* find the node in the tree */ - GNode *node = g_node_find (item->model->root, G_POST_ORDER, G_TRAVERSE_ALL, item); + node = g_node_find (item->model->root, G_POST_ORDER, G_TRAVERSE_ALL, item); /* debug check to make sure the node is empty or contains a dummy node. * if this is not true, the node already contains sub folders which means diff --git a/thunar/thunar-tree-view.c b/thunar/thunar-tree-view.c index 83dc7e23..9e8f2187 100644 --- a/thunar/thunar-tree-view.c +++ b/thunar/thunar-tree-view.c @@ -751,7 +751,7 @@ thunar_tree_view_drag_data_received (GtkWidget *widget, gint y, GtkSelectionData *selection_data, guint info, - guint time) + guint timestamp) { ThunarTreeView *view = THUNAR_TREE_VIEW (widget); GdkDragAction actions; @@ -777,12 +777,12 @@ thunar_tree_view_drag_data_received (GtkWidget *widget, view->drop_occurred = FALSE; /* determine the drop position */ - actions = thunar_tree_view_get_dest_actions (view, context, x, y, time, &file); + actions = thunar_tree_view_get_dest_actions (view, context, x, y, timestamp, &file); if (G_LIKELY ((actions & (GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK)) != 0)) { /* ask the user what to do with the drop data */ action = (context->action == GDK_ACTION_ASK) - ? thunar_dnd_ask (GTK_WIDGET (view), file, view->drop_file_list, time, actions) + ? thunar_dnd_ask (GTK_WIDGET (view), file, view->drop_file_list, timestamp, actions) : context->action; /* perform the requested action */ @@ -795,10 +795,10 @@ thunar_tree_view_drag_data_received (GtkWidget *widget, g_object_unref (G_OBJECT (file)); /* tell the peer that we handled the drop */ - gtk_drag_finish (context, succeed, FALSE, time); + gtk_drag_finish (context, succeed, FALSE, timestamp); /* disable the highlighting and release the drag data */ - thunar_tree_view_drag_leave (GTK_WIDGET (view), context, time); + thunar_tree_view_drag_leave (GTK_WIDGET (view), context, timestamp); } } @@ -809,7 +809,7 @@ thunar_tree_view_drag_drop (GtkWidget *widget, GdkDragContext *context, gint x, gint y, - guint time) + guint timestamp) { ThunarTreeView *view = THUNAR_TREE_VIEW (widget); GdkAtom target; @@ -824,7 +824,7 @@ thunar_tree_view_drag_drop (GtkWidget *widget, view->drop_occurred = TRUE; /* request the drag data from the source. */ - gtk_drag_get_data (widget, context, target, time); + gtk_drag_get_data (widget, context, target, timestamp); } else { @@ -842,7 +842,7 @@ thunar_tree_view_drag_motion (GtkWidget *widget, GdkDragContext *context, gint x, gint y, - guint time) + guint timestamp) { ThunarTreeView *view = THUNAR_TREE_VIEW (widget); GdkAtom target; @@ -865,15 +865,15 @@ thunar_tree_view_drag_motion (GtkWidget *widget, g_object_set (G_OBJECT (view->icon_renderer), "drop-file", NULL, NULL); /* request the drag data from the source */ - gtk_drag_get_data (widget, context, target, time); + gtk_drag_get_data (widget, context, target, timestamp); /* tell Gdk that we don't know whether we can drop */ - gdk_drag_status (context, 0, time); + gdk_drag_status (context, 0, timestamp); } else { /* check if we can drop here */ - thunar_tree_view_get_dest_actions (view, context, x, y, time, NULL); + thunar_tree_view_get_dest_actions (view, context, x, y, timestamp, NULL); } /* start the drag autoscroll timer if not already running */ @@ -892,7 +892,7 @@ thunar_tree_view_drag_motion (GtkWidget *widget, static void thunar_tree_view_drag_leave (GtkWidget *widget, GdkDragContext *context, - guint time) + guint timestamp) { ThunarTreeView *view = THUNAR_TREE_VIEW (widget); @@ -912,7 +912,7 @@ thunar_tree_view_drag_leave (GtkWidget *widget, } /* call the parent's handler */ - (*GTK_WIDGET_CLASS (thunar_tree_view_parent_class)->drag_leave) (widget, context, time); + (*GTK_WIDGET_CLASS (thunar_tree_view_parent_class)->drag_leave) (widget, context, timestamp); } @@ -1335,7 +1335,7 @@ thunar_tree_view_get_dest_actions (ThunarTreeView *view, GdkDragContext *context, gint x, gint y, - guint time, + guint timestamp, ThunarFile **file_return) { GdkDragAction actions = 0; @@ -1386,7 +1386,7 @@ thunar_tree_view_get_dest_actions (ThunarTreeView *view, g_object_set (G_OBJECT (view->icon_renderer), "drop-file", file, NULL); /* tell Gdk whether we can drop here */ - gdk_drag_status (context, action, time); + gdk_drag_status (context, action, timestamp); /* return the file if requested */ if (G_LIKELY (file_return != NULL)) |