From 5e22138afda5349ec3df12f42f9341ecea660899 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 8 May 2007 12:17:17 +0100 Subject: Whitespace fixes and code style consistency Signed-off-by: Emmanuele Bassi --- gtk/gtkfilechooserdefault.c | 53 +++++++++++++++++++++++------------------- 1 files changed, 29 insertions(+), 24 deletions(-) diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index bc7ed91..65ceec0 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -410,11 +410,11 @@ static void select_func (GtkFileSystemModel *model, GtkTreeIter *iter, gpointer user_data); -static void path_bar_clicked (GtkPathBar *path_bar, - GtkFilePath *file_path, - GtkFilePath *child_path, - gboolean child_is_hidden, - GtkFileChooserDefault *impl); +static void path_bar_clicked (GtkPathBar *path_bar, + GtkFilePath *file_path, + GtkFilePath *child_path, + gboolean child_is_hidden, + GtkFileChooserDefault *impl); static void add_bookmark_button_clicked_cb (GtkButton *button, GtkFileChooserDefault *impl); @@ -826,7 +826,8 @@ static void pending_select_paths_add (GtkFileChooserDefault *impl, const GtkFilePath *path) { - impl->pending_select_paths = g_slist_prepend (impl->pending_select_paths, gtk_file_path_copy (path)); + impl->pending_select_paths = + g_slist_prepend (impl->pending_select_paths, gtk_file_path_copy (path)); } /* Used from gtk_tree_selection_selected_foreach() */ @@ -972,7 +973,7 @@ error_dialog (GtkFileChooserDefault *impl, const GtkFilePath *path, GError *error) { - if (error) + if (G_LIKELY (error)) { char *uri = NULL; char *text; @@ -1042,9 +1043,9 @@ error_creating_folder_over_existing_file_dialog (GtkFileChooserDefault *impl, GError *error) { error_dialog (impl, - _("The folder could not be created, as a file with the same name " - "already exists. Try using a different name for the folder, " - "or rename the file first."), + _("The folder could not be created, as a file with the same " + "name already exists. Try using a different name for the " + "folder, or rename the file first."), path, error); } @@ -3210,9 +3211,11 @@ shortcuts_drag_motion_cb (GtkWidget *widget, } #endif - if (context->suggested_action == GDK_ACTION_COPY || (context->actions & GDK_ACTION_COPY) != 0) + if (context->suggested_action == GDK_ACTION_COPY || + (context->actions & GDK_ACTION_COPY) != 0) action = GDK_ACTION_COPY; - else if (context->suggested_action == GDK_ACTION_MOVE || (context->actions & GDK_ACTION_MOVE) != 0) + else if (context->suggested_action == GDK_ACTION_MOVE || + (context->actions & GDK_ACTION_MOVE) != 0) action = GDK_ACTION_MOVE; else { @@ -4760,8 +4763,8 @@ location_mode_set (GtkFileChooserDefault *impl, LocationMode new_mode, gboolean set_button) { - if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN - || impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER) + if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN || + impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER) { GtkWindow *toplevel; GtkWidget *current_focus; @@ -5226,7 +5229,8 @@ gtk_file_chooser_default_set_property (GObject *object, { gtk_file_chooser_default_unselect_all (GTK_FILE_CHOOSER (impl)); - if ((action == GTK_FILE_CHOOSER_ACTION_SAVE || action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER) + if ((action == GTK_FILE_CHOOSER_ACTION_SAVE || + action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER) && impl->select_multiple) { g_warning ("Tried to change the file chooser action to SAVE or CREATE_FOLDER, but " @@ -5273,7 +5277,8 @@ gtk_file_chooser_default_set_property (GObject *object, case GTK_FILE_CHOOSER_PROP_SELECT_MULTIPLE: { gboolean select_multiple = g_value_get_boolean (value); - if ((impl->action == GTK_FILE_CHOOSER_ACTION_SAVE || impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER) + if ((impl->action == GTK_FILE_CHOOSER_ACTION_SAVE || + impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER) && select_multiple) { g_warning ("Tried to set the file chooser to multiple selection mode, but this is " @@ -5578,8 +5583,8 @@ settings_notify_cb (GObject *object, name = g_param_spec_get_name (pspec); - if (strcmp (name, "gtk-icon-theme-name") == 0 - || strcmp (name, "gtk-icon-sizes") == 0) + if (strcmp (name, "gtk-icon-theme-name") == 0 || + strcmp (name, "gtk-icon-sizes") == 0) change_icon_theme (impl); profile_end ("end", NULL); @@ -5860,8 +5865,8 @@ install_list_model_filter (GtkFileChooserDefault *impl) #define COMPARE_DIRECTORIES \ GtkFileChooserDefault *impl = user_data; \ - const GtkFileInfo *info_a = _gtk_file_system_model_get_info (impl->browse_files_model, a); \ - const GtkFileInfo *info_b = _gtk_file_system_model_get_info (impl->browse_files_model, b); \ + const GtkFileInfo *info_a = _gtk_file_system_model_get_info (impl->browse_files_model, a); \ + const GtkFileInfo *info_b = _gtk_file_system_model_get_info (impl->browse_files_model, b); \ gboolean dir_a, dir_b; \ \ if (info_a) \ @@ -6687,7 +6692,7 @@ gtk_file_chooser_default_update_current_folder (GtkFileChooser *chooser, profile_start ("start", (char *) path); - search_switch_to_browse_mode (impl); + search_switch_to_browse_mode (impl); g_assert (path != NULL); @@ -6758,8 +6763,8 @@ gtk_file_chooser_default_set_current_name (GtkFileChooser *chooser, { GtkFileChooserDefault *impl = GTK_FILE_CHOOSER_DEFAULT (chooser); - g_return_if_fail (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE - || impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER); + g_return_if_fail (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE || + impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER); pending_select_paths_free (impl); _gtk_file_chooser_entry_set_file_part (GTK_FILE_CHOOSER_ENTRY (impl->location_entry), name); @@ -8792,7 +8797,7 @@ search_setup_widgets (GtkFileChooserDefault *impl) /* Label */ label = gtk_label_new (NULL); - text = g_strdup_printf ("%s", _("Search:")); + text = g_strconcat ("", _("Search:"), "", NULL); gtk_label_set_markup (GTK_LABEL (label), text); g_free (text); gtk_box_pack_start (GTK_BOX (impl->search_hbox), label, FALSE, FALSE, 0); -- 1.4.4.2