Commit d9fcc4c6 authored by Matthias Clasen's avatar Matthias Clasen

Silence new gcc warnings

gcc 4.6.0 has started to warn about set-but-unused variables.
So don't do that, then.
parent 94c4a312
This diff is collapsed.
......@@ -418,7 +418,6 @@ gtk_button_box_child_requisition (GtkWidget *widget,
gint **widths,
gint **heights)
{
GtkButtonBoxPrivate *priv;
GtkButtonBox *bbox;
GList *children, *list;
gint nchildren;
......@@ -439,7 +438,6 @@ gtk_button_box_child_requisition (GtkWidget *widget,
g_return_if_fail (GTK_IS_BUTTON_BOX (widget));
bbox = GTK_BUTTON_BOX (widget);
priv = bbox->priv;
homogeneous = gtk_box_get_homogeneous (GTK_BOX (widget));
......
......@@ -1566,7 +1566,6 @@ _gtk_button_paint (GtkButton *button,
gint focus_width;
gint focus_pad;
GtkAllocation allocation;
GdkWindow *window;
GtkStyleContext *context;
widget = GTK_WIDGET (button);
......@@ -1582,7 +1581,6 @@ _gtk_button_paint (GtkButton *button,
NULL);
gtk_widget_get_allocation (widget, &allocation);
window = gtk_widget_get_window (widget);
x = 0;
y = 0;
......
This diff is collapsed.
......@@ -3574,8 +3574,7 @@ gtk_cell_area_request_renderer (GtkCellArea *area,
gint *minimum_size,
gint *natural_size)
{
GtkCellAreaPrivate *priv;
gint focus_line_width;
gint focus_line_width;
g_return_if_fail (GTK_IS_CELL_AREA (area));
g_return_if_fail (GTK_IS_CELL_RENDERER (renderer));
......@@ -3583,8 +3582,6 @@ gtk_cell_area_request_renderer (GtkCellArea *area,
g_return_if_fail (minimum_size != NULL);
g_return_if_fail (natural_size != NULL);
priv = area->priv;
gtk_widget_style_get (widget, "focus-line-width", &focus_line_width, NULL);
focus_line_width *= 2;
......
......@@ -744,14 +744,12 @@ allocate_for_orientation (GtkCellAreaBoxContext *context,
GtkCellAreaBoxContextPrivate *priv = context->priv;
GtkCellAreaBoxAllocation *allocs;
GtkRequestedSize *sizes;
GArray *array;
gint n_expand_groups = 0;
gint i, n_groups, position, vis_position;
gint extra_size, extra_extra;
gint avail_size = size;
sizes = _gtk_cell_area_box_context_get_requests (context, area, orientation, for_size, &n_groups);
array = get_array (context, orientation, for_size);
n_expand_groups = count_expand_groups (context);
/* First start by naturally allocating space among groups */
......
......@@ -1113,7 +1113,7 @@ gtk_cell_renderer_get_sensitive (GtkCellRenderer *cell)
*
* Checks whether the cell renderer can do something when activated.
*
* Returns: %TRUE if the cell renderer can do anything when activated.
* Returns: %TRUE if the cell renderer can do anything when activated
*
* Since: 3.0
*/
......@@ -1126,9 +1126,9 @@ gtk_cell_renderer_is_activatable (GtkCellRenderer *cell)
priv = cell->priv;
return (cell->priv->visible &&
(cell->priv->mode == GTK_CELL_RENDERER_MODE_EDITABLE ||
cell->priv->mode == GTK_CELL_RENDERER_MODE_ACTIVATABLE));
return (priv->visible &&
(priv->mode == GTK_CELL_RENDERER_MODE_EDITABLE ||
priv->mode == GTK_CELL_RENDERER_MODE_ACTIVATABLE));
}
......
......@@ -191,14 +191,12 @@ gtk_cell_renderer_spinner_update_size (GtkCellRendererSpinner *cell,
{
GtkCellRendererSpinnerPrivate *priv = cell->priv;
GdkScreen *screen;
GtkIconTheme *icon_theme;
GtkSettings *settings;
if (cell->priv->old_icon_size == cell->priv->icon_size)
if (priv->old_icon_size == priv->icon_size)
return;
screen = gtk_widget_get_screen (GTK_WIDGET (widget));
icon_theme = gtk_icon_theme_get_for_screen (screen);
settings = gtk_settings_get_for_screen (screen);
if (!gtk_icon_size_lookup_for_settings (settings, priv->icon_size, &priv->size, NULL))
......
......@@ -2109,14 +2109,14 @@ gtk_cell_renderer_text_get_preferred_width (GtkCellRenderer *cell,
gint *minimum_size,
gint *natural_size)
{
GtkCellRendererTextPrivate *priv;
GtkCellRendererTextPrivate *priv;
GtkCellRendererText *celltext;
GtkStyle *style;
PangoLayout *layout;
PangoContext *context;
PangoFontMetrics *metrics;
PangoRectangle rect;
gint char_width, digit_width, char_pixels, text_width, ellipsize_chars, xpad;
gint char_width, text_width, ellipsize_chars, xpad;
gint min_width, nat_width;
/* "width-chars" Hard-coded minimum width:
......@@ -2145,11 +2145,9 @@ gtk_cell_renderer_text_get_preferred_width (GtkCellRenderer *cell,
/* Fetch the average size of a charachter */
context = pango_layout_get_context (layout);
metrics = pango_context_get_metrics (context, style->font_desc,
pango_context_get_language (context));
pango_context_get_language (context));
char_width = pango_font_metrics_get_approximate_char_width (metrics);
digit_width = pango_font_metrics_get_approximate_digit_width (metrics);
char_pixels = MAX (char_width, digit_width);
pango_font_metrics_unref (metrics);
g_object_unref (layout);
......@@ -2159,12 +2157,11 @@ gtk_cell_renderer_text_get_preferred_width (GtkCellRenderer *cell,
ellipsize_chars = 3;
else
ellipsize_chars = 0;
if ((priv->ellipsize_set && priv->ellipsize != PANGO_ELLIPSIZE_NONE) || priv->width_chars > 0)
min_width =
xpad * 2 +
MIN (PANGO_PIXELS_CEIL (text_width),
(PANGO_PIXELS (char_width) * MAX (priv->width_chars, ellipsize_chars)));
min_width = xpad * 2 +
MIN (PANGO_PIXELS_CEIL (text_width),
(PANGO_PIXELS (char_width) * MAX (priv->width_chars, ellipsize_chars)));
/* If no width-chars set, minimum for wrapping text will be the wrap-width */
else if (priv->wrap_width > -1)
min_width = xpad * 2 + rect.x + MIN (PANGO_PIXELS_CEIL (text_width), priv->wrap_width);
......@@ -2172,14 +2169,13 @@ gtk_cell_renderer_text_get_preferred_width (GtkCellRenderer *cell,
min_width = xpad * 2 + rect.x + PANGO_PIXELS_CEIL (text_width);
if (priv->width_chars > 0)
nat_width = xpad * 2 +
nat_width = xpad * 2 +
MAX ((PANGO_PIXELS (char_width) * priv->width_chars), PANGO_PIXELS_CEIL (text_width));
else
nat_width = xpad * 2 + PANGO_PIXELS_CEIL (text_width);
nat_width = MAX (nat_width, min_width);
if (priv->max_width_chars > 0)
{
gint max_width = xpad * 2 + PANGO_PIXELS (char_width) * priv->max_width_chars;
......@@ -2202,14 +2198,12 @@ gtk_cell_renderer_text_get_preferred_height_for_width (GtkCellRenderer *cell,
gint *minimum_height,
gint *natural_height)
{
GtkCellRendererTextPrivate *priv;
GtkCellRendererText *celltext;
PangoLayout *layout;
gint text_height, xpad, ypad;
GtkCellRendererText *celltext;
PangoLayout *layout;
gint text_height, xpad, ypad;
celltext = GTK_CELL_RENDERER_TEXT (cell);
priv = celltext->priv;
gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
......
......@@ -506,9 +506,6 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
priv->always_show_toggle ||
(gtk_widget_get_state_flags (widget) & GTK_STATE_FLAG_PRELIGHT))
{
GdkWindow *window;
window = gtk_widget_get_window (widget);
gtk_style_context_save (context);
if (priv->inconsistent)
......
This diff is collapsed.
This diff is collapsed.
......@@ -1323,14 +1323,12 @@ gtk_css_provider_get_style (GtkStyleProvider *provider,
GtkWidgetPath *path)
{
GtkCssProvider *css_provider;
GtkCssProviderPrivate *priv;
GtkStyleProperties *props;
GArray *priority_info;
guint i;
css_provider = GTK_CSS_PROVIDER (provider);
props = gtk_style_properties_new ();
priv = css_provider->priv;
css_provider_dump_symbolic_colors (css_provider, props);
priority_info = css_provider_get_selectors (css_provider, path);
......
......@@ -245,10 +245,8 @@ static void
gtk_custom_paper_unix_dialog_class_init (GtkCustomPaperUnixDialogClass *class)
{
GObjectClass *object_class;
GtkWidgetClass *widget_class;
object_class = (GObjectClass *) class;
widget_class = (GtkWidgetClass *) class;
object_class->finalize = gtk_custom_paper_unix_dialog_finalize;
......
......@@ -3933,7 +3933,6 @@ gtk_entry_motion_notify (GtkWidget *widget,
GtkEntry *entry = GTK_ENTRY (widget);
GtkEntryPrivate *priv = entry->priv;
EntryIconInfo *icon_info = NULL;
GdkDragContext *context;
gint tmp_pos;
gint i;
......@@ -3956,11 +3955,11 @@ gtk_entry_motion_notify (GtkWidget *widget,
{
icon_info->in_drag = TRUE;
icon_info->pressed = FALSE;
context = gtk_drag_begin (widget,
icon_info->target_list,
icon_info->actions,
1,
(GdkEvent*)event);
gtk_drag_begin (widget,
icon_info->target_list,
icon_info->actions,
1,
(GdkEvent*)event);
}
return TRUE;
......@@ -3970,7 +3969,7 @@ gtk_entry_motion_notify (GtkWidget *widget,
if (priv->mouse_cursor_obscured)
{
GdkCursor *cursor;
cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), GDK_XTERM);
gdk_window_set_cursor (priv->text_area, cursor);
g_object_unref (cursor);
......
......@@ -1723,21 +1723,19 @@ model_add_special (GtkFileChooserButton *button)
static void
model_add_volumes (GtkFileChooserButton *button,
GSList *volumes)
GSList *volumes)
{
GtkListStore *store;
gint pos;
gboolean local_only;
GtkFileSystem *file_system;
GSList *l;
if (!volumes)
return;
store = GTK_LIST_STORE (button->priv->model);
pos = model_get_type_position (button, ROW_TYPE_VOLUME);
local_only = gtk_file_chooser_get_local_only (GTK_FILE_CHOOSER (button->priv->dialog));
file_system = button->priv->fs;
for (l = volumes; l; l = l->next)
{
......@@ -1749,13 +1747,13 @@ model_add_volumes (GtkFileChooserButton *button,
volume = l->data;
if (local_only)
{
if (_gtk_file_system_volume_is_mounted (volume))
{
GFile *base_file;
{
if (_gtk_file_system_volume_is_mounted (volume))
{
GFile *base_file;
base_file = _gtk_file_system_volume_get_root (volume);
if (base_file != NULL)
base_file = _gtk_file_system_volume_get_root (volume);
if (base_file != NULL)
{
if (!g_file_is_native (base_file))
{
......@@ -1765,26 +1763,26 @@ model_add_volumes (GtkFileChooserButton *button,
else
g_object_unref (base_file);
}
}
}
}
}
pixbuf = _gtk_file_system_volume_render_icon (volume,
GTK_WIDGET (button),
button->priv->icon_size,
NULL);
GTK_WIDGET (button),
button->priv->icon_size,
NULL);
display_name = _gtk_file_system_volume_get_display_name (volume);
gtk_list_store_insert (store, &iter, pos);
gtk_list_store_set (store, &iter,
ICON_COLUMN, pixbuf,
DISPLAY_NAME_COLUMN, display_name,
TYPE_COLUMN, ROW_TYPE_VOLUME,
DATA_COLUMN, _gtk_file_system_volume_ref (volume),
IS_FOLDER_COLUMN, TRUE,
-1);
ICON_COLUMN, pixbuf,
DISPLAY_NAME_COLUMN, display_name,
TYPE_COLUMN, ROW_TYPE_VOLUME,
DATA_COLUMN, _gtk_file_system_volume_ref (volume),
IS_FOLDER_COLUMN, TRUE,
-1);
if (pixbuf)
g_object_unref (pixbuf);
g_object_unref (pixbuf);
g_free (display_name);
button->priv->n_volumes++;
......@@ -2278,13 +2276,11 @@ static void
update_label_and_image (GtkFileChooserButton *button)
{
GtkFileChooserButtonPrivate *priv = button->priv;
GdkPixbuf *pixbuf;
gchar *label_text;
GSList *files;
files = gtk_file_chooser_get_files (GTK_FILE_CHOOSER (priv->dialog));
label_text = NULL;
pixbuf = NULL;
if (priv->update_button_cancellable)
{
......@@ -2301,51 +2297,53 @@ update_label_and_image (GtkFileChooserButton *button)
volume = _gtk_file_system_get_volume_for_file (priv->fs, file);
if (volume)
{
GFile *base_file;
base_file = _gtk_file_system_volume_get_root (volume);
if (base_file && g_file_equal (base_file, file))
{
label_text = _gtk_file_system_volume_get_display_name (volume);
pixbuf = _gtk_file_system_volume_render_icon (volume,
GTK_WIDGET (button),
priv->icon_size,
NULL);
}
if (base_file)
g_object_unref (base_file);
_gtk_file_system_volume_unref (volume);
if (label_text)
goto out;
}
{
GFile *base_file;
base_file = _gtk_file_system_volume_get_root (volume);
if (base_file && g_file_equal (base_file, file))
{
GdkPixbuf *pixbuf;
label_text = _gtk_file_system_volume_get_display_name (volume);
pixbuf = _gtk_file_system_volume_render_icon (volume,
GTK_WIDGET (button),
priv->icon_size,
NULL);
gtk_image_set_from_pixbuf (GTK_IMAGE (priv->image), pixbuf);
if (pixbuf)
g_object_unref (pixbuf);
}
if (base_file)
g_object_unref (base_file);
_gtk_file_system_volume_unref (volume);
if (label_text)
goto out;
}
if (g_file_is_native (file))
{
priv->update_button_cancellable =
_gtk_file_system_get_info (priv->fs, file,
"standard::icon,standard::display-name",
update_label_get_info_cb,
g_object_ref (button));
}
{
priv->update_button_cancellable =
_gtk_file_system_get_info (priv->fs, file,
"standard::icon,standard::display-name",
update_label_get_info_cb,
g_object_ref (button));
}
else
{
GdkPixbuf *pixbuf;
label_text = _gtk_file_system_get_bookmark_label (button->priv->fs, file);
pixbuf = gtk_icon_theme_load_icon (get_icon_theme (GTK_WIDGET (priv->image)),
"text-x-generic",
priv->icon_size, 0, NULL);
gtk_image_set_from_pixbuf (GTK_IMAGE (priv->image), pixbuf);
if (pixbuf)
g_object_unref (pixbuf);
}
{
GdkPixbuf *pixbuf;
label_text = _gtk_file_system_get_bookmark_label (button->priv->fs, file);
pixbuf = gtk_icon_theme_load_icon (get_icon_theme (GTK_WIDGET (priv->image)),
"text-x-generic",
priv->icon_size, 0, NULL);
gtk_image_set_from_pixbuf (GTK_IMAGE (priv->image), pixbuf);
if (pixbuf)
g_object_unref (pixbuf);
}
}
out:
g_slist_foreach (files, (GFunc) g_object_unref, NULL);
......
......@@ -2155,7 +2155,7 @@ shortcuts_add_bookmarks (GtkFileChooserDefault *impl)
g_object_unref (combo_selected);
}
impl->changing_folder = old_changing_folders;
profile_end ("end", NULL);
......@@ -2166,12 +2166,9 @@ static void
shortcuts_add_current_folder (GtkFileChooserDefault *impl)
{
int pos;
gboolean success;
g_assert (!impl->shortcuts_current_folder_active);
success = TRUE;
g_assert (impl->current_folder != NULL);
pos = shortcut_find_position (impl, impl->current_folder);
......@@ -2181,26 +2178,24 @@ shortcuts_add_current_folder (GtkFileChooserDefault *impl)
GFile *base_file;
/* Separator */
shortcuts_insert_separator (impl, SHORTCUTS_CURRENT_FOLDER_SEPARATOR);
/* Item */
pos = shortcuts_get_index (impl, SHORTCUTS_CURRENT_FOLDER);
volume = _gtk_file_system_get_volume_for_file (impl->file_system, impl->current_folder);
if (volume)
base_file = _gtk_file_system_volume_get_root (volume);
base_file = _gtk_file_system_volume_get_root (volume);
else
base_file = NULL;
base_file = NULL;
if (base_file && g_file_equal (base_file, impl->current_folder))
shortcuts_insert_file (impl, pos, SHORTCUT_TYPE_VOLUME, volume, NULL, NULL, FALSE, SHORTCUTS_CURRENT_FOLDER);
shortcuts_insert_file (impl, pos, SHORTCUT_TYPE_VOLUME, volume, NULL, NULL, FALSE, SHORTCUTS_CURRENT_FOLDER);
else
shortcuts_insert_file (impl, pos, SHORTCUT_TYPE_FILE, NULL, impl->current_folder, NULL, FALSE, SHORTCUTS_CURRENT_FOLDER);
shortcuts_insert_file (impl, pos, SHORTCUT_TYPE_FILE, NULL, impl->current_folder, NULL, FALSE, SHORTCUTS_CURRENT_FOLDER);
if (base_file)
g_object_unref (base_file);
g_object_unref (base_file);
}
else if (impl->save_folder_combo != NULL)
{
......@@ -3987,23 +3982,21 @@ out:
}
static void
file_list_drag_data_received_cb (GtkWidget *widget,
GdkDragContext *context,
gint x,
gint y,
GtkSelectionData *selection_data,
guint info,
guint time_,
gpointer data)
file_list_drag_data_received_cb (GtkWidget *widget,
GdkDragContext *context,
gint x,
gint y,
GtkSelectionData *selection_data,
guint info,
guint time_,
gpointer data)
{
GtkFileChooserDefault *impl;
GtkFileChooser *chooser;
gchar **uris;
char *uri;
GFile *file;
impl = GTK_FILE_CHOOSER_DEFAULT (data);
chooser = GTK_FILE_CHOOSER (data);
/* Allow only drags from other widgets; see bug #533891. */
if (gtk_drag_get_source_widget (context) == widget)
......@@ -4027,13 +4020,13 @@ file_list_drag_data_received_cb (GtkWidget *widget,
data->file = file;
if (impl->file_list_drag_data_received_cancellable)
g_cancellable_cancel (impl->file_list_drag_data_received_cancellable);
g_cancellable_cancel (impl->file_list_drag_data_received_cancellable);
impl->file_list_drag_data_received_cancellable =
_gtk_file_system_get_info (impl->file_system, file,
"standard::type",
file_list_drag_data_received_get_info_cb,
data);
_gtk_file_system_get_info (impl->file_system, file,
"standard::type",
file_list_drag_data_received_get_info_cb,
data);
}
g_signal_stop_emission_by_name (widget, "drag-data-received");
......@@ -4213,7 +4206,6 @@ list_button_press_event_cb (GtkWidget *widget,
GtkFileChooserDefault *impl)
{
static gboolean in_press = FALSE;
gboolean handled;
if (in_press)
return FALSE;
......@@ -4222,7 +4214,7 @@ list_button_press_event_cb (GtkWidget *widget,
return FALSE;
in_press = TRUE;
handled = gtk_widget_event (impl->browse_files_tree_view, (GdkEvent *) event);
gtk_widget_event (impl->browse_files_tree_view, (GdkEvent *) event);
in_press = FALSE;
file_list_popup_menu (impl, event);
......@@ -5747,12 +5739,8 @@ gtk_file_chooser_default_screen_changed (GtkWidget *widget,
static void
gtk_file_chooser_default_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
GtkAllocation *allocation)
{
GtkFileChooserDefault *impl;
impl = GTK_FILE_CHOOSER_DEFAULT (widget);
GTK_WIDGET_CLASS (_gtk_file_chooser_default_parent_class)->size_allocate (widget, allocation);
}
......@@ -5762,6 +5750,7 @@ set_sort_column (GtkFileChooserDefault *impl)
GtkTreeSortable *sortable;
sortable = GTK_TREE_SORTABLE (gtk_tree_view_get_model (GTK_TREE_VIEW (impl->browse_files_tree_view)));
/* can happen when we're still populating the model */
if (sortable == NULL)
return;
......@@ -6721,7 +6710,6 @@ update_chooser_entry (GtkFileChooserDefault *impl)
{
GtkTreeSelection *selection;
struct update_chooser_entry_selected_foreach_closure closure;
const char *file_part;
/* no need to update the file chooser's entry if there's no entry */
if (impl->operation_mode == OPERATION_MODE_SEARCH ||
......@@ -6730,10 +6718,10 @@ update_chooser_entry (GtkFileChooserDefault *impl)
return;
if (!(impl->action == GTK_FILE_CHOOSER_ACTION_SAVE
|| impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER
|| ((impl->action == GTK_FILE_CHOOSER_ACTION_OPEN
|| impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
&& impl->location_mode == LOCATION_MODE_FILENAME_ENTRY)))
|| impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER
|| ((impl->action == GTK_FILE_CHOOSER_ACTION_OPEN
|| impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
&& impl->location_mode == LOCATION_MODE_FILENAME_ENTRY)))
return;
g_assert (impl->location_entry != NULL);
......@@ -6742,8 +6730,6 @@ update_chooser_entry (GtkFileChooserDefault *impl)
closure.num_selected = 0;
gtk_tree_selection_selected_foreach (selection, update_chooser_entry_selected_foreach, &closure);
file_part = NULL;
if (closure.num_selected == 0)
{
goto maybe_clear_entry;
......@@ -6757,7 +6743,7 @@ update_chooser_entry (GtkFileChooserDefault *impl)
info = _gtk_file_system_model_get_info (impl->browse_files_model, &closure.first_selected_iter);
/* If the cursor moved to the row of the newly created folder,
/* If the cursor moved to the row of the newly created folder,
* retrieving info will return NULL.
*/
if (!info)
......@@ -6769,13 +6755,13 @@ update_chooser_entry (GtkFileChooserDefault *impl)
if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN ||
impl->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
{
/* We don't want the name to change when clicking on a folder... */
change_entry = (! _gtk_file_info_consider_as_directory (info));
}
impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
{
/* Don't change the name when clicking on a folder... */
change_entry = (! _gtk_file_info_consider_as_directory (info));
}
else
change_entry = TRUE; /* ... unless we are in SELECT_FOLDER mode */
change_entry = TRUE; /* ... unless we are in SELECT_FOLDER mode */
if (change_entry)
{
......@@ -6791,10 +6777,9 @@ update_chooser_entry (GtkFileChooserDefault *impl)
else
{
g_assert (!(impl->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER));
impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER));
/* Multiple selection, so just clear the entry. */
g_free (impl->browse_files_last_selected_name);
impl->browse_files_last_selected_name = NULL;
......@@ -6814,26 +6799,26 @@ update_chooser_entry (GtkFileChooserDefault *impl)
entry_text = gtk_entry_get_text (GTK_ENTRY (impl->location_entry));
len = strlen (entry_text);
if (len != 0)
{
/* The file chooser entry may have appended a "/" to its text. So
* take it out, and compare the result to the old selection.
*/
if (entry_text[len - 1] == G_DIR_SEPARATOR)
{
char *tmp;
{
/* The file chooser entry may have appended a "/" to its text.
* So take it out, and compare the result to the old selection.
*/
if (entry_text[len - 1] == G_DIR_SEPARATOR)
{
gchar *tmp;
tmp = g_strndup (entry_text, len - 1);
clear_entry = (compare_utf8_filenames (impl->browse_files_last_selected_name, tmp) == 0);
g_free (tmp);
}
else
clear_entry = (compare_utf8_filenames (impl->browse_files_last_selected_name, entry_text) == 0);
}
tmp = g_strndup (entry_text, len - 1);
clear_entry = (compare_utf8_filenames (impl->browse_files_last_selected_name, tmp) == 0);
g_free (tmp);
}
else
clear_entry = (compare_utf8_filenames (impl->browse_files_last_selected_name, entry_text) == 0);
}
else
clear_entry = FALSE;
clear_entry = FALSE;
if (clear_entry)
_gtk_file_chooser_entry_set_file_part (GTK_FILE_CHOOSER_ENTRY (impl->location_entry), "");
_gtk_file_chooser_entry_set_file_part (GTK_FILE_CHOOSER_ENTRY (impl->location_entry), "");
}
}
......@@ -7850,10 +7835,9 @@ gtk_file_chooser_default_list_shortcut_folders (GtkFileChooser *chooser)
/* Guesses a size based upon font sizes */
static void
find_good_size_from_style (GtkWidget *widget,