Commit 55bc3d9a authored by Ramiro Estrugo's avatar Ramiro Estrugo

Move vfs extensions to eel.

	* libnautilus-extensions/nautilus-file-utilities.c:
	* libnautilus-extensions/nautilus-file-utilities.h:
	Move vfs extensions to eel.

	* components/services/install-view/nautilus-service-install-view.c:
	* components/services/install/server/main.c:
	* components/services/inventory/eazel-inventory-collect-hardware.c:
	(add_info):
	* components/services/inventory/eazel-inventory-service.c:
	(impl_Trilobite_Eazel_Inventory_upload):
	* components/text/nautilus-text-view.c: (handle_service_menu_item):
	* components/tree/nautilus-tree-view.c: (select_current_location),
	(tree_load_location_callback), (got_activation_uri_callback):
	* libnautilus-extensions/nautilus-bookmark.c:
	(nautilus_bookmark_compare_with), (nautilus_bookmark_compare_uris),
	(bookmark_file_changed_callback):
	* libnautilus-extensions/nautilus-directory-async.c:
	(top_left_cancel), (activation_uri_cancel), (top_left_start),
	(activation_uri_start):
	* libnautilus-extensions/nautilus-directory-private.h:
	* libnautilus-extensions/nautilus-directory.c:
	(nautilus_directory_make_uri_canonical), (nautilus_directory_new),
	(nautilus_directory_notify_files_moved),
	(nautilus_self_check_directory):
	* libnautilus-extensions/nautilus-drag.c:
	(nautilus_drag_items_in_trash),
	(nautilus_drag_default_drop_action_for_icons):
	* libnautilus-extensions/nautilus-file-operations.c:
	(format_and_ellipsize_uri_for_dialog),
	(nautilus_file_operations_copy_move):
	* libnautilus-extensions/nautilus-file.c:
	(nautilus_file_get_internal),
	(nautilus_file_get_parent_uri_for_display),
	(nautilus_file_can_rename), (nautilus_file_get_uri_scheme),
	(nautilus_file_is_in_trash), (nautilus_self_check_file):
	* libnautilus-extensions/nautilus-icon-dnd.c:
	(nautilus_icon_container_selection_items_local):
	* libnautilus-extensions/nautilus-icon-factory.c:
	(nautilus_icon_factory_get_icon_name_for_file),
	(nautilus_icon_factory_get_emblem_icons_for_file):
	* libnautilus-extensions/nautilus-link.c:
	(nautilus_link_local_get_image_uri):
	* libnautilus-extensions/nautilus-metafile.c:
	(construct_private_metafile_vfs_uri), (metafile_read_cancel),
	(metafile_read_restart):
	* libnautilus-extensions/nautilus-tabs.c:
	* libnautilus-extensions/nautilus-theme.c:
	* libnautilus-extensions/nautilus-thumbnails.c:
	(make_thumbnail_uri):
	* libnautilus-extensions/nautilus-trash-file.c:
	(nautilus_trash_file_initialize):
	* libnautilus-extensions/nautilus-trash-monitor.c:
	(nautilus_trash_files_changed_callback),
	(nautilus_trash_monitor_initialize):
	* src/file-manager/fm-desktop-icon-view.c:
	(update_trash_link_and_delete_copies):
	* src/file-manager/fm-directory-view.c: (show_trash_callback),
	(trash_or_delete_files_common),
	(fm_directory_view_trash_or_delete_files),
	(fm_directory_view_move_copy_items):
	* src/file-manager/fm-properties-window.c:
	(is_merged_trash_directory):
	* src/nautilus-application.c:
	(nautilus_make_uri_list_from_shell_strv):
	* src/nautilus-first-time-druid.c: (read_file_handle_cancel_cover),
	(initiate_file_download):
	* src/nautilus-location-bar.c: (try_to_expand_path),
	(nautilus_location_bar_set_location),
	(nautilus_location_bar_get_location),
	(nautilus_location_bar_update_label):
	* src/nautilus-profiler.c:
	(nautilus_profiler_bonobo_ui_report_callback):
	* src/nautilus-property-browser.c: (add_pattern_to_browser),
	(emblem_dialog_clicked):
	* src/nautilus-sidebar.c: (receive_dropped_uri_list):
	* src/nautilus-theme-selector.c: (add_theme_to_icons):
	* src/nautilus-window-manage-views.c: (set_displayed_location),
	(check_bookmark_location_matches), (handle_go_elsewhere),
	(viewed_file_changed_callback), (determined_initial_view_callback),
	(open_location_prefer_existing_window_callback),
	(report_redirect_callback):
	* src/nautilus-window-menus.c: (show_bogus_bookmark_window):
	Update for vfs extensions move to eel.  Also cleanup the #include
	state of some of these files.  Removed unused #includes.  Remove
	some cut-n-paste code in services components and use the
	extensions in eel directly.
parent 79b2a4e3
2001-04-04 Ramiro Estrugo <ramiro@eazel.com>
* libnautilus-extensions/nautilus-file-utilities.c:
* libnautilus-extensions/nautilus-file-utilities.h:
Move vfs extensions to eel.
* components/services/install-view/nautilus-service-install-view.c:
* components/services/install/server/main.c:
* components/services/inventory/eazel-inventory-collect-hardware.c:
(add_info):
* components/services/inventory/eazel-inventory-service.c:
(impl_Trilobite_Eazel_Inventory_upload):
* components/text/nautilus-text-view.c: (handle_service_menu_item):
* components/tree/nautilus-tree-view.c: (select_current_location),
(tree_load_location_callback), (got_activation_uri_callback):
* libnautilus-extensions/nautilus-bookmark.c:
(nautilus_bookmark_compare_with), (nautilus_bookmark_compare_uris),
(bookmark_file_changed_callback):
* libnautilus-extensions/nautilus-directory-async.c:
(top_left_cancel), (activation_uri_cancel), (top_left_start),
(activation_uri_start):
* libnautilus-extensions/nautilus-directory-private.h:
* libnautilus-extensions/nautilus-directory.c:
(nautilus_directory_make_uri_canonical), (nautilus_directory_new),
(nautilus_directory_notify_files_moved),
(nautilus_self_check_directory):
* libnautilus-extensions/nautilus-drag.c:
(nautilus_drag_items_in_trash),
(nautilus_drag_default_drop_action_for_icons):
* libnautilus-extensions/nautilus-file-operations.c:
(format_and_ellipsize_uri_for_dialog),
(nautilus_file_operations_copy_move):
* libnautilus-extensions/nautilus-file.c:
(nautilus_file_get_internal),
(nautilus_file_get_parent_uri_for_display),
(nautilus_file_can_rename), (nautilus_file_get_uri_scheme),
(nautilus_file_is_in_trash), (nautilus_self_check_file):
* libnautilus-extensions/nautilus-icon-dnd.c:
(nautilus_icon_container_selection_items_local):
* libnautilus-extensions/nautilus-icon-factory.c:
(nautilus_icon_factory_get_icon_name_for_file),
(nautilus_icon_factory_get_emblem_icons_for_file):
* libnautilus-extensions/nautilus-link.c:
(nautilus_link_local_get_image_uri):
* libnautilus-extensions/nautilus-metafile.c:
(construct_private_metafile_vfs_uri), (metafile_read_cancel),
(metafile_read_restart):
* libnautilus-extensions/nautilus-tabs.c:
* libnautilus-extensions/nautilus-theme.c:
* libnautilus-extensions/nautilus-thumbnails.c:
(make_thumbnail_uri):
* libnautilus-extensions/nautilus-trash-file.c:
(nautilus_trash_file_initialize):
* libnautilus-extensions/nautilus-trash-monitor.c:
(nautilus_trash_files_changed_callback),
(nautilus_trash_monitor_initialize):
* src/file-manager/fm-desktop-icon-view.c:
(update_trash_link_and_delete_copies):
* src/file-manager/fm-directory-view.c: (show_trash_callback),
(trash_or_delete_files_common),
(fm_directory_view_trash_or_delete_files),
(fm_directory_view_move_copy_items):
* src/file-manager/fm-properties-window.c:
(is_merged_trash_directory):
* src/nautilus-application.c:
(nautilus_make_uri_list_from_shell_strv):
* src/nautilus-first-time-druid.c: (read_file_handle_cancel_cover),
(initiate_file_download):
* src/nautilus-location-bar.c: (try_to_expand_path),
(nautilus_location_bar_set_location),
(nautilus_location_bar_get_location),
(nautilus_location_bar_update_label):
* src/nautilus-profiler.c:
(nautilus_profiler_bonobo_ui_report_callback):
* src/nautilus-property-browser.c: (add_pattern_to_browser),
(emblem_dialog_clicked):
* src/nautilus-sidebar.c: (receive_dropped_uri_list):
* src/nautilus-theme-selector.c: (add_theme_to_icons):
* src/nautilus-window-manage-views.c: (set_displayed_location),
(check_bookmark_location_matches), (handle_go_elsewhere),
(viewed_file_changed_callback), (determined_initial_view_callback),
(open_location_prefer_existing_window_callback),
(report_redirect_callback):
* src/nautilus-window-menus.c: (show_bogus_bookmark_window):
Update for vfs extensions move to eel. Also cleanup the #include
state of some of these files. Removed unused #includes. Remove
some cut-n-paste code in services components and use the
extensions in eel directly.
2001-04-04 Ramiro Estrugo <ramiro@eazel.com>
* README:
......
......@@ -40,7 +40,6 @@
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-glib-extensions.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <eel/eel-string.h>
#include <eel/eel-label.h>
#include <eel/eel-gdk-extensions.h>
......
......@@ -34,8 +34,8 @@
#ifdef STOP_IN_DEBUG
/* Also add
$(top_builddir)/libnautilus-extensions/nautilus-debug.o \
to the ldadd line in Makefile.am
$(EEL_LIBS) \
to the LDADD line in Makefile.am
*/
#include <eel/eel-debug.h>
#endif
......
......@@ -28,6 +28,8 @@
#include "eazel-inventory-collect-hardware.h"
#include <eel/eel-string.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
......@@ -404,29 +406,6 @@ Host: scsi0 Channel: 00 Id: 04 Lun: 00
return bus_node;
}
/* ripped straight out of libnautilus-extensions because we didn't want the
* dependency for one small function
*/
static gboolean
str_has_prefix (const char *haystack, const char *needle)
{
const char *h, *n;
/* Eat one character at a time. */
h = haystack == NULL ? "" : haystack;
n = needle == NULL ? "" : needle;
do {
if (*n == '\0') {
return TRUE;
}
if (*h == '\0') {
return FALSE;
}
} while (*h++ == *n++);
return FALSE;
}
/* utility routine to extract information from a string and add it to an XML node */
static void
add_info (xmlNodePtr node_ptr,
......@@ -447,7 +426,7 @@ add_info (xmlNodePtr node_ptr,
for (index = 0; index < 32; index++) {
if (info_array[index] == NULL)
break;
if (str_has_prefix (info_array[index], field_name)) {
if (eel_str_has_prefix (info_array[index], field_name)) {
field_data = info_array[index] + strlen (field_name);
field_data = strchr (field_data, ':') + 1;
field_data = g_strchug (field_data);
......
......@@ -22,31 +22,25 @@
*/
#include <config.h>
#include <gnome.h>
#include <liboaf/liboaf.h>
#include "eazel-inventory-service.h"
#include "eazel-inventory-service-interface.h"
#include "eazel-inventory-utils.h"
#include <bonobo.h>
#include <eel/eel-vfs-extensions.h>
#include <gconf/gconf-client.h>
#include <ghttp.h>
#include <gnome.h>
#include <libgnomevfs/gnome-vfs.h>
#define DEBUG(X...) g_print("eazel-inventory-service: " X)
#include <gconf/gconf-client.h>
#include <libtrilobite/libtrilobite.h>
#include <liboaf/liboaf.h>
#include <libtrilobite/libammonite.h>
#include <libtrilobite/libtrilobite-service.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <libtrilobite/libtrilobite.h>
/* FIXME: crack */
/*#include <libammonite/libammonite.h>*/
#include <libtrilobite/libammonite.h>
#include "eazel-inventory-utils.h"
#include "eazel-inventory-service.h"
#include "eazel-inventory-service-interface.h"
#define DEBUG(X...) g_print("eazel-inventory-service: " X)
#define KEY_GCONF_EAZEL_INVENTORY_ENABLED "/apps/eazel-trilobite/inventory/enabled"
......@@ -264,7 +258,7 @@ impl_Trilobite_Eazel_Inventory_upload (PortableServer_Servant servant,
/* TODO: store new MD5 */
path = eazel_inventory_local_path ();
result = nautilus_read_entire_file (path, &file_size, &file_contents);
result = eel_read_entire_file (path, &file_size, &file_contents);
g_free (path);
if (result != GNOME_VFS_OK) {
/* g_warning(_("can't open tempory file hell\n")); */
......
......@@ -26,35 +26,32 @@
#include <config.h>
#include "nautilus-text-view.h"
#include <gnome-xml/parser.h>
#include <gnome-xml/xmlmemory.h>
#include <bonobo/bonobo-zoomable.h>
#include <bonobo/bonobo-control.h>
#include <libnautilus/libnautilus.h>
#include <libnautilus/nautilus-clipboard.h>
#include <bonobo/bonobo-zoomable.h>
#include <eel/eel-background.h>
#include <libnautilus-extensions/nautilus-bonobo-extensions.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <libnautilus-extensions/nautilus-file.h>
#include <eel/eel-gdk-extensions.h>
#include <eel/eel-gdk-pixbuf-extensions.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-string.h>
#include <libnautilus-extensions/nautilus-font-factory.h>
#include <eel/eel-stock-dialogs.h>
#include <eel/eel-string.h>
#include <eel/eel-vfs-extensions.h>
#include <eel/eel-xml-extensions.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <ghttp.h>
#include <gnome-xml/parser.h>
#include <gnome-xml/xmlmemory.h>
#include <gnome.h>
#include <gtk/gtkeventbox.h>
#include <libgnome/gnome-i18n.h>
#include <libgnomevfs/gnome-vfs.h>
#include <ghttp.h>
#include <libnautilus-extensions/nautilus-bonobo-extensions.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <libnautilus-extensions/nautilus-file.h>
#include <libnautilus-extensions/nautilus-font-factory.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus/libnautilus.h>
#include <libnautilus/nautilus-clipboard.h>
#include <limits.h>
#define MAX_SERVICE_ITEMS 32
......@@ -495,7 +492,7 @@ handle_service_menu_item (BonoboUIComponent *ui, gpointer user_data, const char
/* load the resultant page through gnome-vfs */
/* FIXME: This uses sync. I/O. */
if (nautilus_read_entire_file (uri, &text_size, &text_ptr) == GNOME_VFS_OK) {
if (eel_read_entire_file (uri, &text_size, &text_ptr) == GNOME_VFS_OK) {
gtk_editable_delete_text (GTK_EDITABLE (parameters->text_view->details->text_display), 0, -1);
gtk_text_insert (GTK_TEXT (parameters->text_view->details->text_display),
NULL, NULL, NULL,
......
......@@ -30,6 +30,11 @@
#include "nautilus-tree-view-private.h"
#include <bonobo/bonobo-control.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-string.h>
#include <eel/eel-vfs-extensions.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkscrolledwindow.h>
......@@ -39,12 +44,8 @@
#include <libnautilus-extensions/nautilus-file-attributes.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <libnautilus-extensions/nautilus-file.h>
#include <eel/eel-glib-extensions.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <libnautilus-extensions/nautilus-icon-factory.h>
#include <eel/eel-string.h>
#include <stdio.h>
#define DISPLAY_TIMEOUT_INTERVAL_MSECS 500
......@@ -1357,7 +1358,7 @@ select_current_location (NautilusTreeView *view)
cancel_selection_in_progress (view);
/* FIXME bugzilla.eazel.com 6801: it seems likely that either
* nautilus_uris_match or nautilus_uris_match_ignore_fragments
* eel_uris_match or eel_uris_match_ignore_fragments
* should be used here.
*/
if (eel_strcmp (view->details->current_main_view_uri,
......@@ -1380,7 +1381,7 @@ tree_load_location_callback (NautilusView *nautilus_view,
nautilus_view_report_load_complete (nautilus_view);
g_free (view->details->current_main_view_uri);
view->details->current_main_view_uri = nautilus_make_uri_canonical (location);
view->details->current_main_view_uri = eel_make_uri_canonical (location);
select_current_location (view);
}
......@@ -1528,7 +1529,7 @@ got_activation_uri_callback (NautilusFile *file,
uri = nautilus_file_get_activation_uri (file);
if (uri != NULL &&
!nautilus_uris_match_ignore_fragments (view->details->current_main_view_uri, uri) &&
!eel_uris_match_ignore_fragments (view->details->current_main_view_uri, uri) &&
strncmp (uri, "command:", strlen ("command:")) != 0) {
nautilus_view_open_location_in_this_window (NAUTILUS_VIEW (view), uri);
g_free (view->details->selected_uri);
......
......@@ -25,9 +25,12 @@
#include <config.h>
#include "nautilus-bookmark.h"
#include <eel/eel-gtk-macros.h>
#include "nautilus-icon-factory.h"
#include <eel/eel-gdk-pixbuf-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-string.h>
#include <eel/eel-vfs-extensions.h>
#include <gtk/gtkaccellabel.h>
#include <gtk/gtksignal.h>
#include <libgnome/gnome-defs.h>
......@@ -36,9 +39,6 @@
#include <libgnomevfs/gnome-vfs-types.h>
#include <libgnomevfs/gnome-vfs-uri.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <eel/eel-gdk-pixbuf-extensions.h>
#include <eel/eel-gtk-extensions.h>
enum {
APPEARANCE_CHANGED,
......@@ -152,7 +152,7 @@ nautilus_bookmark_compare_with (gconstpointer a, gconstpointer b)
return 1;
}
if (!nautilus_uris_match (bookmark_a->details->uri,
if (!eel_uris_match (bookmark_a->details->uri,
bookmark_b->details->uri)) {
return 1;
}
......@@ -182,7 +182,7 @@ nautilus_bookmark_compare_uris (gconstpointer a, gconstpointer b)
bookmark_a = NAUTILUS_BOOKMARK (a);
bookmark_b = NAUTILUS_BOOKMARK (b);
return !nautilus_uris_match (bookmark_a->details->uri,
return !eel_uris_match (bookmark_a->details->uri,
bookmark_b->details->uri);
}
......@@ -380,7 +380,7 @@ bookmark_file_changed_callback (NautilusFile *file, NautilusBookmark *bookmark)
should_emit_contents_changed_signal = FALSE;
file_uri = nautilus_file_get_uri (file);
if (!nautilus_uris_match (bookmark->details->uri, file_uri)) {
if (!eel_uris_match (bookmark->details->uri, file_uri)) {
g_free (bookmark->details->uri);
bookmark->details->uri = file_uri;
should_emit_contents_changed_signal = TRUE;
......
......@@ -65,12 +65,12 @@
struct TopLeftTextReadState {
NautilusFile *file;
NautilusReadFileHandle *handle;
EelReadFileHandle *handle;
};
struct ActivationURIReadState {
NautilusFile *file;
NautilusReadFileHandle *handle;
EelReadFileHandle *handle;
};
typedef struct {
......@@ -367,7 +367,7 @@ static void
top_left_cancel (NautilusDirectory *directory)
{
if (directory->details->top_left_read_state != NULL) {
nautilus_read_file_cancel (directory->details->top_left_read_state->handle);
eel_read_file_cancel (directory->details->top_left_read_state->handle);
g_free (directory->details->top_left_read_state);
directory->details->top_left_read_state = NULL;
......@@ -379,7 +379,7 @@ static void
activation_uri_cancel (NautilusDirectory *directory)
{
if (directory->details->activation_uri_read_state != NULL) {
nautilus_read_file_cancel (directory->details->activation_uri_read_state->handle);
eel_read_file_cancel (directory->details->activation_uri_read_state->handle);
g_free (directory->details->activation_uri_read_state);
directory->details->activation_uri_read_state = NULL;
......@@ -2467,7 +2467,7 @@ top_left_start (NautilusDirectory *directory)
directory->details->top_left_read_state = g_new0 (TopLeftTextReadState, 1);
directory->details->top_left_read_state->file = file;
uri = nautilus_file_get_uri (file);
directory->details->top_left_read_state->handle = nautilus_read_file_async
directory->details->top_left_read_state->handle = eel_read_file_async
(uri,
top_left_read_callback,
top_left_read_more_callback,
......@@ -2751,13 +2751,13 @@ activation_uri_start (NautilusDirectory *directory)
directory->details->activation_uri_read_state->file = file;
uri = nautilus_file_get_uri (file);
if (gmc_style_link) {
directory->details->activation_uri_read_state->handle = nautilus_read_file_async
directory->details->activation_uri_read_state->handle = eel_read_file_async
(uri,
activation_uri_gmc_link_read_callback,
activation_uri_gmc_link_read_more_callback,
directory);
} else {
directory->details->activation_uri_read_state->handle = nautilus_read_entire_file_async
directory->details->activation_uri_read_state->handle = eel_read_entire_file_async
(uri,
activation_uri_nautilus_link_read_callback,
directory);
......
......@@ -31,7 +31,7 @@
#include <gnome-xml/tree.h>
#include "nautilus-file.h"
#include "nautilus-file-utilities.h"
#include <eel/eel-vfs-extensions.h>
#include "nautilus-directory-metafile-monitor.h"
#include "nautilus-metafile-server.h"
#include <libnautilus/nautilus-idle-queue.h>
......
......@@ -316,7 +316,7 @@ nautilus_directory_make_uri_canonical (const char *uri)
char *with_slashes;
size_t length;
canonical_maybe_trailing_slash = nautilus_make_uri_canonical (uri);
canonical_maybe_trailing_slash = eel_make_uri_canonical (uri);
/* To NautilusDirectory, a uri with or without a trailing
* / is equivalent. This is necessary to prevent separate
......@@ -495,7 +495,7 @@ nautilus_directory_new (const char *uri)
g_assert (uri != NULL);
if (nautilus_uri_is_trash (uri)) {
if (eel_uri_is_trash (uri)) {
directory = NAUTILUS_DIRECTORY (gtk_object_new (NAUTILUS_TYPE_TRASH_DIRECTORY, NULL));
} else {
directory = NAUTILUS_DIRECTORY (gtk_object_new (NAUTILUS_TYPE_VFS_DIRECTORY, NULL));
......@@ -1208,7 +1208,7 @@ nautilus_directory_notify_files_moved (GList *uri_pairs)
nautilus_directory_unref (new_directory);
/* Update the file's name. */
name = nautilus_uri_get_basename (pair->to_uri);
name = eel_uri_get_basename (pair->to_uri);
nautilus_file_update_name (file, name);
g_free (name);
......@@ -1631,10 +1631,10 @@ nautilus_self_check_directory (void)
EEL_CHECK_STRING_RESULT (nautilus_directory_make_uri_canonical (""), "file:///");
EEL_CHECK_STRING_RESULT (nautilus_directory_make_uri_canonical ("file:/"), "file:///");
EEL_CHECK_STRING_RESULT (nautilus_directory_make_uri_canonical ("file:///"), "file:///");
EEL_CHECK_STRING_RESULT (nautilus_directory_make_uri_canonical ("TRASH:XXX"), NAUTILUS_TRASH_URI);
EEL_CHECK_STRING_RESULT (nautilus_directory_make_uri_canonical ("trash:xxx"), NAUTILUS_TRASH_URI);
EEL_CHECK_STRING_RESULT (nautilus_directory_make_uri_canonical ("GNOME-TRASH:XXX"), NAUTILUS_TRASH_URI);
EEL_CHECK_STRING_RESULT (nautilus_directory_make_uri_canonical ("gnome-trash:xxx"), NAUTILUS_TRASH_URI);
EEL_CHECK_STRING_RESULT (nautilus_directory_make_uri_canonical ("TRASH:XXX"), EEL_TRASH_URI);
EEL_CHECK_STRING_RESULT (nautilus_directory_make_uri_canonical ("trash:xxx"), EEL_TRASH_URI);
EEL_CHECK_STRING_RESULT (nautilus_directory_make_uri_canonical ("GNOME-TRASH:XXX"), EEL_TRASH_URI);
EEL_CHECK_STRING_RESULT (nautilus_directory_make_uri_canonical ("gnome-trash:xxx"), EEL_TRASH_URI);
EEL_CHECK_STRING_RESULT (nautilus_directory_make_uri_canonical ("file:///home/mathieu/"), "file:///home/mathieu");
EEL_CHECK_STRING_RESULT (nautilus_directory_make_uri_canonical ("file:///home/mathieu"), "file:///home/mathieu");
EEL_CHECK_STRING_RESULT (nautilus_directory_make_uri_canonical ("ftp://mathieu:password@le-hackeur.org"), "ftp://mathieu:password@le-hackeur.org");
......
......@@ -27,22 +27,21 @@
#include <config.h>
#include "nautilus-drag.h"
#include "nautilus-link.h"
#include <eel/eel-glib-extensions.h>
#include <eel/eel-string.h>
#include <eel/eel-vfs-extensions.h>
#include <gtk/gtkmain.h>
#include <libgnome/gnome-i18n.h>
#include <libgnomeui/gnome-popup-menu.h>
#include <libgnomeui/gnome-uidefs.h>
#include <libgnomevfs/gnome-vfs-find-directory.h>
#include <libgnomevfs/gnome-vfs-ops.h>
#include <libgnomevfs/gnome-vfs-types.h>
#include <libgnomevfs/gnome-vfs-uri.h>
#include <libgnomevfs/gnome-vfs-ops.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include <libgnomeui/gnome-uidefs.h>
#include <libgnomeui/gnome-popup-menu.h>
#include <libgnome/gnome-i18n.h>
#include <stdio.h>
#include <string.h>
#include <gtk/gtkmain.h>
#include <eel/eel-glib-extensions.h>
#include "nautilus-link.h"
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <eel/eel-string.h>
#define NAUTILUS_COMMAND_SPECIFIER "command:"
......@@ -225,7 +224,7 @@ nautilus_drag_items_in_trash (const GList *selection_list)
* we should really test each item but that would be slow for large selections
* and currently dropped items can only be from the same container
*/
return nautilus_uri_is_in_trash (((DragSelectionItem *)selection_list->data)->uri);
return eel_uri_is_in_trash (((DragSelectionItem *)selection_list->data)->uri);
}
gboolean
......@@ -314,7 +313,7 @@ nautilus_drag_default_drop_action_for_icons (GdkDragContext *context,
}
/* Check for trash URI. We do a find_directory for any Trash directory. */
if (nautilus_uri_is_trash (target_uri_string)) {
if (eel_uri_is_trash (target_uri_string)) {
result = gnome_vfs_find_directory (NULL, GNOME_VFS_DIRECTORY_KIND_TRASH,
&target_uri, FALSE, FALSE, 0777);
if (result != GNOME_VFS_OK) {
......
......@@ -34,6 +34,8 @@
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-stock-dialogs.h>
#include <eel/eel-vfs-extensions.h>
#include <gnome.h>
#include <gtk/gtklabel.h>
#include <libgnomevfs/gnome-vfs-async-ops.h>
......@@ -43,10 +45,9 @@
#include <libgnomevfs/gnome-vfs-uri.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include <libnautilus-extensions/nautilus-file-changes-queue.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-extensions/nautilus-link.h>
#include <libnautilus-extensions/nautilus-trash-monitor.h>
#include "nautilus-global-preferences.h"
#include "nautilus-link.h"
#include "nautilus-trash-monitor.h"
typedef enum {
TRANSFER_MOVE,
......@@ -247,7 +248,7 @@ format_and_ellipsize_uri_for_dialog (const char *uri)
{
char *unescaped, *result;
unescaped = nautilus_format_uri_for_display (uri);
unescaped = eel_format_uri_for_display (uri);
result = ellipsize_string_for_dialog (unescaped);
g_free (unescaped);
......@@ -1726,7 +1727,7 @@ nautilus_file_operations_copy_move (const GList *item_uris,
move_options = GNOME_VFS_XFER_RECURSIVE;
if (target_dir != NULL) {
if (nautilus_uri_is_trash (target_dir)) {
if (eel_uri_is_trash (target_dir)) {
target_is_trash = TRUE;
} else {
target_dir_uri = gnome_vfs_uri_new (target_dir);
......
......@@ -27,71 +27,30 @@
#include <libgnomevfs/gnome-vfs-types.h>
#define NAUTILUS_TRASH_URI "trash:"
typedef void (* NautilusReadFileCallback) (GnomeVFSResult result,
GnomeVFSFileSize file_size,
char *file_contents,
gpointer callback_data);
typedef gboolean (* NautilusReadMoreCallback) (GnomeVFSFileSize file_size,
const char *file_contents,
gpointer callback_data);
typedef struct NautilusReadFileHandle NautilusReadFileHandle;
char * nautilus_format_uri_for_display (const char *uri);
char * nautilus_make_uri_from_input (const char *location);
char * nautilus_make_uri_from_shell_arg (const char *location);
gboolean nautilus_uri_is_trash (const char *uri);
gboolean nautilus_uri_is_trash_folder (const char *uri);
gboolean nautilus_uri_is_in_trash (const char *uri);
char * nautilus_make_uri_canonical (const char *uri);
char * nautilus_make_uri_canonical_strip_fragment (const char *uri);
gboolean nautilus_uris_match (const char *uri_1,
const char *uri_2);
gboolean nautilus_uris_match_ignore_fragments (const char *uri_1,
const char *uri_2);
char * nautilus_uri_get_basename (const char *uri);
char * nautilus_uri_get_scheme (const char *uri);
char * nautilus_uri_make_full_from_relative (const char *base_uri,
const char *uri);
/* Recognizing special file names. */
gboolean nautilus_file_name_matches_hidden_pattern (const char *name_or_relative_uri);
gboolean nautilus_file_name_matches_backup_pattern (const char *name_or_relative_uri);
gboolean nautilus_file_name_matches_metafile_pattern(const char *name_or_relative_uri);
gboolean nautilus_file_name_matches_hidden_pattern (const char *name_or_relative_uri);
gboolean nautilus_file_name_matches_backup_pattern (const char *name_or_relative_uri);
gboolean nautilus_file_name_matches_metafile_pattern (const char *name_or_relative_uri);
/* FIXME bugzilla.eazel.com 2424:
* This is the same as gnome-libs g_concat_dir_and_file except
* for handling path == NULL.
*/
char * nautilus_make_path (const char *path,
const char *name);
char * nautilus_make_path (const char *path,
const char *name);
/* These functions all return something something that needs to be
* freed with g_free, is not NULL, and is guaranteed to exist.
*/
char * nautilus_get_user_directory (void);
char * nautilus_get_user_main_directory (void);
char * nautilus_get_desktop_directory (void);
char * nautilus_get_pixmap_directory (void);
char * nautilus_get_user_directory (void);
char * nautilus_get_user_main_directory (void);
char * nautilus_get_desktop_directory (void);
char * nautilus_get_pixmap_directory (void);
/* See if the user_main_directory exists. This should be called before
* nautilus_get_user_main_directory, which creates the directory.
*/
gboolean nautilus_user_main_directory_exists (void);
/* Convenience routine to test if a string is a remote URI. */
gboolean nautilus_is_remote_uri (const char *uri);
gboolean nautilus_user_main_directory_exists (void);
/* A version of gnome's gnome_pixmap_file that works for the nautilus prefix.
* Otherwise similar to gnome_pixmap_file in that it checks to see if the file
......@@ -101,49 +60,22 @@ gboolean nautilus_is_remote_uri (const char
* We might not need this once we get on gnome-libs 2.0 which handles
* gnome_pixmap_file better, using GNOME_PATH.
*/
char * nautilus_pixmap_file (const char *partial_path);
/* Read an entire file at once with gnome-vfs. */
GnomeVFSResult nautilus_read_entire_file (const char *uri,
int *file_size,
char **file_contents);
NautilusReadFileHandle *nautilus_read_entire_file_async (const char *uri,
NautilusReadFileCallback callback,
gpointer callback_data);
NautilusReadFileHandle *nautilus_read_file_async (const char *uri,
NautilusReadFileCallback callback,
NautilusReadMoreCallback read_more_callback,
gpointer callback_data);
void nautilus_read_file_cancel (NautilusReadFileHandle *handle);
/* Convenience routine for simple file copying using text-based uris */
GnomeVFSResult nautilus_copy_uri_simple (const char *source_uri,
const char *dest_uri);
/* gnome-vfs cover to make a directory and parents */
GnomeVFSResult nautilus_make_directory_and_parents (GnomeVFSURI *uri,
guint permissions);
char * nautilus_pixmap_file (const char *partial_path);
/* Returns the build time stamp the Nautilus binary.
* This is useful to be able to tell builds apart.
* A return value of NULL means unknown time stamp.
*/
char * nautilus_get_build_time_stamp (void);
char * nautilus_get_build_time_stamp (void);
/* Returns the "build message", which provides some information on build
* context. May return NULL.
*/
char * nautilus_get_build_message (void);
char * nautilus_get_build_message (void);