Commit 08068379 authored by Darin Adler's avatar Darin Adler

Finished changing all callers that use metadata to use it in a way

	that is compatible with async. metadata reading.

	* components/notes/ntl-notes.c:
	(notes_load_metainfo): Changed to use nautilus_file_call_when_ready
	to wait for the metadata. Also fixed a bug that was causing an assert
	inside the call to gtk_editable_insert_text.
	(main): Made warnings and criticals stop in the debugger.

	* libnautilus/nautilus-directory.c:
	* libnautilus/nautilus-directory.h:
	(nautilus_directory_call_when_ready): Renamed the call to indicate
	it can wait for more than just metadata. For now it does only wait
	for metadata, though.
	(nautilus_directory_cancel_callback): Renamed this too.

	* libnautilus/nautilus-file.c:
	(nautilus_file_call_when_ready), (nautilus_file_cancel_callback):
	Made a corresponding call for the metadata of a single file.

	* libnautilus/nautilus-gdk-extensions.c:
	* src/nautilus-index-title.c:
	Formatting changes.

	* libnautilus/nautilus-metadata.h:
	Clarified that ANNOTATION is a per-file piece of metadata.

	* src/ntl-uri-map.c:
	* src/file-manager/fm-directory-view.c:
	Use new names of calls.

	* src/file-manager/fm-icon-view.c:
	* src/file-manager/fm-list-view.c:
	Added comment.
parent 82c9663d
2000-04-10 Andy Hertzfeld <andy@eazel.com>
2000-04-10 Darin Adler <darin@eazel.com>
Finished changing all callers that use metadata to use it in a way
that is compatible with async. metadata reading.
* components/notes/ntl-notes.c:
(notes_load_metainfo): Changed to use nautilus_file_call_when_ready
to wait for the metadata. Also fixed a bug that was causing an assert
inside the call to gtk_editable_insert_text.
(main): Made warnings and criticals stop in the debugger.
* libnautilus/nautilus-directory.c:
* libnautilus/nautilus-directory.h:
(nautilus_directory_call_when_ready): Renamed the call to indicate
it can wait for more than just metadata. For now it does only wait
for metadata, though.
(nautilus_directory_cancel_callback): Renamed this too.
* libnautilus/nautilus-file.c:
(nautilus_file_call_when_ready), (nautilus_file_cancel_callback):
Made a corresponding call for the metadata of a single file.
* libnautilus/nautilus-gdk-extensions.c:
* src/nautilus-index-title.c:
Formatting changes.
* libnautilus/nautilus-metadata.h:
Clarified that ANNOTATION is a per-file piece of metadata.
* src/ntl-uri-map.c:
* src/file-manager/fm-directory-view.c:
Use new names of calls.
* src/file-manager/fm-icon-view.c:
* src/file-manager/fm-list-view.c:
Added comment.
2000-04-10 Andy Hertzfeld <andy@eazel.com>
* src/nautilus-index-title.c:
fixed bug where multi-line titles in index panel would have a big
vertical gap. Fixed by breaking out of the loop after it finds a
split point. Also, removed an unneccesary justification call.
2000-04-10 Andy Hertzfeld <andy@eazel.com>
2000-04-10 Andy Hertzfeld <andy@eazel.com>
* components/services/startup/eazel-register.c:
added io ports to hardware configuration synopsis
2000-04-10 John Sullivan <sullivan@eazel.com>
2000-04-10 John Sullivan <sullivan@eazel.com>
Fixed bug 377 (clipping emblems in list view looks bad
and loses information)
......@@ -19,7 +56,7 @@
(draw_row): Made it draw the ellipsis character if there's
not enough room to show all emblems.
2000-04-10 John Sullivan <sullivan@eazel.com>
2000-04-10 John Sullivan <sullivan@eazel.com>
* libnautilus/nautilus-list.c:
(nautilus_list_initialize_class), (nautilus_list_initialize),
......@@ -35,17 +72,18 @@
such operations as Select All, switch-from-icon-view-with-lots-
selected, and arrow-key-to-end-of-list significantly faster.
2000-04-09 Andy Hertzfeld <andy@eazel.com>
2000-04-09 Andy Hertzfeld <andy@eazel.com>
* components/services/startup/nautilus-service-startup-view.c:
now it saves the account toke assigned by the service, and passes it back in the
header of subsequent requests
now it saves the account token assigned by the service, and passes
it back in the header of subsequent requests
* libnautilus/nautilus-icon-factory.c:
fixed bug #293, thumbnails of thumbnails endlessly, by explicitly testing for thumbnails
of thumbnails as part of the criteria for making them
also, make a "snapshot" frame for thumbnails (task 295)
fixed bug #293, thumbnails of thumbnails endlessly, by explicitly
testing for thumbnails of thumbnails as part of the criteria for
making them also, make a "snapshot" frame for thumbnails (task
295)
2000-04-09 John Sullivan <sullivan@eazel.com>
2000-04-09 John Sullivan <sullivan@eazel.com>
Finished task 307 (keyboard navigation in list view should
use same keys/behavior as in icon view). There are a few
......@@ -78,13 +116,13 @@
functions that were used by the GtkCList key bindings in favor of
nautilus_list_key_press and friends.
2000-04-07 Andy Hertzfeld <andy@eazel.com>
2000-04-07 Andy Hertzfeld <andy@eazel.com>
* libnautilus/nautilus-icon-canvas-item.c:
inspired by John's list view underlining, the text beneath icons
is now underlined when the icon is pre-lit
2000-04-07 John Sullivan <sullivan@eazel.com>
2000-04-07 John Sullivan <sullivan@eazel.com>
Fixed bug Andy pointed out where list view "links" could
be activated by clicking in white space past the name.
......@@ -128,26 +166,28 @@
(draw_row) Use get_cell_horizontal_start_position that was extracted
from this function.
2000-04-07 Andy Hertzfeld <andy@eazel.com>
2000-04-07 Andy Hertzfeld <andy@eazel.com>
* components/services/startup/nautilus-service-startup-view.c:
switched over to using Jonathan's prototype service, which is only
accessible from eazel's intranet for now. Registration now works with
the service.
* libnautilus/nautilus-icon-canvas-item.c:
first, simple version of drag/swallow highliting - it just darkens the
icon and emboldens the text, exactly like selection highlighting.
Pavel's going to set the flag during dragging soon, so this will help
him see what he's doing. Soon, we'll have a more elaborate approach.
2000-04-06 Andy Hertzfeld <andy@eazel.com>
2000-04-06 Andy Hertzfeld <andy@eazel.com>
* components/services/startup/nautilus-service-startup-view.c:
made configuration upload make the HTTP request and handle errors, but still not
quite finished, since it's not passing the cookie back yet. Also, created a stub
summary page plus minor clean-ups
2000-04-06 Pavel Cisler <pavel@eazel.com>
2000-04-06 Pavel Cisler <pavel@eazel.com>
* src/file-manager/dfos-xfer-progress-dialog.c:
* src/file-manager/dfos-xfer-progress-dialog.h:
(dfos_xfer_progress_dialog_new_file):
......@@ -176,7 +216,7 @@
(fs_xfer):
New copy engine main entry.
2000-04-06 Andy Hertzfeld <andy@eazel.com>
2000-04-06 Andy Hertzfeld <andy@eazel.com>
* components/services/startup/nautilus-service-startup-view.c:
more work to polish registration and implement configuration upload,
......
......@@ -36,77 +36,103 @@
#include <ctype.h>
#include <libnautilus/nautilus-background.h>
#include <libnautilus/nautilus-file.h>
#include <libnautilus/nautilus-debug.h>
#define NOTES_DEFAULT_BACKGROUND_COLOR "rgb:FFFF/FFFF/BBBB"
typedef struct {
NautilusViewFrame *view;
GtkWidget *note_text_field;
char* uri;
} NotesView;
char *uri;
NautilusFile *file;
} Notes;
static int notes_object_count = 0;
static void
notes_load_metainfo (NotesView *hview)
finish_loading_note (NautilusFile *file,
gpointer callback_data)
{
NautilusFile *file;
Notes *notes;
int position;
char *notes_text;
gtk_editable_delete_text (GTK_EDITABLE (hview->note_text_field), 0, -1);
file = nautilus_file_get (hview->uri);
if (file == NULL) {
return;
}
g_assert (NAUTILUS_IS_FILE (file));
notes = callback_data;
g_assert (notes->file == file);
notes_text = nautilus_file_get_metadata (file, NAUTILUS_METADATA_KEY_ANNOTATION, "");
gtk_editable_insert_text (GTK_EDITABLE (hview->note_text_field),
position = 0;
gtk_editable_insert_text (GTK_EDITABLE (notes->note_text_field),
notes_text,
strlen (notes_text),
&position);
g_free (notes_text);
nautilus_file_unref (file);
}
/* save the metainfo corresponding to the current uri, if any, into the text field */
static void
done_with_file (Notes *notes)
{
nautilus_file_cancel_callback (notes->file, finish_loading_note, notes);
nautilus_file_unref (notes->file);
}
static void
notes_save_metainfo(NotesView *hview)
notes_load_metainfo (Notes *notes)
{
NautilusFile *file;
char *notes_text;
GList *keys;
gtk_editable_delete_text (GTK_EDITABLE (notes->note_text_field), 0, -1);
file = nautilus_file_get (hview->uri);
done_with_file (notes);
notes->file = nautilus_file_get (notes->uri);
if (file == NULL) {
return;
}
notes_text = gtk_editable_get_chars (GTK_EDITABLE (hview->note_text_field), 0 , -1);
nautilus_file_set_metadata (file, NAUTILUS_METADATA_KEY_ANNOTATION, NULL, notes_text);
keys = g_list_prepend (NULL, NAUTILUS_METADATA_KEY_ANNOTATION);
nautilus_file_call_when_ready (file, keys, finish_loading_note, notes);
g_list_free (keys);
}
/* save the metainfo corresponding to the current uri, if any, into the text field */
static void
notes_save_metainfo (Notes *notes)
{
char *notes_text;
if (notes->file == NULL) {
return;
}
notes_text = gtk_editable_get_chars (GTK_EDITABLE (notes->note_text_field), 0 , -1);
nautilus_file_set_metadata (notes->file, NAUTILUS_METADATA_KEY_ANNOTATION, NULL, notes_text);
g_free (notes_text);
nautilus_file_unref (file);
}
static void
notes_notify_location_change (NautilusViewFrame *view,
Nautilus_NavigationInfo *loci,
NotesView *hview)
{
if (strcmp (hview->uri, loci->requested_uri) != 0) {
notes_save_metainfo (hview);
g_free (hview->uri);
hview->uri = g_strdup (loci->requested_uri);
notes_load_metainfo (hview);
Notes *notes)
{
if (strcmp (notes->uri, loci->requested_uri) != 0) {
notes_save_metainfo (notes);
g_free (notes->uri);
notes->uri = g_strdup (loci->requested_uri);
notes_load_metainfo (notes);
}
}
static void
do_destroy (GtkObject *obj, NotesView *hview)
do_destroy (GtkObject *obj, Notes *notes)
{
done_with_file (notes);
g_free (notes->uri);
g_free (notes);
notes_object_count--;
if (notes_object_count <= 0) {
gtk_main_quit();
......@@ -117,13 +143,13 @@ static BonoboObject *
make_notes_view (BonoboGenericFactory *Factory, const char *goad_id, gpointer closure)
{
GtkWidget *vbox;
NotesView *hview;
Notes *notes;
NautilusBackground *background;
g_return_val_if_fail (strcmp (goad_id, "ntl_notes_view") == 0, NULL);
hview = g_new0 (NotesView, 1);
hview->uri = g_strdup ("");
notes = g_new0 (Notes, 1);
notes->uri = g_strdup ("");
/* allocate a vbox to hold all of the UI elements */
......@@ -131,28 +157,28 @@ make_notes_view (BonoboGenericFactory *Factory, const char *goad_id, gpointer cl
/* create the text container */
hview->note_text_field = gtk_text_new (NULL, NULL);
gtk_text_set_editable (GTK_TEXT (hview->note_text_field), TRUE);
gtk_box_pack_start (GTK_BOX (vbox), hview->note_text_field, TRUE, TRUE, 0);
background = nautilus_get_widget_background (GTK_WIDGET (hview->note_text_field));
notes->note_text_field = gtk_text_new (NULL, NULL);
gtk_text_set_editable (GTK_TEXT (notes->note_text_field), TRUE);
gtk_box_pack_start (GTK_BOX (vbox), notes->note_text_field, TRUE, TRUE, 0);
background = nautilus_get_widget_background (GTK_WIDGET (notes->note_text_field));
nautilus_background_set_color (background, NOTES_DEFAULT_BACKGROUND_COLOR);
gtk_widget_show_all (vbox);
/* Create CORBA object. */
hview->view = NAUTILUS_VIEW_FRAME (nautilus_meta_view_frame_new (vbox));
gtk_signal_connect (GTK_OBJECT (hview->view), "destroy", do_destroy, hview);
notes->view = NAUTILUS_VIEW_FRAME (nautilus_meta_view_frame_new (vbox));
gtk_signal_connect (GTK_OBJECT (notes->view), "destroy", do_destroy, notes);
notes_object_count++;
/* handle events */
gtk_signal_connect (GTK_OBJECT (hview->view), "notify_location_change",
notes_notify_location_change, hview);
gtk_signal_connect (GTK_OBJECT (notes->view), "notify_location_change",
notes_notify_location_change, notes);
/* set description */
nautilus_meta_view_frame_set_label (NAUTILUS_META_VIEW_FRAME (hview->view),
nautilus_meta_view_frame_set_label (NAUTILUS_META_VIEW_FRAME (notes->view),
_("Notes"));
return BONOBO_OBJECT (hview->view);
return BONOBO_OBJECT (notes->view);
}
int
......@@ -162,6 +188,14 @@ main(int argc, char *argv[])
CORBA_ORB orb;
CORBA_Environment ev;
/* Make criticals and warnings stop in the debugger if NAUTILUS_DEBUG is set.
* Unfortunately, this has to be done explicitly for each domain.
*/
if (getenv("NAUTILUS_DEBUG") != NULL) {
nautilus_make_warnings_and_criticals_stop_in_debugger
(G_LOG_DOMAIN, g_log_domain_glib, "Gdk", "Gtk", "GnomeVFS", "GnomeUI", "Bonobo", NULL);
}
/* initialize CORBA and Bonobo */
CORBA_exception_init (&ev);
orb = gnome_CORBA_init_with_popt_table ("ntl-notes", VERSION, &argc, argv,
......
......@@ -36,77 +36,103 @@
#include <ctype.h>
#include <libnautilus/nautilus-background.h>
#include <libnautilus/nautilus-file.h>
#include <libnautilus/nautilus-debug.h>
#define NOTES_DEFAULT_BACKGROUND_COLOR "rgb:FFFF/FFFF/BBBB"
typedef struct {
NautilusViewFrame *view;
GtkWidget *note_text_field;
char* uri;
} NotesView;
char *uri;
NautilusFile *file;
} Notes;
static int notes_object_count = 0;
static void
notes_load_metainfo (NotesView *hview)
finish_loading_note (NautilusFile *file,
gpointer callback_data)
{
NautilusFile *file;
Notes *notes;
int position;
char *notes_text;
gtk_editable_delete_text (GTK_EDITABLE (hview->note_text_field), 0, -1);
file = nautilus_file_get (hview->uri);
if (file == NULL) {
return;
}
g_assert (NAUTILUS_IS_FILE (file));
notes = callback_data;
g_assert (notes->file == file);
notes_text = nautilus_file_get_metadata (file, NAUTILUS_METADATA_KEY_ANNOTATION, "");
gtk_editable_insert_text (GTK_EDITABLE (hview->note_text_field),
position = 0;
gtk_editable_insert_text (GTK_EDITABLE (notes->note_text_field),
notes_text,
strlen (notes_text),
&position);
g_free (notes_text);
nautilus_file_unref (file);
}
/* save the metainfo corresponding to the current uri, if any, into the text field */
static void
done_with_file (Notes *notes)
{
nautilus_file_cancel_callback (notes->file, finish_loading_note, notes);
nautilus_file_unref (notes->file);
}
static void
notes_save_metainfo(NotesView *hview)
notes_load_metainfo (Notes *notes)
{
NautilusFile *file;
char *notes_text;
GList *keys;
gtk_editable_delete_text (GTK_EDITABLE (notes->note_text_field), 0, -1);
file = nautilus_file_get (hview->uri);
done_with_file (notes);
notes->file = nautilus_file_get (notes->uri);
if (file == NULL) {
return;
}
notes_text = gtk_editable_get_chars (GTK_EDITABLE (hview->note_text_field), 0 , -1);
nautilus_file_set_metadata (file, NAUTILUS_METADATA_KEY_ANNOTATION, NULL, notes_text);
keys = g_list_prepend (NULL, NAUTILUS_METADATA_KEY_ANNOTATION);
nautilus_file_call_when_ready (file, keys, finish_loading_note, notes);
g_list_free (keys);
}
/* save the metainfo corresponding to the current uri, if any, into the text field */
static void
notes_save_metainfo (Notes *notes)
{
char *notes_text;
if (notes->file == NULL) {
return;
}
notes_text = gtk_editable_get_chars (GTK_EDITABLE (notes->note_text_field), 0 , -1);
nautilus_file_set_metadata (notes->file, NAUTILUS_METADATA_KEY_ANNOTATION, NULL, notes_text);
g_free (notes_text);
nautilus_file_unref (file);
}
static void
notes_notify_location_change (NautilusViewFrame *view,
Nautilus_NavigationInfo *loci,
NotesView *hview)
{
if (strcmp (hview->uri, loci->requested_uri) != 0) {
notes_save_metainfo (hview);
g_free (hview->uri);
hview->uri = g_strdup (loci->requested_uri);
notes_load_metainfo (hview);
Notes *notes)
{
if (strcmp (notes->uri, loci->requested_uri) != 0) {
notes_save_metainfo (notes);
g_free (notes->uri);
notes->uri = g_strdup (loci->requested_uri);
notes_load_metainfo (notes);
}
}
static void
do_destroy (GtkObject *obj, NotesView *hview)
do_destroy (GtkObject *obj, Notes *notes)
{
done_with_file (notes);
g_free (notes->uri);
g_free (notes);
notes_object_count--;
if (notes_object_count <= 0) {
gtk_main_quit();
......@@ -117,13 +143,13 @@ static BonoboObject *
make_notes_view (BonoboGenericFactory *Factory, const char *goad_id, gpointer closure)
{
GtkWidget *vbox;
NotesView *hview;
Notes *notes;
NautilusBackground *background;
g_return_val_if_fail (strcmp (goad_id, "ntl_notes_view") == 0, NULL);
hview = g_new0 (NotesView, 1);
hview->uri = g_strdup ("");
notes = g_new0 (Notes, 1);
notes->uri = g_strdup ("");
/* allocate a vbox to hold all of the UI elements */
......@@ -131,28 +157,28 @@ make_notes_view (BonoboGenericFactory *Factory, const char *goad_id, gpointer cl
/* create the text container */
hview->note_text_field = gtk_text_new (NULL, NULL);
gtk_text_set_editable (GTK_TEXT (hview->note_text_field), TRUE);
gtk_box_pack_start (GTK_BOX (vbox), hview->note_text_field, TRUE, TRUE, 0);
background = nautilus_get_widget_background (GTK_WIDGET (hview->note_text_field));
notes->note_text_field = gtk_text_new (NULL, NULL);
gtk_text_set_editable (GTK_TEXT (notes->note_text_field), TRUE);
gtk_box_pack_start (GTK_BOX (vbox), notes->note_text_field, TRUE, TRUE, 0);
background = nautilus_get_widget_background (GTK_WIDGET (notes->note_text_field));
nautilus_background_set_color (background, NOTES_DEFAULT_BACKGROUND_COLOR);
gtk_widget_show_all (vbox);
/* Create CORBA object. */
hview->view = NAUTILUS_VIEW_FRAME (nautilus_meta_view_frame_new (vbox));
gtk_signal_connect (GTK_OBJECT (hview->view), "destroy", do_destroy, hview);
notes->view = NAUTILUS_VIEW_FRAME (nautilus_meta_view_frame_new (vbox));
gtk_signal_connect (GTK_OBJECT (notes->view), "destroy", do_destroy, notes);
notes_object_count++;
/* handle events */
gtk_signal_connect (GTK_OBJECT (hview->view), "notify_location_change",
notes_notify_location_change, hview);
gtk_signal_connect (GTK_OBJECT (notes->view), "notify_location_change",
notes_notify_location_change, notes);
/* set description */
nautilus_meta_view_frame_set_label (NAUTILUS_META_VIEW_FRAME (hview->view),
nautilus_meta_view_frame_set_label (NAUTILUS_META_VIEW_FRAME (notes->view),
_("Notes"));
return BONOBO_OBJECT (hview->view);
return BONOBO_OBJECT (notes->view);
}
int
......@@ -162,6 +188,14 @@ main(int argc, char *argv[])
CORBA_ORB orb;
CORBA_Environment ev;
/* Make criticals and warnings stop in the debugger if NAUTILUS_DEBUG is set.
* Unfortunately, this has to be done explicitly for each domain.
*/
if (getenv("NAUTILUS_DEBUG") != NULL) {
nautilus_make_warnings_and_criticals_stop_in_debugger
(G_LOG_DOMAIN, g_log_domain_glib, "Gdk", "Gtk", "GnomeVFS", "GnomeUI", "Bonobo", NULL);
}
/* initialize CORBA and Bonobo */
CORBA_exception_init (&ev);
orb = gnome_CORBA_init_with_popt_table ("ntl-notes", VERSION, &argc, argv,
......
......@@ -1083,19 +1083,20 @@ nautilus_directory_get_file_metadata_node (NautilusDirectory *directory,
}
void
nautilus_directory_metadata_call_when_ready (NautilusDirectory *directory,
GList *tags,
NautilusMetadataCallback callback,
gpointer callback_data)
nautilus_directory_call_when_ready (NautilusDirectory *directory,
GList *directory_metadata_tags,
GList *file_metadata_tags,
NautilusDirectoryCallback callback,
gpointer callback_data)
{
/* For now, it's synchronous for testing. */
(* callback) (directory, callback_data);
}
void
nautilus_directory_metadata_callback_cancel (NautilusDirectory *directory,
NautilusMetadataCallback callback,
gpointer callback_data)
nautilus_directory_cancel_callback (NautilusDirectory *directory,
NautilusDirectoryCallback callback,
gpointer callback_data)
{
}
......
......@@ -56,77 +56,82 @@ typedef struct NautilusDirectoryClass NautilusDirectoryClass;
#define NAUTILUS_IS_DIRECTORY_CLASS(klass) \
(GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_DIRECTORY))
typedef void (*NautilusMetadataCallback) (NautilusDirectory *directory,
gpointer callback_data);
typedef void (*NautilusFileListCallback) (NautilusDirectory *directory,
GList *files,
gpointer callback_data);
typedef void (*NautilusDirectoryCallback) (NautilusDirectory *directory,
gpointer callback_data);
typedef void (*NautilusFileListCallback) (NautilusDirectory *directory,
GList *files,
gpointer callback_data);
/* Basic GtkObject requirements. */
GtkType nautilus_directory_get_type (void);
GtkType nautilus_directory_get_type (void);
/* Get a directory given a uri.
* Creates the appropriate subclass given the uri mappings.
* Returns a referenced object, not a floating one. Unref when finished.
* If two windows are viewing the same uri, the directory object is shared.
*/
NautilusDirectory *nautilus_directory_get (const char *uri);
NautilusDirectory *nautilus_directory_get (const char *uri);
/* Convenience functions, since we do a lot of ref'ing and unref'ing. */
void nautilus_directory_ref (NautilusDirectory *directory);
void nautilus_directory_unref (NautilusDirectory *directory);
void nautilus_directory_ref (NautilusDirectory *directory);
void nautilus_directory_unref (NautilusDirectory *directory);
/* Access to a URI. */
char * nautilus_directory_get_uri (NautilusDirectory *directory);
char * nautilus_directory_get_uri (NautilusDirectory *directory);
/* Waiting for data that's read asynchronously.
* This interface currently works only for metadata, but could be expanded
* to other attributes as well.
*/
void nautilus_directory_call_when_ready (NautilusDirectory *directory,
GList *directory_metadata_tags,
GList *file_metadata_tags,
NautilusDirectoryCallback callback,
gpointer callback_data);
void nautilus_directory_cancel_callback (NautilusDirectory *directory,
NautilusDirectoryCallback callback,
gpointer callback_data);
/* Getting and setting metadata. */
char * nautilus_directory_get_metadata (NautilusDirectory *directory,
const char *tag,
const char *default_metadata);
void nautilus_directory_set_metadata (NautilusDirectory *directory,
const char *tag,
const char *default_metadata,
const char *metadata);
void nautilus_directory_metadata_call_when_ready (NautilusDirectory *directory,
GList *tags,
NautilusMetadataCallback callback,
gpointer callback_data);
void nautilus_directory_metadata_callback_cancel (NautilusDirectory *directory,
NautilusMetadataCallback callback,
gpointer callback_data);
char * nautilus_directory_get_metadata (NautilusDirectory *directory,
const char *tag,
const char *default_metadata);
void nautilus_directory_set_metadata (NautilusDirectory *directory,
const char *tag,
const char *default_metadata,
const char *metadata);
/* Covers for common data types. */
gboolean nautilus_directory_get_boolean_metadata (NautilusDirectory *directory,
const char *tag,
gboolean default_metadata);
void nautilus_directory_set_boolean_metadata (NautilusDirectory *directory,
const char *tag,
gboolean default_metadata,
gboolean metadata);
int nautilus_directory_get_integer_metadata (NautilusDirectory *directory,
const char *tag,
int default_metadata);
void nautilus_directory_set_integer_metadata (NautilusDirectory *directory,
const char *tag,
int default_metadata,
int metadata);
gboolean nautilus_directory_get_boolean_metadata (NautilusDirectory *directory,
const char *tag,
gboolean default_metadata);
void nautilus_directory_set_boolean_metadata (NautilusDirectory *directory,
const char *tag,
gboolean default_metadata,
gboolean metadata);
int nautilus_directory_get_integer_metadata (NautilusDirectory *directory,
const char *tag,
int default_metadata);
void nautilus_directory_set_integer_metadata (NautilusDirectory *directory,
const char *tag,
int default_metadata,
int metadata);
/* Monitor the files in a directory. */
void nautilus_directory_monitor_files_ref (NautilusDirectory *directory,
NautilusFileListCallback initial_files_callback,
gpointer callback_data);
void nautilus_directory_monitor_files_unref (NautilusDirectory *directory);
void nautilus_directory_monitor_files_ref (NautilusDirectory *directory,
NautilusFileListCallback initial_files_callback,
gpointer callback_data);
void nautilus_directory_monitor_files_unref (NautilusDirectory *directory);
/* Return true if the directory has information about all the files.
* This will be false until the directory has been read at least once.
*/
gboolean nautilus_directory_are_all_files_seen (NautilusDirectory *directory);
gboolean nautilus_directory_are_all_files_seen (NautilusDirectory *directory);
/* Return true if the directory metadata has been loaded.
* Until this is true, get_metadata calls will return defaults.
* (We could have another way to indicate "don't know".)
*/
gboolean nautilus_directory_metadata_loaded (NautilusDirectory *directory);
gboolean nautilus_directory_metadata_loaded (NautilusDirectory *directory);
typedef struct NautilusDirectoryDetails NautilusDirectoryDetails;
......@@ -143,25 +148,24 @@ struct NautilusDirectoryClass
/*** Notification signals for clients to connect to. ***/
/* The files_added signal is emitted as the directory model
discovers new files.