mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-25 02:36:07 +00:00
reviewed by: Rebecca Schulman <rebecka@eazel.com>
Fixed bug 3811 (shallow file counts and top-left text are fetched even for non-displayed hidden/backup items). * libnautilus-extensions/nautilus-directory-private.h: * libnautilus-extensions/nautilus-directory-async.c: (allow_metafile): Add "ghelp:" and "gnome-help:" to the unfortunate list of hard-coded schemes. If we hard-code "help:" we have to hard-code its synonyms too. (find_monitor): Use g_new0 so fields in the Monitor are not uninitialized in this case (the fields in question are ignored, but it's still nicer this way). (nautilus_directory_monitor_add_internal): Set up the "monitor hidden files" and "monitor backup files" in the Monitor structure based on new parameters. (should_display_file_name): Use nautilus_file_name_matches_hidden_pattern and nautilus_file_name_matches_backup_pattern. (monitor_includes_file): New function that encapsulates the rule about which monitor includes which file. Handles the new flags for not monitoring hidden or backup files. (is_needy): Call monitor_includes_file. (select_needy_file): Call monitor_includes_file. * libnautilus-extensions/nautilus-file-private.h: * libnautilus-extensions/nautilus-file.c: (nautilus_file_name_matches_hidden_pattern), (nautilus_file_name_matches_backup_pattern): New functions to share with the directory code. (nautilus_file_is_hidden_file), (nautilus_file_is_backup_file): Use the new functions and use the raw relative_uri -- no need to unescape to change to a file name since the "." and "~" characters are not encoded. * src/file-manager/fm-directory-view.c: (fm_directory_view_initialize): Share more code with the filtering_changed_callback. Handle the desktop view better by never setting the "show hidden" and "show backup" flags (so they are both FALSE) and not setting up the callbacks. (fm_directory_view_destroy): Since we don't set up the callbacks for desktop windows, don't remove them for desktop windows. (queue_pending_files): Remove the desktop special case from here. It was strange to set the flags up then wait until this moment to clear them both. It's better to keep them FALSE. (finish_loading): Renamed and changed to pass the appropriate values in to the nautilus_directory_file_monitor_add call -- this is the actual bug fix. (filtering_changed_callback): Remove the desktop special case, since this function will now never be called for the desktop. * libnautilus-extensions/nautilus-directory.h: * libnautilus-extensions/nautilus-directory.c: (nautilus_directory_file_monitor_add): Pass through the new "monitor hidden files" and "monitor backup files" parameters. (nautilus_self_check_directory): Pass TRUE for both. * libnautilus-extensions/nautilus-vfs-directory.c: (vfs_file_monitor_add): Pass through the new "monitor hidden files" and "monitor backup files" parameters. * libnautilus-extensions/nautilus-merged-directory.c: (merged_file_monitor_add), (monitor_add_directory): Store the "monitor hidden files" and "monitor backup files" and pass them through to the individual directory monitor calls. * components/tree/nautilus-tree-model.c: (nautilus_tree_model_node_begin_monitoring_no_connect): * libnautilus-extensions/nautilus-file.c: (nautilus_file_monitor_add): * libnautilus-extensions/nautilus-trash-monitor.c: (nautilus_trash_monitor_initialize): * src/nautilus-applicable-views.c: (got_minimum_file_info_callback): Pass in TRUE for "monitor hidden files" and "monitor backup files" to get the same behavior as before. (In some cases the booleans are just ignored, in other cases we just monitor all files as we used to.) * RENAMING: Remind myself to change the name of the NAUTILUS_CALL_VIRTUAL macro to NAUTILUS_CALL_METHOD some day.
This commit is contained in:
parent
bec53ebbfc
commit
f649b991af
89
ChangeLog
89
ChangeLog
|
@ -1,3 +1,86 @@
|
|||
2001-01-04 Darin Adler <darin@eazel.com>
|
||||
|
||||
reviewed by: Rebecca Schulman <rebecka@eazel.com>
|
||||
|
||||
Fixed bug 3811 (shallow file counts and top-left text are fetched
|
||||
even for non-displayed hidden/backup items).
|
||||
|
||||
* libnautilus-extensions/nautilus-directory-private.h:
|
||||
* libnautilus-extensions/nautilus-directory-async.c:
|
||||
(allow_metafile): Add "ghelp:" and "gnome-help:" to the
|
||||
unfortunate list of hard-coded schemes. If we hard-code "help:" we
|
||||
have to hard-code its synonyms too.
|
||||
(find_monitor): Use g_new0 so fields in the Monitor are not
|
||||
uninitialized in this case (the fields in question are ignored,
|
||||
but it's still nicer this way).
|
||||
(nautilus_directory_monitor_add_internal): Set up the "monitor
|
||||
hidden files" and "monitor backup files" in the Monitor structure
|
||||
based on new parameters.
|
||||
(should_display_file_name): Use
|
||||
nautilus_file_name_matches_hidden_pattern and
|
||||
nautilus_file_name_matches_backup_pattern.
|
||||
(monitor_includes_file): New function that encapsulates the rule
|
||||
about which monitor includes which file. Handles the new flags for
|
||||
not monitoring hidden or backup files.
|
||||
(is_needy): Call monitor_includes_file.
|
||||
(select_needy_file): Call monitor_includes_file.
|
||||
|
||||
* libnautilus-extensions/nautilus-file-private.h:
|
||||
* libnautilus-extensions/nautilus-file.c:
|
||||
(nautilus_file_name_matches_hidden_pattern),
|
||||
(nautilus_file_name_matches_backup_pattern): New functions to
|
||||
share with the directory code.
|
||||
(nautilus_file_is_hidden_file), (nautilus_file_is_backup_file):
|
||||
Use the new functions and use the raw relative_uri -- no need to
|
||||
unescape to change to a file name since the "." and "~" characters
|
||||
are not encoded.
|
||||
|
||||
* src/file-manager/fm-directory-view.c:
|
||||
(fm_directory_view_initialize): Share more code with the
|
||||
filtering_changed_callback. Handle the desktop view better by
|
||||
never setting the "show hidden" and "show backup" flags (so they
|
||||
are both FALSE) and not setting up the callbacks.
|
||||
(fm_directory_view_destroy): Since we don't set up the callbacks
|
||||
for desktop windows, don't remove them for desktop windows.
|
||||
(queue_pending_files): Remove the desktop special case from
|
||||
here. It was strange to set the flags up then wait until this
|
||||
moment to clear them both. It's better to keep them FALSE.
|
||||
(finish_loading): Renamed and changed to pass the appropriate
|
||||
values in to the nautilus_directory_file_monitor_add call -- this
|
||||
is the actual bug fix.
|
||||
(filtering_changed_callback): Remove the desktop special case,
|
||||
since this function will now never be called for the desktop.
|
||||
|
||||
* libnautilus-extensions/nautilus-directory.h:
|
||||
* libnautilus-extensions/nautilus-directory.c:
|
||||
(nautilus_directory_file_monitor_add): Pass through the new
|
||||
"monitor hidden files" and "monitor backup files" parameters.
|
||||
(nautilus_self_check_directory): Pass TRUE for both.
|
||||
* libnautilus-extensions/nautilus-vfs-directory.c:
|
||||
(vfs_file_monitor_add): Pass through the new "monitor hidden
|
||||
files" and "monitor backup files" parameters.
|
||||
|
||||
* libnautilus-extensions/nautilus-merged-directory.c:
|
||||
(merged_file_monitor_add), (monitor_add_directory): Store the
|
||||
"monitor hidden files" and "monitor backup files" and pass them
|
||||
through to the individual directory monitor calls.
|
||||
|
||||
* components/tree/nautilus-tree-model.c:
|
||||
(nautilus_tree_model_node_begin_monitoring_no_connect):
|
||||
* libnautilus-extensions/nautilus-file.c:
|
||||
(nautilus_file_monitor_add):
|
||||
* libnautilus-extensions/nautilus-trash-monitor.c:
|
||||
(nautilus_trash_monitor_initialize):
|
||||
* src/nautilus-applicable-views.c:
|
||||
(got_minimum_file_info_callback):
|
||||
Pass in TRUE for "monitor hidden files" and "monitor backup files"
|
||||
to get the same behavior as before. (In some cases the booleans
|
||||
are just ignored, in other cases we just monitor all files as we
|
||||
used to.)
|
||||
|
||||
* RENAMING: Remind myself to change the name of the
|
||||
NAUTILUS_CALL_VIRTUAL macro to NAUTILUS_CALL_METHOD some day.
|
||||
|
||||
2001-01-04 John Harper <jsh@eazel.com>
|
||||
|
||||
* libnautilus-extensions/nautilus-gdk-extensions.c,
|
||||
|
@ -308,7 +391,7 @@ Wed Jan 03 04:11:01 2001 George Lebl <jirka@5z.com>
|
|||
|
||||
2001-01-03 Ramiro Estrugo <ramiro@eazel.com>
|
||||
|
||||
reviewed by: Pavel Cisler<pavel@eazel.com>
|
||||
reviewed by: Pavel Cisler <pavel@eazel.com>
|
||||
|
||||
Fix bugs 4677, 3031.
|
||||
|
||||
|
@ -902,7 +985,7 @@ Wed Jan 03 04:11:01 2001 George Lebl <jirka@5z.com>
|
|||
|
||||
2000-12-23 Gene Z. Ragan <gzr@eazel.com>
|
||||
|
||||
reviewed by: Pavel Cisler<pavel@eazel.com>
|
||||
reviewed by: Pavel Cisler <pavel@eazel.com>
|
||||
|
||||
Fixed bug 4158, dropping a file onto gnome-terminal
|
||||
doesn't insert a path name.
|
||||
|
@ -938,7 +1021,7 @@ Wed Jan 03 04:11:01 2001 George Lebl <jirka@5z.com>
|
|||
|
||||
2000-12-22 Gene Z. Ragan <gzr@eazel.com>
|
||||
|
||||
reviewed by: Pavel Cisler<pavel@eazel.com>
|
||||
reviewed by: Pavel Cisler <pavel@eazel.com>
|
||||
|
||||
Fixed bug 4951, No error given selecting unmountable "Disks" volume.
|
||||
|
||||
|
|
7
RENAMING
7
RENAMING
|
@ -12,6 +12,11 @@ When we rename files in the repository, we do it by this process:
|
|||
|
||||
This retains the history in both the old and new locations.
|
||||
|
||||
------
|
||||
macros
|
||||
------
|
||||
NAUTILUS_CALL_VIRTUAL -> NAUTILUS_CALL_METHOD
|
||||
|
||||
---------------
|
||||
directory names
|
||||
---------------
|
||||
|
@ -62,4 +67,4 @@ classes: NautilusToolbar -> NautilusToolBar
|
|||
files: nautilus-toolbar.[ch] -> nautilus-tool-bar.[ch],
|
||||
nautilus-window-toolbars.c -> nautilus-window-tool-bars.c
|
||||
Should also search for variable names, etc (being careful not
|
||||
to change the Gtk and Bonobo calls)
|
||||
to change the Gtk and Bonobo calls)
|
||||
|
|
|
@ -385,6 +385,7 @@ nautilus_tree_model_node_begin_monitoring_no_connect (NautilusTreeModel
|
|||
monitor_attributes = g_list_prepend (NULL, NAUTILUS_FILE_ATTRIBUTE_IS_DIRECTORY);
|
||||
nautilus_directory_file_monitor_add (directory,
|
||||
model,
|
||||
TRUE, TRUE,
|
||||
monitor_attributes,
|
||||
force_reload);
|
||||
g_list_free (monitor_attributes);
|
||||
|
|
|
@ -41,13 +41,13 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* turn this on to see messages about each load_directory call: */
|
||||
#if 0
|
||||
/* comment this back in to see messages about each load_directory call: */
|
||||
#define DEBUG_LOAD_DIRECTORY
|
||||
#endif
|
||||
|
||||
/* turn this on to check if async. job calls are balanced */
|
||||
#if 0
|
||||
/* comment this back in to check if async. job calls are balanced */
|
||||
#define DEBUG_ASYNC_JOBS
|
||||
#endif
|
||||
|
||||
|
@ -96,6 +96,8 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
NautilusFile *file; /* Which file, NULL means all. */
|
||||
gboolean monitor_hidden_files; /* defines whether "all" includes hidden files */
|
||||
gboolean monitor_backup_files; /* defines whether "all" includes backup files */
|
||||
gconstpointer client;
|
||||
Request request;
|
||||
} Monitor;
|
||||
|
@ -111,13 +113,12 @@ static GHashTable *async_jobs;
|
|||
#endif
|
||||
|
||||
/* Forward declarations for functions that need them. */
|
||||
static void deep_count_load (NautilusDirectory *directory,
|
||||
const char *uri);
|
||||
static void metafile_read_restart (NautilusDirectory *directory);
|
||||
static gboolean request_is_satisfied (NautilusDirectory *directory,
|
||||
NautilusFile *file,
|
||||
Request *request);
|
||||
|
||||
static void deep_count_load (NautilusDirectory *directory,
|
||||
const char *uri);
|
||||
static void metafile_read_restart (NautilusDirectory *directory);
|
||||
static gboolean request_is_satisfied (NautilusDirectory *directory,
|
||||
NautilusFile *file,
|
||||
Request *request);
|
||||
static void cancel_loading_attributes (NautilusDirectory *directory,
|
||||
GList *file_attributes);
|
||||
|
||||
|
@ -654,11 +655,14 @@ allow_metafile (NautilusDirectory *directory)
|
|||
* access inside gnome-vfs.
|
||||
*/
|
||||
uri = directory->details->uri;
|
||||
if (nautilus_istr_has_prefix (uri, "info:")
|
||||
if (nautilus_is_search_uri (uri)
|
||||
|| nautilus_istr_has_prefix (uri, "ghelp:")
|
||||
|| nautilus_istr_has_prefix (uri, "gnome-help:")
|
||||
|| nautilus_istr_has_prefix (uri, "help:")
|
||||
|| nautilus_istr_has_prefix (uri, "info:")
|
||||
|| nautilus_istr_has_prefix (uri, "man:")
|
||||
|| nautilus_istr_has_prefix (uri, "pipe:")
|
||||
|| nautilus_is_search_uri (uri)) {
|
||||
) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -950,7 +954,7 @@ find_monitor (NautilusDirectory *directory,
|
|||
GList *result;
|
||||
Monitor *monitor;
|
||||
|
||||
monitor = g_new (Monitor, 1);
|
||||
monitor = g_new0 (Monitor, 1);
|
||||
monitor->client = client;
|
||||
monitor->file = file;
|
||||
|
||||
|
@ -1083,6 +1087,8 @@ void
|
|||
nautilus_directory_monitor_add_internal (NautilusDirectory *directory,
|
||||
NautilusFile *file,
|
||||
gconstpointer client,
|
||||
gboolean monitor_hidden_files,
|
||||
gboolean monitor_backup_files,
|
||||
GList *file_attributes)
|
||||
{
|
||||
Monitor *monitor;
|
||||
|
@ -1096,6 +1102,8 @@ nautilus_directory_monitor_add_internal (NautilusDirectory *directory,
|
|||
/* Add the new monitor. */
|
||||
monitor = g_new (Monitor, 1);
|
||||
monitor->file = file;
|
||||
monitor->monitor_hidden_files = monitor_hidden_files;
|
||||
monitor->monitor_backup_files = monitor_backup_files;
|
||||
monitor->client = client;
|
||||
nautilus_directory_set_up_request (&monitor->request, file_attributes);
|
||||
|
||||
|
@ -2029,18 +2037,21 @@ mark_all_files_unconfirmed (NautilusDirectory *directory)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
should_display_file_name (const char *name, GnomeVFSDirectoryFilterOptions options)
|
||||
should_display_file_name (const char *name,
|
||||
GnomeVFSDirectoryFilterOptions options)
|
||||
{
|
||||
if (options & GNOME_VFS_DIRECTORY_FILTER_NODOTFILES) {
|
||||
if (name[0] == '.') {
|
||||
return FALSE;
|
||||
}
|
||||
/* Note that the name is URI-encoded, but this should not
|
||||
* affect the . or the ~.
|
||||
*/
|
||||
|
||||
if ((options & GNOME_VFS_DIRECTORY_FILTER_NODOTFILES) != 0
|
||||
&& nautilus_file_name_matches_hidden_pattern (name)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (options & GNOME_VFS_DIRECTORY_FILTER_NOBACKUPFILES) {
|
||||
if (name[strlen (name) - 1] == '~') {
|
||||
return FALSE;
|
||||
}
|
||||
if ((options & GNOME_VFS_DIRECTORY_FILTER_NOBACKUPFILES) != 0
|
||||
&& nautilus_file_name_matches_backup_pattern (name)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Note that we don't bother to check for "." or ".." here, because
|
||||
|
@ -2228,6 +2239,24 @@ nautilus_directory_force_reload (NautilusDirectory *directory,
|
|||
nautilus_directory_async_state_changed (directory);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
monitor_includes_file (const Monitor *monitor,
|
||||
NautilusFile *file)
|
||||
{
|
||||
if (monitor->file == file) {
|
||||
return TRUE;
|
||||
}
|
||||
if (monitor->file != NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
if (file == file->details->directory->details->as_file) {
|
||||
return FALSE;
|
||||
}
|
||||
return nautilus_file_should_show (file,
|
||||
monitor->monitor_hidden_files,
|
||||
monitor->monitor_backup_files);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_needy (NautilusFile *file,
|
||||
FileCheck check_missing,
|
||||
|
@ -2262,11 +2291,7 @@ is_needy (NautilusFile *file,
|
|||
node != NULL; node = node->next) {
|
||||
monitor = node->data;
|
||||
if ((* check_wanted) (&monitor->request)) {
|
||||
if (monitor->file == file) {
|
||||
return TRUE;
|
||||
}
|
||||
if (monitor->file == NULL
|
||||
&& file != directory->details->as_file) {
|
||||
if (monitor_includes_file (monitor, file)) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -2324,7 +2349,7 @@ select_needy_file (NautilusDirectory *directory,
|
|||
for (node_2 = directory->details->monitor_list;
|
||||
node_2 != NULL; node_2 = node_2->next) {
|
||||
monitor = node_2->data;
|
||||
if ((monitor->file == NULL || monitor->file == file)
|
||||
if (monitor_includes_file (monitor, file)
|
||||
&& (* check_wanted) (&monitor->request)) {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -141,6 +141,8 @@ void nautilus_directory_cancel_callback_internal (NautilusD
|
|||
void nautilus_directory_monitor_add_internal (NautilusDirectory *directory,
|
||||
NautilusFile *file,
|
||||
gconstpointer client,
|
||||
gboolean monitor_hidden_files,
|
||||
gboolean monitor_backup_files,
|
||||
GList *attributes);
|
||||
void nautilus_directory_monitor_remove_internal (NautilusDirectory *directory,
|
||||
NautilusFile *file,
|
||||
|
|
|
@ -1393,6 +1393,8 @@ nautilus_directory_cancel_callback (NautilusDirectory *directory,
|
|||
void
|
||||
nautilus_directory_file_monitor_add (NautilusDirectory *directory,
|
||||
gconstpointer client,
|
||||
gboolean monitor_hidden_files,
|
||||
gboolean monitor_backup_files,
|
||||
GList *file_attributes,
|
||||
gboolean force_reload)
|
||||
{
|
||||
|
@ -1402,6 +1404,8 @@ nautilus_directory_file_monitor_add (NautilusDirectory *directory,
|
|||
NAUTILUS_CALL_VIRTUAL
|
||||
(NAUTILUS_DIRECTORY_CLASS, directory,
|
||||
file_monitor_add, (directory, client,
|
||||
monitor_hidden_files,
|
||||
monitor_backup_files,
|
||||
file_attributes,
|
||||
force_reload));
|
||||
}
|
||||
|
@ -1477,6 +1481,7 @@ nautilus_self_check_directory (void)
|
|||
|
||||
nautilus_directory_file_monitor_add
|
||||
(directory, &data_dummy,
|
||||
TRUE, TRUE,
|
||||
NULL, FALSE);
|
||||
|
||||
got_metadata_flag = FALSE;
|
||||
|
|
|
@ -38,9 +38,6 @@
|
|||
set of known files changes.
|
||||
2) An abstract interface for getting attributes and performing
|
||||
operations on files.
|
||||
3) An interface that folds together the cached information that's
|
||||
kept in the metafile with "trustworthy" versions of the same
|
||||
information available from other means.
|
||||
*/
|
||||
|
||||
#define NAUTILUS_TYPE_DIRECTORY \
|
||||
|
@ -121,6 +118,8 @@ typedef struct
|
|||
gpointer callback_data);
|
||||
void (* file_monitor_add) (NautilusDirectory *directory,
|
||||
gconstpointer client,
|
||||
gboolean monitor_hidden_files,
|
||||
gboolean monitor_backup_files,
|
||||
GList *monitor_attributes,
|
||||
gboolean force_reload);
|
||||
void (* file_monitor_remove) (NautilusDirectory *directory,
|
||||
|
@ -179,6 +178,8 @@ void nautilus_directory_cancel_callback (NautilusDirector
|
|||
/* Monitor the files in a directory. */
|
||||
void nautilus_directory_file_monitor_add (NautilusDirectory *directory,
|
||||
gconstpointer client,
|
||||
gboolean monitor_hidden_files,
|
||||
gboolean monitor_backup_files,
|
||||
GList *monitor_attributes,
|
||||
gboolean force_reload);
|
||||
void nautilus_directory_file_monitor_remove (NautilusDirectory *directory,
|
||||
|
|
|
@ -128,3 +128,7 @@ gboolean nautilus_file_should_get_top_left_text (NautilusFile *f
|
|||
*/
|
||||
void nautilus_file_invalidate_attributes_internal (NautilusFile *file,
|
||||
GList *file_attributes);
|
||||
|
||||
/* 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);
|
||||
|
|
|
@ -1787,32 +1787,34 @@ nautilus_file_compare_name (NautilusFile *file,
|
|||
return result;
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_file_name_matches_hidden_pattern (const char *name_or_relative_uri)
|
||||
{
|
||||
g_return_val_if_fail (name_or_relative_uri != NULL, FALSE);
|
||||
|
||||
return name_or_relative_uri[0] == '.';
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_file_name_matches_backup_pattern (const char *name_or_relative_uri)
|
||||
{
|
||||
g_return_val_if_fail (name_or_relative_uri != NULL, FALSE);
|
||||
|
||||
return nautilus_str_has_suffix (name_or_relative_uri, "~");
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_file_is_hidden_file (NautilusFile *file)
|
||||
{
|
||||
char *name;
|
||||
gboolean is_hidden;
|
||||
|
||||
name = nautilus_file_get_name (file);
|
||||
is_hidden = nautilus_str_has_prefix (name, ".");
|
||||
g_free (name);
|
||||
|
||||
return is_hidden;
|
||||
return nautilus_file_name_matches_hidden_pattern
|
||||
(file->details->relative_uri);
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_file_is_backup_file (NautilusFile *file)
|
||||
{
|
||||
char *name;
|
||||
gboolean is_backup;
|
||||
|
||||
name = nautilus_file_get_name (file);
|
||||
is_backup = nautilus_str_has_suffix (name, "~");
|
||||
g_free (name);
|
||||
|
||||
return is_backup;
|
||||
return nautilus_file_name_matches_backup_pattern
|
||||
(file->details->relative_uri);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
@ -2075,8 +2077,7 @@ nautilus_file_monitor_add (NautilusFile *file,
|
|||
|
||||
nautilus_directory_monitor_add_internal
|
||||
(file->details->directory, file,
|
||||
client,
|
||||
attributes);
|
||||
client, TRUE, TRUE, attributes);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -54,6 +54,8 @@ typedef struct {
|
|||
typedef struct {
|
||||
NautilusMergedDirectory *merged;
|
||||
|
||||
gboolean monitor_hidden_files;
|
||||
gboolean monitor_backup_files;
|
||||
GList *monitor_attributes;
|
||||
gboolean force_reload;
|
||||
} MergedMonitor;
|
||||
|
@ -305,6 +307,8 @@ merged_cancel_callback (NautilusDirectory *directory,
|
|||
static void
|
||||
merged_file_monitor_add (NautilusDirectory *directory,
|
||||
gconstpointer client,
|
||||
gboolean monitor_hidden_files,
|
||||
gboolean monitor_backup_files,
|
||||
GList *file_attributes,
|
||||
gboolean force_reload)
|
||||
{
|
||||
|
@ -327,6 +331,8 @@ merged_file_monitor_add (NautilusDirectory *directory,
|
|||
g_hash_table_insert (merged->details->monitors,
|
||||
(gpointer) client, monitor);
|
||||
}
|
||||
monitor->monitor_hidden_files = monitor_hidden_files;
|
||||
monitor->monitor_backup_files = monitor_backup_files;
|
||||
monitor->monitor_attributes = nautilus_g_str_list_copy (file_attributes);
|
||||
monitor->force_reload = force_reload;
|
||||
|
||||
|
@ -334,6 +340,7 @@ merged_file_monitor_add (NautilusDirectory *directory,
|
|||
for (p = merged->details->directories; p != NULL; p = p->next) {
|
||||
nautilus_directory_file_monitor_add
|
||||
(p->data, monitor,
|
||||
monitor_hidden_files, monitor_backup_files,
|
||||
file_attributes, force_reload);
|
||||
}
|
||||
}
|
||||
|
@ -457,6 +464,8 @@ monitor_add_directory (gpointer key,
|
|||
monitor = value;
|
||||
nautilus_directory_file_monitor_add
|
||||
(NAUTILUS_DIRECTORY (callback_data), monitor,
|
||||
monitor->monitor_hidden_files,
|
||||
monitor->monitor_backup_files,
|
||||
monitor->monitor_attributes,
|
||||
monitor->force_reload);
|
||||
}
|
||||
|
|
|
@ -129,7 +129,7 @@ nautilus_trash_monitor_initialize (gpointer object, gpointer klass)
|
|||
|
||||
/* Make sure we get notified about changes */
|
||||
nautilus_directory_file_monitor_add
|
||||
(trash_directory, trash_monitor, attributes, FALSE);
|
||||
(trash_directory, trash_monitor, TRUE, TRUE, attributes, FALSE);
|
||||
|
||||
g_list_free (attributes);
|
||||
|
||||
|
|
|
@ -102,6 +102,8 @@ vfs_cancel_callback (NautilusDirectory *directory,
|
|||
static void
|
||||
vfs_file_monitor_add (NautilusDirectory *directory,
|
||||
gconstpointer client,
|
||||
gboolean monitor_hidden_files,
|
||||
gboolean monitor_backup_files,
|
||||
GList *file_attributes,
|
||||
gboolean force_reload)
|
||||
{
|
||||
|
@ -116,6 +118,8 @@ vfs_file_monitor_add (NautilusDirectory *directory,
|
|||
nautilus_directory_monitor_add_internal
|
||||
(directory, NULL,
|
||||
client,
|
||||
monitor_hidden_files,
|
||||
monitor_backup_files,
|
||||
file_attributes);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,13 +41,13 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* turn this on to see messages about each load_directory call: */
|
||||
#if 0
|
||||
/* comment this back in to see messages about each load_directory call: */
|
||||
#define DEBUG_LOAD_DIRECTORY
|
||||
#endif
|
||||
|
||||
/* turn this on to check if async. job calls are balanced */
|
||||
#if 0
|
||||
/* comment this back in to check if async. job calls are balanced */
|
||||
#define DEBUG_ASYNC_JOBS
|
||||
#endif
|
||||
|
||||
|
@ -96,6 +96,8 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
NautilusFile *file; /* Which file, NULL means all. */
|
||||
gboolean monitor_hidden_files; /* defines whether "all" includes hidden files */
|
||||
gboolean monitor_backup_files; /* defines whether "all" includes backup files */
|
||||
gconstpointer client;
|
||||
Request request;
|
||||
} Monitor;
|
||||
|
@ -111,13 +113,12 @@ static GHashTable *async_jobs;
|
|||
#endif
|
||||
|
||||
/* Forward declarations for functions that need them. */
|
||||
static void deep_count_load (NautilusDirectory *directory,
|
||||
const char *uri);
|
||||
static void metafile_read_restart (NautilusDirectory *directory);
|
||||
static gboolean request_is_satisfied (NautilusDirectory *directory,
|
||||
NautilusFile *file,
|
||||
Request *request);
|
||||
|
||||
static void deep_count_load (NautilusDirectory *directory,
|
||||
const char *uri);
|
||||
static void metafile_read_restart (NautilusDirectory *directory);
|
||||
static gboolean request_is_satisfied (NautilusDirectory *directory,
|
||||
NautilusFile *file,
|
||||
Request *request);
|
||||
static void cancel_loading_attributes (NautilusDirectory *directory,
|
||||
GList *file_attributes);
|
||||
|
||||
|
@ -654,11 +655,14 @@ allow_metafile (NautilusDirectory *directory)
|
|||
* access inside gnome-vfs.
|
||||
*/
|
||||
uri = directory->details->uri;
|
||||
if (nautilus_istr_has_prefix (uri, "info:")
|
||||
if (nautilus_is_search_uri (uri)
|
||||
|| nautilus_istr_has_prefix (uri, "ghelp:")
|
||||
|| nautilus_istr_has_prefix (uri, "gnome-help:")
|
||||
|| nautilus_istr_has_prefix (uri, "help:")
|
||||
|| nautilus_istr_has_prefix (uri, "info:")
|
||||
|| nautilus_istr_has_prefix (uri, "man:")
|
||||
|| nautilus_istr_has_prefix (uri, "pipe:")
|
||||
|| nautilus_is_search_uri (uri)) {
|
||||
) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -950,7 +954,7 @@ find_monitor (NautilusDirectory *directory,
|
|||
GList *result;
|
||||
Monitor *monitor;
|
||||
|
||||
monitor = g_new (Monitor, 1);
|
||||
monitor = g_new0 (Monitor, 1);
|
||||
monitor->client = client;
|
||||
monitor->file = file;
|
||||
|
||||
|
@ -1083,6 +1087,8 @@ void
|
|||
nautilus_directory_monitor_add_internal (NautilusDirectory *directory,
|
||||
NautilusFile *file,
|
||||
gconstpointer client,
|
||||
gboolean monitor_hidden_files,
|
||||
gboolean monitor_backup_files,
|
||||
GList *file_attributes)
|
||||
{
|
||||
Monitor *monitor;
|
||||
|
@ -1096,6 +1102,8 @@ nautilus_directory_monitor_add_internal (NautilusDirectory *directory,
|
|||
/* Add the new monitor. */
|
||||
monitor = g_new (Monitor, 1);
|
||||
monitor->file = file;
|
||||
monitor->monitor_hidden_files = monitor_hidden_files;
|
||||
monitor->monitor_backup_files = monitor_backup_files;
|
||||
monitor->client = client;
|
||||
nautilus_directory_set_up_request (&monitor->request, file_attributes);
|
||||
|
||||
|
@ -2029,18 +2037,21 @@ mark_all_files_unconfirmed (NautilusDirectory *directory)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
should_display_file_name (const char *name, GnomeVFSDirectoryFilterOptions options)
|
||||
should_display_file_name (const char *name,
|
||||
GnomeVFSDirectoryFilterOptions options)
|
||||
{
|
||||
if (options & GNOME_VFS_DIRECTORY_FILTER_NODOTFILES) {
|
||||
if (name[0] == '.') {
|
||||
return FALSE;
|
||||
}
|
||||
/* Note that the name is URI-encoded, but this should not
|
||||
* affect the . or the ~.
|
||||
*/
|
||||
|
||||
if ((options & GNOME_VFS_DIRECTORY_FILTER_NODOTFILES) != 0
|
||||
&& nautilus_file_name_matches_hidden_pattern (name)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (options & GNOME_VFS_DIRECTORY_FILTER_NOBACKUPFILES) {
|
||||
if (name[strlen (name) - 1] == '~') {
|
||||
return FALSE;
|
||||
}
|
||||
if ((options & GNOME_VFS_DIRECTORY_FILTER_NOBACKUPFILES) != 0
|
||||
&& nautilus_file_name_matches_backup_pattern (name)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Note that we don't bother to check for "." or ".." here, because
|
||||
|
@ -2228,6 +2239,24 @@ nautilus_directory_force_reload (NautilusDirectory *directory,
|
|||
nautilus_directory_async_state_changed (directory);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
monitor_includes_file (const Monitor *monitor,
|
||||
NautilusFile *file)
|
||||
{
|
||||
if (monitor->file == file) {
|
||||
return TRUE;
|
||||
}
|
||||
if (monitor->file != NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
if (file == file->details->directory->details->as_file) {
|
||||
return FALSE;
|
||||
}
|
||||
return nautilus_file_should_show (file,
|
||||
monitor->monitor_hidden_files,
|
||||
monitor->monitor_backup_files);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_needy (NautilusFile *file,
|
||||
FileCheck check_missing,
|
||||
|
@ -2262,11 +2291,7 @@ is_needy (NautilusFile *file,
|
|||
node != NULL; node = node->next) {
|
||||
monitor = node->data;
|
||||
if ((* check_wanted) (&monitor->request)) {
|
||||
if (monitor->file == file) {
|
||||
return TRUE;
|
||||
}
|
||||
if (monitor->file == NULL
|
||||
&& file != directory->details->as_file) {
|
||||
if (monitor_includes_file (monitor, file)) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -2324,7 +2349,7 @@ select_needy_file (NautilusDirectory *directory,
|
|||
for (node_2 = directory->details->monitor_list;
|
||||
node_2 != NULL; node_2 = node_2->next) {
|
||||
monitor = node_2->data;
|
||||
if ((monitor->file == NULL || monitor->file == file)
|
||||
if (monitor_includes_file (monitor, file)
|
||||
&& (* check_wanted) (&monitor->request)) {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -141,6 +141,8 @@ void nautilus_directory_cancel_callback_internal (NautilusD
|
|||
void nautilus_directory_monitor_add_internal (NautilusDirectory *directory,
|
||||
NautilusFile *file,
|
||||
gconstpointer client,
|
||||
gboolean monitor_hidden_files,
|
||||
gboolean monitor_backup_files,
|
||||
GList *attributes);
|
||||
void nautilus_directory_monitor_remove_internal (NautilusDirectory *directory,
|
||||
NautilusFile *file,
|
||||
|
|
|
@ -1393,6 +1393,8 @@ nautilus_directory_cancel_callback (NautilusDirectory *directory,
|
|||
void
|
||||
nautilus_directory_file_monitor_add (NautilusDirectory *directory,
|
||||
gconstpointer client,
|
||||
gboolean monitor_hidden_files,
|
||||
gboolean monitor_backup_files,
|
||||
GList *file_attributes,
|
||||
gboolean force_reload)
|
||||
{
|
||||
|
@ -1402,6 +1404,8 @@ nautilus_directory_file_monitor_add (NautilusDirectory *directory,
|
|||
NAUTILUS_CALL_VIRTUAL
|
||||
(NAUTILUS_DIRECTORY_CLASS, directory,
|
||||
file_monitor_add, (directory, client,
|
||||
monitor_hidden_files,
|
||||
monitor_backup_files,
|
||||
file_attributes,
|
||||
force_reload));
|
||||
}
|
||||
|
@ -1477,6 +1481,7 @@ nautilus_self_check_directory (void)
|
|||
|
||||
nautilus_directory_file_monitor_add
|
||||
(directory, &data_dummy,
|
||||
TRUE, TRUE,
|
||||
NULL, FALSE);
|
||||
|
||||
got_metadata_flag = FALSE;
|
||||
|
|
|
@ -38,9 +38,6 @@
|
|||
set of known files changes.
|
||||
2) An abstract interface for getting attributes and performing
|
||||
operations on files.
|
||||
3) An interface that folds together the cached information that's
|
||||
kept in the metafile with "trustworthy" versions of the same
|
||||
information available from other means.
|
||||
*/
|
||||
|
||||
#define NAUTILUS_TYPE_DIRECTORY \
|
||||
|
@ -121,6 +118,8 @@ typedef struct
|
|||
gpointer callback_data);
|
||||
void (* file_monitor_add) (NautilusDirectory *directory,
|
||||
gconstpointer client,
|
||||
gboolean monitor_hidden_files,
|
||||
gboolean monitor_backup_files,
|
||||
GList *monitor_attributes,
|
||||
gboolean force_reload);
|
||||
void (* file_monitor_remove) (NautilusDirectory *directory,
|
||||
|
@ -179,6 +178,8 @@ void nautilus_directory_cancel_callback (NautilusDirector
|
|||
/* Monitor the files in a directory. */
|
||||
void nautilus_directory_file_monitor_add (NautilusDirectory *directory,
|
||||
gconstpointer client,
|
||||
gboolean monitor_hidden_files,
|
||||
gboolean monitor_backup_files,
|
||||
GList *monitor_attributes,
|
||||
gboolean force_reload);
|
||||
void nautilus_directory_file_monitor_remove (NautilusDirectory *directory,
|
||||
|
|
|
@ -128,3 +128,7 @@ gboolean nautilus_file_should_get_top_left_text (NautilusFile *f
|
|||
*/
|
||||
void nautilus_file_invalidate_attributes_internal (NautilusFile *file,
|
||||
GList *file_attributes);
|
||||
|
||||
/* 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);
|
||||
|
|
|
@ -1787,32 +1787,34 @@ nautilus_file_compare_name (NautilusFile *file,
|
|||
return result;
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_file_name_matches_hidden_pattern (const char *name_or_relative_uri)
|
||||
{
|
||||
g_return_val_if_fail (name_or_relative_uri != NULL, FALSE);
|
||||
|
||||
return name_or_relative_uri[0] == '.';
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_file_name_matches_backup_pattern (const char *name_or_relative_uri)
|
||||
{
|
||||
g_return_val_if_fail (name_or_relative_uri != NULL, FALSE);
|
||||
|
||||
return nautilus_str_has_suffix (name_or_relative_uri, "~");
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_file_is_hidden_file (NautilusFile *file)
|
||||
{
|
||||
char *name;
|
||||
gboolean is_hidden;
|
||||
|
||||
name = nautilus_file_get_name (file);
|
||||
is_hidden = nautilus_str_has_prefix (name, ".");
|
||||
g_free (name);
|
||||
|
||||
return is_hidden;
|
||||
return nautilus_file_name_matches_hidden_pattern
|
||||
(file->details->relative_uri);
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_file_is_backup_file (NautilusFile *file)
|
||||
{
|
||||
char *name;
|
||||
gboolean is_backup;
|
||||
|
||||
name = nautilus_file_get_name (file);
|
||||
is_backup = nautilus_str_has_suffix (name, "~");
|
||||
g_free (name);
|
||||
|
||||
return is_backup;
|
||||
return nautilus_file_name_matches_backup_pattern
|
||||
(file->details->relative_uri);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
@ -2075,8 +2077,7 @@ nautilus_file_monitor_add (NautilusFile *file,
|
|||
|
||||
nautilus_directory_monitor_add_internal
|
||||
(file->details->directory, file,
|
||||
client,
|
||||
attributes);
|
||||
client, TRUE, TRUE, attributes);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -54,6 +54,8 @@ typedef struct {
|
|||
typedef struct {
|
||||
NautilusMergedDirectory *merged;
|
||||
|
||||
gboolean monitor_hidden_files;
|
||||
gboolean monitor_backup_files;
|
||||
GList *monitor_attributes;
|
||||
gboolean force_reload;
|
||||
} MergedMonitor;
|
||||
|
@ -305,6 +307,8 @@ merged_cancel_callback (NautilusDirectory *directory,
|
|||
static void
|
||||
merged_file_monitor_add (NautilusDirectory *directory,
|
||||
gconstpointer client,
|
||||
gboolean monitor_hidden_files,
|
||||
gboolean monitor_backup_files,
|
||||
GList *file_attributes,
|
||||
gboolean force_reload)
|
||||
{
|
||||
|
@ -327,6 +331,8 @@ merged_file_monitor_add (NautilusDirectory *directory,
|
|||
g_hash_table_insert (merged->details->monitors,
|
||||
(gpointer) client, monitor);
|
||||
}
|
||||
monitor->monitor_hidden_files = monitor_hidden_files;
|
||||
monitor->monitor_backup_files = monitor_backup_files;
|
||||
monitor->monitor_attributes = nautilus_g_str_list_copy (file_attributes);
|
||||
monitor->force_reload = force_reload;
|
||||
|
||||
|
@ -334,6 +340,7 @@ merged_file_monitor_add (NautilusDirectory *directory,
|
|||
for (p = merged->details->directories; p != NULL; p = p->next) {
|
||||
nautilus_directory_file_monitor_add
|
||||
(p->data, monitor,
|
||||
monitor_hidden_files, monitor_backup_files,
|
||||
file_attributes, force_reload);
|
||||
}
|
||||
}
|
||||
|
@ -457,6 +464,8 @@ monitor_add_directory (gpointer key,
|
|||
monitor = value;
|
||||
nautilus_directory_file_monitor_add
|
||||
(NAUTILUS_DIRECTORY (callback_data), monitor,
|
||||
monitor->monitor_hidden_files,
|
||||
monitor->monitor_backup_files,
|
||||
monitor->monitor_attributes,
|
||||
monitor->force_reload);
|
||||
}
|
||||
|
|
|
@ -129,7 +129,7 @@ nautilus_trash_monitor_initialize (gpointer object, gpointer klass)
|
|||
|
||||
/* Make sure we get notified about changes */
|
||||
nautilus_directory_file_monitor_add
|
||||
(trash_directory, trash_monitor, attributes, FALSE);
|
||||
(trash_directory, trash_monitor, TRUE, TRUE, attributes, FALSE);
|
||||
|
||||
g_list_free (attributes);
|
||||
|
||||
|
|
|
@ -102,6 +102,8 @@ vfs_cancel_callback (NautilusDirectory *directory,
|
|||
static void
|
||||
vfs_file_monitor_add (NautilusDirectory *directory,
|
||||
gconstpointer client,
|
||||
gboolean monitor_hidden_files,
|
||||
gboolean monitor_backup_files,
|
||||
GList *file_attributes,
|
||||
gboolean force_reload)
|
||||
{
|
||||
|
@ -116,6 +118,8 @@ vfs_file_monitor_add (NautilusDirectory *directory,
|
|||
nautilus_directory_monitor_add_internal
|
||||
(directory, NULL,
|
||||
client,
|
||||
monitor_hidden_files,
|
||||
monitor_backup_files,
|
||||
file_attributes);
|
||||
}
|
||||
|
||||
|
|
|
@ -957,119 +957,120 @@ static float fm_directory_view_preferred_zoom_levels[] = {
|
|||
};
|
||||
|
||||
static void
|
||||
fm_directory_view_initialize (FMDirectoryView *directory_view)
|
||||
fm_directory_view_initialize (FMDirectoryView *view)
|
||||
{
|
||||
directory_view->details = g_new0 (FMDirectoryViewDetails, 1);
|
||||
view->details = g_new0 (FMDirectoryViewDetails, 1);
|
||||
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (directory_view),
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (view),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (directory_view), NULL);
|
||||
gtk_scrolled_window_set_vadjustment (GTK_SCROLLED_WINDOW (directory_view), NULL);
|
||||
gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (view), NULL);
|
||||
gtk_scrolled_window_set_vadjustment (GTK_SCROLLED_WINDOW (view), NULL);
|
||||
|
||||
directory_view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (directory_view));
|
||||
view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (view));
|
||||
|
||||
directory_view->details->zoomable = bonobo_zoomable_new ();
|
||||
bonobo_zoomable_set_parameters_full (directory_view->details->zoomable,
|
||||
view->details->zoomable = bonobo_zoomable_new ();
|
||||
bonobo_zoomable_set_parameters_full (view->details->zoomable,
|
||||
0.0, .25, 4.0, TRUE, TRUE, FALSE,
|
||||
fm_directory_view_preferred_zoom_levels, NULL,
|
||||
NAUTILUS_N_ELEMENTS (fm_directory_view_preferred_zoom_levels));
|
||||
bonobo_object_add_interface (BONOBO_OBJECT (directory_view->details->nautilus_view),
|
||||
BONOBO_OBJECT (directory_view->details->zoomable));
|
||||
bonobo_object_add_interface (BONOBO_OBJECT (view->details->nautilus_view),
|
||||
BONOBO_OBJECT (view->details->zoomable));
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (directory_view->details->nautilus_view),
|
||||
gtk_signal_connect (GTK_OBJECT (view->details->nautilus_view),
|
||||
"stop_loading",
|
||||
GTK_SIGNAL_FUNC (stop_loading_callback),
|
||||
directory_view);
|
||||
gtk_signal_connect (GTK_OBJECT (directory_view->details->nautilus_view),
|
||||
view);
|
||||
gtk_signal_connect (GTK_OBJECT (view->details->nautilus_view),
|
||||
"load_location",
|
||||
GTK_SIGNAL_FUNC (load_location_callback),
|
||||
directory_view);
|
||||
gtk_signal_connect (GTK_OBJECT (directory_view->details->nautilus_view),
|
||||
view);
|
||||
gtk_signal_connect (GTK_OBJECT (view->details->nautilus_view),
|
||||
"selection_changed",
|
||||
GTK_SIGNAL_FUNC (selection_changed_callback),
|
||||
directory_view);
|
||||
view);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (get_bonobo_control (directory_view)),
|
||||
gtk_signal_connect (GTK_OBJECT (get_bonobo_control (view)),
|
||||
"activate",
|
||||
bonobo_control_activate_callback,
|
||||
directory_view);
|
||||
view);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (directory_view->details->zoomable),
|
||||
gtk_signal_connect (GTK_OBJECT (view->details->zoomable),
|
||||
"zoom_in",
|
||||
zoomable_zoom_in_callback,
|
||||
directory_view);
|
||||
gtk_signal_connect (GTK_OBJECT (directory_view->details->zoomable),
|
||||
view);
|
||||
gtk_signal_connect (GTK_OBJECT (view->details->zoomable),
|
||||
"zoom_out",
|
||||
zoomable_zoom_out_callback,
|
||||
directory_view);
|
||||
gtk_signal_connect (GTK_OBJECT (directory_view->details->zoomable),
|
||||
view);
|
||||
gtk_signal_connect (GTK_OBJECT (view->details->zoomable),
|
||||
"set_zoom_level",
|
||||
GTK_SIGNAL_FUNC (zoomable_set_zoom_level_callback),
|
||||
directory_view);
|
||||
gtk_signal_connect (GTK_OBJECT (directory_view->details->zoomable),
|
||||
view);
|
||||
gtk_signal_connect (GTK_OBJECT (view->details->zoomable),
|
||||
"zoom_to_fit",
|
||||
zoomable_zoom_to_fit_callback,
|
||||
directory_view);
|
||||
view);
|
||||
gtk_signal_connect_while_alive (GTK_OBJECT (nautilus_trash_monitor_get ()),
|
||||
"trash_state_changed",
|
||||
fm_directory_view_trash_state_changed_callback,
|
||||
directory_view,
|
||||
GTK_OBJECT (directory_view));
|
||||
view,
|
||||
GTK_OBJECT (view));
|
||||
|
||||
gtk_widget_show (GTK_WIDGET (directory_view));
|
||||
gtk_widget_show (GTK_WIDGET (view));
|
||||
|
||||
/* Obtain the filtering preferences */
|
||||
directory_view->details->show_hidden_files =
|
||||
nautilus_preferences_get_boolean (NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES, FALSE);
|
||||
/* Desktop always filters out hidden files */
|
||||
/* FIXME bugzilla.eazel.com 5060: Should use methods instead
|
||||
* of hardcoding desktop knowledge in here.
|
||||
*/
|
||||
if (!FM_IS_DESKTOP_ICON_VIEW (view)) {
|
||||
filtering_changed_callback (view);
|
||||
|
||||
directory_view->details->show_backup_files =
|
||||
nautilus_preferences_get_boolean (NAUTILUS_PREFERENCES_SHOW_BACKUP_FILES, FALSE);
|
||||
|
||||
/* Keep track of changes in this pref to filter files accordingly. */
|
||||
nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES,
|
||||
filtering_changed_callback,
|
||||
directory_view);
|
||||
|
||||
/* Keep track of changes in this pref to filter files accordingly. */
|
||||
nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_SHOW_BACKUP_FILES,
|
||||
filtering_changed_callback,
|
||||
directory_view);
|
||||
/* Keep track of changes in this pref to filter files accordingly. */
|
||||
nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES,
|
||||
filtering_changed_callback,
|
||||
view);
|
||||
|
||||
/* Keep track of changes in this pref to filter files accordingly. */
|
||||
nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_SHOW_BACKUP_FILES,
|
||||
filtering_changed_callback,
|
||||
view);
|
||||
}
|
||||
|
||||
/* Keep track of changes in this pref to display menu names correctly. */
|
||||
nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_CONFIRM_TRASH,
|
||||
schedule_update_menus_callback,
|
||||
directory_view);
|
||||
view);
|
||||
|
||||
/* Keep track of changes in text attribute names */
|
||||
nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_ICON_CAPTIONS,
|
||||
text_attribute_names_changed_callback,
|
||||
directory_view);
|
||||
view);
|
||||
|
||||
/* Keep track of changes in embedded text policy */
|
||||
nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_SHOW_TEXT_IN_ICONS,
|
||||
embedded_text_policy_changed_callback,
|
||||
directory_view);
|
||||
view);
|
||||
|
||||
/* Keep track of changes in image display policy */
|
||||
nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS,
|
||||
image_display_policy_changed_callback,
|
||||
directory_view);
|
||||
view);
|
||||
|
||||
/* Keep track of changes in the font family */
|
||||
nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_DIRECTORY_VIEW_FONT_FAMILY,
|
||||
directory_view_font_family_changed_callback,
|
||||
directory_view);
|
||||
view);
|
||||
|
||||
/* Keep track of changes in clicking policy */
|
||||
nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_CLICK_POLICY,
|
||||
click_policy_changed_callback,
|
||||
directory_view);
|
||||
view);
|
||||
|
||||
/* Keep track of changes in graphics trade offs */
|
||||
nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_SMOOTH_GRAPHICS_MODE,
|
||||
smooth_graphics_mode_changed_callback,
|
||||
directory_view);
|
||||
view);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1110,12 +1111,18 @@ fm_directory_view_destroy (GtkObject *object)
|
|||
gtk_idle_remove (view->details->update_menus_idle_id);
|
||||
}
|
||||
|
||||
nautilus_preferences_remove_callback (NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES,
|
||||
filtering_changed_callback,
|
||||
view);
|
||||
nautilus_preferences_remove_callback (NAUTILUS_PREFERENCES_SHOW_BACKUP_FILES,
|
||||
filtering_changed_callback,
|
||||
view);
|
||||
/* FIXME bugzilla.eazel.com 5060: Should use methods instead
|
||||
* of hardcoding desktop knowledge in here.
|
||||
*/
|
||||
if (!FM_IS_DESKTOP_ICON_VIEW (view)) {
|
||||
nautilus_preferences_remove_callback (NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES,
|
||||
filtering_changed_callback,
|
||||
view);
|
||||
nautilus_preferences_remove_callback (NAUTILUS_PREFERENCES_SHOW_BACKUP_FILES,
|
||||
filtering_changed_callback,
|
||||
view);
|
||||
}
|
||||
|
||||
nautilus_preferences_remove_callback (NAUTILUS_PREFERENCES_CONFIRM_TRASH,
|
||||
schedule_update_menus_callback,
|
||||
view);
|
||||
|
@ -1938,15 +1945,6 @@ queue_pending_files (FMDirectoryView *view,
|
|||
{
|
||||
GList *filtered_files;
|
||||
|
||||
/* Desktop always filters out hidden files */
|
||||
/* FIXME bugzilla.eazel.com 5060: Should use methods instead
|
||||
* of hardcoding desktop knowledge in here.
|
||||
*/
|
||||
if (FM_IS_DESKTOP_ICON_VIEW (view)) {
|
||||
view->details->show_hidden_files = FALSE;
|
||||
view->details->show_backup_files = FALSE;
|
||||
}
|
||||
|
||||
/* Filter out hidden files if needed */
|
||||
filtered_files = nautilus_file_list_filter_hidden_and_backup
|
||||
(files,
|
||||
|
@ -3694,7 +3692,7 @@ load_directory (FMDirectoryView *view,
|
|||
}
|
||||
|
||||
static void
|
||||
finish_loading_uri (FMDirectoryView *view)
|
||||
finish_loading (FMDirectoryView *view)
|
||||
{
|
||||
GList *attributes;
|
||||
|
||||
|
@ -3746,6 +3744,8 @@ finish_loading_uri (FMDirectoryView *view)
|
|||
|
||||
nautilus_directory_file_monitor_add (view->details->model,
|
||||
view,
|
||||
view->details->show_hidden_files,
|
||||
view->details->show_backup_files,
|
||||
attributes,
|
||||
view->details->force_reload);
|
||||
view->details->force_reload = FALSE;
|
||||
|
@ -3764,7 +3764,7 @@ metadata_ready_callback (NautilusFile *file,
|
|||
g_assert (FM_IS_DIRECTORY_VIEW (view));
|
||||
g_assert (view->details->directory_as_file == file);
|
||||
|
||||
finish_loading_uri (view);
|
||||
finish_loading (view);
|
||||
}
|
||||
|
||||
NautilusStringList *
|
||||
|
@ -4089,16 +4089,6 @@ filtering_changed_callback (gpointer callback_data)
|
|||
|
||||
directory_view = FM_DIRECTORY_VIEW (callback_data);
|
||||
|
||||
/* Hidden files are never shown on the desktop */
|
||||
/* FIXME bugzilla.eazel.com 5060: Should use methods instead
|
||||
* of hardcoding desktop knowledge in here.
|
||||
*/
|
||||
if (FM_IS_DESKTOP_ICON_VIEW (directory_view)) {
|
||||
directory_view->details->show_hidden_files = FALSE;
|
||||
directory_view->details->show_backup_files = FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
directory_view->details->show_hidden_files =
|
||||
nautilus_preferences_get_boolean (NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES, FALSE);
|
||||
|
||||
|
|
|
@ -201,7 +201,7 @@ got_minimum_file_info_callback (NautilusFile *file,
|
|||
* components.
|
||||
*/
|
||||
nautilus_directory_file_monitor_add (info->directory, info,
|
||||
NULL, FALSE);
|
||||
TRUE, TRUE, NULL, FALSE);
|
||||
|
||||
if (nautilus_mime_actions_file_needs_full_file_attributes (file)) {
|
||||
if (got_file_info_callback_common (file, data, FALSE)) {
|
||||
|
|
Loading…
Reference in a new issue