make it check if a target is begin copied into itself before doing the

2000-09-17  Mathieu Lacage  <mathieu@eazel.com>

	* src/file-manager/fm-list-view.c: (fm_list_receive_dropped_icons):
	make it check if a target is begin copied into itself before doing
	the actual file operation. ie: bug 3085
	* test/Makefile.am: add brand new test I used in my quest for bug
	1963
	* test/test-nautilus-background.c: (main): the actual test :)
	run and you will see beautiful background.
This commit is contained in:
Mathieu Lacage 2000-09-18 00:48:37 +00:00 committed by Mathieu Lacage
parent bda09ed1ea
commit e9e4d6ddca
4 changed files with 90 additions and 38 deletions

View file

@ -1,3 +1,13 @@
2000-09-17 Mathieu Lacage <mathieu@eazel.com>
* src/file-manager/fm-list-view.c: (fm_list_receive_dropped_icons):
make it check if a target is begin copied into itself before doing
the actual file operation. ie: bug 3085
* test/Makefile.am: add brand new test I used in my quest for bug
1963
* test/test-nautilus-background.c: (main): the actual test :)
run and you will see beautiful background.
2000-09-17 Maciej Stachowiak <mjs@eazel.com>
More work towards bug 1994. I'm not yet checking in the code to

View file

@ -555,10 +555,8 @@ fm_list_receive_dropped_icons (NautilusList *list,
target_item = NULL;
}
list_view_uri = fm_directory_view_get_uri (directory_view);
if (target_item != NULL
|| action != GDK_ACTION_MOVE
|| !nautilus_drag_items_local (list_view_uri, drop_data)) {
&& !nautilus_drag_items_local (list_view_uri, drop_data)) {
/* build a list of URIs to copy */
for (p = drop_data; p != NULL; p = p->next) {
@ -569,18 +567,13 @@ fm_list_receive_dropped_icons (NautilusList *list,
source_uris = g_list_reverse (source_uris);
/* figure out the uri of the destination */
if (target_item != NULL) {
target_item_uri = nautilus_file_get_uri (target_item);
} else {
target_item_uri = g_strdup (list_view_uri);
}
target_item_uri = nautilus_file_get_uri (target_item);
/* start the copy */
fm_directory_view_move_copy_items (source_uris, NULL,
target_item_uri, action, x, y, directory_view);
}
g_free (list_view_uri);
}
g_free (target_item_uri);

View file

@ -1,41 +1,43 @@
NULL=
INCLUDES =\
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_builddir)/libnautilus \
$(BONOBO_CFLAGS) \
$(OAF_CFLAGS) \
$(GCONF_CFLAGS) \
$(GNOMEUI_CFLAGS) \
$(VFS_CFLAGS) \
$(XML_CFLAGS) \
-DVERSION="\"$(VERSION)\"" \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-DNAUTILUS_DATADIR=\""$(datadir)/nautilus"\" \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_builddir)/libnautilus \
$(BONOBO_CFLAGS) \
$(OAF_CFLAGS) \
$(GCONF_CFLAGS) \
$(GNOMEUI_CFLAGS) \
$(VFS_CFLAGS) \
$(XML_CFLAGS) \
-DVERSION="\"$(VERSION)\"" \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-DNAUTILUS_DATADIR=\""$(datadir)/nautilus"\" \
$(NULL)
# -DBACKGROUNDS_DIR=\""$(top_srcdir)/data/backgrounds"\" \
LDADD =\
$(top_builddir)/libnautilus/libnautilus.la \
$(top_builddir)/libnautilus-extensions/libnautilus-extensions.la \
$(BONOBO_LIBS) \
$(OAF_LIBS) \
$(GCONF_LIBS) \
$(GNOMEUI_LIBS) \
$(VFS_LIBS) \
$(XML_LIBS) \
$(top_builddir)/libnautilus/libnautilus.la \
$(top_builddir)/libnautilus-extensions/libnautilus-extensions.la \
$(BONOBO_LIBS) \
$(OAF_LIBS) \
$(GCONF_LIBS) \
$(GNOMEUI_LIBS) \
$(VFS_LIBS) \
$(XML_LIBS) \
$(NULL)
noinst_PROGRAMS =\
test-nautilus-font \
test-nautilus-font-picker \
test-nautilus-image \
test-nautilus-label \
test-nautilus-mime-actions \
test-nautilus-mime-actions-set \
test-nautilus-password-dialog \
test-nautilus-preferences \
test-nautilus-widgets \
test-nautilus-font \
test-nautilus-font-picker \
test-nautilus-image \
test-nautilus-label \
test-nautilus-mime-actions \
test-nautilus-mime-actions-set \
test-nautilus-password-dialog \
test-nautilus-preferences \
test-nautilus-widgets \
test-nautilus-background \
$(NULL)
test_nautilus_font_SOURCES = test-nautilus-font.c
@ -47,6 +49,7 @@ test_nautilus_mime_actions_set_SOURCES = test-nautilus-mime-actions-set.c
test_nautilus_password_dialog_SOURCES = test-nautilus-password-dialog.c
test_nautilus_preferences_SOURCES = test-nautilus-preferences.c
test_nautilus_widgets_SOURCES = test-nautilus-widgets.c
test_nautilus_background_SOURCES = test-nautilus-background.c
EXTRA_DIST =\
font-test.sh \

View file

@ -0,0 +1,46 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
#include <libnautilus-extensions/nautilus-background.h>
#include <libgnomevfs/gnome-vfs-init.h>
#include <gtk/gtk.h>
#define BACKGROUNDS_DIR "/gnome-source/nautilus/data/backgrounds"
int
main (int argc, char *argv[])
{
GtkWidget *window, *ctree;
NautilusBackground *background;
char *image_uri;
char *titles[] = { "test 1", "test 2", "test 3"};
gtk_init (&argc, &argv);
gnome_vfs_init ();
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
ctree = gtk_ctree_new_with_titles (3, 2, titles);
#if 0
gtk_container_add (GTK_CONTAINER (window), ctree);
#endif
gtk_signal_connect (GTK_OBJECT (window), "destroy",
gtk_main_quit, NULL);
background = nautilus_get_widget_background (window);
nautilus_background_set_color (background,
"red-blue:h");
image_uri = g_strconcat ("file://", BACKGROUNDS_DIR, "/50s.png", NULL);
#if 1
nautilus_background_set_image_uri (background, image_uri);
#endif
g_free (image_uri);
gtk_widget_show_all (window);
gtk_main ();
return 0;
}