Fix a memory leak in the search patch

This commit is contained in:
Matthias Clasen 2007-04-09 21:10:38 +00:00
parent 083bacb5ee
commit 06435be7d6
2 changed files with 141 additions and 135 deletions

View File

@ -1,5 +1,5 @@
--- /dev/null 2007-01-30 22:42:40.851021051 -0500
+++ gtk+-2.10.9/gtk/gtksearchenginetracker.h 2007-01-30 23:27:42.000000000 -0500
--- /dev/null 2007-04-09 09:59:25.840251204 +0200
+++ gtk+-2.10.11/gtk/gtksearchenginetracker.h 2007-04-09 22:42:19.000000000 +0200
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2005 Mr Jamie McCracken
@ -60,8 +60,8 @@
+G_END_DECLS
+
+#endif /* __GTK_SEARCH_ENGINE_TRACKER_H__ */
--- /dev/null 2007-01-30 22:42:40.851021051 -0500
+++ gtk+-2.10.9/gtk/gtksearchengine.h 2007-01-30 23:27:42.000000000 -0500
--- /dev/null 2007-04-09 09:59:25.840251204 +0200
+++ gtk+-2.10.11/gtk/gtksearchengine.h 2007-04-09 22:42:19.000000000 +0200
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2005 Novell, Inc.
@ -154,8 +154,8 @@
+G_END_DECLS
+
+#endif /* __GTK_SEARCH_ENGINE_H__ */
--- /dev/null 2007-01-30 22:42:40.851021051 -0500
+++ gtk+-2.10.9/gtk/gtksearchenginebeagle.h 2007-01-30 23:27:42.000000000 -0500
--- /dev/null 2007-04-09 09:59:25.840251204 +0200
+++ gtk+-2.10.11/gtk/gtksearchenginebeagle.h 2007-04-09 22:42:19.000000000 +0200
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2005 Novell, Inc.
@ -216,8 +216,8 @@
+G_END_DECLS
+
+#endif /* __GTK_SEARCH_ENGINE_BEAGLE_H__ */
--- /dev/null 2007-01-30 22:42:40.851021051 -0500
+++ gtk+-2.10.9/gtk/gtksearchengine.c 2007-01-30 23:27:42.000000000 -0500
--- /dev/null 2007-04-09 09:59:25.840251204 +0200
+++ gtk+-2.10.11/gtk/gtksearchengine.c 2007-04-09 22:42:19.000000000 +0200
@@ -0,0 +1,197 @@
+/*
+ * Copyright (C) 2005 Novell, Inc.
@ -416,8 +416,8 @@
+
+ g_signal_emit (engine, signals[ERROR], 0, error_message);
+}
--- /dev/null 2007-01-30 22:42:40.851021051 -0500
+++ gtk+-2.10.9/gtk/gtksearchenginetracker.c 2007-01-30 23:27:42.000000000 -0500
--- /dev/null 2007-04-09 09:59:25.840251204 +0200
+++ gtk+-2.10.11/gtk/gtksearchenginetracker.c 2007-04-09 22:42:19.000000000 +0200
@@ -0,0 +1,362 @@
+/*
+ * Copyright (C) 2005 Mr Jamie McCracken
@ -781,8 +781,8 @@
+
+ return GTK_SEARCH_ENGINE (engine);
+}
--- gtk+-2.10.9/gtk/Makefile.am.search 2007-01-22 10:48:04.000000000 -0500
+++ gtk+-2.10.9/gtk/Makefile.am 2007-01-30 23:27:42.000000000 -0500
--- gtk+-2.10.11/gtk/Makefile.am.search 2007-03-14 05:07:06.000000000 +0100
+++ gtk+-2.10.11/gtk/Makefile.am 2007-04-09 22:42:19.000000000 +0200
@@ -332,6 +332,11 @@
# GTK+ header files that don't get installed
@ -807,9 +807,9 @@
fnmatch.c \
gtkaboutdialog.c \
gtkaccelgroup.c \
--- gtk+-2.10.9/gtk/gtkfilechooserdefault.c.search 2007-01-22 10:48:04.000000000 -0500
+++ gtk+-2.10.9/gtk/gtkfilechooserdefault.c 2007-01-30 23:27:42.000000000 -0500
@@ -78,6 +78,8 @@
--- gtk+-2.10.11/gtk/gtkfilechooserdefault.c.search 2007-03-14 05:07:03.000000000 +0100
+++ gtk+-2.10.11/gtk/gtkfilechooserdefault.c 2007-04-09 22:46:41.000000000 +0200
@@ -79,6 +79,8 @@
#include <errno.h>
#include <string.h>
#include <time.h>
@ -818,7 +818,7 @@
@@ -171,13 +173,20 @@
@@ -172,13 +174,20 @@
SHORTCUTS_COL_PIXBUF,
SHORTCUTS_COL_NAME,
SHORTCUTS_COL_DATA,
@ -840,7 +840,7 @@
/* Column numbers for the file list */
enum {
FILE_LIST_COL_NAME,
@@ -186,6 +195,16 @@
@@ -187,6 +196,16 @@
FILE_LIST_COL_NUM_COLUMNS
};
@ -857,7 +857,7 @@
/* Identifiers for target types */
enum {
GTK_TREE_MODEL_ROW,
@@ -225,9 +244,19 @@
@@ -226,9 +245,19 @@
static const int num_file_list_dest_targets = (sizeof (file_list_dest_targets)
/ sizeof (file_list_dest_targets[0]));
@ -877,7 +877,7 @@
SHORTCUTS_HOME,
SHORTCUTS_DESKTOP,
SHORTCUTS_VOLUMES,
@@ -419,6 +448,14 @@
@@ -420,6 +449,14 @@
GtkFileChooserDefault *impl);
static void location_switch_to_path_bar (GtkFileChooserDefault *impl);
@ -892,7 +892,7 @@
@@ -428,26 +465,26 @@
@@ -429,26 +466,26 @@
GtkTreeModelFilter parent;
GtkFileChooserDefault *impl;
@ -930,7 +930,7 @@
@@ -663,6 +700,7 @@
@@ -664,6 +701,7 @@
impl->reload_state = RELOAD_EMPTY;
impl->pending_select_paths = NULL;
impl->location_mode = LOCATION_MODE_PATH_BAR;
@ -938,7 +938,7 @@
gtk_box_set_spacing (GTK_BOX (impl), 12);
@@ -678,22 +716,24 @@
@@ -679,22 +717,24 @@
GtkTreeIter *iter)
{
gpointer col_data;
@ -967,7 +967,7 @@
{
GtkFileSystemVolume *volume;
@@ -704,6 +744,8 @@
@@ -705,6 +745,8 @@
{
GtkFilePath *path;
@ -976,7 +976,7 @@
path = col_data;
gtk_file_path_free (path);
}
@@ -790,8 +832,11 @@
@@ -791,8 +833,11 @@
GtkFileChooserDefault *impl = GTK_FILE_CHOOSER_DEFAULT (object);
GSList *l;
@ -990,16 +990,17 @@
shortcuts_free (impl);
@@ -829,6 +874,8 @@
@@ -829,6 +874,9 @@
if (impl->sort_model)
g_object_unref (impl->sort_model);
+ search_clear_model (impl, FALSE);
+
+ search_stop_searching (impl);
+ search_clear_model (impl, FALSE);
g_free (impl->preview_display_name);
g_free (impl->edited_new_text);
@@ -1080,6 +1127,14 @@
@@ -1081,6 +1129,14 @@
update_preview_widget_visibility (impl);
}
@ -1014,7 +1015,7 @@
/* Re-reads all the icons for the shortcuts, used when the theme changes */
struct ReloadIconsData
{
@@ -1150,19 +1205,20 @@
@@ -1151,19 +1207,20 @@
do
{
gpointer data;
@ -1039,7 +1040,7 @@
{
GtkFileSystemVolume *volume;
@@ -1177,46 +1233,53 @@
@@ -1178,46 +1235,53 @@
if (pixbuf)
g_object_unref (pixbuf);
}
@ -1132,7 +1133,7 @@
}
}
}
@@ -1348,7 +1411,6 @@
@@ -1349,7 +1413,6 @@
{
gint pos = -1;
gboolean cancelled = handle->cancelled;
@ -1140,7 +1141,7 @@
GdkPixbuf *pixbuf;
GtkTreePath *path;
GtkTreeIter iter;
@@ -1413,12 +1475,15 @@
@@ -1414,12 +1477,15 @@
SHORTCUTS_COL_PIXBUF, pixbuf,
SHORTCUTS_COL_PIXBUF_VISIBLE, TRUE,
SHORTCUTS_COL_NAME, request->label_copy,
@ -1159,7 +1160,7 @@
if (request->type == SHORTCUTS_CURRENT_FOLDER
&& request->impl->save_folder_combo != NULL)
@@ -1430,7 +1495,7 @@
@@ -1431,7 +1497,7 @@
g_signal_handlers_block_by_func (request->impl->save_folder_combo,
G_CALLBACK (save_folder_combo_changed_cb),
request->impl);
@ -1168,7 +1169,7 @@
g_signal_handlers_unblock_by_func (request->impl->save_folder_combo,
G_CALLBACK (save_folder_combo_changed_cb),
request->impl);
@@ -1504,7 +1569,7 @@
@@ -1505,7 +1571,7 @@
static void
shortcuts_insert_path (GtkFileChooserDefault *impl,
int pos,
@ -1177,7 +1178,7 @@
GtkFileSystemVolume *volume,
const GtkFilePath *path,
const char *label,
@@ -1517,79 +1582,89 @@
@@ -1518,79 +1584,89 @@
GtkTreeIter iter;
GtkIconTheme *icon_theme;
@ -1324,7 +1325,7 @@
}
if (pos == -1)
@@ -1604,13 +1679,16 @@
@@ -1605,13 +1681,16 @@
SHORTCUTS_COL_PIXBUF_VISIBLE, TRUE,
SHORTCUTS_COL_NAME, label_copy,
SHORTCUTS_COL_DATA, data,
@ -1344,7 +1345,7 @@
if (type == SHORTCUTS_CURRENT_FOLDER && impl->save_folder_combo != NULL)
{
@@ -1622,7 +1700,8 @@
@@ -1623,7 +1702,8 @@
g_signal_handlers_block_by_func (impl->save_folder_combo,
G_CALLBACK (save_folder_combo_changed_cb),
impl);
@ -1354,7 +1355,7 @@
g_signal_handlers_unblock_by_func (impl->save_folder_combo,
G_CALLBACK (save_folder_combo_changed_cb),
impl);
@@ -1636,6 +1715,30 @@
@@ -1637,6 +1717,30 @@
profile_end ("end", NULL);
}
@ -1385,7 +1386,7 @@
/* Appends an item for the user's home directory to the shortcuts model */
static void
shortcuts_append_home (GtkFileChooserDefault *impl)
@@ -1654,7 +1757,8 @@
@@ -1655,7 +1759,8 @@
home_path = gtk_file_system_filename_to_path (impl->file_system, home);
@ -1395,7 +1396,7 @@
gtk_file_path_free (home_path);
@@ -1687,7 +1791,9 @@
@@ -1688,7 +1793,9 @@
path = gtk_file_system_filename_to_path (impl->file_system, name);
g_free (name);
@ -1406,7 +1407,7 @@
/* We do not actually pop up an error dialog if there is no desktop directory
* because some people may really not want to have one.
*/
@@ -1726,7 +1832,7 @@
@@ -1727,7 +1834,7 @@
label = gtk_file_system_get_bookmark_label (impl->file_system, path);
/* NULL GError, but we don't really want to show error boxes here */
@ -1415,7 +1416,7 @@
num_inserted++;
g_free (label);
@@ -1745,6 +1851,16 @@
@@ -1746,6 +1853,16 @@
int n;
n = 0;
@ -1432,7 +1433,7 @@
if (where == SHORTCUTS_HOME)
goto out;
@@ -1842,15 +1958,18 @@
@@ -1843,15 +1960,18 @@
}
}
@ -1454,7 +1455,7 @@
impl->changing_folder = old_changing_folders;
@@ -1860,11 +1979,13 @@
@@ -1861,11 +1981,13 @@
/* Inserts a separator node in the shortcuts list */
static void
shortcuts_insert_separator (GtkFileChooserDefault *impl,
@ -1470,7 +1471,7 @@
gtk_list_store_insert (impl->shortcuts_model, &iter,
shortcuts_get_index (impl, where));
@@ -1873,6 +1994,7 @@
@@ -1874,6 +1996,7 @@
SHORTCUTS_COL_PIXBUF_VISIBLE, FALSE,
SHORTCUTS_COL_NAME, NULL,
SHORTCUTS_COL_DATA, NULL,
@ -1478,7 +1479,7 @@
-1);
}
@@ -1885,7 +2007,7 @@
@@ -1886,7 +2009,7 @@
GtkTreeIter iter;
GtkFilePath *list_selected = NULL;
GtkFilePath *combo_selected = NULL;
@ -1487,7 +1488,7 @@
gpointer col_data;
profile_start ("start", NULL);
@@ -1898,10 +2020,10 @@
@@ -1899,10 +2022,10 @@
gtk_tree_model_get (GTK_TREE_MODEL (impl->shortcuts_model),
&iter,
SHORTCUTS_COL_DATA, &col_data,
@ -1500,7 +1501,7 @@
list_selected = gtk_file_path_copy (col_data);
}
@@ -1909,13 +2031,18 @@
@@ -1910,13 +2033,18 @@
gtk_combo_box_get_active_iter (GTK_COMBO_BOX (impl->save_folder_combo),
&iter))
{
@ -1522,7 +1523,7 @@
combo_selected = gtk_file_path_copy (col_data);
}
@@ -1933,8 +2060,11 @@
@@ -1934,8 +2062,11 @@
if (impl->num_bookmarks > 0)
shortcuts_insert_separator (impl, SHORTCUTS_BOOKMARKS_SEPARATOR);
@ -1536,7 +1537,7 @@
if (list_selected)
{
@@ -1948,8 +2078,8 @@
@@ -1949,8 +2080,8 @@
pos = shortcut_find_position (impl, combo_selected);
if (pos != -1)
@ -1547,7 +1548,7 @@
gtk_file_path_free (combo_selected);
}
@@ -1994,11 +2124,11 @@
@@ -1995,11 +2126,11 @@
if (base_path &&
strcmp (gtk_file_path_get_string (base_path), gtk_file_path_get_string (impl->current_folder)) == 0)
{
@ -1561,7 +1562,7 @@
if (volume)
gtk_file_system_volume_free (impl->file_system, volume);
}
@@ -2007,7 +2137,8 @@
@@ -2008,7 +2139,8 @@
gtk_file_path_free (base_path);
}
else if (impl->save_folder_combo != NULL)
@ -1571,7 +1572,7 @@
}
/* Updates the current folder row in the shortcuts model */
@@ -2029,9 +2160,9 @@
@@ -2030,9 +2162,9 @@
/* Filter function used for the shortcuts filter model */
static gboolean
@ -1584,7 +1585,7 @@
{
GtkFileChooserDefault *impl;
GtkTreePath *path;
@@ -2058,11 +2189,17 @@
@@ -2059,11 +2191,17 @@
GDK_TYPE_PIXBUF, /* pixbuf */
G_TYPE_STRING, /* name */
G_TYPE_POINTER, /* path or volume */
@ -1603,7 +1604,7 @@
if (impl->file_system)
{
shortcuts_append_home (impl);
@@ -2070,12 +2207,12 @@
@@ -2071,12 +2209,12 @@
shortcuts_add_volumes (impl);
}
@ -1621,7 +1622,7 @@
impl,
NULL);
}
@@ -2293,16 +2430,16 @@
@@ -2294,16 +2432,16 @@
for (i = 0; i < current_folder_separator_idx; i++)
{
gpointer col_data;
@ -1641,7 +1642,7 @@
{
GtkFileSystemVolume *volume;
GtkFilePath *base_path;
@@ -2318,7 +2455,7 @@
@@ -2319,7 +2457,7 @@
if (exists)
return i;
}
@ -1650,7 +1651,7 @@
{
GtkFilePath *model_path;
@@ -2424,7 +2561,7 @@
@@ -2425,7 +2563,7 @@
if (!gtk_tree_selection_get_selected (selection, NULL, &parent_iter))
return FALSE;
@ -1659,7 +1660,7 @@
iter,
&parent_iter);
return TRUE;
@@ -2447,11 +2584,12 @@
@@ -2448,11 +2586,12 @@
SHORTCUTS_COL_DATA, &col_data,
SHORTCUTS_COL_REMOVABLE, &removable,
-1);
@ -1673,7 +1674,7 @@
path = col_data;
error = NULL;
@@ -2608,6 +2746,16 @@
@@ -2609,6 +2748,16 @@
gboolean active;
gchar *tip;
@ -1690,7 +1691,7 @@
selection_check (impl, &num_selected, NULL, &all_folders);
if (num_selected == 0)
@@ -3121,7 +3269,7 @@
@@ -3122,7 +3271,7 @@
{
GtkTreeIter iter;
gpointer col_data;
@ -1699,7 +1700,7 @@
GtkTreePath *path;
int old_position;
int bookmarks_index;
@@ -3146,10 +3294,10 @@
@@ -3147,10 +3296,10 @@
gtk_tree_model_get (GTK_TREE_MODEL (impl->shortcuts_model), &iter,
SHORTCUTS_COL_NAME, &name,
SHORTCUTS_COL_DATA, &col_data,
@ -1712,7 +1713,7 @@
file_path = col_data;
file_path_copy = gtk_file_path_copy (file_path); /* removal below will free file_path, so we need a copy */
@@ -3233,17 +3381,11 @@
@@ -3234,17 +3383,11 @@
GtkTreeIter *iter,
gpointer data)
{
@ -1733,7 +1734,7 @@
}
/* Since GtkTreeView has a keybinding attached to '/', we need to catch
@@ -3488,7 +3630,7 @@
@@ -3489,7 +3632,7 @@
/* Accessible object name for the file chooser's shortcuts pane */
atk_object_set_name (gtk_widget_get_accessible (impl->browse_shortcuts_tree_view), _("Places"));
@ -1742,7 +1743,7 @@
gtk_tree_view_enable_model_drag_source (GTK_TREE_VIEW (impl->browse_shortcuts_tree_view),
GDK_BUTTON1_MASK,
@@ -3561,8 +3703,7 @@
@@ -3562,8 +3705,7 @@
gtk_tree_view_set_row_separator_func (GTK_TREE_VIEW (impl->browse_shortcuts_tree_view),
shortcuts_row_separator_func,
@ -1752,7 +1753,7 @@
gtk_tree_view_append_column (GTK_TREE_VIEW (impl->browse_shortcuts_tree_view), column);
@@ -3933,6 +4074,8 @@
@@ -3934,6 +4076,8 @@
{
file_list_build_popup_menu (impl);
@ -1761,7 +1762,7 @@
/* The sensitivity of the Add to Bookmarks item is set in
* bookmarks_check_add_sensitivity()
*/
@@ -4032,6 +4175,28 @@
@@ -4033,6 +4177,28 @@
return TRUE;
}
@ -1790,7 +1791,7 @@
/* Creates the widgets for the file list */
static GtkWidget *
create_file_list (GtkFileChooserDefault *impl)
@@ -4045,7 +4210,7 @@
@@ -4046,7 +4212,7 @@
swin = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swin),
@ -1799,7 +1800,7 @@
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (swin),
GTK_SHADOW_IN);
@@ -4135,6 +4300,7 @@
@@ -4136,6 +4302,7 @@
gtk_tree_view_column_set_sort_column_id (column, FILE_LIST_COL_SIZE);
gtk_tree_view_append_column (GTK_TREE_VIEW (impl->browse_files_tree_view), column);
#endif
@ -1807,7 +1808,7 @@
/* Modification time column */
column = gtk_tree_view_column_new ();
@@ -4145,8 +4311,11 @@
@@ -4146,8 +4313,11 @@
gtk_tree_view_column_pack_start (column, renderer, TRUE);
gtk_tree_view_column_set_cell_data_func (column, renderer,
list_mtime_data_func, impl, NULL);
@ -1820,7 +1821,7 @@
gtk_widget_show_all (swin);
return swin;
@@ -4254,9 +4423,59 @@
@@ -4255,9 +4425,59 @@
return;
if (gtk_combo_box_get_active_iter (combo, &iter))
@ -1881,7 +1882,7 @@
/* Creates the combo box with the save folders */
static GtkWidget *
save_folder_combo_create (GtkFileChooserDefault *impl)
@@ -4264,8 +4483,14 @@
@@ -4265,8 +4485,14 @@
GtkWidget *combo;
GtkCellRenderer *cell;
@ -1897,7 +1898,7 @@
"focus-on-click", FALSE,
NULL);
gtk_widget_show (combo);
@@ -4287,8 +4512,7 @@
@@ -4288,8 +4514,7 @@
gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (combo),
shortcuts_row_separator_func,
@ -1907,7 +1908,7 @@
g_signal_connect (combo, "changed",
G_CALLBACK (save_folder_combo_changed_cb), impl);
@@ -4622,6 +4846,7 @@
@@ -4622,6 +4847,7 @@
hbox = gtk_hbox_new (FALSE, 12);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
@ -1915,7 +1916,7 @@
location_button_create (impl);
gtk_box_pack_start (GTK_BOX (hbox), impl->location_button, FALSE, FALSE, 0);
@@ -5210,6 +5435,9 @@
@@ -5206,6 +5432,9 @@
impl->shortcuts_activate_iter_handle = NULL;
}
@ -1925,7 +1926,7 @@
remove_settings_signal (impl, gtk_widget_get_screen (GTK_WIDGET (impl)));
G_OBJECT_CLASS (_gtk_file_chooser_default_parent_class)->dispose (object);
@@ -5487,31 +5715,32 @@
@@ -5483,31 +5712,32 @@
GTK_WIDGET_CLASS (_gtk_file_chooser_default_parent_class)->map (widget);
@ -1983,7 +1984,7 @@
bookmarks_changed_cb (impl->file_system, impl);
@@ -5982,12 +6211,6 @@
@@ -5978,12 +6208,6 @@
* but rather on behalf of something else like GtkFileChooserButton. In
* that case, the chooser's selection should be what the caller expects,
* as the user can't see that something else got selected. See bug #165264.
@ -1996,7 +1997,7 @@
*/
if (GTK_WIDGET_MAPPED (impl) && impl->action == GTK_FILE_CHOOSER_ACTION_OPEN)
browse_files_select_first_row (impl);
@@ -6034,17 +6257,11 @@
@@ -6030,17 +6254,11 @@
profile_end ("end", NULL);
}
@ -2017,7 +2018,7 @@
if (impl->browse_files_model)
{
g_object_unref (impl->browse_files_model);
@@ -6056,6 +6273,20 @@
@@ -6052,6 +6270,20 @@
g_object_unref (impl->sort_model);
impl->sort_model = NULL;
}
@ -2038,7 +2039,7 @@
set_busy_cursor (impl, TRUE);
gtk_tree_view_set_model (GTK_TREE_VIEW (impl->browse_files_tree_view), NULL);
@@ -6130,6 +6361,9 @@
@@ -6126,6 +6358,9 @@
struct update_chooser_entry_selected_foreach_closure closure;
const char *file_part;
@ -2048,7 +2049,7 @@
if (!(impl->action == GTK_FILE_CHOOSER_ACTION_SAVE
|| impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER
|| ((impl->action == GTK_FILE_CHOOSER_ACTION_OPEN
@@ -6151,35 +6385,40 @@
@@ -6147,35 +6382,40 @@
}
else if (closure.num_selected == 1)
{
@ -2117,7 +2118,7 @@
}
else
{
@@ -6386,6 +6625,8 @@
@@ -6382,6 +6622,8 @@
profile_start ("start", (char *) path);
@ -2126,7 +2127,7 @@
g_assert (path != NULL);
if (impl->local_only &&
@@ -6427,6 +6668,9 @@
@@ -6423,6 +6665,9 @@
{
GtkFileChooserDefault *impl = GTK_FILE_CHOOSER_DEFAULT (chooser);
@ -2136,7 +2137,7 @@
if (impl->reload_state == RELOAD_EMPTY)
{
char *current_working_dir;
@@ -6487,9 +6731,9 @@
@@ -6483,9 +6728,9 @@
return FALSE;
if (!parent_path)
@ -2148,7 +2149,7 @@
same_path = FALSE;
else
{
@@ -6585,6 +6829,16 @@
@@ -6581,6 +6826,16 @@
gtk_file_chooser_default_select_all (GtkFileChooser *chooser)
{
GtkFileChooserDefault *impl = GTK_FILE_CHOOSER_DEFAULT (chooser);
@ -2165,7 +2166,7 @@
if (impl->select_multiple)
gtk_tree_model_foreach (GTK_TREE_MODEL (impl->sort_model),
maybe_select, impl);
@@ -6714,6 +6968,10 @@
@@ -6720,6 +6975,10 @@
struct get_paths_closure info;
GtkWindow *toplevel;
GtkWidget *current_focus;
@ -2176,7 +2177,7 @@
info.impl = impl;
info.result = NULL;
@@ -6725,12 +6983,14 @@
@@ -6731,12 +6990,14 @@
else
current_focus = NULL;
@ -2191,7 +2192,7 @@
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (impl->browse_files_tree_view));
gtk_tree_selection_selected_foreach (selection, get_paths_foreach, &info);
@@ -6765,8 +7025,12 @@
@@ -6771,8 +7032,12 @@
return NULL;
}
@ -2206,7 +2207,7 @@
}
else if (impl->toplevel_last_focus_widget == impl->browse_files_tree_view)
goto file_list;
@@ -6935,7 +7199,7 @@
@@ -6941,7 +7206,7 @@
pos = shortcuts_get_pos_for_shortcut_folder (data->impl, data->impl->num_shortcuts);
@ -2215,7 +2216,7 @@
out:
g_object_unref (data->impl);
@@ -7049,15 +7313,15 @@
@@ -7055,15 +7320,15 @@
for (i = 0; i < impl->num_shortcuts; i++)
{
gpointer col_data;
@ -2234,7 +2235,7 @@
shortcut = col_data;
if (gtk_file_path_compare (shortcut, path) == 0)
@@ -7106,15 +7370,15 @@
@@ -7112,15 +7377,15 @@
for (i = 0; i < impl->num_shortcuts; i++)
{
gpointer col_data;
@ -2253,7 +2254,7 @@
shortcut = col_data;
list = g_slist_prepend (list, gtk_file_path_copy (shortcut));
@@ -7449,6 +7713,23 @@
@@ -7455,6 +7720,23 @@
}
}
@ -2277,7 +2278,7 @@
static void
action_create_folder_cb (GtkFileSystemHandle *handle,
const GtkFilePath *path,
@@ -7714,6 +7995,9 @@
@@ -7720,6 +8002,9 @@
g_assert (impl->action >= GTK_FILE_CHOOSER_ACTION_OPEN && impl->action <= GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER);
@ -2287,7 +2288,7 @@
selection_check (impl, &num_selected, &all_files, &all_folders);
if (num_selected > 2)
@@ -7850,7 +8134,7 @@
@@ -7856,7 +8141,7 @@
{
shortcuts_activate_iter (impl, &iter);
@ -2296,7 +2297,7 @@
}
else
goto file_list;
@@ -7864,6 +8148,11 @@
@@ -7870,6 +8155,11 @@
*/
goto file_list;
}
@ -2308,7 +2309,7 @@
else if (impl->location_entry && impl->toplevel_last_focus_widget == impl->location_entry)
{
/* The focus is on a dialog's action area button, *and* the widget that
@@ -7913,15 +8202,453 @@
@@ -7919,15 +8209,453 @@
gtk_widget_grab_focus (widget);
}
@ -2768,7 +2769,7 @@
*/
filter_index = g_slist_index (impl->filters, filter);
if (impl->filters && filter && filter_index < 0)
@@ -7961,28 +8688,44 @@
@@ -7967,28 +8695,44 @@
{
GtkTreePath *cursor_path;
const GtkFilePath *new_path;
@ -2830,7 +2831,7 @@
}
if (new_path != impl->preview_path &&
@@ -7998,7 +8741,7 @@
@@ -8004,7 +8748,7 @@
if (new_path)
{
impl->preview_path = gtk_file_path_copy (new_path);
@ -2839,7 +2840,7 @@
}
else
{
@@ -8067,6 +8810,8 @@
@@ -8073,6 +8817,8 @@
{
GtkFilePath *path;
@ -2848,7 +2849,7 @@
/* We ref the file chooser since volume_mount() may run a main loop, and the
* user could close the file chooser window in the meantime.
*/
@@ -8087,6 +8832,8 @@
@@ -8093,6 +8839,8 @@
if (path != NULL)
{
change_folder_and_display_error (impl, path);
@ -2857,7 +2858,7 @@
gtk_file_path_free (path);
}
}
@@ -8119,7 +8866,10 @@
@@ -8125,7 +8873,10 @@
goto out;
if (!error && gtk_file_info_get_is_folder (info))
@ -2869,7 +2870,7 @@
else
gtk_file_chooser_default_select_path (GTK_FILE_CHOOSER (data->impl), data->path, NULL);
@@ -8136,26 +8886,25 @@
@@ -8142,26 +8893,25 @@
GtkTreeIter *iter)
{
gpointer col_data;
@ -2901,7 +2902,7 @@
{
GtkFileSystemVolume *volume;
@@ -8163,7 +8912,7 @@
@@ -8169,7 +8919,7 @@
shortcuts_activate_volume (impl, volume);
}
@ -2910,7 +2911,7 @@
{
struct ShortcutsActivateData *data;
@@ -8176,6 +8925,10 @@
@@ -8182,6 +8932,10 @@
GTK_FILE_INFO_IS_FOLDER,
shortcuts_activate_get_info_cb, data);
}
@ -2921,7 +2922,7 @@
}
/* Callback used when a row in the shortcuts list is activated */
@@ -8188,15 +8941,13 @@
@@ -8194,15 +8948,13 @@
GtkTreeIter iter;
GtkTreeIter child_iter;
@ -2939,7 +2940,7 @@
}
/* Handler for GtkWidget::key-press-event on the shortcuts list */
@@ -8236,8 +8987,15 @@
@@ -8242,8 +8994,15 @@
gpointer data)
{
GtkFileChooserDefault *impl = data;
@ -2956,7 +2957,7 @@
}
static gboolean
@@ -8249,6 +9007,9 @@
@@ -8255,6 +9014,9 @@
{
GtkFileChooserDefault *impl = data;
@ -2966,7 +2967,7 @@
if (impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ||
impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
{
@@ -8274,7 +9035,7 @@
@@ -8280,7 +9042,7 @@
GtkFileChooserDefault *impl)
{
/* See if we are in the new folder editable row for Save mode */
@ -2975,7 +2976,7 @@
{
const GtkFileInfo *info;
gboolean had_selection;
@@ -8289,6 +9050,8 @@
@@ -8295,6 +9057,8 @@
out:
@ -2984,7 +2985,7 @@
update_chooser_entry (impl);
check_preview_change (impl);
bookmarks_check_add_sensitivity (impl);
@@ -8306,6 +9069,12 @@
@@ -8312,6 +9076,12 @@
GtkTreeIter iter, child_iter;
const GtkFileInfo *info;
@ -2997,7 +2998,7 @@
if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (impl->sort_model), &iter, path))
return;
@@ -8376,6 +9145,15 @@
@@ -8382,6 +9152,15 @@
const GtkFileInfo *info;
gboolean sensitive = TRUE;
@ -3013,7 +3014,7 @@
profile_start ("start", NULL);
info = get_list_file_info (impl, iter);
@@ -8425,13 +9203,33 @@
@@ -8431,13 +9210,33 @@
gpointer data)
{
GtkFileChooserDefault *impl = data;
@ -3049,7 +3050,7 @@
NULL);
return;
@@ -8447,6 +9245,7 @@
@@ -8453,6 +9252,7 @@
g_object_set (cell,
"text", gtk_file_info_get_display_name (info),
"sensitive", sensitive,
@ -3057,7 +3058,7 @@
NULL);
}
@@ -8508,7 +9307,6 @@
@@ -8514,7 +9314,6 @@
gpointer data)
{
GtkFileChooserDefault *impl;
@ -3065,7 +3066,7 @@
GtkFileTime time_mtime;
GDate mtime, now;
int days_diff;
@@ -8517,17 +9315,35 @@
@@ -8523,17 +9322,35 @@
impl = data;
@ -3109,7 +3110,7 @@
if (time_mtime == 0)
strcpy (buf, _("Unknown"));
@@ -8558,10 +9374,6 @@
@@ -8564,10 +9381,6 @@
}
}
@ -3120,7 +3121,7 @@
g_object_set (cell,
"text", buf,
"sensitive", sensitive,
@@ -8587,7 +9399,23 @@
@@ -8593,7 +9406,23 @@
static void
location_popup_handler (GtkFileChooserDefault *impl,
const gchar *path)
@ -3145,7 +3146,7 @@
if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN
|| impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
{
@@ -8656,6 +9484,7 @@
@@ -8662,6 +9491,7 @@
g_assert_not_reached ();
shortcuts_activate_iter (impl, &iter);
@ -3153,7 +3154,7 @@
}
/* Handler for the "home-folder" keybinding signal */
@@ -8700,26 +9529,26 @@
@@ -8706,26 +9536,26 @@
/* Drag and drop interfaces */
static void
@ -3186,7 +3187,7 @@
pos = *gtk_tree_path_get_indices (path);
bookmarks_pos = shortcuts_get_index (model->impl, SHORTCUTS_BOOKMARKS);
@@ -8729,13 +9558,13 @@
@@ -8735,13 +9565,13 @@
/* GtkTreeDragSource::drag_data_get implementation for the shortcuts filter model */
static gboolean
@ -3205,7 +3206,7 @@
/* FIXME */
@@ -8744,30 +9573,30 @@
@@ -8750,30 +9580,30 @@
/* Fill the GtkTreeDragSourceIface vtable */
static void
@ -3247,8 +3248,8 @@
"child-model", child_model,
"virtual-root", root,
NULL);
--- gtk+-2.10.9/gtk/gtkfilechooserprivate.h.search 2007-01-22 10:48:04.000000000 -0500
+++ gtk+-2.10.9/gtk/gtkfilechooserprivate.h 2007-01-30 23:27:42.000000000 -0500
--- gtk+-2.10.11/gtk/gtkfilechooserprivate.h.search 2007-03-14 05:07:03.000000000 +0100
+++ gtk+-2.10.11/gtk/gtkfilechooserprivate.h 2007-04-09 22:42:19.000000000 +0200
@@ -25,6 +25,8 @@
#include "gtkfilesystem.h"
#include "gtkfilesystemmodel.h"
@ -3345,8 +3346,8 @@
guint expand_folders : 1;
#if 0
--- /dev/null 2007-01-30 22:42:40.851021051 -0500
+++ gtk+-2.10.9/gtk/gtksearchenginesimple.h 2007-01-30 23:27:42.000000000 -0500
--- /dev/null 2007-04-09 09:59:25.840251204 +0200
+++ gtk+-2.10.11/gtk/gtksearchenginesimple.h 2007-04-09 22:42:19.000000000 +0200
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2005 Red Hat, Inc
@ -3407,8 +3408,8 @@
+G_END_DECLS
+
+#endif /* __GTK_SEARCH_ENGINE_SIMPLE_H__ */
--- /dev/null 2007-01-30 22:42:40.851021051 -0500
+++ gtk+-2.10.9/gtk/gtksearchenginesimple.c 2007-01-30 23:29:14.000000000 -0500
--- /dev/null 2007-04-09 09:59:25.840251204 +0200
+++ gtk+-2.10.11/gtk/gtksearchenginesimple.c 2007-04-09 22:42:19.000000000 +0200
@@ -0,0 +1,376 @@
+/*
+ * Copyright (C) 2005 Red Hat, Inc
@ -3786,8 +3787,8 @@
+
+ return engine;
+}
--- /dev/null 2007-01-30 22:42:40.851021051 -0500
+++ gtk+-2.10.9/gtk/gtksearchenginebeagle.c 2007-01-30 23:27:42.000000000 -0500
--- /dev/null 2007-04-09 09:59:25.840251204 +0200
+++ gtk+-2.10.11/gtk/gtksearchenginebeagle.c 2007-04-09 22:42:19.000000000 +0200
@@ -0,0 +1,420 @@
+/*
+ * Copyright (C) 2005 Novell, Inc.
@ -4209,8 +4210,8 @@
+
+ return GTK_SEARCH_ENGINE (engine);
+}
--- /dev/null 2007-01-30 22:42:40.851021051 -0500
+++ gtk+-2.10.9/gtk/gtkquery.c 2007-01-30 23:27:42.000000000 -0500
--- /dev/null 2007-04-09 09:59:25.840251204 +0200
+++ gtk+-2.10.11/gtk/gtkquery.c 2007-04-09 22:42:19.000000000 +0200
@@ -0,0 +1,142 @@
+/*
+ * Copyright (C) 2005 Novell, Inc.
@ -4354,8 +4355,8 @@
+ g_strdup (mime_type));
+}
+
--- /dev/null 2007-01-30 22:42:40.851021051 -0500
+++ gtk+-2.10.9/gtk/gtkquery.h 2007-01-30 23:27:42.000000000 -0500
--- /dev/null 2007-04-09 09:59:25.840251204 +0200
+++ gtk+-2.10.11/gtk/gtkquery.h 2007-04-09 22:42:19.000000000 +0200
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2005 Novell, Inc.

View File

@ -16,7 +16,7 @@
Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X
Name: gtk2
Version: %{base_version}
Release: 3%{?dist}
Release: 4%{?dist}
License: LGPL
Group: System Environment/Libraries
Source: http://ftp.gnome.org/pub/gnome/sources/gtk+/2.10/gtk+-%{version}.tar.bz2
@ -37,6 +37,7 @@ Patch7: gtk+-2.10.7-cursor-blink.patch
Patch10: gtk+-2.10.4-im-reset.patch
# fixed in upstream cvs
Patch11: raw-printers.patch
Patch12: gtk-keys.patch
BuildRequires: atk-devel >= %{atk_version}
BuildRequires: pango-devel >= %{pango_version}
@ -123,6 +124,7 @@ docs for the GTK+ widget toolkit.
%patch7 -p1 -b .cursor-blink
%patch10 -p1 -b .im-reset
%patch11 -p1 -b .raw-printers
%patch12 -p1 -b .keys
for i in config.guess config.sub ; do
test -f %{_datadir}/libtool/$i && cp %{_datadir}/libtool/$i .
@ -289,6 +291,9 @@ rm -rf $RPM_BUILD_ROOT
%doc tmpdocs/examples
%changelog
* Mon Apr 9 2007 Matthias Clasen <mclasen@redhat.com> - 1.10.11-4
- Fix a memory leak in the search patch
* Wed Mar 28 2007 Matthias Clasen <mclasen@redhat.com> - 1.10.11-3
- Support raw printers