rpms/gtk2/devel gtk+-2.10.3-search.patch, NONE, 1.1 .cvsignore, 1.59, 1.60 gtk2.spec, 1.177, 1.178 sources, 1.64, 1.65

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Sep 5 13:49:48 UTC 2006


Author: mclasen

Update of /cvs/dist/rpms/gtk2/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv27173

Modified Files:
	.cvsignore gtk2.spec sources 
Added Files:
	gtk+-2.10.3-search.patch 
Log Message:
2.10.3


gtk+-2.10.3-search.patch:
 gtkfilechooserdefault.c | 1442 +++++++++++++++++++++++++++++++++++++++---------
 gtkfilechooserprivate.h |   42 +
 2 files changed, 1237 insertions(+), 247 deletions(-)

--- NEW FILE gtk+-2.10.3-search.patch ---
--- gtk+-2.10.3/gtk/gtkfilechooserprivate.h.search	2006-09-04 16:54:38.000000000 -0400
+++ gtk+-2.10.3/gtk/gtkfilechooserprivate.h	2006-09-05 09:04:44.000000000 -0400
@@ -147,6 +147,20 @@
   LOCATION_MODE_FILENAME_ENTRY
 } LocationMode;
 
+typedef enum {
+  OPERATION_MODE_BROWSE,
+  OPERATION_MODE_SEARCH
+} OperationMode;
+
+typedef struct _BeagleHit BeagleHit;
+typedef struct _BeagleQuery BeagleQuery;
+typedef struct _BeagleClient BeagleClient;
+typedef struct _BeagleRequest BeagleRequest;
+typedef struct _BeagleFinishedResponse BeagleFinishedResponse;
+typedef struct _BeagleHitsAddedResponse BeagleHitsAddedResponse;
+typedef struct _BeagleQueryPartProperty BeagleQueryPartProperty;
+typedef struct _BeagleQueryPart BeagleQueryPart;
+
 struct _GtkFileChooserDefault
 {
   GtkVBox parent_instance;
@@ -175,11 +189,19 @@
   GtkWidget *browse_files_popup_menu_add_shortcut_item;
   GtkWidget *browse_files_popup_menu_hidden_files_item;
   GtkWidget *browse_new_folder_button;
+  GtkWidget *browse_path_bar_hbox;
   GtkWidget *browse_path_bar;
 
   GtkFileSystemModel *browse_files_model;
   char *browse_files_last_selected_name;
 
+  /* Widgets for searching */
+  GtkWidget *search_hbox;
+  GtkWidget *search_entry;
+  BeagleClient *search_client;
+  BeagleQuery *search_query;
+  GtkListStore *search_model;
+
   GtkWidget *filter_combo_hbox;
   GtkWidget *filter_combo;
   GtkWidget *preview_box;
@@ -195,7 +217,16 @@
   LocationMode location_mode;
 
   GtkListStore *shortcuts_model;
-  GtkTreeModel *shortcuts_filter_model;
+
+  /* Filter for the shortcuts pane.  We filter out the "current folder" row and
+   * the separator that we use for the "Save in folder" combo.
+   */
+  GtkTreeModel *shortcuts_pane_filter_model;
+  
+  /* Filter for the "Save in folder" combo.  We filter out the Search row and
+   * its separator.
+   */
+  GtkTreeModel *shortcuts_combo_filter_model;
 
   GtkTreeModelSort *sort_model;
 
@@ -215,6 +246,8 @@
   ReloadState reload_state;
   guint load_timeout_id;
 
+  OperationMode operation_mode;
+
   GSList *pending_select_paths;
 
   GtkFileFilter *current_filter;
@@ -222,9 +255,6 @@
 
   GtkTooltips *tooltips;
 
-  gboolean has_home;
-  gboolean has_desktop;
-
   int num_volumes;
   int num_shortcuts;
   int num_bookmarks;
@@ -239,6 +269,7 @@
 
   GtkTreeViewColumn *list_name_column;
   GtkCellRenderer *list_name_renderer;
+  GtkTreeViewColumn *list_mtime_column;
 
   GSource *edited_idle;
   char *edited_new_text;
@@ -265,6 +296,9 @@
   guint list_sort_ascending : 1;
   guint changing_folder : 1;
   guint shortcuts_current_folder_active : 1;
+  guint has_home : 1;
+  guint has_desktop : 1;
+  guint has_search : 1;
 
 #if 0
   guint shortcuts_drag_outside : 1;
--- gtk+-2.10.3/gtk/gtkfilechooserdefault.c.search	2006-09-04 17:02:44.000000000 -0400
+++ gtk+-2.10.3/gtk/gtkfilechooserdefault.c	2006-09-05 09:17:26.000000000 -0400
@@ -78,6 +78,8 @@
 #include <errno.h>
 #include <string.h>
 #include <time.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 
 
 
@@ -171,13 +173,20 @@
   SHORTCUTS_COL_PIXBUF,
   SHORTCUTS_COL_NAME,
   SHORTCUTS_COL_DATA,
-  SHORTCUTS_COL_IS_VOLUME,
+  SHORTCUTS_COL_TYPE,
   SHORTCUTS_COL_REMOVABLE,
   SHORTCUTS_COL_PIXBUF_VISIBLE,
   SHORTCUTS_COL_HANDLE,
   SHORTCUTS_COL_NUM_COLUMNS
 };
 
+typedef enum {
+  SHORTCUT_TYPE_PATH,
+  SHORTCUT_TYPE_VOLUME,
+  SHORTCUT_TYPE_SEPARATOR,
+  SHORTCUT_TYPE_SEARCH
+} ShortcutType;
+
 /* Column numbers for the file list */
 enum {
   FILE_LIST_COL_NAME,
@@ -186,6 +195,16 @@
   FILE_LIST_COL_NUM_COLUMNS
 };
 
+/* Column numbers for the search model.  
+ * Keep this in sync with search_setup_model() 
+ */
+enum {
+  SEARCH_MODEL_COL_PATH,
+  SEARCH_MODEL_COL_DISPLAY_NAME,
+  SEARCH_MODEL_COL_COLLATION_KEY,
+  SEARCH_MODEL_COL_STAT
+};
+
 /* Identifiers for target types */
 enum {
   GTK_TREE_MODEL_ROW,
@@ -225,9 +244,140 @@
 static const int num_file_list_dest_targets = (sizeof (file_list_dest_targets)
 					       / sizeof (file_list_dest_targets[0]));
 
+/* We dlopen() all the following from libbeagle at runtime */
+#define BEAGLE_HIT(x) ((BeagleHit *)(x))
+#define BEAGLE_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), beagle_request_get_type(), BeagleRequest))
+#define BEAGLE_QUERY_PART(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), beagle_query_part_get_type(), BeagleQueryPart))
+
+typedef enum {
+        BEAGLE_QUERY_PART_LOGIC_REQUIRED   = 1,
+	BEAGLE_QUERY_PART_LOGIC_PROHIBITED = 2
+} BeagleQueryPartLogic;
+
+typedef enum {
+	BEAGLE_PROPERTY_TYPE_UNKNOWN = 0,
+	BEAGLE_PROPERTY_TYPE_TEXT    = 1,
+	BEAGLE_PROPERTY_TYPE_KEYWORD = 2,
+	BEAGLE_PROPERTY_TYPE_DATE    = 3,
+	BEAGLE_PROPERTY_TYPE_LAST    = 4
+} BeaglePropertyType;
+
+/* *static* wrapper function pointers */
+static gboolean (*beagle_client_send_request_async) (BeagleClient  *client,
+                                                    BeagleRequest  *request,
+                                                    GError        **err) = NULL;
+static G_CONST_RETURN char *(*beagle_hit_get_uri) (BeagleHit *hit) = NULL;
+static GSList *(*beagle_hits_added_response_get_hits) (BeagleHitsAddedResponse *response) = NULL;
+static BeagleQuery *(*beagle_query_new) (void) = NULL;
+static void (*beagle_query_add_text) (BeagleQuery     *query,
+				      const char      *str) = NULL;
+static void (*beagle_query_add_hit_type) (BeagleQuery *query,
+					  const char  *hit_type) = NULL;
+static BeagleQueryPartProperty *(*beagle_query_part_property_new) (void) = NULL;
+static void (*beagle_query_part_set_logic) (BeagleQueryPart      *part, 
+					    BeagleQueryPartLogic  logic) = NULL;
+static void (*beagle_query_part_property_set_key) (BeagleQueryPartProperty *part, 
+						   const char              *key) = NULL;
+static void (*beagle_query_part_property_set_value) (BeagleQueryPartProperty *part, 
+						     const char *             value) = NULL;
+static void (*beagle_query_part_property_set_property_type) (BeagleQueryPartProperty *part, 
+							     BeaglePropertyType       prop_type) = NULL;
+static void (*beagle_query_add_part) (BeagleQuery     *query, 
+				      BeagleQueryPart *part) = NULL;
+static GType (*beagle_request_get_type) (void) = NULL;
+static GType (*beagle_query_part_get_type) (void) = NULL;
+static gboolean (*beagle_util_daemon_is_running) (void) = NULL;
+static BeagleClient *(*beagle_client_new_real) (const char *client_name) = NULL;
+
+static struct BeagleDlMapping
+{
[...2079 lines suppressed...]
 
       return;
@@ -8341,6 +9266,7 @@
   g_object_set (cell,
 		"text", gtk_file_info_get_display_name (info),
 		"sensitive", sensitive,
+		"ellipsize", PANGO_ELLIPSIZE_END,
 		NULL);
 }
 
@@ -8402,7 +9328,6 @@
 		      gpointer           data)
 {
   GtkFileChooserDefault *impl;
-  const GtkFileInfo *info;
   GtkFileTime time_mtime;
   GDate mtime, now;
   int days_diff;
@@ -8411,17 +9336,35 @@
 
   impl = data;
 
-  info = get_list_file_info (impl, iter);
-  if (!info)
+  if (impl->operation_mode == OPERATION_MODE_SEARCH)
     {
-      g_object_set (cell,
-		    "text", "",
-		    "sensitive", TRUE,
-		    NULL);
-      return;
+      struct stat *statbuf;
+
+      gtk_tree_model_get (GTK_TREE_MODEL (impl->search_model), iter,
+			  SEARCH_MODEL_COL_STAT, &statbuf,
+			  -1);
+      time_mtime = statbuf->st_mtime;
     }
+  else
+    {
+      const GtkFileInfo *info;
 
-  time_mtime = gtk_file_info_get_modification_time (info);
+      info = get_list_file_info (impl, iter);
+      if (!info)
+	{
+	  g_object_set (cell,
+			"text", "",
+			"sensitive", TRUE,
+			NULL);
+	  return;
+	}
+
+      time_mtime = gtk_file_info_get_modification_time (info);
+
+      if (impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ||
+	  impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+	sensitive = gtk_file_info_get_is_folder (info);
+    }
 
   if (time_mtime == 0)
     strcpy (buf, _("Unknown"));
@@ -8452,10 +9395,6 @@
 	}
     }
 
-  if (impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ||
-      impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
-    sensitive = gtk_file_info_get_is_folder (info);
-
   g_object_set (cell,
 		"text", buf,
 		"sensitive", sensitive,
@@ -8481,7 +9420,23 @@
 static void
 location_popup_handler (GtkFileChooserDefault *impl,
 			const gchar           *path)
-{
+{ 
+  if (impl->operation_mode == OPERATION_MODE_SEARCH)
+    {
+      GtkWidget *widget_to_focus;
+
+      search_switch_to_browse_mode (impl); /* This will give us the location widgets back */
+      if (impl->current_folder)
+        change_folder_and_display_error (impl, impl->current_folder);
+
+      if (impl->location_mode == LOCATION_MODE_PATH_BAR)
+        widget_to_focus = impl->browse_files_tree_view;
+      else
+        widget_to_focus = impl->location_entry;
+
+      gtk_widget_grab_focus (widget_to_focus);
+      return; 
+    }
   if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN
       || impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
     {
@@ -8550,6 +9505,7 @@
     g_assert_not_reached ();
 
   shortcuts_activate_iter (impl, &iter);
+  focus_browse_tree_view_if_possible (impl);
 }
 
 /* Handler for the "home-folder" keybinding signal */
@@ -8594,26 +9550,26 @@
 /* Drag and drop interfaces */
 
 static void
-_shortcuts_model_filter_class_init (ShortcutsModelFilterClass *class)
+_shortcuts_pane_model_filter_class_init (ShortcutsPaneModelFilterClass *class)
 {
 }
 
 static void
-_shortcuts_model_filter_init (ShortcutsModelFilter *model)
+_shortcuts_pane_model_filter_init (ShortcutsPaneModelFilter *model)
 {
   model->impl = NULL;
 }
 
 /* GtkTreeDragSource::row_draggable implementation for the shortcuts filter model */
 static gboolean
-shortcuts_model_filter_row_draggable (GtkTreeDragSource *drag_source,
-				      GtkTreePath       *path)
+shortcuts_pane_model_filter_row_draggable (GtkTreeDragSource *drag_source,
+				           GtkTreePath       *path)
 {
-  ShortcutsModelFilter *model;
+  ShortcutsPaneModelFilter *model;
   int pos;
   int bookmarks_pos;
 
-  model = SHORTCUTS_MODEL_FILTER (drag_source);
+  model = SHORTCUTS_PANE_MODEL_FILTER (drag_source);
 
   pos = *gtk_tree_path_get_indices (path);
   bookmarks_pos = shortcuts_get_index (model->impl, SHORTCUTS_BOOKMARKS);
@@ -8623,13 +9579,13 @@
 
 /* GtkTreeDragSource::drag_data_get implementation for the shortcuts filter model */
 static gboolean
-shortcuts_model_filter_drag_data_get (GtkTreeDragSource *drag_source,
-				      GtkTreePath       *path,
-				      GtkSelectionData  *selection_data)
+shortcuts_pane_model_filter_drag_data_get (GtkTreeDragSource *drag_source,
+				           GtkTreePath       *path,
+				           GtkSelectionData  *selection_data)
 {
-  ShortcutsModelFilter *model;
+  ShortcutsPaneModelFilter *model;
 
-  model = SHORTCUTS_MODEL_FILTER (drag_source);
+  model = SHORTCUTS_PANE_MODEL_FILTER (drag_source);
 
   /* FIXME */
 
@@ -8638,30 +9594,30 @@
 
 /* Fill the GtkTreeDragSourceIface vtable */
 static void
-shortcuts_model_filter_drag_source_iface_init (GtkTreeDragSourceIface *iface)
+shortcuts_pane_model_filter_drag_source_iface_init (GtkTreeDragSourceIface *iface)
 {
-  iface->row_draggable = shortcuts_model_filter_row_draggable;
-  iface->drag_data_get = shortcuts_model_filter_drag_data_get;
+  iface->row_draggable = shortcuts_pane_model_filter_row_draggable;
+  iface->drag_data_get = shortcuts_pane_model_filter_drag_data_get;
 }
 
 #if 0
 /* Fill the GtkTreeDragDestIface vtable */
 static void
-shortcuts_model_filter_drag_dest_iface_init (GtkTreeDragDestIface *iface)
+shortcuts_pane_model_filter_drag_dest_iface_init (GtkTreeDragDestIface *iface)
 {
-  iface->drag_data_received = shortcuts_model_filter_drag_data_received;
-  iface->row_drop_possible = shortcuts_model_filter_row_drop_possible;
+  iface->drag_data_received = shortcuts_pane_model_filter_drag_data_received;
+  iface->row_drop_possible = shortcuts_pane_model_filter_row_drop_possible;
 }
 #endif
 
 static GtkTreeModel *
-shortcuts_model_filter_new (GtkFileChooserDefault *impl,
-			    GtkTreeModel          *child_model,
-			    GtkTreePath           *root)
+shortcuts_pane_model_filter_new (GtkFileChooserDefault *impl,
+			         GtkTreeModel          *child_model,
+			         GtkTreePath           *root)
 {
-  ShortcutsModelFilter *model;
+  ShortcutsPaneModelFilter *model;
 
-  model = g_object_new (SHORTCUTS_MODEL_FILTER_TYPE,
+  model = g_object_new (SHORTCUTS_PANE_MODEL_FILTER_TYPE,
 			"child-model", child_model,
 			"virtual-root", root,
 			NULL);


Index: .cvsignore
===================================================================
RCS file: /cvs/dist/rpms/gtk2/devel/.cvsignore,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- .cvsignore	18 Aug 2006 05:03:05 -0000	1.59
+++ .cvsignore	5 Sep 2006 13:49:45 -0000	1.60
@@ -42,3 +42,4 @@
 gtk+-2.10.0.tar.bz2
 gtk+-2.10.1.tar.bz2
 gtk+-2.10.2.tar.bz2
+gtk+-2.10.3.tar.bz2


Index: gtk2.spec
===================================================================
RCS file: /cvs/dist/rpms/gtk2/devel/gtk2.spec,v
retrieving revision 1.177
retrieving revision 1.178
diff -u -r1.177 -r1.178
--- gtk2.spec	1 Sep 2006 15:03:16 -0000	1.177
+++ gtk2.spec	5 Sep 2006 13:49:46 -0000	1.178
@@ -10,13 +10,13 @@
 %define cairo_version %{cairo_base_version}-1
 %define libpng_version 2:1.2.2-16
 
-%define base_version 2.10.2
+%define base_version 2.10.3
 %define bin_version 2.10.0
 
 Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X
 Name: gtk2
 Version: %{base_version}
-Release: 6%{?dist}
+Release: 1%{?dist}
 License: LGPL
 Group: System Environment/Libraries
 Source: gtk+-%{version}.tar.bz2
@@ -27,13 +27,7 @@
 # Fedora patch
 Patch1: gtk+-2.8.10-set-invisible-char-to-bullet.patch
 # Filechooser search
-Patch2: gtk+-2.10.1-search.patch
-
-# The following are fixed in upstream cvs
-Patch3: gtk+-2.10.2-recent.patch
-Patch4: gtk+-2.10.2-values-and-names.patch
-Patch5: gtk+-2.10.2-poll.patch
-Patch6: gtk+-2.10.2-printer-list.patch
+Patch2: gtk+-2.10.3-search.patch
 
 # backport from HEAD
 Patch7: gtk+-2.10.2-cursor-blink.patch
@@ -118,10 +112,7 @@
 %patch0 -p1 -b .lib64
 %patch1 -p1 -b .set-invisible-char-to-bullet
 %patch2 -p1 -b .search
-%patch3 -p1 -b .recent
-%patch4 -p1 -b .values-and-names
-%patch5 -p1 -b .poll
-%patch6 -p1 -b .printer-list
+
 %patch7 -p0 -b .cursor-blink
 %patch8 -p1 -b .im-reset
 
@@ -295,6 +286,9 @@
 %doc tmpdocs/examples
 
 %changelog
+* Tue Sep  5 2006 Matthias Clasen <mclasen at redhat.com> - 2.10.3-1.fc6
+- Update to 2.10.3
+
 * Fri Sep  1 2006 Matthias Clasen <mclasen at redhat.com> - 2.10.2-6.fc6
 - Fix a problem with entering Hangul in entries
 


Index: sources
===================================================================
RCS file: /cvs/dist/rpms/gtk2/devel/sources,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -r1.64 -r1.65
--- sources	18 Aug 2006 05:03:05 -0000	1.64
+++ sources	5 Sep 2006 13:49:46 -0000	1.65
@@ -1,2 +1,2 @@
 d8c012f67a8f23fa9aa495fca5331784  update-scripts.tar.gz
-9039804dfd115e40a70a6ba096f418a2  gtk+-2.10.2.tar.bz2
+c662ca204e204edfd8b8b917b9a852aa  gtk+-2.10.3.tar.bz2




More information about the fedora-cvs-commits mailing list