gnome-utils r8504 - trunk/gsearchtool



Author: dcransto
Date: Tue Mar 17 02:08:08 2009
New Revision: 8504
URL: http://svn.gnome.org/viewvc/gnome-utils?rev=8504&view=rev

Log:
2009-03-16  Dennis Cranston  <dennis_cranston yahoo com>

        * Makefile.am:
        * gnome-search-tool.schemas.in:
        * gsearchtool-callbacks.c (look_in_folder_changed_cb),
        (open_file_event_cb), (open_file_cb), (open_folder_cb),
        (file_changed_cb), (move_to_trash_cb),
(file_key_press_event_cb),
        (open_with_list_sort), (build_popup_menu_for_file),
        (file_button_release_event_cb), (file_event_after_cb),
        (file_motion_notify_cb), (drag_file_cb):
        * gsearchtool-callbacks.h:
        * gsearchtool-spinner.c (gsearch_spinner_cache_data_load),
        (bump_spinner_frame_cb):
        * gsearchtool-support.c (gsearchtool_gconf_set_string),
        (escape_double_quotes), (backslash_backslash_characters),
        (backslash_special_characters), (get_file_type_description),
        (gsearchtool_get_thumbnail_image), (get_themed_icon_pixbuf),
        (get_file_pixbuf), (open_file_with_application), (launch_file):
        * gsearchtool-support.h:
        * gsearchtool.c (setup_find_name_options), (start_animation),
        (stop_animation), (build_search_command),
        (add_file_to_search_results), (update_search_counts),
        (intermediate_file_count_update),
(tree_model_iter_free_monitor),
        (set_constraint_gconf_boolean), (handle_goption_args),
        (create_search_results_section), (set_clone_command),
        (handle_gconf_settings), (gsearch_app_create), (main):
        * gsearchtool.h:
        Bug 543713: Port application from gnome-vfs to gio 
        Bug 524574: Use the new gio trash system
        Bug 573670: Remove use of gnome-thumbnail from libgnomeui
        Bug 567159: Display resize cursor on column headers
        Bug 544136: Popup menu enhancement - adds "Open With"
        Bug 473474: Save and restore "Look in Folder" selection 
        Bug 557253: Change the "Include other filesystems." option 
                    to "Exclude other filesystems."
        Bug 531134: Open folders with the default handler, allows 
                    folders to open in thunar for XFCE
        Bug 545304: Search fails on none UTF-8 locales
        Bug 522396: Search fails if apostrophe in folder name
        Bug 531193: Opening files of certain types fails


Modified:
   trunk/gsearchtool/ChangeLog
   trunk/gsearchtool/Makefile.am
   trunk/gsearchtool/gnome-search-tool.schemas.in
   trunk/gsearchtool/gsearchtool-callbacks.c
   trunk/gsearchtool/gsearchtool-callbacks.h
   trunk/gsearchtool/gsearchtool-support.c
   trunk/gsearchtool/gsearchtool-support.h
   trunk/gsearchtool/gsearchtool.c
   trunk/gsearchtool/gsearchtool.h

Modified: trunk/gsearchtool/Makefile.am
==============================================================================
--- trunk/gsearchtool/Makefile.am	(original)
+++ trunk/gsearchtool/Makefile.am	Tue Mar 17 02:08:08 2009
@@ -4,7 +4,6 @@
 
 INCLUDES = 	\
 	$(GNOME_UTILS_CFLAGS)					\
-	$(GNOMEVFS_CFLAGS)					\
 	$(GNOMEDESKTOP_CFLAGS)					\
 	$(LIBGNOME_CFLAGS)					\
 	-DG_DISABLE_DEPRECATED					\
@@ -33,7 +32,6 @@
 gnome_search_tool_LDADD =   \
 	$(LIBGNOME_LIBS)    \
 	$(GNOME_UTILS_LIBS) \
-	$(GNOMEVFS_LIBS)    \
 	$(GNOMEDESKTOP_LIBS)
 
 man_MANS = gnome-search-tool.1

Modified: trunk/gsearchtool/gnome-search-tool.schemas.in
==============================================================================
--- trunk/gsearchtool/gnome-search-tool.schemas.in	(original)
+++ trunk/gsearchtool/gnome-search-tool.schemas.in	Tue Mar 17 02:08:08 2009
@@ -239,17 +239,17 @@
       </locale>
     </schema>
     <schema>
-      <applyto>/apps/gnome-search-tool/select/include_other_filesystems</applyto>
-      <key>/schemas/apps/gnome-search-tool/select/include_other_filesystems</key>
+      <applyto>/apps/gnome-search-tool/select/exclude_other_filesystems</applyto>
+      <key>/schemas/apps/gnome-search-tool/select/exclude_other_filesystems</key>
       <owner>gnome-search-tool</owner>
       <type>bool</type>
       <default>FALSE</default>
       <locale name="C">
         <short><!-- Translators: The quoted text is the label of an available 
         search option that is translated elsewhere. -->Select the search option 
-        "Include other filesystems"</short>
+        "Exclude other filesystems"</short>
         <long>
-          This key determines if the "Include other filesystems" search option 
+          This key determines if the "Exclude other filesystems" search option 
 	  is selected when the search tool is started.
         </long>
       </locale>
@@ -375,5 +375,19 @@
 	</long>
       </locale>
     </schema>
+    <schema>
+      <applyto>/apps/gnome-search-tool/look_in_folder</applyto>
+      <key>/schemas/apps/gnome-search-tool/look_in_folder</key>
+      <owner>gnome-search-tool</owner>
+      <type>string</type>
+      <default></default>
+      <locale name="C">
+        <short>Look in Folder</short>
+	<long>
+	  This key defines the default value of the "Look in Folder"
+	  widget.
+	</long>
+      </locale>
+    </schema>
   </schemalist>
 </gconfschemafile>

Modified: trunk/gsearchtool/gsearchtool-callbacks.c
==============================================================================
--- trunk/gsearchtool/gsearchtool-callbacks.c	(original)
+++ trunk/gsearchtool/gsearchtool-callbacks.c	Tue Mar 17 02:08:08 2009
@@ -35,9 +35,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 #include <glib/gi18n.h>
-#include <libgnomevfs/gnome-vfs-ops.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-#include <libgnomevfs/gnome-vfs-find-directory.h>
+#include <gio/gio.h>
 #include <libgnome/gnome-desktop-item.h>
 
 #include <gnome.h>
@@ -308,6 +306,22 @@
 	}
 }
 
+void
+look_in_folder_changed_cb (GtkWidget * widget,
+                           gpointer data)
+{
+	GSearchWindow * gsearch = data;
+	gchar * value;
+
+	value = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (gsearch->look_in_folder_button));
+
+	if (value != NULL) {
+		gsearchtool_gconf_set_string ("/apps/gnome-search-tool/look_in_folder", value);
+	}
+	g_free (value);
+}
+
+
 static gint
 display_dialog_file_open_limit (GtkWidget * window,
                                   gint count)
@@ -415,7 +429,15 @@
 }
 
 void
-open_file_cb (GtkAction * action,
+open_file_event_cb (GtkWidget * widget,
+                    GdkEventButton * event,
+                    gpointer data)
+{
+	open_file_cb ((GtkMenuItem *) widget, data);
+}
+
+void
+open_file_cb (GtkMenuItem * action,
               gpointer data)
 {
 	GSearchWindow * gsearch = data;
@@ -461,7 +483,11 @@
 		if (!no_files_found) {
 			gchar * file;
 			gchar * locale_file;
+			GAppInfo * app = NULL;
 
+			if (GTK_IS_OBJECT (action)) {
+				app = g_object_get_data (G_OBJECT (action), "app");
+			}
 			file = g_build_filename (utf8_path, utf8_name, NULL);
 			locale_file = g_locale_from_utf8 (file, -1, NULL, NULL, NULL);
 
@@ -472,7 +498,7 @@
 				                                    _("The document does not exist."));
 
 			}
-			else if (open_file_with_application (gsearch->window, locale_file) == FALSE) {
+			else if (open_file_with_application (gsearch->window, locale_file, app) == FALSE) {
 
 				if (launch_file (locale_file) == FALSE) {
 
@@ -552,6 +578,9 @@
 {
 	GSearchWindow * gsearch = data;
 	GtkTreeModel * model;
+	GFile * g_file = NULL;
+	GFileInfo * g_file_info = NULL;
+	GAppInfo * g_app_info = NULL;
 	GList * list;
 	guint index;
 
@@ -589,28 +618,43 @@
 
 		folder_locale = g_filename_from_utf8 (folder_utf8, -1, NULL, NULL, NULL);
 
-		if (open_file_with_nautilus (gsearch->window, folder_locale) == FALSE) {
-
-			display_dialog_could_not_open_folder (gsearch->window, folder_utf8);
-
-			g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
-			g_list_free (list);
-			g_free (folder_locale);
-			g_free (folder_utf8);
-			return;
+		if (index == 0) {
+			g_file = g_file_new_for_path (folder_locale);
+			g_file_info = g_file_query_info (g_file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, G_FILE_QUERY_INFO_NONE, NULL, NULL);
+			g_app_info = g_app_info_get_default_for_type (g_file_info_get_content_type (g_file_info), FALSE);
+		}
+
+		if (open_file_with_application (gsearch->window, folder_locale, g_app_info) == FALSE) {
+
+			if (open_file_with_nautilus (gsearch->window, folder_locale) == FALSE) {
+
+				display_dialog_could_not_open_folder (gsearch->window, folder_utf8);
+
+				g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
+				g_list_free (list);
+				g_free (folder_locale);
+				g_free (folder_utf8);
+				g_object_unref (g_file);
+				g_object_unref (g_file_info);
+				g_object_unref (g_app_info);
+				return;
+			}
 		}
 		g_free (folder_locale);
 		g_free (folder_utf8);
 	}
 	g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
 	g_list_free (list);
+	g_object_unref (g_file);
+	g_object_unref (g_file_info);
+	g_object_unref (g_app_info);
 }
 
 void
-file_changed_cb (GnomeVFSMonitorHandle * handle,
+file_changed_cb (GFileMonitor * handle,
                  const gchar * monitor_uri,
                  const gchar * info_uri,
-                 GnomeVFSMonitorEventType event_type,
+                 GFileMonitorEvent event_type,
                  gpointer data)
 {
 	GSearchMonitor * monitor = data;
@@ -620,7 +664,7 @@
 	GtkTreeIter iter;
 
 	switch (event_type) {
-	case GNOME_VFS_MONITOR_EVENT_DELETED:
+	case G_FILE_MONITOR_EVENT_DELETED:
 		path = gtk_tree_row_reference_get_path (monitor->reference);
 		model = gtk_tree_row_reference_get_model (monitor->reference);
 		gtk_tree_model_get_iter (model, &iter, path);
@@ -735,36 +779,6 @@
 	g_free (primary);
 }
 
-static char *
-get_trash_path (const gchar * file)
-{
-	GnomeVFSURI * trash_uri;
-	GnomeVFSURI * uri;
-	gchar       * filename;
-
-	filename = gnome_vfs_escape_path_string (file);
-	uri = gnome_vfs_uri_new (filename);
-	g_free (filename);
-
-	gnome_vfs_find_directory (uri,
-				  GNOME_VFS_DIRECTORY_KIND_TRASH,
-				  &trash_uri,
-				  TRUE,
-				  TRUE,
-				  0777);
-	gnome_vfs_uri_unref (uri);
-
-	if (trash_uri == NULL) {
-		return NULL;
-	}
-	else {
-		gchar * trash_path;
-		trash_path = gnome_vfs_uri_to_string (trash_uri, GNOME_VFS_URI_HIDE_TOPLEVEL_METHOD);
-		gnome_vfs_uri_unref (trash_uri);
-		return trash_path;
-	}
-}
-
 void
 move_to_trash_cb (GtkAction * action,
                   gpointer data)
@@ -785,11 +799,13 @@
 		GtkTreeModel * model;
 		GtkTreeIter iter;
 		GList * list;
+		GFile * g_file;
+		GError * error;
 		gchar * utf8_basename;
 		gchar * utf8_basepath;
 		gchar * utf8_filename;
 		gchar * locale_filename;
-		gchar * trash_path;
+		gboolean result;
 
 		list = gtk_tree_selection_get_selected_rows (GTK_TREE_SELECTION (gsearch->search_results_selection),
  		                                             &model);
@@ -815,7 +831,6 @@
 
 		utf8_filename = g_build_filename (utf8_basepath, utf8_basename, NULL);
 		locale_filename = g_locale_from_utf8 (utf8_filename, -1, NULL, NULL, NULL);
-		trash_path = get_trash_path (locale_filename);
 
 		if ((!g_file_test (locale_filename, G_FILE_TEST_EXISTS)) &&
 		    (!g_file_test (locale_filename, G_FILE_TEST_IS_SYMLINK))) {
@@ -823,55 +838,17 @@
 			display_dialog_could_not_move_to_trash (gsearch->window, utf8_basename,
 			                                        _("The document does not exist."));
 		}
-		else if (trash_path != NULL) {
-			GnomeVFSResult result;
-			gchar * basename;
-			gchar * destination;
-			gchar * destination_uri;
-			gchar * source_uri;
-
-			basename = g_locale_from_utf8 (utf8_basename, -1, NULL, NULL, NULL);
-			destination = g_build_filename (trash_path, basename, NULL);
-
-			/* Bugzilla #404158: Do not overwrite existing files in the trash folder */
-			while (g_file_test (destination, G_FILE_TEST_EXISTS)) {
-				gchar * temp;
-
-				temp = g_strdup (basename);
-				g_free (basename);
-
-				basename = gsearchtool_get_next_duplicate_name (temp);
-				g_free (destination);
-				g_free (temp);
 
-				destination = g_build_filename (trash_path, basename, NULL);
-			}
-			
-			destination_uri = g_filename_to_uri (destination, NULL, NULL);
-			source_uri = g_filename_to_uri (locale_filename, NULL, NULL);
+		g_file = g_file_new_for_path (locale_filename);
+		result = g_file_trash (g_file, NULL, &error);
 
-			result = gnome_vfs_move (source_uri, destination_uri, TRUE);
-			gtk_tree_selection_unselect_iter (GTK_TREE_SELECTION (gsearch->search_results_selection), &iter);
-
-			if (result == GNOME_VFS_OK) {
-				tree_model_iter_free_monitor (GTK_TREE_MODEL (gsearch->search_results_list_store),
-							      NULL, &iter, NULL);
-				gtk_list_store_remove (GTK_LIST_STORE (gsearch->search_results_list_store), &iter);
-			}
-			else {
-				gchar * message;
+		gtk_tree_selection_unselect_iter (GTK_TREE_SELECTION (gsearch->search_results_selection), &iter);
+		g_object_unref (g_file);
 
-				message = g_strdup_printf (_("Moving \"%s\" failed: %s."),
-				                           utf8_filename,
-				                           gnome_vfs_result_to_string (result));
-				display_dialog_could_not_move_to_trash (gsearch->window, utf8_basename,
- 				                                        message);
-				g_free (message);
-			}
-			g_free (basename);
-			g_free (destination);
-			g_free (destination_uri);
-			g_free (source_uri);			
+		if (result == TRUE) {
+			tree_model_iter_free_monitor (GTK_TREE_MODEL (gsearch->search_results_list_store),
+						      NULL, &iter, NULL);
+			gtk_list_store_remove (GTK_LIST_STORE (gsearch->search_results_list_store), &iter);
 		}
 		else {
 			gint response;
@@ -880,16 +857,15 @@
 			response = display_dialog_delete_permanently (gsearch->window, utf8_filename);
 
 			if (response == GTK_RESPONSE_OK) {
-				GnomeVFSResult result;
-
-				if (!g_file_test (locale_filename, G_FILE_TEST_IS_DIR)) {
-					result = gnome_vfs_unlink (locale_filename);
-				}
-				else {
-					result = gnome_vfs_remove_directory (locale_filename);
-				}
+				GFile * g_file;
+				GError * error;
+				gboolean result;
+
+				g_file = g_file_new_for_path (locale_filename);
+				result = g_file_delete (g_file, NULL, &error);
+				g_object_unref (g_file);
 
-				if (result == GNOME_VFS_OK) {
+				if (result == TRUE) {
 					tree_model_iter_free_monitor (GTK_TREE_MODEL (gsearch->search_results_list_store),
 								      NULL, &iter, NULL);
 					gtk_list_store_remove (GTK_LIST_STORE (gsearch->search_results_list_store), &iter);
@@ -898,13 +874,25 @@
 					gchar * message;
 
 					message = g_strdup_printf (_("Deleting \"%s\" failed: %s."),
-					                             utf8_filename, gnome_vfs_result_to_string (result));
+					                             utf8_filename, error->message);
 
 					display_dialog_could_not_delete (gsearch->window, utf8_basename, message);
 
+					g_error_free (error);
 					g_free (message);
 				}
 			}
+			else {
+				gchar * message;
+
+				message = g_strdup_printf (_("Moving \"%s\" failed: %s."),
+				                           utf8_filename,
+				                           error->message);
+				display_dialog_could_not_move_to_trash (gsearch->window, utf8_basename,
+				                                        message);
+				g_error_free (error);
+				g_free (message);
+			}
 		}
 		g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
 		g_list_free (list);
@@ -912,7 +900,6 @@
 		g_free (utf8_filename);
 		g_free (utf8_basename);
 		g_free (utf8_basepath);
-		g_free (trash_path);
 	}
 
 	/* Bugzilla #397945: Select next row in the search results list */
@@ -973,7 +960,7 @@
 	    event->keyval == GDK_Return ||
 	    event->keyval == GDK_KP_Enter) {
 		if (event->state != GDK_CONTROL_MASK) {
-			open_file_cb ((GtkAction *) NULL, data);
+			open_file_cb ((GtkMenuItem *) NULL, data);
 			return TRUE;
 		}
 	}
@@ -984,14 +971,217 @@
 	return FALSE;
 }
 
+static gint
+open_with_list_sort (gconstpointer a,
+                     gconstpointer b)
+{
+	const gchar * a_app_name = g_app_info_get_name ((GAppInfo *) a);
+	const gchar * b_app_name = g_app_info_get_name ((GAppInfo *) b);
+	gchar * a_utf8;
+	gchar * b_utf8;
+	gint result;
+
+	a_utf8 = g_utf8_casefold (a_app_name, -1);
+	b_utf8 = g_utf8_casefold (b_app_name, -1);
+
+	result = g_utf8_collate (a_utf8, b_utf8);
+
+	g_free (a_utf8);
+	g_free (b_utf8);
+
+	return result;
+}
+
+static void
+build_popup_menu_for_file (GSearchWindow * gsearch,
+                           gchar * file)
+{
+	GtkWidget * new1, * image1, * separatormenuitem1;
+	GtkWidget * new2;
+	gint i;
+
+	if (GTK_IS_MENU (gsearch->search_results_popup_menu) == TRUE) {
+		g_object_ref_sink (gsearch->search_results_popup_menu);
+		g_object_unref (gsearch->search_results_popup_menu);
+	}
+
+	if (GTK_IS_MENU (gsearch->search_results_popup_submenu) == TRUE) {
+		g_object_ref_sink (gsearch->search_results_popup_submenu);
+		g_object_unref (gsearch->search_results_popup_submenu);
+	}
+
+	gsearch->search_results_popup_menu = gtk_menu_new ();
+
+	if (file == NULL || g_file_test (file, G_FILE_TEST_IS_DIR) == TRUE) {
+		/* Popup menu item: Open */
+		new1 = gtk_image_menu_item_new_with_mnemonic  (_("_Open"));
+		gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), new1);
+		gtk_widget_show (new1);
+
+		image1 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU);
+		gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (new1), image1);
+		gtk_widget_show (image1);
+
+		g_signal_connect (G_OBJECT (new1),
+		                  "activate",
+		                  G_CALLBACK (open_file_cb),
+		                  (gpointer) gsearch);
+	}
+	else {
+		GFile * g_file;
+		GFileInfo * file_info;
+		GList * list;
+		gchar * str;
+		gint list_length;
+	
+		g_file = g_file_new_for_path (file);
+		file_info = g_file_query_info (g_file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, G_FILE_QUERY_INFO_NONE, NULL, NULL);
+		list = g_app_info_get_all_for_type (g_file_info_get_content_type (file_info));
+
+		list_length = g_list_length (list);
+	
+		if (list_length >= 3) { /* Sort all except first application by name */
+			GList * tmp;
+
+			tmp = g_list_first (list);
+			list = g_list_remove_link (list, tmp);
+			list = g_list_sort (list, open_with_list_sort);
+			list = g_list_prepend (list, tmp->data);
+			g_list_free (tmp);
+		}
+		
+		/* Popup menu item: Open with (default) */
+		str = g_strdup_printf ("_Open with \"%s\"",  g_app_info_get_name (list->data));
+		new1 = gtk_image_menu_item_new_with_mnemonic (str);
+		gtk_widget_show (new1);
+
+		g_object_set_data_full (G_OBJECT (new1), "app", (GAppInfo *)list->data,
+		                        (GDestroyNotify) g_object_unref);
+
+		gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), new1);
+
+		g_signal_connect ((gpointer) new1, "activate", G_CALLBACK (open_file_cb),
+				  (gpointer) gsearch);
+
+		image1 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU);
+		gtk_widget_show (image1);
+		gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (new1), image1);
+		
+		separatormenuitem1 = gtk_separator_menu_item_new ();
+		gtk_widget_show (separatormenuitem1);
+		gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), separatormenuitem1);
+		gtk_widget_set_sensitive (separatormenuitem1, FALSE);			
+
+		for (list = g_list_next (list), i = 0; list != NULL; list = g_list_next (list), i++) {
+
+			/* Popup menu item: Open with (others) */
+			str = g_strdup_printf ("Open with \"%s\"",  g_app_info_get_name (list->data));
+			new1 = gtk_menu_item_new_with_mnemonic (str);
+			gtk_widget_show (new1);
+
+			g_object_set_data_full (G_OBJECT (new1), "app", (GAppInfo *)list->data,
+		                                (GDestroyNotify) g_object_unref);
+
+			if (list_length >= 4) {
+
+				if (i == 0) {
+					gsearch->search_results_popup_submenu = gtk_menu_new ();
+
+					/* Popup menu item: Open With */
+				  	new2 = gtk_menu_item_new_with_mnemonic  (_("Open Wit_h"));
+				  	gtk_widget_show (new2);
+				 	gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), new2);
+
+	  			  	gtk_menu_item_set_submenu (GTK_MENU_ITEM (new2), gsearch->search_results_popup_submenu);
+	                       	}
+				gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_submenu), new1);
+
+				/* For submenu items, the "activate" signal is only emitted if the user first clicks 
+				   on the parent menu item.  Since submenus in gtk+ are automatically displayed when
+				   the user hovers over them, most will never click on the parent menu item.  
+				   The work-around is to connect to "button-press-event". */
+				g_signal_connect (G_OBJECT(new1), "button-press-event", G_CALLBACK (open_file_event_cb),
+				                  (gpointer) gsearch);
+			}
+			else {
+				gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), new1);
+				g_signal_connect ((gpointer) new1, "activate", G_CALLBACK (open_file_cb),
+				                  (gpointer) gsearch);
+			}
+		}
+
+		if (list_length >= 2) {
+			separatormenuitem1 = gtk_separator_menu_item_new ();
+			gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), separatormenuitem1);
+			gtk_widget_show (separatormenuitem1);
+		}
+	}
+
+	/* Popup menu item: Open Folder */
+	new1 = gtk_image_menu_item_new_with_mnemonic  (_("Open _Folder"));
+	gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), new1);
+	gtk_widget_show (new1);
+
+	image1 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU);
+	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (new1), image1);
+	gtk_widget_show (image1);
+
+	g_signal_connect (G_OBJECT (new1),
+	                  "activate",
+	                  G_CALLBACK (open_folder_cb),
+	                  (gpointer) gsearch);
+
+	/* Popup menu item: Move to Trash */
+	separatormenuitem1 = gtk_separator_menu_item_new ();
+	gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), separatormenuitem1);
+	gtk_widget_show (separatormenuitem1);
+
+	new1 = gtk_image_menu_item_new_with_mnemonic  (_("Mo_ve to Trash"));
+	gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), new1);
+	gtk_widget_show (new1);
+
+	GtkIconTheme *icon_theme;
+	GdkPixbuf *pixbuf;
+	icon_theme = gtk_icon_theme_get_default ();
+	pixbuf = gtk_icon_theme_load_icon (icon_theme, "user-trash", GTK_ICON_SIZE_MENU, 0, NULL);
+	image1 = gtk_image_new_from_pixbuf (pixbuf);
+	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (new1), image1);
+	gtk_widget_show (image1);
+
+	g_signal_connect (G_OBJECT (new1),
+	                  "activate",
+	                  G_CALLBACK (move_to_trash_cb),
+	                  (gpointer) gsearch);
+
+	/* Popup menu item: Save Results As... */
+	separatormenuitem1 = gtk_separator_menu_item_new ();
+	gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), separatormenuitem1);
+	gtk_widget_show (separatormenuitem1);
+
+	gsearch->search_results_save_results_as_item = gtk_image_menu_item_new_with_mnemonic  (_("_Save Results As..."));
+	gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), gsearch->search_results_save_results_as_item);
+	gtk_widget_show (gsearch->search_results_save_results_as_item);
+
+	if (gsearch->command_details->command_status == RUNNING) {
+		gtk_widget_set_sensitive (gsearch->search_results_save_results_as_item, FALSE);
+	}
+
+	image1 = gtk_image_new_from_stock ("gtk-save", GTK_ICON_SIZE_MENU);
+	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (gsearch->search_results_save_results_as_item), image1);
+	gtk_widget_show (image1);
+
+	g_signal_connect (G_OBJECT (gsearch->search_results_save_results_as_item),
+	                  "activate",
+	                  G_CALLBACK (show_file_selector_cb),
+	                  (gpointer) gsearch);
+}	
+
 gboolean
 file_button_release_event_cb (GtkWidget * widget,
                               GdkEventButton * event,
                               gpointer data)
 {
 	GSearchWindow * gsearch = data;
-	gboolean no_files_found = FALSE;
-	GtkTreeIter iter;
 
 	if (event->window != gtk_tree_view_get_bin_window (GTK_TREE_VIEW (gsearch->search_results_tree_view))) {
 		return FALSE;
@@ -1025,8 +1215,12 @@
 	}
 
 	if (event->button == 3) {
+		gboolean no_files_found = FALSE;
 		GtkTreeModel * model;
+		GtkTreeIter iter;
 		GList * list;
+		gchar * utf8_name_first;
+		gchar * utf8_path_first;
 
 		list = gtk_tree_selection_get_selected_rows (GTK_TREE_SELECTION (gsearch->search_results_selection),
 		                                             &model);
@@ -1035,12 +1229,95 @@
 		                         g_list_first (list)->data);
 
 		gtk_tree_model_get (GTK_TREE_MODEL (gsearch->search_results_list_store), &iter,
+		                    COLUMN_NAME, &utf8_name_first,
+		                    COLUMN_PATH, &utf8_path_first,
 			    	    COLUMN_NO_FILES_FOUND, &no_files_found,
 			   	    -1);
 
 		if (!no_files_found) {
+
+			gboolean show_app_list = TRUE;
+			GAppInfo * first_app_info = NULL;
+			GTimer * timer;
+			GList * tmp;
+			gchar * utf8_name_tmp;
+			gchar * utf8_path_tmp;
+			gchar * utf8_file;
+			gint index;
+			gchar * utf8_filename;
+			gchar * locale_filename;
+			gchar * file = NULL;
+
+			timer = g_timer_new ();
+			g_timer_start (timer);
+
+			if (g_list_length (list) >= 2) {
+
+				/* Verify the selected files each have the same default handler. */
+				for (tmp = g_list_first (list), index = 0; tmp != NULL; tmp = g_list_next (tmp), index++) {
+			
+					GFile * g_file;
+					GAppInfo * app_info;
+					gchar * locale_file;
+
+					gtk_tree_model_get_iter (GTK_TREE_MODEL (gsearch->search_results_list_store), &iter,
+					                         tmp->data);
+
+					gtk_tree_model_get (GTK_TREE_MODEL (gsearch->search_results_list_store), &iter,
+					                    COLUMN_NAME, &utf8_name_tmp,
+					                    COLUMN_PATH, &utf8_path_tmp,
+					                    -1);
+
+					utf8_file = g_build_filename (utf8_path_tmp, utf8_name_tmp, NULL);
+					locale_file = g_filename_from_utf8 (utf8_file, -1, NULL, NULL, NULL);
+					g_file = g_file_new_for_path (locale_file);
+					app_info = g_file_query_default_handler (g_file, NULL, NULL);
+
+					if (G_IS_APP_INFO (app_info) == FALSE) {
+						show_app_list = FALSE;
+					}
+					else {
+						if (index == 0) { 
+							first_app_info = g_app_info_dup (app_info);
+							g_object_unref (app_info);
+							continue;
+						}
+
+						show_app_list = g_app_info_equal (app_info, first_app_info);
+						g_object_unref (app_info);
+
+						/* Break out, if more that 1.5 seconds have passed */
+						if (g_timer_elapsed (timer, NULL) > 1.50) {
+							show_app_list = FALSE;
+						}
+					}
+					g_object_unref (g_file);
+					g_free (utf8_name_tmp);
+					g_free (utf8_path_tmp);
+					g_free (utf8_file);
+
+					if (show_app_list == FALSE) {
+						break;
+					}
+				}
+				g_timer_destroy (timer);
+				if (first_app_info != NULL) {
+					g_object_unref (first_app_info);
+				}
+			}
+			utf8_filename = g_build_filename (utf8_path_first, utf8_name_first, NULL);
+			locale_filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL);
+			
+			file = g_strdup (((show_app_list == TRUE) ? locale_filename : NULL));
+
+			build_popup_menu_for_file (gsearch, file);
 			gtk_menu_popup (GTK_MENU (gsearch->search_results_popup_menu), NULL, NULL, NULL, NULL,
 			                event->button, event->time);
+
+			g_free (utf8_filename);
+			g_free (locale_filename);
+			g_free (file);
+
 		}
 		g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
 		g_list_free (list);
@@ -1048,7 +1325,7 @@
 	else if (event->button == 1 || event->button == 2) {
 		if (gsearch->is_search_results_single_click_to_activate == TRUE) {
 			if (!(event->state & GDK_CONTROL_MASK) && !(event->state & GDK_SHIFT_MASK)) {
-			     	open_file_cb ((GtkAction *) NULL, data);
+			     	open_file_cb ((GtkMenuItem *) NULL, data);
 			}
 		}
 	}
@@ -1073,7 +1350,7 @@
 	if (!(event->state & GDK_CONTROL_MASK) && !(event->state & GDK_SHIFT_MASK)) {
 		if (gsearch->is_search_results_single_click_to_activate == FALSE) {
 			if (event->type == GDK_2BUTTON_PRESS) {
-				open_file_cb ((GtkAction *) NULL, data);
+				open_file_cb ((GtkMenuItem *) NULL, data);
 				return TRUE;
 			}
 		}
@@ -1092,12 +1369,10 @@
 	GtkTreeIter iter;
 
 	if (gsearch->is_search_results_single_click_to_activate == FALSE) {
-		gdk_window_set_cursor (event->window, NULL);
 		return FALSE;
 	}
 
 	if (event->window != gtk_tree_view_get_bin_window (GTK_TREE_VIEW (gsearch->search_results_tree_view))) {
-		gdk_window_set_cursor (event->window, NULL);
                 return FALSE;
 	}
 
@@ -1233,7 +1508,8 @@
 		gboolean no_files_found = FALSE;
 		gchar * utf8_name;
 		gchar * utf8_path;
-		gchar * file;
+		gchar * utf8_file;
+		gchar * locale_file;
 
 		gtk_tree_model_get_iter (GTK_TREE_MODEL (gsearch->search_results_list_store), &iter,
 		                         g_list_nth (list, index)->data);
@@ -1244,10 +1520,11 @@
 		                    COLUMN_NO_FILES_FOUND, &no_files_found,
 		                    -1);
 
-		file = g_build_filename (utf8_path, utf8_name, NULL);
+		utf8_file = g_build_filename (utf8_path, utf8_name, NULL);
+		locale_file = g_filename_from_utf8 (utf8_file, -1, NULL, NULL, NULL);
 
 		if (!no_files_found) {
-			gchar * tmp_uri = g_filename_to_uri (file, NULL, NULL);
+			gchar * tmp_uri = g_filename_to_uri (locale_file, NULL, NULL);
 
 			if (uri_list == NULL) {
 				uri_list = g_strdup (tmp_uri);
@@ -1267,82 +1544,14 @@
 		}
 		g_free (utf8_name);
 		g_free (utf8_path);
-		g_free (file);
+		g_free (utf8_file);
+		g_free (locale_file);
 	}
 	g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
 	g_list_free (list);
 	g_free (uri_list);
 }
 
-void
-drag_data_animation_cb (GtkWidget * widget,
-                        GdkDragContext * context,
-                        GtkSelectionData * selection_data,
-                        guint info,
-                        guint time,
-                        gpointer data)
-{
-	GSearchWindow * gsearch = data;
-	GnomeDesktopItem * ditem;
-	GString * command = g_string_new ("");
-	gchar ** argv;
-	gchar * desktop_item_name = NULL;
-	gchar * uri;
-	gchar * path;
-	gchar * disk;
-	gchar * scheme;
-	gint argc;
-	gint index;
-
-	set_clone_command (gsearch, &argc, &argv, "gnome-search-tool", TRUE);
-
-	if (argc == 0) {
-		return;
-	}
-
-	for (index = 0; index < argc; index++) {
-		command = g_string_append (command, argv[index]);
-		command = g_string_append_c (command, ' ');
-	}
-	command = g_string_append (command, "--start");
-
-	disk = g_locale_from_utf8 (command->str, -1, NULL, NULL, NULL);
-	uri = gnome_vfs_make_uri_from_input_with_dirs (disk, GNOME_VFS_MAKE_URI_DIR_HOMEDIR);
-	scheme = gnome_vfs_get_uri_scheme (uri);
-
-	ditem = gnome_desktop_item_new ();
-
-	gnome_desktop_item_set_entry_type (ditem, GNOME_DESKTOP_ITEM_TYPE_APPLICATION);
-	gnome_desktop_item_set_string (ditem, GNOME_DESKTOP_ITEM_EXEC, command->str);
-
-	desktop_item_name = get_desktop_item_name (gsearch);
-
-	gnome_desktop_item_set_string (ditem, GNOME_DESKTOP_ITEM_NAME, desktop_item_name);
-	gnome_desktop_item_set_boolean (ditem, GNOME_DESKTOP_ITEM_TERMINAL, FALSE);
-	gnome_desktop_item_set_string (ditem, GNOME_DESKTOP_ITEM_ICON, GNOME_SEARCH_TOOL_ICON);
-	gnome_desktop_item_set_boolean (ditem, "StartupNotify", TRUE);
-
-	g_string_free (command, TRUE);
-	g_free (desktop_item_name);
-	g_free (uri);
-
-	path = gsearchtool_get_unique_filename (g_get_tmp_dir (), ".desktop");
-	gnome_desktop_item_set_location (ditem, path);
-
-	uri = gnome_vfs_get_uri_from_local_path (path);
-
-	if (gnome_desktop_item_save (ditem, NULL, FALSE, NULL)) {
-		gtk_selection_data_set (selection_data,
-					selection_data->target, 8,
-					(guchar *) uri, strlen (uri));
-	}
-	gnome_desktop_item_unref (ditem);
-
-	g_free (uri);
-	g_free (path);
-	g_free (disk);
-	g_free (scheme);
-}
 
 void
 show_file_selector_cb (GtkAction * action,

Modified: trunk/gsearchtool/gsearchtool-callbacks.h
==============================================================================
--- trunk/gsearchtool/gsearchtool-callbacks.h	(original)
+++ trunk/gsearchtool/gsearchtool-callbacks.h	Tue Mar 17 02:08:08 2009
@@ -76,16 +76,23 @@
 name_contains_activate_cb (GtkWidget * widget,
                            gpointer data);
 void
-open_file_cb (GtkAction * action,
+look_in_folder_changed_cb (GtkWidget * widget,
+                           gpointer data);
+void
+open_file_cb (GtkMenuItem * action,
               gpointer data);
 void
+open_file_event_cb (GtkWidget * widget,
+                    GdkEventButton * event,
+                    gpointer data);
+void
 open_folder_cb (GtkAction * action,
                 gpointer data);
 void
-file_changed_cb (GnomeVFSMonitorHandle * handle,
+file_changed_cb (GFileMonitor * handle,
                  const gchar * monitor_uri,
                  const gchar * info_uri,
-                 GnomeVFSMonitorEventType event_type,
+                 GFileMonitorEvent event_type,
                  gpointer data);
 void
 move_to_trash_cb (GtkAction * action,
@@ -102,13 +109,6 @@
               guint time,
               gpointer data);
 void
-drag_data_animation_cb (GtkWidget * widget,
-                        GdkDragContext * context,
-                        GtkSelectionData * selection_data,
-                        guint info,
-                        guint time,
-                        gpointer data);
-void
 show_file_selector_cb (GtkAction * action,
                        gpointer data);
 void

Modified: trunk/gsearchtool/gsearchtool-support.c
==============================================================================
--- trunk/gsearchtool/gsearchtool-support.c	(original)
+++ trunk/gsearchtool/gsearchtool-support.c	Tue Mar 17 02:08:08 2009
@@ -34,12 +34,8 @@
 #include <glib.h>
 #include <regex.h>
 #include <gdk/gdkx.h>
-#include <libgnomevfs/gnome-vfs-mime.h>
-#include <libgnomevfs/gnome-vfs-mime-handlers.h>
-#include <libgnomevfs/gnome-vfs-ops.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
+#include <gio/gio.h>
 #include <libgnome/gnome-desktop-item.h>
-#include <libgnomeui/gnome-thumbnail.h>
 
 #include <gnome.h>
 
@@ -51,16 +47,13 @@
 #define C_STANDARD_NUMERIC_STRFTIME_CHARACTERS "dHIjmMSUwWyY"
 #define SUS_EXTENDED_STRFTIME_MODIFIERS "EO"
 #define BINARY_EXEC_MIME_TYPE      "application/x-executable"
-#define ICON_THEME_EXECUTABLE_ICON "gnome-fs-executable"
-#define ICON_THEME_REGULAR_ICON    "gnome-fs-regular"
-#define ICON_THEME_CHAR_DEVICE     "gnome-fs-chardev"
-#define ICON_THEME_BLOCK_DEVICE    "gnome-fs-blockdev"
-#define ICON_THEME_SOCKET          "gnome-fs-socket"
-#define ICON_THEME_FIFO            "gnome-fs-fifo"
-#define MAX_SYMLINKS_FOLLOWED      32
 #define GSEARCH_DATE_FORMAT_LOCALE "locale"
 #define GSEARCH_DATE_FORMAT_ISO    "iso"
 
+GtkTreeViewColumn *
+gsearchtool_gtk_tree_view_get_column_with_sort_column_id (GtkTreeView * treeview,
+                                                          gint id);
+
 /* START OF THE GCONF FUNCTIONS */
 
 static gboolean
@@ -122,6 +115,24 @@
 	return result;
 }
 
+void
+gsearchtool_gconf_set_string (const gchar * key,
+                              const gchar * value)
+{
+	GConfClient * client;
+	GError * error = NULL;
+
+	g_return_if_fail (key != NULL);
+
+	client = gsearchtool_gconf_client_get_global ();
+	g_return_if_fail (client != NULL);
+
+	gconf_client_set_string (client, key, value, &error);
+
+	gsearchtool_gconf_handle_error (&error);			      
+			      
+}
+
 GSList *
 gsearchtool_gconf_get_list (const gchar * key,
                             GConfValueType list_type)
@@ -549,6 +560,54 @@
 }
 
 gchar *
+escape_double_quotes (const gchar * string)
+{
+	GString * gs;
+
+	if (string == NULL) {
+		return NULL;
+	}
+
+	if (count_of_char_in_string (string, '\"') == 0) {
+		return g_strdup(string);
+	}
+	gs = g_string_new ("");
+	for(; *string; string++) {
+		if (*string == '\"') {
+			g_string_append(gs, "\\\"");
+		}
+		else {
+			g_string_append_c(gs, *string);
+		}
+	}
+	return g_string_free (gs, FALSE);
+}
+
+gchar *
+backslash_backslash_characters (const gchar * string)
+{
+	GString * gs;
+
+	if (string == NULL) {
+		return NULL;
+	}
+
+	if (count_of_char_in_string (string, '\\') == 0){
+		return g_strdup(string);
+	}
+	gs = g_string_new ("");
+	for(; *string; string++) {
+		if (*string == '\\') {
+			g_string_append(gs, "\\\\");
+		}
+		else {
+			g_string_append_c(gs, *string);
+		}
+	}
+	return g_string_free (gs, FALSE);
+}
+
+gchar *
 backslash_special_characters (const gchar * string)
 {
 	GString * gs;
@@ -557,7 +616,7 @@
 		return NULL;
 	}
 
-	if ((count_of_char_in_string (string, '\\') == 0) &&
+	if ((count_of_char_in_string (string, '\\') == 0) && 
 	    (count_of_char_in_string (string, '-') == 0)) {
 		return g_strdup(string);
 	}
@@ -566,7 +625,7 @@
 		if (*string == '\\') {
 			g_string_append(gs, "\\\\");
 		}
-		else if (*string == '-') {
+		if (*string == '-') {
 			g_string_append(gs, "\\-");
 		}
 		else {
@@ -791,42 +850,50 @@
 
 gchar *
 get_file_type_description (const gchar * file,
-                           GnomeVFSFileInfo * file_info)
+                           GFileInfo * file_info)
 {
+	const char * content_type = NULL;
 	gchar * desc;
 
-	if (file == NULL || file_info->mime_type == NULL) {
-		return g_strdup (gnome_vfs_mime_get_description (GNOME_VFS_MIME_TYPE_UNKNOWN));
+	if (file != NULL) {
+		content_type = g_file_info_get_content_type (file_info);
 	}
 
-	desc = g_strdup (gnome_vfs_mime_get_description (file_info->mime_type));
+	if (content_type == NULL || g_content_type_is_unknown (content_type) == TRUE) {
+		return g_strdup (g_content_type_get_description ("application/octet-stream"));
+	}	
 
-	if (file_info->symlink_name != NULL) {
+	desc = g_strdup (g_content_type_get_description (content_type));
 
+	if (g_file_info_get_is_symlink (file_info) == TRUE) {
+
+		const gchar * symlink_target;
 		gchar * absolute_symlink = NULL;
 		gchar * str = NULL;
 
-		if (g_path_is_absolute (file_info->symlink_name) != TRUE) {
+		symlink_target = g_file_info_get_symlink_target (file_info);
+
+		if (g_path_is_absolute (symlink_target) != TRUE) {
 			gchar *dirname;
 
 			dirname = g_path_get_dirname (file);
-			absolute_symlink = g_strconcat (dirname, G_DIR_SEPARATOR_S, file_info->symlink_name, NULL);
+			absolute_symlink = g_strconcat (dirname, G_DIR_SEPARATOR_S, symlink_target, NULL);
 			g_free (dirname);
 		}
 		else {
-			absolute_symlink = g_strdup (file_info->symlink_name);
+			absolute_symlink = g_strdup (symlink_target);
 		}
 
 		if (g_file_test (absolute_symlink, G_FILE_TEST_EXISTS) != TRUE) {
-                       if ((g_ascii_strcasecmp (file_info->mime_type, "x-special/socket") != 0) &&
-                           (g_ascii_strcasecmp (file_info->mime_type, "x-special/fifo") != 0)) {
+                       if ((g_ascii_strcasecmp (content_type, "x-special/socket") != 0) &&
+                           (g_ascii_strcasecmp (content_type, "x-special/fifo") != 0)) {
 				g_free (absolute_symlink);
 				g_free (desc);
 				return g_strdup (_("link (broken)"));
 			}
 		}
 
-		str = g_strdup_printf (_("link to %s"), (desc != NULL) ? desc : file_info->mime_type);
+		str = g_strdup_printf (_("link to %s"), (desc != NULL) ? desc : content_type);
 		g_free (absolute_symlink);
 		g_free (desc);
 		return str;
@@ -1020,17 +1087,12 @@
 }
 
 static GdkPixbuf *
-gsearchtool_get_thumbnail_image (const gchar * file)
+gsearchtool_get_thumbnail_image (const gchar * thumbnail)
 {
 	GdkPixbuf * pixbuf = NULL;
-	gchar * thumbnail_path;
-	gchar * uri;
 
-	uri = gnome_vfs_get_uri_from_local_path (file);
-	thumbnail_path = gnome_thumbnail_path_for_uri (uri, GNOME_THUMBNAIL_SIZE_NORMAL);
-
-	if (thumbnail_path != NULL) {
-		if (g_file_test (thumbnail_path, G_FILE_TEST_EXISTS)) {
+	if (thumbnail != NULL) {
+		if (g_file_test (thumbnail, G_FILE_TEST_EXISTS)) {
 
 			GdkPixbuf * thumbnail_pixbuf = NULL;
 			gfloat scale_factor_x = 1.0;
@@ -1038,7 +1100,7 @@
 			gint scale_x;
 			gint scale_y;
 
-			thumbnail_pixbuf = gdk_pixbuf_new_from_file (thumbnail_path, NULL);
+			thumbnail_pixbuf = gdk_pixbuf_new_from_file (thumbnail, NULL);
 			gsearchtool_thumbnail_frame_image (&thumbnail_pixbuf);
 
 			if (gdk_pixbuf_get_width (thumbnail_pixbuf) > ICON_SIZE) {
@@ -1060,159 +1122,71 @@
 			pixbuf = gdk_pixbuf_scale_simple (thumbnail_pixbuf, scale_x, scale_y, GDK_INTERP_BILINEAR);
 			g_object_unref (thumbnail_pixbuf);
 		}
-		g_free (thumbnail_path);
 	}
-	g_free (uri);
 	return pixbuf;
 }
 
-static gchar *
-gsearchtool_icon_lookup (GSearchWindow * gsearch,
-                         const gchar * file,
-                         const gchar * mime,
-                         GnomeVFSFileInfo * file_info,
-                         gboolean enable_thumbnails)
-{
-	GnomeIconLookupFlags lookup_flags = GNOME_ICON_LOOKUP_FLAGS_NONE;
-	gchar * icon_name = NULL;
-	gchar * uri;
-
-	uri = gnome_vfs_get_uri_from_local_path (file);
-
-	if ((enable_thumbnails == TRUE) && (gsearch->show_thumbnails == TRUE)) {
-		if ((strncmp (file_info->mime_type, "image/", 6) != 0) ||
-	    	    (file_info->size < gsearch->show_thumbnails_file_size_limit)) {
-		    	if (gsearch->thumbnail_factory == NULL) {
-			    	gsearch->thumbnail_factory = gnome_thumbnail_factory_new (GNOME_THUMBNAIL_SIZE_NORMAL);
-			}
-			lookup_flags = GNOME_ICON_LOOKUP_FLAGS_SHOW_SMALL_IMAGES_AS_THEMSELVES |
-			               GNOME_ICON_LOOKUP_FLAGS_ALLOW_SVG_AS_THEMSELVES;
-		}
-	}
-
-	icon_name = gnome_icon_lookup (gtk_icon_theme_get_default (),
-	                               gsearch->thumbnail_factory,
-				       uri,
-				       NULL,
-				       file_info,
-				       mime,
-				       lookup_flags,
-				       NULL);
-	g_free (uri);
-	return icon_name;
-}
-
-GdkPixbuf *
-get_file_pixbuf (GSearchWindow * gsearch,
-                 const gchar * file,
-                 GnomeVFSFileInfo * file_info)
+static GdkPixbuf *
+get_themed_icon_pixbuf (GThemedIcon * icon,
+                        int size,
+                        GtkIconTheme * icon_theme)
 {
+	char ** icon_names;
+	GtkIconInfo * icon_info;
 	GdkPixbuf * pixbuf;
-	gchar * icon_name = NULL;
-
-	if (file == NULL || file_info->mime_type == NULL) {
-		icon_name = g_strdup (ICON_THEME_REGULAR_ICON);
-	}
-	else if ((g_file_test (file, G_FILE_TEST_IS_EXECUTABLE)) &&
-	         (g_ascii_strcasecmp (file_info->mime_type, "application/x-executable-binary") == 0)) {
-		icon_name = g_strdup (ICON_THEME_EXECUTABLE_ICON);
-	}
-	else if (g_ascii_strcasecmp (file_info->mime_type, "x-special/device-char") == 0) {
-		icon_name = g_strdup (ICON_THEME_CHAR_DEVICE);
-	}
-	else if (g_ascii_strcasecmp (file_info->mime_type, "x-special/device-block") == 0) {
-		icon_name = g_strdup (ICON_THEME_BLOCK_DEVICE);
-	}
-	else if (g_ascii_strcasecmp (file_info->mime_type, "x-special/socket") == 0) {
-		icon_name = g_strdup (ICON_THEME_SOCKET);
-	}
-	else if (g_ascii_strcasecmp (file_info->mime_type, "x-special/fifo") == 0) {
-		icon_name = g_strdup (ICON_THEME_FIFO);
-	}
-	else {
-		icon_name = gsearchtool_icon_lookup (gsearch, file, file_info->mime_type, file_info, TRUE);
-	}
+	GError * error = NULL;
 
-	pixbuf = (GdkPixbuf *) g_hash_table_lookup (gsearch->search_results_filename_hash_table, icon_name);
+	g_object_get (icon, "names", &icon_names, NULL);
 
+	icon_info = gtk_icon_theme_choose_icon (icon_theme, (const char **)icon_names, size, 0);
+	if (icon_info == NULL) {
+		icon_info = gtk_icon_theme_lookup_icon (icon_theme, "text-x-generic", size, GTK_ICON_LOOKUP_USE_BUILTIN);
+	}
+	pixbuf = gtk_icon_info_load_icon (icon_info, &error);
 	if (pixbuf == NULL) {
+		g_warning ("Could not load icon pixbuf: %s\n", error->message);
+		g_clear_error (&error);
+	}
 
-		if (gsearch->show_thumbnails == TRUE) {
-
-			if ((strncmp (file_info->mime_type, "image/", 6) != 0) ||
-	    		    (file_info->size < gsearch->show_thumbnails_file_size_limit)) {
-
-				if (strcmp (icon_name, file) == 0) {
-					pixbuf = gdk_pixbuf_new_from_file_at_scale (file, ICON_SIZE, ICON_SIZE, TRUE, NULL);
-
-					if (pixbuf == NULL) {
-						icon_name = gsearchtool_icon_lookup (gsearch, file, file_info->mime_type, file_info, FALSE);
-					}
-				}
+	gtk_icon_info_free (icon_info);
+	g_strfreev (icon_names);
 
-				if (pixbuf == NULL) {
-					pixbuf = gsearchtool_get_thumbnail_image (file);
-				}
-			}
-		}
+	return pixbuf;
+}
 
-		if (pixbuf == NULL) {
 
-			GdkPixbuf * thumbnail_pixbuf = NULL;
 
-			thumbnail_pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), icon_name,
-			                                             ICON_SIZE, 0, NULL);
+GdkPixbuf *
+get_file_pixbuf (GSearchWindow * gsearch,
+                 GFileInfo * file_info)
+{
+	GdkPixbuf * pixbuf;
+	GIcon * icon = NULL;
+	const gchar * content_type = NULL;
+	const gchar * thumbnail_path = NULL;
 
-			if (thumbnail_pixbuf != NULL) {
+	if (file_info == NULL) {
+		return NULL;
+	}
 
-				/*  The following is a workaround for bugzilla report #311318,                   */
-				/*  "gtk_icon_theme_load_icon () can return pixbufs larger than requested size". */
-				/*  Please see the url, http://bugzilla.gnome.org/show_bug.cgi?id=311318.        */
-
-				if ((gdk_pixbuf_get_width (thumbnail_pixbuf) > ICON_SIZE) ||
-				    (gdk_pixbuf_get_height (thumbnail_pixbuf) > ICON_SIZE)) {
-
-					gfloat scale_factor_x = 1.0;
-					gfloat scale_factor_y = 1.0;
-					gint scale_x;
-					gint scale_y;
-
-					if (gdk_pixbuf_get_width (thumbnail_pixbuf) > ICON_SIZE) {
-						scale_factor_x = (gfloat) ICON_SIZE / (gfloat) gdk_pixbuf_get_width (thumbnail_pixbuf);
-					}
-					if (gdk_pixbuf_get_height (thumbnail_pixbuf) > ICON_SIZE) {
-						scale_factor_y = (gfloat) ICON_SIZE / (gfloat) gdk_pixbuf_get_height (thumbnail_pixbuf);
-					}
-
-					if (gdk_pixbuf_get_width (thumbnail_pixbuf) > gdk_pixbuf_get_height (thumbnail_pixbuf)) {
-						scale_x = ICON_SIZE;
-						scale_y = (gint) (gdk_pixbuf_get_height (thumbnail_pixbuf) * scale_factor_x);
-					}
-					else {
-						scale_x = (gint) (gdk_pixbuf_get_width (thumbnail_pixbuf) * scale_factor_y);
-						scale_y = ICON_SIZE;
-					}
+	content_type = g_file_info_get_content_type (file_info);
+	icon = g_file_info_get_icon (file_info);
 
-					pixbuf = gdk_pixbuf_scale_simple (thumbnail_pixbuf, scale_x, scale_y, GDK_INTERP_BILINEAR);
-					g_object_unref (thumbnail_pixbuf);
-				}
-				else {
-					pixbuf = thumbnail_pixbuf;
-				}
-			}
-		}
+	if (gsearch->show_thumbnails == TRUE) {
+		thumbnail_path = g_file_info_get_attribute_byte_string (file_info, G_FILE_ATTRIBUTE_THUMBNAIL_PATH);
+	}
 
-		if (pixbuf != NULL) {
-			g_hash_table_insert (gsearch->search_results_filename_hash_table, icon_name, pixbuf);
-		}
-		else {
-			g_free (icon_name);
-		}
+	if (thumbnail_path != NULL) {
+		pixbuf = gsearchtool_get_thumbnail_image (thumbnail_path);
 	}
 	else {
-		g_free (icon_name);
-	}
+		pixbuf = (GdkPixbuf *) g_hash_table_lookup (gsearch->search_results_filename_hash_table, content_type);
 
+		if (pixbuf == NULL) {
+			pixbuf = get_themed_icon_pixbuf (G_THEMED_ICON (icon), ICON_SIZE, gtk_icon_theme_get_default ());
+			g_hash_table_insert (gsearch->search_results_filename_hash_table, g_strdup (content_type), pixbuf);	
+		}
+	}
 	return pixbuf;
 }
 
@@ -1281,69 +1255,49 @@
 
 gboolean
 open_file_with_application (GtkWidget * window,
-                            const gchar * file)
+                            const gchar * file,
+                            GAppInfo * app)
 {
-	GnomeVFSMimeApplication * application;
-	const char * mime;
+	GdkAppLaunchContext * context;
+	gboolean result;
 
-	mime = gnome_vfs_get_file_mime_type (file, NULL, FALSE);
-	application = gnome_vfs_mime_get_default_application (mime);
+	context = gdk_app_launch_context_new ();
 
-	if (!g_file_test (file, G_FILE_TEST_IS_DIR)) {
-		if (application) {
-			const char *desktop_file;
-			GnomeDesktopItem *ditem;
-		 	GdkScreen *screen;
-		 	GError *error = NULL;
-			GList *uris = NULL;
-			gboolean result;
-			char *uri;
+	if (app == NULL) {
+		gchar * uri;
 
-			desktop_file = gnome_vfs_mime_application_get_desktop_file_path (application);
+		uri = g_filename_to_uri (file, NULL, NULL);
+		result = g_app_info_launch_default_for_uri (uri, (GAppLaunchContext *) context, NULL);
+		g_free (uri);
+	}
+	else {
+		GList * g_file_list = NULL;
+		GFile * g_file = NULL;
 
-			uri = gnome_vfs_get_uri_from_local_path (file);
-			uris = g_list_append (uris, uri);
+		g_file = g_file_new_for_path (file);
 
-			if (!g_file_test (desktop_file, G_FILE_TEST_EXISTS)) {
-				result = (gnome_vfs_mime_application_launch (application, uris) == GNOME_VFS_OK);
-			}
-			else {
-				result = TRUE;
-				ditem = gnome_desktop_item_new_from_file (desktop_file, 0, &error);
-				if (error) {
-					result = FALSE;
-					g_error_free (error);
-				}
-				else {
-				 	screen = gtk_widget_get_screen (window);
-					gnome_desktop_item_set_launch_time (ditem, gtk_get_current_event_time ());
-					gnome_desktop_item_launch_on_screen (ditem, uris,
-						GNOME_DESKTOP_ITEM_LAUNCH_APPEND_PATHS, screen, -1, &error);
-					if (error) {
-						result = FALSE;
-						g_error_free (error);
-					}
-				}
-				gnome_desktop_item_unref (ditem);
-			}
-			gnome_vfs_mime_application_free (application);
-			g_list_free (uris);
-			g_free (uri);
+		if (g_file == NULL) {
+			result = FALSE;
+		}
+		else {
+			g_file_list = g_list_prepend (g_file_list, g_file);
 
-			return result;
+			result = g_app_info_launch (app, g_file_list, (GAppLaunchContext *) context, NULL);
+			g_list_free (g_file_list);
+			g_object_unref (g_file);
 		}
 	}
-	return FALSE;
+	return result;
 }
 
 gboolean
 launch_file (const gchar * file)
 {
-	const char * mime = gnome_vfs_get_file_mime_type (file, NULL, FALSE);
+	const char * content_type = g_content_type_guess (file, NULL, 0, NULL);
 	gboolean result = FALSE;
 
 	if ((g_file_test (file, G_FILE_TEST_IS_EXECUTABLE)) &&
-	    (g_ascii_strcasecmp (mime, BINARY_EXEC_MIME_TYPE) == 0)) {
+	    (g_ascii_strcasecmp (content_type, BINARY_EXEC_MIME_TYPE) == 0)) {
 		result = g_spawn_command_line_async (file, NULL);
 	}
 

Modified: trunk/gsearchtool/gsearchtool-support.h
==============================================================================
--- trunk/gsearchtool/gsearchtool-support.h	(original)
+++ trunk/gsearchtool/gsearchtool-support.h	Tue Mar 17 02:08:08 2009
@@ -52,6 +52,10 @@
 char *
 gsearchtool_gconf_get_string (const gchar * key);
 
+void
+gsearchtool_gconf_set_string (const gchar * key,
+                              const gchar * value);
+
 GSList *
 gsearchtool_gconf_get_list (const gchar * key,
                             GConfValueType list_type);
@@ -86,6 +90,12 @@
 escape_single_quotes (const gchar * string);
 
 gchar *
+escape_double_quotes (const gchar * string);
+
+gchar *
+backslash_backslash_characters (const gchar * string);
+
+gchar *
 backslash_special_characters (const gchar * string);
 
 gchar *
@@ -99,17 +109,17 @@
                              struct tm * time_pieces);
 gchar *
 get_file_type_description (const gchar * file,
-                           GnomeVFSFileInfo * file_info);
+                           GFileInfo * file_info);
 GdkPixbuf *
 get_file_pixbuf (GSearchWindow * gsearch,
-                 const gchar * file,
-                 GnomeVFSFileInfo * file_info);
+                 GFileInfo * file_info);
 gboolean
 open_file_with_nautilus (GtkWidget * window,
                          const gchar * file);
 gboolean
 open_file_with_application (GtkWidget * window,
-                            const gchar * file);
+                            const gchar * file,
+                            GAppInfo * app);
 gboolean
 launch_file (const gchar * file);
 

Modified: trunk/gsearchtool/gsearchtool.c
==============================================================================
--- trunk/gsearchtool/gsearchtool.c	(original)
+++ trunk/gsearchtool/gsearchtool.c	Tue Mar 17 02:08:08 2009
@@ -40,9 +40,7 @@
 #include <sys/wait.h>
 #include <glib/gi18n.h>
 #include <gdk/gdk.h>
-#include <libgnomevfs/gnome-vfs-mime.h>
-#include <libgnomevfs/gnome-vfs-ops.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
+#include <gio/gio.h>
 
 #include <gnome.h>
 
@@ -51,7 +49,7 @@
 #include "gsearchtool-support.h"
 #include "gsearchtool-spinner.h"
 
-#define GNOME_SEARCH_TOOL_DEFAULT_ICON_SIZE 48
+#define GNOME_SEARCH_TOOL_DEFAULT_ICON_SIZE 16
 #define GNOME_SEARCH_TOOL_STOCK "panel-searchtool"
 #define GNOME_SEARCH_TOOL_REFRESH_DURATION  50000
 #define LEFT_LABEL_SPACING "     "
@@ -97,7 +95,7 @@
 	{ SEARCH_CONSTRAINT_TYPE_SEPARATOR, NULL, NULL, NULL, TRUE },
 	{ SEARCH_CONSTRAINT_TYPE_BOOLEAN, "SHOW_HIDDEN_FILES", N_("Show hidden and backup files"), NULL, FALSE },
 	{ SEARCH_CONSTRAINT_TYPE_BOOLEAN, "-follow", N_("Follow symbolic links"), NULL, FALSE },
-	{ SEARCH_CONSTRAINT_TYPE_BOOLEAN, "INCLUDE_OTHER_FILESYSTEMS", N_("Include other filesystems"), NULL, FALSE },
+	{ SEARCH_CONSTRAINT_TYPE_BOOLEAN, "EXCLUDE_OTHER_FILESYSTEMS", N_("Exclude other filesystems"), NULL, FALSE },
 	{ SEARCH_CONSTRAINT_TYPE_NONE, NULL, NULL, NULL, FALSE}
 };
 
@@ -148,7 +146,7 @@
 	gchar * regex;
 	gboolean hidden;
 	gboolean follow;
-	gboolean allmounts;
+	gboolean mounts;
 	gchar * sortby;
 	gboolean descending;
 	gboolean start;
@@ -173,29 +171,10 @@
 	{ "regex", 0, 0, G_OPTION_ARG_STRING, &GSearchGOptionArguments.regex, NULL, N_("PATTERN") },
 	{ "hidden", 0, 0, G_OPTION_ARG_NONE, &GSearchGOptionArguments.hidden, NULL, NULL },
 	{ "follow", 0, 0, G_OPTION_ARG_NONE, &GSearchGOptionArguments.follow, NULL, NULL },
-	{ "allmounts", 0, 0, G_OPTION_ARG_NONE, &GSearchGOptionArguments.allmounts, NULL, NULL },
+	{ "mounts", 0, 0, G_OPTION_ARG_NONE, &GSearchGOptionArguments.mounts, NULL, NULL },
 	{ NULL }
 };
 
-static GtkActionEntry GSearchUiEntries[] = {
-  { "Open",          GTK_STOCK_OPEN,    N_("_Open"),               NULL, NULL, NULL },
-  { "OpenFolder",    GTK_STOCK_OPEN,    N_("O_pen Folder"),        NULL, NULL, NULL },
-  { "MoveToTrash",   GTK_STOCK_DELETE,  N_("Mo_ve to Trash"),      NULL, NULL, NULL },
-  { "SaveResultsAs", GTK_STOCK_SAVE_AS, N_("_Save Results As..."), NULL, NULL, NULL },
-};
-
-static const char * GSearchUiDescription =
-"<ui>"
-"  <popup name='PopupMenu'>"
-"      <menuitem action='Open'/>"
-"      <menuitem action='OpenFolder'/>"
-"      <separator/>"
-"      <menuitem action='MoveToTrash'/>"
-"      <separator/>"
-"      <menuitem action='SaveResultsAs'/>"
-"  </popup>"
-"</ui>";
-
 static gchar * find_command_default_name_argument;
 static gchar * locate_command_default_options;
 pid_t locate_database_check_command_pid;
@@ -412,12 +391,12 @@
 	if (strstr (file, "*") == NULL) {
 
 		if ((strlen (file) == 0) || (file[0] != '.')) {
-	 		g_string_append_printf (command, "\\( %s '*%s*' -o %s '.*%s*' \\) ",
+	 		g_string_append_printf (command, "\\( %s \"*%s*\" -o %s \".*%s*\" \\) ",
 					find_command_default_name_argument, file,
 					find_command_default_name_argument, file);
 		}
 		else {
-			g_string_append_printf (command, "\\( %s '*%s*' -o %s '.*%s*' -o %s '%s*' \\) ",
+			g_string_append_printf (command, "\\( %s \"*%s*\" -o %s \".*%s*\" -o %s \"%s*\" \\) ",
 					find_command_default_name_argument, file,
 					find_command_default_name_argument, file,
 					find_command_default_name_argument, file);
@@ -425,22 +404,22 @@
 	}
 	else {
 		if (file[0] == '.') {
-			g_string_append_printf (command, "\\( %s '%s' -o %s '.*%s' \\) ",
+			g_string_append_printf (command, "\\( %s \"%s\" -o %s \".*%s\" \\) ",
 					find_command_default_name_argument, file,
 					find_command_default_name_argument, file);
 		}
 		else if (file[0] != '*') {
-			g_string_append_printf (command, "%s '%s' ",
+			g_string_append_printf (command, "%s \"%s\" ",
 					find_command_default_name_argument, file);
 		}
 		else {
 			if ((strlen (file) >= 1) && (file[1] == '.')) {
-				g_string_append_printf (command, "\\( %s '%s' -o %s '%s' \\) ",
+				g_string_append_printf (command, "\\( %s \"%s\" -o %s \"%s\" \\) ",
 					find_command_default_name_argument, file,
 					find_command_default_name_argument, &file[1]);
 			}
 			else {
-				g_string_append_printf (command, "\\( %s '%s' -o %s '.%s' \\) ",
+				g_string_append_printf (command, "\\( %s \"%s\" -o %s \".%s\" \\) ",
 					find_command_default_name_argument, file,
 					find_command_default_name_argument, file);
 			}
@@ -519,6 +498,7 @@
 		gtk_label_set_text (GTK_LABEL (gsearch->files_found_label), "");
 		if (gsearchtool_gconf_get_boolean ("/desktop/gnome/interface/enable_animations")) {
 			gsearch_spinner_start (GSEARCH_SPINNER (gsearch->progress_spinner));
+			gtk_widget_show (gsearch->progress_spinner);
 		}
 		g_free (title);
 
@@ -529,7 +509,6 @@
 		gtk_widget_set_sensitive (gsearch->stop_button, TRUE);
 		gtk_widget_hide (gsearch->find_button);
 		gtk_widget_set_sensitive (gsearch->find_button, FALSE);
-		gtk_widget_set_sensitive (gsearch->search_results_save_results_as_item, FALSE);
 		gtk_widget_set_sensitive (gsearch->search_results_vbox, TRUE);
 		gtk_widget_set_sensitive (GTK_WIDGET (gsearch->search_results_tree_view), TRUE);
 		gtk_widget_set_sensitive (gsearch->available_options_vbox, FALSE);
@@ -548,10 +527,14 @@
 	gtk_widget_set_sensitive (gsearch->show_more_options_expander, TRUE);
 	gtk_widget_set_sensitive (gsearch->name_and_folder_table, TRUE);
 	gtk_widget_set_sensitive (gsearch->find_button, TRUE);
-	gtk_widget_set_sensitive (gsearch->search_results_save_results_as_item, TRUE);
+	gtk_widget_hide (gsearch->progress_spinner);
 	gtk_widget_hide (gsearch->stop_button);
 	gtk_widget_show (gsearch->find_button);
 
+	if (GTK_IS_MENU_ITEM (gsearch->search_results_save_results_as_item) == TRUE) {
+		gtk_widget_set_sensitive (gsearch->search_results_save_results_as_item, TRUE);
+	}
+
 	if (gtk_window_get_focus (GTK_WINDOW (gsearch->window)) == NULL) {
 		gtk_window_set_focus (GTK_WINDOW (gsearch->window), gsearch->focus);
 	}
@@ -567,8 +550,9 @@
 	gchar * file_is_named_locale;
 	gchar * file_is_named_escaped;
 	gchar * file_is_named_backslashed;
-	gchar * look_in_folder_utf8;
 	gchar * look_in_folder_locale;
+	gchar * look_in_folder_escaped;
+	gchar * look_in_folder_backslashed;
 
 	start_animation (gsearch, first_pass);
 	setup_case_insensitive_arguments (gsearch);
@@ -612,20 +596,9 @@
 		return NULL;
 	}
 
-	look_in_folder_utf8 = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (gsearch->look_in_folder_button));
+	look_in_folder_locale = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (gsearch->look_in_folder_button));
 
-	if (look_in_folder_utf8 != NULL) {
-		look_in_folder_locale = g_locale_from_utf8 (look_in_folder_utf8, -1, NULL, NULL, &error);
-		if (look_in_folder_locale == NULL) {
-			stop_animation (gsearch);
-			display_dialog_character_set_conversion_error (gsearch->window, look_in_folder_utf8, error);
-			g_free (look_in_folder_utf8);
-			g_error_free (error);
-			return NULL;
-		}
-		g_free (look_in_folder_utf8);
-	}
-	else {
+	if (look_in_folder_locale == NULL) {
 		/* If for some reason a path was not returned fallback to the user's home directory. */
 		look_in_folder_locale = g_strdup (g_get_home_dir ());
 		gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (gsearch->look_in_folder_button), look_in_folder_locale);
@@ -640,6 +613,8 @@
 	}
 	g_free (gsearch->command_details->look_in_folder_string);
 
+	look_in_folder_backslashed = backslash_backslash_characters (look_in_folder_locale);
+	look_in_folder_escaped = escape_double_quotes (look_in_folder_backslashed);
 	gsearch->command_details->look_in_folder_string = g_strdup (look_in_folder_locale);
 
 	command = g_string_new ("");
@@ -656,8 +631,8 @@
 	if ((GTK_WIDGET_VISIBLE (gsearch->available_options_vbox) == FALSE) ||
 	    (has_additional_constraints (gsearch) == FALSE)) {
 
-		file_is_named_backslashed = backslash_special_characters (file_is_named_locale);
-		file_is_named_escaped = escape_single_quotes (file_is_named_backslashed);
+		file_is_named_backslashed = backslash_backslash_characters (file_is_named_locale);
+		file_is_named_escaped = escape_double_quotes (file_is_named_backslashed);
 		gsearch->command_details->name_contains_pattern_string = g_strdup (file_is_named_utf8);
 
 		if (gsearch->command_details->is_command_first_pass == TRUE) {
@@ -687,16 +662,16 @@
 			    && (locate != NULL)
 			    && (is_quick_search_excluded_path (look_in_folder_locale) == FALSE)) {
 
-					g_string_append_printf (command, "%s %s '%s*%s'",
+					g_string_append_printf (command, "%s %s \"%s*%s\"",
 							locate,
 							locate_command_default_options,
-							look_in_folder_locale,
+							look_in_folder_escaped,
 							file_is_named_escaped);
 					gsearch->command_details->is_command_using_quick_mode = TRUE;
 			}
 			else {
-				g_string_append_printf (command, "find \"%s\" %s '%s' -xdev -print",
-							look_in_folder_locale,
+				g_string_append_printf (command, "find \"%s\" %s \"%s\" -print",
+							look_in_folder_escaped,
 							find_command_default_name_argument,
 							file_is_named_escaped);
 			}
@@ -704,22 +679,22 @@
 			g_free (show_thumbnails_string);
 		}
 		else {
-			g_string_append_printf (command, "find \"%s\" %s '%s' -xdev -print",
-						look_in_folder_locale,
+			g_string_append_printf (command, "find \"%s\" %s \"%s\" -print",
+						look_in_folder_escaped,
 						find_command_default_name_argument,
 						file_is_named_escaped);
 		}
 	}
 	else {
 		GList * list;
-		gboolean disable_mount_argument = FALSE;
+		gboolean disable_mount_argument = TRUE;
 
 		gsearch->command_details->is_command_regex_matching_enabled = FALSE;
-		file_is_named_backslashed = backslash_special_characters (file_is_named_locale);
-		file_is_named_escaped = escape_single_quotes (file_is_named_backslashed);
+		file_is_named_backslashed = backslash_backslash_characters (file_is_named_locale);
+		file_is_named_escaped = escape_double_quotes (file_is_named_backslashed);
 
 		g_string_append_printf (command, "find \"%s\" %s",
-					look_in_folder_locale,
+					look_in_folder_escaped,
 					setup_find_name_options (file_is_named_escaped));
 
 		for (list = gsearch->available_options_selected_list; list != NULL; list = g_list_next (list)) {
@@ -728,8 +703,8 @@
 
 			switch (GSearchOptionTemplates[constraint->constraint_id].type) {
 			case SEARCH_CONSTRAINT_TYPE_BOOLEAN:
-				if (strcmp (GSearchOptionTemplates[constraint->constraint_id].option, "INCLUDE_OTHER_FILESYSTEMS") == 0) {
-					disable_mount_argument = TRUE;
+				if (strcmp (GSearchOptionTemplates[constraint->constraint_id].option, "EXCLUDE_OTHER_FILESYSTEMS") == 0) {
+					disable_mount_argument = FALSE;
 				}
 				else if (strcmp (GSearchOptionTemplates[constraint->constraint_id].option, "SHOW_HIDDEN_FILES") == 0) {
 					gsearch->command_details->is_command_show_hidden_files_enabled = TRUE;
@@ -816,6 +791,8 @@
 	g_free (file_is_named_backslashed);
 	g_free (file_is_named_escaped);
 	g_free (look_in_folder_locale);
+	g_free (look_in_folder_backslashed);
+	g_free (look_in_folder_escaped);
 
 	return g_string_free (command, FALSE);
 }
@@ -828,11 +805,13 @@
 {
 	GdkPixbuf * pixbuf;
 	GSearchMonitor * monitor;
-	GnomeVFSFileInfo * vfs_file_info;
-	GnomeVFSMonitorHandle * handle;
-	GnomeVFSResult result;
-	GtkTreePath *path;
-	GtkTreeRowReference *reference;
+	GFileMonitor * handle;
+	GFileInfo * file_info;
+	GFile * g_file;
+	GError * error = NULL;
+	GTimeVal time_val;
+	GtkTreePath * path;
+	GtkTreeRowReference * reference;
 	gchar * description;
 	gchar * readable_size;
 	gchar * readable_date;
@@ -843,7 +822,6 @@
 	gchar * dir_name;
 	gchar * relative_dir_name;
 	gchar * look_in_folder;
-	gchar * escape_path_string;
 
 	if (g_hash_table_lookup_extended (gsearch->search_results_filename_hash_table, file, NULL, NULL) == TRUE) {
 		return;
@@ -859,20 +837,16 @@
 	if (gtk_tree_view_get_headers_visible (GTK_TREE_VIEW (gsearch->search_results_tree_view)) == FALSE) {
 		gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (gsearch->search_results_tree_view), TRUE);
 	}
+	
+	g_file = g_file_new_for_path (file);
+	file_info = g_file_query_info (g_file, "standard::*,time::modified,thumbnail::path", 0, NULL, NULL);
+
+	pixbuf = get_file_pixbuf (gsearch, file_info);
+	description = get_file_type_description (file, file_info);
+	readable_size = g_format_size_for_display (g_file_info_get_size (file_info));
 
-	vfs_file_info = gnome_vfs_file_info_new ();
-	escape_path_string = gnome_vfs_escape_path_string (file);
-	gnome_vfs_get_file_info (escape_path_string, vfs_file_info,
-	                         GNOME_VFS_FILE_INFO_DEFAULT |
-	                         GNOME_VFS_FILE_INFO_GET_MIME_TYPE |
-	                         GNOME_VFS_FILE_INFO_FORCE_SLOW_MIME_TYPE |
-	                         GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
-
-	pixbuf = get_file_pixbuf (gsearch, file, vfs_file_info);
-	description = get_file_type_description (file, vfs_file_info);
-
-	readable_size = gnome_vfs_format_file_size_for_display (vfs_file_info->size);
-	readable_date = get_readable_date (gsearch->search_results_date_format_string, vfs_file_info->mtime);
+	g_file_info_get_modification_time (file_info, &time_val);
+	readable_date = get_readable_date (gsearch->search_results_date_format_string, time_val.tv_sec); 
 
 	base_name = g_path_get_basename (file);
 	dir_name = g_path_get_dirname (file);
@@ -908,10 +882,10 @@
 			    COLUMN_RELATIVE_PATH, utf8_relative_dir_name,
 			    COLUMN_PATH, utf8_dir_name,
 			    COLUMN_READABLE_SIZE, readable_size,
-			    COLUMN_SIZE, (-1) * (gdouble) vfs_file_info->size,
-			    COLUMN_TYPE, (description != NULL) ? description : vfs_file_info->mime_type,
+			    COLUMN_SIZE, (-1) * (gdouble) g_file_info_get_size(file_info),
+			    COLUMN_TYPE, (description != NULL) ? description : g_strdup (g_file_info_get_content_type (file_info)),
 			    COLUMN_READABLE_DATE, readable_date,
-			    COLUMN_DATE, (-1) * (gdouble) vfs_file_info->mtime,
+			    COLUMN_DATE, (-1) * (gdouble) time_val.tv_sec,
 			    COLUMN_NO_FILES_FOUND, FALSE,
 			    -1);
 
@@ -921,22 +895,27 @@
 		reference = gtk_tree_row_reference_new (GTK_TREE_MODEL (store), path);
 		gtk_tree_path_free (path);
 
-		result = gnome_vfs_monitor_add (&handle, file, GNOME_VFS_MONITOR_FILE,
-						(GnomeVFSMonitorCallback) file_changed_cb, monitor);
-		if (result == GNOME_VFS_OK) {
+		handle = g_file_monitor_file (g_file, G_FILE_MONITOR_EVENT_DELETED, NULL, &error);
+
+		if (error == NULL) {
 			monitor->gsearch = gsearch;
 			monitor->reference = reference;
 			monitor->handle = handle;
 			gtk_list_store_set (GTK_LIST_STORE (store), iter,
 			                    COLUMN_MONITOR, monitor, -1);
+
+			g_signal_connect (handle, "changed",
+					  G_CALLBACK (file_changed_cb), monitor);
 		}
 		else {
 			gtk_tree_row_reference_free (reference);
 			g_slice_free (GSearchMonitor, monitor);
+			g_clear_error (&error);
 		}
 	}
 
-	gnome_vfs_file_info_unref (vfs_file_info);
+	g_object_unref (g_file);
+	g_object_unref (file_info);
 	g_free (base_name);
 	g_free (dir_name);
 	g_free (relative_dir_name);
@@ -944,7 +923,6 @@
 	g_free (utf8_dir_name);
 	g_free (utf8_relative_dir_name);
 	g_free (look_in_folder);
-	g_free (escape_path_string);
 	g_free (description);
 	g_free (readable_size);
 	g_free (readable_date);
@@ -997,12 +975,12 @@
 		add_no_files_found_message (gsearch);
 	}
 	else {
-		title_bar_string = g_strdup_printf (ngettext ("%d File Found",
-					                      "%d Files Found",
+		title_bar_string = g_strdup_printf (ngettext ("%'d File Found",
+					                      "%'d Files Found",
 					                      total_files),
 						    total_files);
-		message_string = g_strdup_printf (ngettext ("%d file found",
-					                    "%d files found",
+		message_string = g_strdup_printf (ngettext ("%'d file found",
+					                    "%'d files found",
 					                    total_files),
 						  total_files);
 	}
@@ -1039,8 +1017,8 @@
 
 	if (count > 0) {
 
-		string = g_strdup_printf (ngettext ("%d file found",
-		                                    "%d files found",
+		string = g_strdup_printf (ngettext ("%'d file found",
+		                                    "%'d files found",
 		                                    count),
 		                          count);
 
@@ -1061,7 +1039,7 @@
 
 	gtk_tree_model_get (model, iter, COLUMN_MONITOR, &monitor, -1);
 	if (monitor) {
-		gnome_vfs_monitor_cancel (monitor->handle);
+		g_file_monitor_cancel (monitor->handle);
 		gtk_tree_row_reference_free (monitor->reference);
 		g_slice_free (GSearchMonitor, monitor);
 	}
@@ -1217,7 +1195,7 @@
 	   		       	       	               flag);
 			break;
 		case SEARCH_CONSTRAINT_SEARCH_OTHER_FILESYSTEMS:
-			gsearchtool_gconf_set_boolean ("/apps/gnome-search-tool/select/include_other_filesystems",
+			gsearchtool_gconf_set_boolean ("/apps/gnome-search-tool/select/exlude_other_filesystems",
 	   		       	       	               flag);
 			break;
 
@@ -1284,97 +1262,6 @@
 
 }
 
-gchar *
-get_desktop_item_name (GSearchWindow * gsearch)
-{
-
-	GString * gs;
-	gchar * file_is_named_utf8;
-	gchar * file_is_named_locale;
-	gchar * look_in_folder_utf8;
-	gchar * look_in_folder_locale;
-	GList * list;
-
-	gs = g_string_new ("");
-	g_string_append (gs, _("Search for Files"));
-	g_string_append (gs, " (");
-
-	file_is_named_utf8 = (gchar *) gtk_entry_get_text (GTK_ENTRY (gnome_entry_gtk_entry (GNOME_ENTRY (gsearch->name_contains_entry))));
-	file_is_named_locale = g_locale_from_utf8 (file_is_named_utf8 != NULL ? file_is_named_utf8 : "" ,
-	                                           -1, NULL, NULL, NULL);
-	g_string_append_printf (gs, "named=%s", file_is_named_locale);
-	g_free (file_is_named_locale);
-
-	look_in_folder_utf8 = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (gsearch->look_in_folder_button));
-	look_in_folder_locale = g_locale_from_utf8 (look_in_folder_utf8 != NULL ? look_in_folder_utf8 : "",
-	                                            -1, NULL, NULL, NULL);
-	g_string_append_printf (gs, "&path=%s", look_in_folder_locale);
-	g_free (look_in_folder_locale);
-	g_free (look_in_folder_utf8);
-
-	if (GTK_WIDGET_VISIBLE (gsearch->available_options_vbox)) {
-		for (list = gsearch->available_options_selected_list; list != NULL; list = g_list_next (list)) {
-			GSearchConstraint * constraint = list->data;
-			gchar * locale = NULL;
-
-			switch (constraint->constraint_id) {
-			case SEARCH_CONSTRAINT_CONTAINS_THE_TEXT:
-				locale = g_locale_from_utf8 (constraint->data.text, -1, NULL, NULL, NULL);
-				g_string_append_printf (gs, "&contains=%s", locale);
-				break;
-			case SEARCH_CONSTRAINT_DATE_MODIFIED_BEFORE:
-				g_string_append_printf (gs, "&mtimeless=%d", constraint->data.time);
-				break;
-			case SEARCH_CONSTRAINT_DATE_MODIFIED_AFTER:
-				g_string_append_printf (gs, "&mtimemore=%d", constraint->data.time);
-				break;
-			case SEARCH_CONSTRAINT_SIZE_IS_MORE_THAN:
-				g_string_append_printf (gs, "&sizemore=%u", constraint->data.number);
-				break;
-			case SEARCH_CONSTRAINT_SIZE_IS_LESS_THAN:
-				g_string_append_printf (gs, "&sizeless=%u", constraint->data.number);
-				break;
-			case SEARCH_CONSTRAINT_FILE_IS_EMPTY:
-				g_string_append (gs, "&empty");
-				break;
-			case SEARCH_CONSTRAINT_OWNED_BY_USER:
-				locale = g_locale_from_utf8 (constraint->data.text, -1, NULL, NULL, NULL);
-				g_string_append_printf (gs, "&user=%s", locale);
-				break;
-			case SEARCH_CONSTRAINT_OWNED_BY_GROUP:
-				locale = g_locale_from_utf8 (constraint->data.text, -1, NULL, NULL, NULL);
-				g_string_append_printf (gs, "&group=%s", locale);
-				break;
-			case SEARCH_CONSTRAINT_OWNER_IS_UNRECOGNIZED:
-				g_string_append (gs, "&nouser");
-				break;
-			case SEARCH_CONSTRAINT_FILE_IS_NOT_NAMED:
-				locale = g_locale_from_utf8 (constraint->data.text, -1, NULL, NULL, NULL);
-				g_string_append_printf (gs, "&notnamed=%s", locale);
-				break;
-			case SEARCH_CONSTRAINT_FILE_MATCHES_REGULAR_EXPRESSION:
-				locale = g_locale_from_utf8 (constraint->data.text, -1, NULL, NULL, NULL);
-				g_string_append_printf (gs, "&regex=%s", locale);
-				break;
-			case SEARCH_CONSTRAINT_SHOW_HIDDEN_FILES_AND_FOLDERS:
-				g_string_append (gs, "&hidden");
-				break;
-			case SEARCH_CONSTRAINT_FOLLOW_SYMBOLIC_LINKS:
-				g_string_append (gs, "&follow");
-				break;
-			case SEARCH_CONSTRAINT_SEARCH_OTHER_FILESYSTEMS:
-				g_string_append (gs, "&allmounts");
-				break;
-			default:
-				break;
-			}
-		g_free (locale);
-		}
-	}
-	g_string_append_c (gs, ')');
-	return g_string_free (gs, FALSE);
-}
-
 static void
 gsearch_setup_goption_descriptions (void)
 {
@@ -1478,7 +1365,7 @@
 		goption_args_found = TRUE;
 		add_constraint (gsearch, SEARCH_CONSTRAINT_FOLLOW_SYMBOLIC_LINKS, NULL, TRUE);
 	}
-	if (GSearchGOptionArguments.allmounts) {
+	if (GSearchGOptionArguments.mounts) {
 		goption_args_found = TRUE;
 		add_constraint (gsearch, SEARCH_CONSTRAINT_SEARCH_OTHER_FILESYSTEMS, NULL, TRUE);
 	}
@@ -1702,10 +1589,6 @@
 			g_free (gsearch->command_details->name_contains_regex_string);
 			g_free (gsearch->search_results_date_format_string);
 
-			if (gsearch->thumbnail_factory != NULL) {
-				g_object_unref (gsearch->thumbnail_factory);
-				gsearch->thumbnail_factory = NULL;
-			}
 		}
 		return FALSE;
 	}
@@ -2368,17 +2251,21 @@
 
 	vbox = gtk_vbox_new (FALSE, 6);
 
-	hbox = gtk_hbox_new (FALSE, 12);
+	hbox = gtk_hbox_new (FALSE, 6);
 	gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
 
 	label = gtk_label_new_with_mnemonic (_("S_earch results:"));
 	g_object_set (G_OBJECT (label), "xalign", 0.0, NULL);
-	gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
+	gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
+
+	gsearch->progress_spinner = gsearch_spinner_new ();
+	gsearch_spinner_set_size ((GSearchSpinner *)gsearch->progress_spinner, GTK_ICON_SIZE_MENU);
+	gtk_box_pack_start (GTK_BOX (hbox), gsearch->progress_spinner, FALSE, FALSE, 0);
 
 	gsearch->files_found_label = gtk_label_new (NULL);
 	gtk_label_set_selectable (GTK_LABEL (gsearch->files_found_label), TRUE);
 	g_object_set (G_OBJECT (gsearch->files_found_label), "xalign", 1.0, NULL);
-	gtk_box_pack_start (GTK_BOX (hbox), gsearch->files_found_label, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (hbox), gsearch->files_found_label, TRUE, TRUE, 0);
 
 	window = gtk_scrolled_window_new (NULL, NULL);
 	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (window), GTK_SHADOW_IN);
@@ -2594,7 +2481,6 @@
 	gchar ** argv;
 	gchar * file_is_named_utf8;
 	gchar * file_is_named_locale;
-	gchar * look_in_folder_utf8;
 	gchar * look_in_folder_locale;
 	gchar * tmp;
 	GList * list;
@@ -2615,10 +2501,11 @@
 	g_free (tmp);
 	g_free (file_is_named_locale);
 
-	look_in_folder_utf8 = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (gsearch->look_in_folder_button));
-	look_in_folder_locale = g_locale_from_utf8 (look_in_folder_utf8 != NULL ? look_in_folder_utf8 : "",
-	                                            -1, NULL, NULL, NULL);
-	g_free (look_in_folder_utf8);
+	look_in_folder_locale = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (gsearch->look_in_folder_button));
+	
+	if (look_in_folder_locale == NULL) {
+		look_in_folder_locale = g_strdup ("");
+	}
 
 	if (escape_values)
 		tmp = g_shell_quote (look_in_folder_locale);
@@ -2704,7 +2591,7 @@
 				argv[i++] = g_strdup ("--follow");
 				break;
 			case SEARCH_CONSTRAINT_SEARCH_OTHER_FILESYSTEMS:
-				argv[i++] = g_strdup ("--allmounts");
+				argv[i++] = g_strdup ("--mounts");
 				break;
 			default:
 				break;
@@ -2780,66 +2667,12 @@
 		add_constraint (gsearch, SEARCH_CONSTRAINT_FOLLOW_SYMBOLIC_LINKS, NULL, FALSE);
 	}
 
-	if (gsearchtool_gconf_get_boolean ("/apps/gnome-search-tool/select/include_other_filesystems")) {
+	if (gsearchtool_gconf_get_boolean ("/apps/gnome-search-tool/select/exclude_other_filesystems")) {
 		add_constraint (gsearch, SEARCH_CONSTRAINT_SEARCH_OTHER_FILESYSTEMS, NULL, FALSE);
 	}
 }
 
 static void
-gsearchtool_ui_manager (GSearchWindow * gsearch)
-{
-	GtkActionGroup * action_group;
-	GtkAccelGroup * accel_group;
-	GtkAction * action;
-	GError * error = NULL;
-
-	action_group = gtk_action_group_new ("PopupActions");
-	gtk_action_group_set_translation_domain (action_group, NULL);
-	gtk_action_group_add_actions (action_group, GSearchUiEntries, G_N_ELEMENTS (GSearchUiEntries), gsearch->window);
-
-	gsearch->window_ui_manager = gtk_ui_manager_new ();
-	gtk_ui_manager_insert_action_group (gsearch->window_ui_manager, action_group, 0);
-
-	accel_group = gtk_ui_manager_get_accel_group (gsearch->window_ui_manager);
-	gtk_window_add_accel_group (GTK_WINDOW (gsearch->window), accel_group);
-
-	if (!gtk_ui_manager_add_ui_from_string (gsearch->window_ui_manager, GSearchUiDescription, -1, &error)) {
-      		g_message ("Building menus failed: %s", error->message);
-		g_error_free (error);
-      		exit (EXIT_FAILURE);
-	}
-
-	action = gtk_ui_manager_get_action (gsearch->window_ui_manager, "/PopupMenu/Open");
-	g_signal_connect (G_OBJECT (action),
-	                  "activate",
-	                  G_CALLBACK (open_file_cb),
-	                  (gpointer) gsearch);
-
-	action = gtk_ui_manager_get_action (gsearch->window_ui_manager, "/PopupMenu/OpenFolder");
-	g_signal_connect (G_OBJECT (action),
-	                  "activate",
-	                  G_CALLBACK (open_folder_cb),
-	                  (gpointer) gsearch);
-
-	action = gtk_ui_manager_get_action (gsearch->window_ui_manager, "/PopupMenu/MoveToTrash");
-	g_signal_connect (G_OBJECT (action),
-	                  "activate",
-	                  G_CALLBACK (move_to_trash_cb),
-	                  (gpointer) gsearch);
-
-	action = gtk_ui_manager_get_action (gsearch->window_ui_manager, "/PopupMenu/SaveResultsAs");
-	g_signal_connect (G_OBJECT (action),
-	                  "activate",
-	                  G_CALLBACK (show_file_selector_cb),
-	                  (gpointer) gsearch);
-
-	gsearch->search_results_popup_menu = gtk_ui_manager_get_widget (gsearch->window_ui_manager,
-	                                                                "/PopupMenu");
-	gsearch->search_results_save_results_as_item = gtk_ui_manager_get_widget (gsearch->window_ui_manager,
-	                                                                          "/PopupMenu/SaveResultsAs");
-}
-
-static void
 gsearch_window_size_allocate (GtkWidget * widget,
                               GtkAllocation * allocation,
                               GSearchWindow * gsearch)
@@ -2853,7 +2686,6 @@
 static GtkWidget *
 gsearch_app_create (GSearchWindow * gsearch)
 {
-	GtkTargetEntry drag_types[] = {{ "text/uri-list", 0, 0 }};
 	gchar * locale_string;
 	gchar * utf8_string;
 	GtkWidget * hbox;
@@ -2862,7 +2694,6 @@
 	GtkWidget * label;
 	GtkWidget * button;
 	GtkWidget * container;
-	GdkPixbuf * pixbuf;
 
 	gsearch->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 	gsearch->is_window_maximized = gsearchtool_gconf_get_boolean ("/apps/gnome-search-tool/default_window_maximized");
@@ -2891,39 +2722,9 @@
 	gtk_container_add (GTK_CONTAINER (gsearch->window), container);
 	gtk_container_set_border_width (GTK_CONTAINER (container), 12);
 
-	hbox = gtk_hbox_new (FALSE, 12);
+	hbox = gtk_hbox_new (FALSE, 6);
 	gtk_box_pack_start (GTK_BOX (container), hbox, FALSE, FALSE, 0);
 
-	vbox = gtk_vbox_new (FALSE, 0);
-	gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
-
-	gsearch->progress_spinner = gsearch_spinner_new ();
-	gtk_widget_show (gsearch->progress_spinner);
-	gtk_box_pack_start (GTK_BOX (vbox), gsearch->progress_spinner, FALSE, FALSE, 0);
-
-	gtk_drag_source_set (gsearch->progress_spinner,
-			     GDK_BUTTON1_MASK,
-			     drag_types,
-			     G_N_ELEMENTS (drag_types),
-			     GDK_ACTION_COPY);
-
-	pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
-	                                   GNOME_SEARCH_TOOL_ICON,
-	                                   GNOME_SEARCH_TOOL_DEFAULT_ICON_SIZE,
-	                                   0,
-	                                   NULL);
-	if (pixbuf) {
-		gtk_drag_source_set_icon_pixbuf (gsearch->progress_spinner, pixbuf);
-	}
-	else {
-		gtk_drag_source_set_icon_stock (gsearch->progress_spinner, GTK_STOCK_FIND);
-	}
-
-	g_signal_connect (G_OBJECT (gsearch->progress_spinner),
-			  "drag_data_get",
-			  G_CALLBACK (drag_data_animation_cb),
-			  (gpointer) gsearch);
-
 	gsearch->name_and_folder_table = gtk_table_new (2, 2, FALSE);
 	gtk_table_set_row_spacings (GTK_TABLE (gsearch->name_and_folder_table), 6);
 	gtk_table_set_col_spacings (GTK_TABLE (gsearch->name_and_folder_table), 12);
@@ -2960,11 +2761,22 @@
 	gtk_label_set_mnemonic_widget (GTK_LABEL (label), GTK_WIDGET (gsearch->look_in_folder_button));
 	gtk_table_attach (GTK_TABLE (gsearch->name_and_folder_table), gsearch->look_in_folder_button, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0, 0);
 
+	g_signal_connect (G_OBJECT (gsearch->look_in_folder_button), "current-folder-changed",
+	                  G_CALLBACK (look_in_folder_changed_cb),
+			  (gpointer) gsearch);
+
 	if (gsearch->is_window_accessible) {
 		add_atk_namedesc (GTK_WIDGET (gsearch->look_in_folder_button), _("Look in folder"), _("Select the folder or device from which you want to begin the search."));
 	}
 
-	locale_string = g_get_current_dir ();
+	locale_string = gsearchtool_gconf_get_string ("/apps/gnome-search-tool/look_in_folder");
+
+	if ((g_file_test (locale_string, G_FILE_TEST_EXISTS) == FALSE) || 
+	    (g_file_test (locale_string, G_FILE_TEST_IS_DIR) == FALSE)) {
+		g_free (locale_string);
+		locale_string = g_get_current_dir ();
+	}
+	
 	utf8_string = g_filename_to_utf8 (locale_string, -1, NULL, NULL, NULL);
 
 	gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (gsearch->look_in_folder_button), utf8_string);
@@ -3045,6 +2857,7 @@
 
 	gtk_widget_show_all (container);
 	gtk_widget_hide (gsearch->available_options_vbox);
+	gtk_widget_hide (gsearch->progress_spinner);
 	gtk_widget_hide (gsearch->stop_button);
 
 	gtk_window_set_focus (GTK_WINDOW (gsearch->window),
@@ -3153,7 +2966,6 @@
 
 	window = g_object_new (GSEARCH_TYPE_WINDOW, NULL);
 	gsearch = GSEARCH_WINDOW (window);
-	gsearchtool_ui_manager (gsearch);
 
 	gtk_window_set_wmclass (GTK_WINDOW (gsearch->window), "gnome-search-tool", "gnome-search-tool");
 	gtk_window_set_resizable (GTK_WINDOW (gsearch->window), TRUE);

Modified: trunk/gsearchtool/gsearchtool.h
==============================================================================
--- trunk/gsearchtool/gsearchtool.h	(original)
+++ trunk/gsearchtool/gsearchtool.h	Tue Mar 17 02:08:08 2009
@@ -115,6 +115,7 @@
 	GtkWidget             * files_found_label;
 	GtkWidget             * search_results_vbox;
 	GtkWidget             * search_results_popup_menu;
+	GtkWidget             * search_results_popup_submenu;
 	GtkWidget             * search_results_save_results_as_item;
 	GtkTreeView           * search_results_tree_view;
 	GtkListStore          * search_results_list_store;
@@ -125,7 +126,6 @@
 	GHashTable            * search_results_filename_hash_table;
 	GHashTable            * search_results_pixbuf_hash_table;
 	gchar                 * search_results_date_format_string;
-	GnomeThumbnailFactory * thumbnail_factory;
 	gint		        show_thumbnails_file_size_limit;
 	gboolean		show_thumbnails;
 	gboolean                is_search_results_single_click_to_activate;
@@ -169,7 +169,7 @@
 struct _GSearchMonitor {
 	GSearchWindow         * gsearch;
 	GtkTreeRowReference   * reference;
-	GnomeVFSMonitorHandle * handle;
+	GFileMonitor          * handle;
 };
 
 GType
@@ -205,9 +205,6 @@
                    gchar *** argvp,
                    gpointer client_data,
                    gboolean escape_values);
-gchar *
-get_desktop_item_name (GSearchWindow * gsearch);
-
 void
 update_search_counts (GSearchWindow * gsearch);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]