mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-11-05 16:04:31 +00:00
reviewed by: John Sullivan <sullivan@eazel.com>
Fixed bug 8232 (Trash.gmc and home directory link files made by gmc show on Desktop): * libnautilus-extensions/nautilus-file.c: (nautilus_file_should_show): Moved special case for gmc files in here. (filter_hidden_and_backup_partition_callback): Removed special case for gmc files, since it's now in the lower level. Also fixed code that was casting a pointer to an int without using GPOINTER_TO_INT. * src/nautilus-application.c: Fix typo.
This commit is contained in:
parent
6de9bc5e73
commit
40a997710d
4 changed files with 62 additions and 49 deletions
17
ChangeLog
17
ChangeLog
|
@ -1,3 +1,20 @@
|
|||
2001-05-03 Darin Adler <darin@eazel.com>
|
||||
|
||||
reviewed by: John Sullivan <sullivan@eazel.com>
|
||||
|
||||
Fixed bug 8232 (Trash.gmc and home directory link files made by
|
||||
gmc show on Desktop):
|
||||
|
||||
* libnautilus-extensions/nautilus-file.c:
|
||||
(nautilus_file_should_show): Moved special case for gmc files in
|
||||
here.
|
||||
(filter_hidden_and_backup_partition_callback): Removed special
|
||||
case for gmc files, since it's now in the lower level. Also fixed
|
||||
code that was casting a pointer to an int without using
|
||||
GPOINTER_TO_INT.
|
||||
|
||||
* src/nautilus-application.c: Fix typo.
|
||||
|
||||
2001-05-03 Darin Adler <darin@eazel.com>
|
||||
|
||||
reviewed by: John Sullivan <sullivan@eazel.com>
|
||||
|
|
|
@ -77,6 +77,10 @@ extern void eazel_dump_stack_trace (const char *print_prefix,
|
|||
/* Name of Nautilus trash directories */
|
||||
#define TRASH_DIRECTORY_NAME ".Trash"
|
||||
|
||||
typedef enum {
|
||||
SHOW_HIDDEN = 1 << 0,
|
||||
SHOW_BACKUP = 1 << 1
|
||||
} FilterOptions;
|
||||
|
||||
typedef struct {
|
||||
NautilusFile *file;
|
||||
|
@ -1884,20 +1888,6 @@ nautilus_file_is_metafile (NautilusFile *file)
|
|||
(file->details->relative_uri);
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_file_should_show (NautilusFile *file,
|
||||
gboolean show_hidden,
|
||||
gboolean show_backup)
|
||||
{
|
||||
return (show_hidden || ! nautilus_file_is_hidden_file (file)) &&
|
||||
(show_backup || ! nautilus_file_is_backup_file (file));
|
||||
}
|
||||
|
||||
typedef enum {
|
||||
SHOW_HIDDEN = 1 << 0,
|
||||
SHOW_BACKUP = 1 << 1
|
||||
} NautilusFileFilterOptions;
|
||||
|
||||
static gboolean
|
||||
is_special_desktop_gmc_file (NautilusFile *file)
|
||||
{
|
||||
|
@ -1959,6 +1949,18 @@ is_special_desktop_gmc_file (NautilusFile *file)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_file_should_show (NautilusFile *file,
|
||||
gboolean show_hidden,
|
||||
gboolean show_backup)
|
||||
{
|
||||
if (nautilus_file_is_in_desktop (file) && is_special_desktop_gmc_file (file)) {
|
||||
return FALSE;
|
||||
}
|
||||
return (show_hidden || ! nautilus_file_is_hidden_file (file)) &&
|
||||
(show_backup || ! nautilus_file_is_backup_file (file));
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_file_is_in_desktop (NautilusFile *file)
|
||||
{
|
||||
|
@ -1973,15 +1975,11 @@ filter_hidden_and_backup_partition_callback (gpointer data,
|
|||
gpointer callback_data)
|
||||
{
|
||||
NautilusFile *file;
|
||||
NautilusFileFilterOptions options;
|
||||
FilterOptions options;
|
||||
|
||||
file = NAUTILUS_FILE (data);
|
||||
options = (NautilusFileFilterOptions) callback_data;
|
||||
options = GPOINTER_TO_INT (callback_data);
|
||||
|
||||
if (nautilus_file_is_in_desktop (file) && is_special_desktop_gmc_file (file)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return nautilus_file_should_show (file,
|
||||
options & SHOW_HIDDEN,
|
||||
options & SHOW_BACKUP);
|
||||
|
@ -2001,10 +1999,10 @@ nautilus_file_list_filter_hidden_and_backup (GList *files,
|
|||
|
||||
filtered_files = nautilus_file_list_copy (files);
|
||||
filtered_files = eel_g_list_partition (filtered_files,
|
||||
filter_hidden_and_backup_partition_callback,
|
||||
GINT_TO_POINTER ((show_hidden ? SHOW_HIDDEN : 0) |
|
||||
(show_backup ? SHOW_BACKUP : 0)),
|
||||
&removed_files);
|
||||
filter_hidden_and_backup_partition_callback,
|
||||
GINT_TO_POINTER ((show_hidden ? SHOW_HIDDEN : 0) |
|
||||
(show_backup ? SHOW_BACKUP : 0)),
|
||||
&removed_files);
|
||||
nautilus_file_list_free (removed_files);
|
||||
|
||||
return filtered_files;
|
||||
|
|
|
@ -77,6 +77,10 @@ extern void eazel_dump_stack_trace (const char *print_prefix,
|
|||
/* Name of Nautilus trash directories */
|
||||
#define TRASH_DIRECTORY_NAME ".Trash"
|
||||
|
||||
typedef enum {
|
||||
SHOW_HIDDEN = 1 << 0,
|
||||
SHOW_BACKUP = 1 << 1
|
||||
} FilterOptions;
|
||||
|
||||
typedef struct {
|
||||
NautilusFile *file;
|
||||
|
@ -1884,20 +1888,6 @@ nautilus_file_is_metafile (NautilusFile *file)
|
|||
(file->details->relative_uri);
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_file_should_show (NautilusFile *file,
|
||||
gboolean show_hidden,
|
||||
gboolean show_backup)
|
||||
{
|
||||
return (show_hidden || ! nautilus_file_is_hidden_file (file)) &&
|
||||
(show_backup || ! nautilus_file_is_backup_file (file));
|
||||
}
|
||||
|
||||
typedef enum {
|
||||
SHOW_HIDDEN = 1 << 0,
|
||||
SHOW_BACKUP = 1 << 1
|
||||
} NautilusFileFilterOptions;
|
||||
|
||||
static gboolean
|
||||
is_special_desktop_gmc_file (NautilusFile *file)
|
||||
{
|
||||
|
@ -1959,6 +1949,18 @@ is_special_desktop_gmc_file (NautilusFile *file)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_file_should_show (NautilusFile *file,
|
||||
gboolean show_hidden,
|
||||
gboolean show_backup)
|
||||
{
|
||||
if (nautilus_file_is_in_desktop (file) && is_special_desktop_gmc_file (file)) {
|
||||
return FALSE;
|
||||
}
|
||||
return (show_hidden || ! nautilus_file_is_hidden_file (file)) &&
|
||||
(show_backup || ! nautilus_file_is_backup_file (file));
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_file_is_in_desktop (NautilusFile *file)
|
||||
{
|
||||
|
@ -1973,15 +1975,11 @@ filter_hidden_and_backup_partition_callback (gpointer data,
|
|||
gpointer callback_data)
|
||||
{
|
||||
NautilusFile *file;
|
||||
NautilusFileFilterOptions options;
|
||||
FilterOptions options;
|
||||
|
||||
file = NAUTILUS_FILE (data);
|
||||
options = (NautilusFileFilterOptions) callback_data;
|
||||
options = GPOINTER_TO_INT (callback_data);
|
||||
|
||||
if (nautilus_file_is_in_desktop (file) && is_special_desktop_gmc_file (file)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return nautilus_file_should_show (file,
|
||||
options & SHOW_HIDDEN,
|
||||
options & SHOW_BACKUP);
|
||||
|
@ -2001,10 +1999,10 @@ nautilus_file_list_filter_hidden_and_backup (GList *files,
|
|||
|
||||
filtered_files = nautilus_file_list_copy (files);
|
||||
filtered_files = eel_g_list_partition (filtered_files,
|
||||
filter_hidden_and_backup_partition_callback,
|
||||
GINT_TO_POINTER ((show_hidden ? SHOW_HIDDEN : 0) |
|
||||
(show_backup ? SHOW_BACKUP : 0)),
|
||||
&removed_files);
|
||||
filter_hidden_and_backup_partition_callback,
|
||||
GINT_TO_POINTER ((show_hidden ? SHOW_HIDDEN : 0) |
|
||||
(show_backup ? SHOW_BACKUP : 0)),
|
||||
&removed_files);
|
||||
nautilus_file_list_free (removed_files);
|
||||
|
||||
return filtered_files;
|
||||
|
|
|
@ -337,7 +337,7 @@ nautilus_make_uri_list_from_shell_strv (const char * const *strv)
|
|||
return uri_list;
|
||||
}
|
||||
|
||||
/* Find ~/.gnome-desktop/Trash and rename it to ~/.gnome-desktop/Trash-gmc
|
||||
/* Find ~/.gnome-desktop/Trash and rename it to ~/.gnome-desktop/Trash.gmc
|
||||
* Only if it is a directory
|
||||
*/
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue