summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2003-04-02 11:51:14 +0000
committerAlexander Larsson <alexl@src.gnome.org>2003-04-02 11:51:14 +0000
commit4e04c0a008356c211468a44a3a15a43fd9fe4dbd (patch)
tree07423c2626eace628bdca197ca0964fa27511ef2 /components
parent234e6a286bcf82adbb9462fb5870246f19c240b5 (diff)
downloadnautilus-4e04c0a008356c211468a44a3a15a43fd9fe4dbd.tar.gz
Convert file attributes from list of strings to a bitmask. Patch from
2003-04-02 Alexander Larsson <alexl@redhat.com> * components/notes/nautilus-notes.c: * components/tree/nautilus-tree-model.c: * components/tree/nautilus-tree-view.c: * libnautilus-private/nautilus-directory-async.c: * libnautilus-private/nautilus-directory-background.c: * libnautilus-private/nautilus-directory-private.h: * libnautilus-private/nautilus-directory.c: * libnautilus-private/nautilus-directory.h: * libnautilus-private/nautilus-file-attributes.h: * libnautilus-private/nautilus-file-private.h: * libnautilus-private/nautilus-file.c: (rename_callback), * libnautilus-private/nautilus-file.h: * libnautilus-private/nautilus-icon-factory.c: * libnautilus-private/nautilus-icon-factory.h: * libnautilus-private/nautilus-link.c: * libnautilus-private/nautilus-merged-directory.c: * libnautilus-private/nautilus-mime-actions.c: * libnautilus-private/nautilus-mime-actions.h: * libnautilus-private/nautilus-program-choosing.c: * libnautilus-private/nautilus-trash-file.c: * libnautilus-private/nautilus-trash-monitor.c: * libnautilus-private/nautilus-vfs-directory.c: * libnautilus-private/nautilus-vfs-file.c: * src/file-manager/fm-directory-view.c: * src/file-manager/fm-icon-container.c: * src/file-manager/fm-properties-window.c: * src/nautilus-applicable-views.c: * src/nautilus-information-panel.c: * src/nautilus-sidebar-title.c: * src/nautilus-window-manage-views.c: * src/nautilus-window.c: * test/test-nautilus-mime-actions-set.c: * test/test-nautilus-mime-actions.c: Convert file attributes from list of strings to a bitmask. Patch from andersca@codefactory.se.
Diffstat (limited to 'components')
-rw-r--r--components/notes/nautilus-notes.c8
-rw-r--r--components/tree/nautilus-tree-model.c27
-rw-r--r--components/tree/nautilus-tree-view.c7
3 files changed, 19 insertions, 23 deletions
diff --git a/components/notes/nautilus-notes.c b/components/notes/nautilus-notes.c
index 05e0501f9..30a619301 100644
--- a/components/notes/nautilus-notes.c
+++ b/components/notes/nautilus-notes.c
@@ -210,8 +210,8 @@ done_with_file (Notes *notes)
static void
notes_load_metainfo (Notes *notes)
{
- GList *attributes;
-
+ NautilusFileAttributes attributes;
+
done_with_file (notes);
notes->file = nautilus_file_get (notes->uri);
@@ -221,15 +221,13 @@ notes_load_metainfo (Notes *notes)
return;
}
- attributes = g_list_prepend (NULL, NAUTILUS_FILE_ATTRIBUTE_METADATA);
+ attributes = NAUTILUS_FILE_ATTRIBUTE_METADATA;
nautilus_file_monitor_add (notes->file, notes, attributes);
if (nautilus_file_check_if_ready (notes->file, attributes)) {
load_note_text_from_metadata (notes->file, notes);
}
- g_list_free (attributes);
-
g_signal_connect (notes->file, "changed",
G_CALLBACK (load_note_text_from_metadata), notes);
}
diff --git a/components/tree/nautilus-tree-model.c b/components/tree/nautilus-tree-model.c
index 4baa12165..8703e5282 100644
--- a/components/tree/nautilus-tree-model.c
+++ b/components/tree/nautilus-tree-model.c
@@ -876,22 +876,23 @@ done_loading_callback (NautilusDirectory *directory,
nautilus_file_unref (file);
}
-static GList *
+static NautilusFileAttributes
get_tree_monitor_attributes (void)
{
- GList *attrs;
+ NautilusFileAttributes attributes;
- attrs = nautilus_icon_factory_get_required_file_attributes ();
- attrs = g_list_prepend (attrs, NAUTILUS_FILE_ATTRIBUTE_IS_DIRECTORY);
- attrs = g_list_prepend (attrs, NAUTILUS_FILE_ATTRIBUTE_DISPLAY_NAME);
- return attrs;
+ attributes = nautilus_icon_factory_get_required_file_attributes ();
+ attributes |= NAUTILUS_FILE_ATTRIBUTE_IS_DIRECTORY |
+ NAUTILUS_FILE_ATTRIBUTE_DISPLAY_NAME;
+
+ return attributes;
}
static void
start_monitoring_directory (NautilusTreeModel *model, TreeNode *node)
{
NautilusDirectory *directory;
- GList *attrs;
+ NautilusFileAttributes attributes;
if (node->done_loading_id != 0) {
return;
@@ -914,12 +915,11 @@ start_monitoring_directory (NautilusTreeModel *model, TreeNode *node)
set_done_loading (model, node, nautilus_directory_are_all_files_seen (directory));
- attrs = get_tree_monitor_attributes ();
+ attributes = get_tree_monitor_attributes ();
nautilus_directory_file_monitor_add (directory, model,
model->details->show_hidden_files,
model->details->show_backup_files,
- attrs, files_changed_callback, model);
- g_list_free (attrs);
+ attributes, files_changed_callback, model);
}
static int
@@ -1380,7 +1380,7 @@ nautilus_tree_model_set_root_uri (NautilusTreeModel *model, const char *root_uri
{
NautilusFile *file;
TreeNode *node;
- GList *attrs;
+ NautilusFileAttributes attributes;
g_return_if_fail (model->details->root_node == NULL);
@@ -1392,9 +1392,8 @@ nautilus_tree_model_set_root_uri (NautilusTreeModel *model, const char *root_uri
g_signal_connect_object (file, "changed",
G_CALLBACK (root_node_file_changed_callback), model, 0);
- attrs = get_tree_monitor_attributes ();
- nautilus_file_monitor_add (file, model, attrs);
- g_list_free (attrs);
+ attributes = get_tree_monitor_attributes ();
+ nautilus_file_monitor_add (file, model, attributes);
nautilus_file_unref (file);
diff --git a/components/tree/nautilus-tree-view.c b/components/tree/nautilus-tree-view.c
index 0aacde770..467a6c77a 100644
--- a/components/tree/nautilus-tree-view.c
+++ b/components/tree/nautilus-tree-view.c
@@ -302,7 +302,7 @@ static void
selection_changed_callback (GtkTreeSelection *selection,
NautilusTreeView *view)
{
- GList *attrs;
+ NautilusFileAttributes attributes;
GtkTreeIter iter;
cancel_activation (view);
@@ -316,10 +316,9 @@ selection_changed_callback (GtkTreeSelection *selection,
return;
}
- attrs = g_list_prepend (NULL, NAUTILUS_FILE_ATTRIBUTE_ACTIVATION_URI);
- nautilus_file_call_when_ready (view->details->activation_file, attrs,
+ attributes = NAUTILUS_FILE_ATTRIBUTE_ACTIVATION_URI;
+ nautilus_file_call_when_ready (view->details->activation_file, attributes,
got_activation_uri_callback, view);
- g_list_free (attrs);
}
static int