nautilus/libnautilus-extensions/nautilus-trash-monitor.h
Pavel Cisler a085188ccf reviewed by: Darin Adler <darin@eazel.com>
2000-12-12  Pavel Cisler <pavel@eazel.com>

	reviewed by: Darin Adler <darin@eazel.com>

	Fixed 4954 Nautilus crashes attempting to empty a .Trash
	containing undeletable files

	* libnautilus-extensions/nautilus-file-operations.c:
	(build_error_string), (handle_xfer_vfs_error)
	Reworked the error message building logic. Split up
	the routine into a part that decides what the interesting
	input for building the error message is and a part that
	actually builds the error message. Fixed a number
	of cases where a wrong error message would be used. The
	actual bug in the bug report was one of the cases -- an assert
	catching a case that was not handled properly.

	Fixed:
	part of -- 638 When a new volume gets mounted, integrate its Trash
	directory.
	part of -- 4143 Files dragged to trash icon on desktop seem to
	vanish,
	part of -- 4963 Files dragged to Trash from floppy don't appear
	in Trash,

	* libnautilus-extensions/nautilus-trash-monitor.c:
	* libnautilus-extensions/nautilus-trash-monitor.h:
	(add_one_volume_trash),
	(nautilus_trash_monitor_get_trash_directories):
	Added a new call that returns a list of all the Trash directories
	on all the mouted volumes.

	* libnautilus-extensions/nautilus-trash-directory.c: (add_volume):
	Got rid of get_volume_vfs_uri_if_writable.
	Used the new nautilus_volume_monitor_should_integrate_trash instead
	to pick the volumes that can support trash.

	* libnautilus-extensions/nautilus-volume-monitor.c:
	(nautilus_volume_monitor_should_integrate_trash),
	(nautilus_volume_monitor_get_volume_mount_uri):
	* libnautilus-extensions/nautilus-volume-monitor.h:
	Add new helper calls used by the routine that collects all the
	trash uris from all mouted volumes.

	* libnautilus-extensions/nautilus-file-operations.c:
	(do_empty_trash):
	Pass in a list of Trash directories instead of just the
	single trash in the user's home directory.

	Fixed:
	2443 Trash is only found on EXT2 volumes
	2444 Trash on read-only volumes is not displayed
	remaining part of -- 4143 Files dragged to trash icon on desktop
	seem to vanish,
	remaining part of -- 4963 Files dragged to Trash from floppy
	don't appear in Trash,

	* libnautilus-extensions/nautilus-volume-monitor.c:
	(nautilus_volume_monitor_should_integrate_trash):
	Removed the old logic from get_volume_vfs_uri_if_writable
	that only displayed trash from writable ext2 volumes.
	Enumerated all the file system types that we know can
	support trash.
2000-12-13 01:41:12 +00:00

66 lines
2.3 KiB
C

/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/*
nautilus-trash-monitor.h: Nautilus trash state watcher.
Copyright (C) 2000 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Pavel Cisler <pavel@eazel.com>
*/
#ifndef NAUTILUS_TRASH_MONITOR_H
#define NAUTILUS_TRASH_MONITOR_H
#include <gtk/gtkobject.h>
#include <libgnomevfs/gnome-vfs.h>
typedef struct NautilusTrashMonitor NautilusTrashMonitor;
typedef struct NautilusTrashMonitorClass NautilusTrashMonitorClass;
typedef struct NautilusTrashMonitorDetails NautilusTrashMonitorDetails;
#define NAUTILUS_TYPE_TRASH_MONITOR \
(nautilus_trash_monitor_get_type ())
#define NAUTILUS_TRASH_MONITOR(obj) \
(GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_TRASH_MONITOR, NautilusTrashMonitor))
#define NAUTILUS_TRASH_MONITOR_CLASS(klass) \
(GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_TRASH_MONITOR, NautilusTrashMonitorClass))
#define NAUTILUS_IS_TRASH_MONITOR(obj) \
(GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_TRASH_MONITOR))
#define NAUTILUS_IS_TRASH_MONITOR_CLASS(klass) \
(GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_TRASH_MONITOR))
struct NautilusTrashMonitor {
GtkObject object;
NautilusTrashMonitorDetails *details;
};
struct NautilusTrashMonitorClass {
GtkObjectClass parent_class;
void (* trash_state_changed) (NautilusTrashMonitor *trash_monitor,
gboolean new_state);
};
GtkType nautilus_trash_monitor_get_type (void);
NautilusTrashMonitor *nautilus_trash_monitor_get (void);
gboolean nautilus_trash_monitor_is_empty (void);
GList * nautilus_trash_monitor_get_trash_directories (void);
#endif