diff options
author | Pablo Barciela <[email protected]> | 2019-06-14 09:30:32 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2022-07-20 00:07:37 +0200 |
commit | 25ffc1e58eeb5c2faef66eba1ac58bf0ac19ff67 (patch) | |
tree | 2a79eb2b3fe44cf6b49ec1b2bf23092cbef5d6a1 /src/caja-information-panel.c | |
parent | ed722a990406ce48b353c5eb7499fa8662cdff12 (diff) | |
download | caja-25ffc1e58eeb5c2faef66eba1ac58bf0ac19ff67.tar.bz2 caja-25ffc1e58eeb5c2faef66eba1ac58bf0ac19ff67.tar.xz |
src: reduce the scope of some variables
Diffstat (limited to 'src/caja-information-panel.c')
-rw-r--r-- | src/caja-information-panel.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/caja-information-panel.c b/src/caja-information-panel.c index 2beae1c9..519751bd 100644 --- a/src/caja-information-panel.c +++ b/src/caja-information-panel.c @@ -485,7 +485,6 @@ receive_dropped_uri_list (CajaInformationPanel *information_panel, char **uris; gboolean exactly_one; GtkWindow *window; - EelBackground *background; uris = g_uri_list_extract_uris ((gchar *) gtk_selection_data_get_data (selection_data)); exactly_one = uris[0] != NULL && (uris[1] == NULL || uris[1][0] == '\0'); @@ -508,6 +507,8 @@ receive_dropped_uri_list (CajaInformationPanel *information_panel, if (action > 0) { + EelBackground *background; + background = eel_get_widget_background (GTK_WIDGET (information_panel)); eel_background_set_dropped_image (background, action, uris[0]); } @@ -579,7 +580,6 @@ receive_dropped_color (CajaInformationPanel *information_panel, { guint16 *channels; char color_spec[8]; - EelBackground *background; if (gtk_selection_data_get_length (selection_data) != 8 || gtk_selection_data_get_format (selection_data) != 16) @@ -607,6 +607,8 @@ receive_dropped_color (CajaInformationPanel *information_panel, if (action > 0) { + EelBackground *background; + background = eel_get_widget_background (GTK_WIDGET (information_panel)); eel_background_set_dropped_color (background, GTK_WIDGET (information_panel), action, x, y, selection_data); @@ -679,7 +681,6 @@ static gboolean caja_information_panel_press_event (GtkWidget *widget, GdkEventButton *event) { CajaInformationPanel *information_panel; - GtkWidget *menu; if (gtk_widget_get_window (widget) != event->window) { @@ -691,6 +692,8 @@ caja_information_panel_press_event (GtkWidget *widget, GdkEventButton *event) /* handle the context menu */ if (event->button == CONTEXTUAL_MENU_BUTTON) { + GtkWidget *menu; + menu = caja_information_panel_create_context_menu (information_panel); eel_pop_up_context_menu (GTK_MENU(menu), event); @@ -771,7 +774,6 @@ static void add_buttons_from_metadata (CajaInformationPanel *information_panel, const char *button_data) { char **terms; - char *current_term, *temp_str; char *button_name, *command_string; const char *term; int index; @@ -784,6 +786,8 @@ add_buttons_from_metadata (CajaInformationPanel *information_panel, const char * /* for each term, either create a button or attach a property to one */ for (index = 0; (term = terms[index]) != NULL; index++) { + char *current_term, *temp_str; + current_term = g_strdup (term); temp_str = strchr (current_term, '='); if (temp_str) @@ -836,7 +840,6 @@ static void caja_information_panel_update_buttons (CajaInformationPanel *information_panel) { char *button_data; - GAppInfo *default_app; /* dispose of any existing buttons */ if (information_panel->details->has_buttons) @@ -860,6 +863,8 @@ caja_information_panel_update_buttons (CajaInformationPanel *information_panel) if (caja_mime_has_any_applications_for_file (information_panel->details->file) && !caja_file_is_directory (information_panel->details->file)) { + GAppInfo *default_app; + default_app = caja_mime_get_default_application_for_file (information_panel->details->file); add_command_button (information_panel, default_app); @@ -986,8 +991,6 @@ selection_changed_callback (CajaWindowInfo *window, { int selection_count; GList *selection; - GFile *selected; - CajaFile *file; char *uri, *name; selection = caja_window_info_get_selection (window); @@ -995,6 +998,9 @@ selection_changed_callback (CajaWindowInfo *window, if (selection_count == 1) { + GFile *selected; + CajaFile *file; + selection = caja_window_info_get_selection (window); selected = selection->data; |