Commit 1c5c03bc authored by Darin Adler's avatar Darin Adler

reviewed by: John Sullivan <sullivan@eazel.com>

	Fix bug 7783 (Makefile.am used to install xml data is wrong):

	* data/Makefile.am: Integrate build fix from fcrozat. Don't use
	the magic "info" name since it is used for special purposes on
	Mandrake and other systems.

	Other strings:

	* THANKS: Added some people who made recent contributions.
	* check-THANKS.pl: Add some more alternate names.

	* components/help/hyperbola-filefmt.c: (locale_score): Fix legal
	code that doesn't compile with some versions of gcc by adding a
	cast.

	* help/nautilus-user-manual/es/.cvsignore: Add
	nautilus-user-manual.junk.

	* libnautilus-extensions/nautilus-directory-async.c:
	(metafile_read_check_for_directory_callback),
	(metafile_read_done_callback),
	(metafile_write_failure_close_callback),
	(metafile_write_success_close_callback),
	(metafile_write_create_callback), (directory_load_callback),
	(directory_count_callback), (new_files_callback), (has_problem),
	(deep_count_callback), (mime_list_callback),
	(top_left_read_callback), (get_info_callback),
	(activation_uri_nautilus_link_read_callback),
	(activation_uri_gmc_link_read_callback),
	(cancel_activation_uri_for_file): Add ref/unref pairs that we need
	in callbacks that use NautilusDirectory objects but that also send
	out signals which might end up unref'ing them.

	* libnautilus-extensions/nautilus-file-operations.c:
	(nautilus_self_check_file_operations): Add tests to demonstrate
	bug 7701.

	* libnautilus-extensions/nautilus-smooth-text-layout-cache.c:
	(nautilus_self_check_smooth_text_layout_cache): Fix some destroys
	that should have been unrefs.

	* libnautilus-extensions/nautilus-string.c:
	(nautilus_self_check_string): Added tests for
	nautilus_str_get_after_prefix.
parent 93b00cb5
2001-03-15 Darin Adler <darin@eazel.com>
reviewed by: John Sullivan <sullivan@eazel.com>
Fix bug 7783 (Makefile.am used to install xml data is wrong):
* data/Makefile.am: Integrate build fix from fcrozat. Don't use
the magic "info" name since it is used for special purposes on
Mandrake and other systems.
Other strings:
* THANKS: Added some people who made recent contributions.
* check-THANKS.pl: Add some more alternate names.
* components/help/hyperbola-filefmt.c: (locale_score): Fix legal
code that doesn't compile with some versions of gcc by adding a
cast.
* help/nautilus-user-manual/es/.cvsignore: Add
nautilus-user-manual.junk.
* libnautilus-extensions/nautilus-directory-async.c:
(metafile_read_check_for_directory_callback),
(metafile_read_done_callback),
(metafile_write_failure_close_callback),
(metafile_write_success_close_callback),
(metafile_write_create_callback), (directory_load_callback),
(directory_count_callback), (new_files_callback), (has_problem),
(deep_count_callback), (mime_list_callback),
(top_left_read_callback), (get_info_callback),
(activation_uri_nautilus_link_read_callback),
(activation_uri_gmc_link_read_callback),
(cancel_activation_uri_for_file): Add ref/unref pairs that we need
in callbacks that use NautilusDirectory objects but that also send
out signals which might end up unref'ing them.
* libnautilus-extensions/nautilus-file-operations.c:
(nautilus_self_check_file_operations): Add tests to demonstrate
bug 7701.
* libnautilus-extensions/nautilus-smooth-text-layout-cache.c:
(nautilus_self_check_smooth_text_layout_cache): Fix some destroys
that should have been unrefs.
* libnautilus-extensions/nautilus-string.c:
(nautilus_self_check_string): Added tests for
nautilus_str_get_after_prefix.
2001-03-14 Gene Z. Ragan <gzr@eazel.com>
* libnautilus-extensions/nautilus-icon-dnd.c:
......
......@@ -64,6 +64,8 @@ Christian Rose <menthos@menthos.com>
Christophe Merlet <redfox@eikonex.org>
Christopher R. Gabriel <cgabriel@softwarelibero.org>
Eric Brayeur <eb@ibelgique.com>
Emese Kovacs <emese@gnome.hu>
Frederic Crozat <fcrozat@mandrakesoft.com>
Grkem Cetin <gorkem@gelecek.com.tr>
Gustavo Maciel Dias Vieira <gdvieira@zaz.com.br>
Jarkko Ranta <jjranta@cc.joensuu.fi>
......
......@@ -43,6 +43,7 @@ my %name_map = ("Darin as Andy" => "Darin Adler",
"Eskil Olsen" => "Eskil Heyn Olsen",
"Szabolcs BAN" => "Szabolcs Ban",
"arik devens" => "Arik Devens",
"Takuo KITAME" => "Takuo Kitame",
"Robin Slomkowski" => "Robin * Slomkowski");
# Map from alternate email addresses of some users to canonical versions
......@@ -54,6 +55,7 @@ my %email_map = ('at@ue-spacy.com' => 'tagoh@gnome.gr.jp',
'yakk@yakk.net.au' => 'ian@eazel.com',
'linuxfan@ionet..net' => 'josh@eazel.com',
'snickell@stanford.edu' => 'seth@eazel.com',
'mathieu@gnu.org' => 'mathieu@eazel.com',
'mathieu@gnome.org' => 'mathieu@eazel.com',
'hp@pobox.com' => 'hp@redhat.com',
'kmaraas@online.no' => 'kmaraas@gnome.org',
......
......@@ -1565,7 +1565,7 @@ locale_score (GList *locales, xmlNode *doc_node)
score = 0;
for (li = locales; li != NULL; li = li->next) {
if (strcmp (locale, li->data) == 0) {
if (strcmp (locale, (char *) li->data) == 0) {
return score;
}
......
NULL=
infodir = $(datadir)/nautilus
nautilusdatadir = $(datadir)/nautilus
info_DATA = \
nautilusdata_DATA = \
browser.xml \
static_bookmarks.xml \
nautilus-extras.placeholder \
nautilus-suggested.placeholder \
$(NULL)
EXTRA_DIST = $(info_DATA)
EXTRA_DIST = $(nautilusdata_DATA)
SUBDIRS = \
emblems \
......
......@@ -2,5 +2,5 @@ Makefile
Makefile.in
index.html
nautilus-user-manual
nautilus-user-manual.junk
omf_timestamp
......@@ -504,6 +504,8 @@ metafile_read_check_for_directory_callback (GnomeVFSAsyncHandle *handle,
g_assert (directory->details->metafile_read_state->get_file_info_handle == handle);
g_assert (nautilus_g_list_exactly_one_item (results));
nautilus_directory_ref (directory);
directory->details->metafile_read_state->get_file_info_handle = NULL;
result = results->data;
......@@ -517,6 +519,8 @@ metafile_read_check_for_directory_callback (GnomeVFSAsyncHandle *handle,
/* Not a directory. */
metafile_read_done (directory);
}
nautilus_directory_unref (directory);
}
static void
......@@ -602,9 +606,12 @@ metafile_read_done_callback (GnomeVFSResult result,
directory = NAUTILUS_DIRECTORY (callback_data);
g_assert (directory->details->metafile == NULL);
nautilus_directory_ref (directory);
if (result != GNOME_VFS_OK) {
g_assert (file_contents == NULL);
metafile_read_failed (directory);
nautilus_directory_unref (directory);
return;
}
......@@ -612,6 +619,7 @@ metafile_read_done_callback (GnomeVFSResult result,
if ((GnomeVFSFileSize) size != file_size) {
g_free (file_contents);
metafile_read_failed (directory);
nautilus_directory_unref (directory);
return;
}
......@@ -623,6 +631,8 @@ metafile_read_done_callback (GnomeVFSResult result,
g_free (buffer);
metafile_read_done (directory);
nautilus_directory_unref (directory);
}
static void
......@@ -768,7 +778,9 @@ metafile_write_failure_close_callback (GnomeVFSAsyncHandle *handle,
directory = NAUTILUS_DIRECTORY (callback_data);
nautilus_directory_ref (directory);
metafile_write_failed (directory);
nautilus_directory_unref (directory);
}
static void
......@@ -781,8 +793,11 @@ metafile_write_success_close_callback (GnomeVFSAsyncHandle *handle,
directory = NAUTILUS_DIRECTORY (callback_data);
g_assert (directory->details->metafile_write_state->handle == NULL);
nautilus_directory_ref (directory);
if (result != GNOME_VFS_OK) {
metafile_write_failed (directory);
nautilus_directory_unref (directory);
return;
}
......@@ -797,6 +812,8 @@ metafile_write_success_close_callback (GnomeVFSAsyncHandle *handle,
}
metafile_write_done (directory);
nautilus_directory_unref (directory);
}
static void
......@@ -834,7 +851,9 @@ metafile_write_create_callback (GnomeVFSAsyncHandle *handle,
g_assert (directory->details->metafile_write_state->handle == handle);
if (result != GNOME_VFS_OK) {
nautilus_directory_ref (directory);
metafile_write_failed (directory);
nautilus_directory_unref (directory);
return;
}
......@@ -1493,6 +1512,8 @@ directory_load_callback (GnomeVFSAsyncHandle *handle,
g_assert (directory->details->directory_load_in_progress != NULL);
g_assert (directory->details->directory_load_in_progress == handle);
nautilus_directory_ref (directory);
for (element = list; element != NULL; element = element->next) {
directory_load_one (directory, element->data);
}
......@@ -1501,6 +1522,8 @@ directory_load_callback (GnomeVFSAsyncHandle *handle,
|| result != GNOME_VFS_OK) {
directory_load_done (directory, result);
}
nautilus_directory_unref (directory);
}
static void
......@@ -1747,6 +1770,8 @@ directory_count_callback (GnomeVFSAsyncHandle *handle,
return;
}
nautilus_directory_ref (directory);
count_file->details->directory_count_is_up_to_date = TRUE;
/* Record either a failure or success. */
......@@ -1767,6 +1792,8 @@ directory_count_callback (GnomeVFSAsyncHandle *handle,
/* Start up the next one. */
async_job_end (directory, "directory count");
nautilus_directory_async_state_changed (directory);
nautilus_directory_unref (directory);
}
static void
......@@ -1781,6 +1808,8 @@ new_files_callback (GnomeVFSAsyncHandle *handle,
directory = NAUTILUS_DIRECTORY (callback_data);
handles = &directory->details->get_file_infos_in_progress;
g_assert (handle == NULL || g_list_find (*handles, handle) != NULL);
nautilus_directory_ref (directory);
/* Note that this call is done. */
*handles = g_list_remove (*handles, handle);
......@@ -1793,6 +1822,8 @@ new_files_callback (GnomeVFSAsyncHandle *handle,
directory_load_one (directory, result->file_info);
}
}
nautilus_directory_unref (directory);
}
void
......@@ -2003,7 +2034,6 @@ has_problem (NautilusDirectory *directory, NautilusFile *file, FileCheck problem
}
return FALSE;
}
static gboolean
......@@ -2603,6 +2633,8 @@ deep_count_callback (GnomeVFSAsyncHandle *handle,
file = directory->details->deep_count_file;
g_assert (NAUTILUS_IS_FILE (file));
nautilus_directory_ref (directory);
for (element = list; element != NULL; element = element->next) {
deep_count_one (directory, element->data);
}
......@@ -2638,6 +2670,8 @@ deep_count_callback (GnomeVFSAsyncHandle *handle,
async_job_end (directory, "deep count");
nautilus_directory_async_state_changed (directory);
}
nautilus_directory_unref (directory);
}
static void
......@@ -2743,6 +2777,8 @@ mime_list_callback (GnomeVFSAsyncHandle *handle,
return;
}
nautilus_directory_ref (directory);
file->details->mime_list_is_up_to_date = TRUE;
/* Record either a failure or success. */
......@@ -2770,6 +2806,8 @@ mime_list_callback (GnomeVFSAsyncHandle *handle,
/* Start up the next one. */
async_job_end (directory, "MIME list");
nautilus_directory_async_state_changed (directory);
nautilus_directory_unref (directory);
}
static void
......@@ -2873,6 +2911,8 @@ top_left_read_callback (GnomeVFSResult result,
directory = NAUTILUS_DIRECTORY (callback_data);
nautilus_directory_ref (directory);
directory->details->top_left_read_state->handle = NULL;
directory->details->top_left_read_state->file->details->top_left_text_is_up_to_date = TRUE;
......@@ -2897,6 +2937,8 @@ top_left_read_callback (GnomeVFSResult result,
nautilus_file_changed (changed_file);
nautilus_file_unref (changed_file);
}
nautilus_directory_unref (directory);
}
static gboolean
......@@ -2974,6 +3016,8 @@ get_info_callback (GnomeVFSAsyncHandle *handle,
g_assert (nautilus_g_list_exactly_one_item (results));
get_info_file = directory->details->get_info_file;
g_assert (NAUTILUS_IS_FILE (get_info_file));
nautilus_directory_ref (directory);
directory->details->get_info_file = NULL;
directory->details->get_info_in_progress = NULL;
......@@ -3011,6 +3055,8 @@ get_info_callback (GnomeVFSAsyncHandle *handle,
async_job_end (directory, "file info");
nautilus_directory_async_state_changed (directory);
nautilus_directory_unref (directory);
}
static void
......@@ -3116,6 +3162,8 @@ activation_uri_nautilus_link_read_callback (GnomeVFSResult result,
directory = NAUTILUS_DIRECTORY (callback_data);
nautilus_directory_ref (directory);
/* Handle the case where we read the Nautilus link. */
if (result != GNOME_VFS_OK) {
/* FIXME bugzilla.eazel.com 2433: We should report this error to the user. */
......@@ -3131,6 +3179,8 @@ activation_uri_nautilus_link_read_callback (GnomeVFSResult result,
activation_uri_read_done (directory, uri);
g_free (uri);
nautilus_directory_unref (directory);
}
static void
......@@ -3144,6 +3194,8 @@ activation_uri_gmc_link_read_callback (GnomeVFSResult result,
directory = NAUTILUS_DIRECTORY (callback_data);
nautilus_directory_ref (directory);
/* Handle the case where we read the GMC link. */
if (result != GNOME_VFS_OK || !nautilus_str_has_prefix (file_contents, "URL: ")) {
/* FIXME bugzilla.eazel.com 2433: We should report this error to the user. */
......@@ -3161,6 +3213,8 @@ activation_uri_gmc_link_read_callback (GnomeVFSResult result,
g_free (file_contents);
activation_uri_read_done (directory, uri);
g_free (uri);
nautilus_directory_unref (directory);
}
static gboolean
......@@ -3326,7 +3380,6 @@ nautilus_directory_cancel (NautilusDirectory *directory)
async_job_wake_up ();
}
static void
cancel_directory_count_for_file (NautilusDirectory *directory,
NautilusFile *file)
......@@ -3336,7 +3389,6 @@ cancel_directory_count_for_file (NautilusDirectory *directory,
}
}
static void
cancel_deep_counts_for_file (NautilusDirectory *directory,
NautilusFile *file)
......@@ -3346,7 +3398,6 @@ cancel_deep_counts_for_file (NautilusDirectory *directory,
}
}
static void
cancel_mime_list_for_file (NautilusDirectory *directory,
NautilusFile *file)
......@@ -3385,7 +3436,6 @@ cancel_activation_uri_for_file (NautilusDirectory *directory,
}
}
static void
cancel_loading_attributes (NautilusDirectory *directory,
GList *file_attributes)
......
......@@ -2255,6 +2255,8 @@ nautilus_self_check_file_operations (void)
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (another copy)"), 1), _("foo (3rd copy)"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (another copy).txt"), 1), _("foo (3rd copy).txt"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo foo (another copy).txt"), 1), _("foo foo (3rd copy).txt"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (13th copy)"), 1), _("foo (14th copy)"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (13th copy).txt"), 1), _("foo (14th copy).txt"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (21st copy)"), 1), _("foo (22nd copy)"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (21st copy).txt"), 1), _("foo (22nd copy).txt"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (22nd copy)"), 1), _("foo (23rd copy)"));
......@@ -2266,6 +2268,14 @@ nautilus_self_check_file_operations (void)
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo foo (24th copy)"), 1), _("foo foo (25th copy)"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo foo (24th copy).txt"), 1), _("foo foo (25th copy).txt"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo foo (100000000000000th copy).txt"), 1), _("foo foo (copy).txt"));
/* FIXME bugzilla.eazel.com 7701: These are wrong. */
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (10th copy)"), 1), _("foo (11st copy)"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (10th copy).txt"), 1), _("foo (11st copy).txt"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (11th copy)"), 1), _("foo (12nd copy)"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (11th copy).txt"), 1), _("foo (12nd copy).txt"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (12th copy)"), 1), _("foo (13rd copy)"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (12th copy).txt"), 1), _("foo (13rd copy).txt"));
}
#endif
......@@ -754,8 +754,8 @@ nautilus_self_check_smooth_text_layout_cache (void)
free_test_case (cases + i);
}
gtk_object_destroy (GTK_OBJECT (test_font));
gtk_object_destroy (GTK_OBJECT (test_cache));
gtk_object_unref (GTK_OBJECT (test_font));
gtk_object_unref (GTK_OBJECT (test_cache));
}
#endif /* NAUTILUS_OMIT_SELF_CHECK */
......@@ -852,6 +852,17 @@ nautilus_self_check_string (void)
NAUTILUS_CHECK_STRING_RESULT (nautilus_str_get_prefix ("foo:bar", ":"), "foo");
NAUTILUS_CHECK_STRING_RESULT (nautilus_str_get_prefix ("footle:bar", "tle:"), "foo");
NAUTILUS_CHECK_STRING_RESULT (nautilus_str_get_after_prefix (NULL, NULL), NULL);
NAUTILUS_CHECK_STRING_RESULT (nautilus_str_get_after_prefix (NULL, "foo"), NULL);
NAUTILUS_CHECK_STRING_RESULT (nautilus_str_get_after_prefix ("foo", NULL), "foo");
NAUTILUS_CHECK_STRING_RESULT (nautilus_str_get_after_prefix ("", ""), "");
NAUTILUS_CHECK_STRING_RESULT (nautilus_str_get_after_prefix ("", "foo"), NULL);
NAUTILUS_CHECK_STRING_RESULT (nautilus_str_get_after_prefix ("foo", ""), "foo");
NAUTILUS_CHECK_STRING_RESULT (nautilus_str_get_after_prefix ("foo", "foo"), "foo");
NAUTILUS_CHECK_STRING_RESULT (nautilus_str_get_after_prefix ("foo:", ":"), ":");
NAUTILUS_CHECK_STRING_RESULT (nautilus_str_get_after_prefix ("foo:bar", ":"), ":bar");
NAUTILUS_CHECK_STRING_RESULT (nautilus_str_get_after_prefix ("footle:bar", "tle:"), "tle:bar");
NAUTILUS_CHECK_STRING_RESULT (nautilus_str_strip_chr (NULL, '_'), NULL);
NAUTILUS_CHECK_STRING_RESULT (nautilus_str_strip_chr ("", '_'), "");
NAUTILUS_CHECK_STRING_RESULT (nautilus_str_strip_chr ("foo", '_'), "foo");
......
......@@ -504,6 +504,8 @@ metafile_read_check_for_directory_callback (GnomeVFSAsyncHandle *handle,
g_assert (directory->details->metafile_read_state->get_file_info_handle == handle);
g_assert (nautilus_g_list_exactly_one_item (results));
nautilus_directory_ref (directory);
directory->details->metafile_read_state->get_file_info_handle = NULL;
result = results->data;
......@@ -517,6 +519,8 @@ metafile_read_check_for_directory_callback (GnomeVFSAsyncHandle *handle,
/* Not a directory. */
metafile_read_done (directory);
}
nautilus_directory_unref (directory);
}
static void
......@@ -602,9 +606,12 @@ metafile_read_done_callback (GnomeVFSResult result,
directory = NAUTILUS_DIRECTORY (callback_data);
g_assert (directory->details->metafile == NULL);
nautilus_directory_ref (directory);
if (result != GNOME_VFS_OK) {
g_assert (file_contents == NULL);
metafile_read_failed (directory);
nautilus_directory_unref (directory);
return;
}
......@@ -612,6 +619,7 @@ metafile_read_done_callback (GnomeVFSResult result,
if ((GnomeVFSFileSize) size != file_size) {
g_free (file_contents);
metafile_read_failed (directory);
nautilus_directory_unref (directory);
return;
}
......@@ -623,6 +631,8 @@ metafile_read_done_callback (GnomeVFSResult result,
g_free (buffer);
metafile_read_done (directory);
nautilus_directory_unref (directory);
}
static void
......@@ -768,7 +778,9 @@ metafile_write_failure_close_callback (GnomeVFSAsyncHandle *handle,
directory = NAUTILUS_DIRECTORY (callback_data);
nautilus_directory_ref (directory);
metafile_write_failed (directory);
nautilus_directory_unref (directory);
}
static void
......@@ -781,8 +793,11 @@ metafile_write_success_close_callback (GnomeVFSAsyncHandle *handle,
directory = NAUTILUS_DIRECTORY (callback_data);
g_assert (directory->details->metafile_write_state->handle == NULL);
nautilus_directory_ref (directory);
if (result != GNOME_VFS_OK) {
metafile_write_failed (directory);
nautilus_directory_unref (directory);
return;
}
......@@ -797,6 +812,8 @@ metafile_write_success_close_callback (GnomeVFSAsyncHandle *handle,
}
metafile_write_done (directory);
nautilus_directory_unref (directory);
}
static void
......@@ -834,7 +851,9 @@ metafile_write_create_callback (GnomeVFSAsyncHandle *handle,
g_assert (directory->details->metafile_write_state->handle == handle);
if (result != GNOME_VFS_OK) {
nautilus_directory_ref (directory);
metafile_write_failed (directory);
nautilus_directory_unref (directory);
return;
}
......@@ -1493,6 +1512,8 @@ directory_load_callback (GnomeVFSAsyncHandle *handle,
g_assert (directory->details->directory_load_in_progress != NULL);
g_assert (directory->details->directory_load_in_progress == handle);
nautilus_directory_ref (directory);
for (element = list; element != NULL; element = element->next) {
directory_load_one (directory, element->data);
}
......@@ -1501,6 +1522,8 @@ directory_load_callback (GnomeVFSAsyncHandle *handle,
|| result != GNOME_VFS_OK) {
directory_load_done (directory, result);
}
nautilus_directory_unref (directory);
}
static void
......@@ -1747,6 +1770,8 @@ directory_count_callback (GnomeVFSAsyncHandle *handle,
return;
}
nautilus_directory_ref (directory);
count_file->details->directory_count_is_up_to_date = TRUE;
/* Record either a failure or success. */
......@@ -1767,6 +1792,8 @@ directory_count_callback (GnomeVFSAsyncHandle *handle,
/* Start up the next one. */
async_job_end (directory, "directory count");
nautilus_directory_async_state_changed (directory);
nautilus_directory_unref (directory);
}
static void
......@@ -1781,6 +1808,8 @@ new_files_callback (GnomeVFSAsyncHandle *handle,
directory = NAUTILUS_DIRECTORY (callback_data);
handles = &directory->details->get_file_infos_in_progress;
g_assert (handle == NULL || g_list_find (*handles, handle) != NULL);
nautilus_directory_ref (directory);
/* Note that this call is done. */
*handles = g_list_remove (*handles, handle);
......@@ -1793,6 +1822,8 @@ new_files_callback (GnomeVFSAsyncHandle *handle,
directory_load_one (directory, result->file_info);
}
}
nautilus_directory_unref (directory);
}
void
......@@ -2003,7 +2034,6 @@ has_problem (NautilusDirectory *directory, NautilusFile *file, FileCheck problem
}
return FALSE;
}
static gboolean
......@@ -2603,6 +2633,8 @@ deep_count_callback (GnomeVFSAsyncHandle *handle,
file = directory->details->deep_count_file;
g_assert (NAUTILUS_IS_FILE (file));
nautilus_directory_ref (directory);
for (element = list; element != NULL; element = element->next) {
deep_count_one (directory, element->data);
}
......@@ -2638,6 +2670,8 @@ deep_count_callback (GnomeVFSAsyncHandle *handle,
async_job_end (directory, "deep count");
nautilus_directory_async_state_changed (directory);
}
nautilus_directory_unref (directory);
}
static void
......@@ -2743,6 +2777,8 @@ mime_list_callback (GnomeVFSAsyncHandle *handle,
return;
}
nautilus_directory_ref (directory);
file->details->mime_list_is_up_to_date = TRUE;
/* Record either a failure or success. */
......@@ -2770,6 +2806,8 @@ mime_list_callback (GnomeVFSAsyncHandle *handle,
/* Start up the next one. */
async_job_end (directory, "MIME list");
nautilus_directory_async_state_changed (directory);
nautilus_directory_unref (directory);
}
static void
......@@ -2873,6 +2911,8 @@ top_left_read_callback (GnomeVFSResult result,
directory = NAUTILUS_DIRECTORY (callback_data);
nautilus_directory_ref (directory);
directory->details->top_left_read_state->handle = NULL;
directory->details->top_left_read_state->file->details->top_left_text_is_up_to_date = TRUE;
......@@ -2897,6 +2937,8 @@ top_left_read_callback (GnomeVFSResult result,
nautilus_file_changed (changed_file);
nautilus_file_unref (changed_file);
}
nautilus_directory_unref (directory);
}
static gboolean
......@@ -2974,6 +3016,8 @@ get_info_callback (GnomeVFSAsyncHandle *handle,
g_assert (nautilus_g_list_exactly_one_item (results));
get_info_file = directory->details->get_info_file;
g_assert (NAUTILUS_IS_FILE (get_info_file));
nautilus_directory_ref (directory);
directory->details->get_info_file = NULL;
directory->details->get_info_in_progress = NULL;
......@@ -3011,6 +3055,8 @@ get_info_callback (GnomeVFSAsyncHandle *handle,
async_job_end (directory, "file info");
nautilus_directory_async_state_changed (directory);
nautilus_directory_unref (directory);
}
static void
......@@ -3116,6 +3162,8 @@ activation_uri_nautilus_link_read_callback (GnomeVFSResult result,
directory = NAUTILUS_DIRECTORY (callback_data);
nautilus_directory_ref (directory);
/* Handle the case where we read the Nautilus link. */
if (result != GNOME_VFS_OK) {
/* FIXME bugzilla.eazel.com 2433: We should report this error to the user. */
......@@ -3131,6 +3179,8 @@ activation_uri_nautilus_link_read_callback (GnomeVFSResult result,
activation_uri_read_done (directory, uri);
g_free (uri);
nautilus_directory_unref (directory);
}
static void
......@@ -3144,6 +3194,8 @@ activation_uri_gmc_link_read_callback (GnomeVFSResult result,
directory = NAUTILUS_DIRECTORY (callback_data);
nautilus_directory_ref (directory);
/* Handle the case where we read the GMC link. */
if (result != GNOME_VFS_OK || !nautilus_str_has_prefix (file_contents, "URL: ")) {
/* FIXME bugzilla.eazel.com 2433: We should report this error to the user. */
......@@ -3161,6 +3213,8 @@ activation_uri_gmc_link_read_callback (GnomeVFSResult result,
g_free (file_contents);
activation_uri_read_done (directory, uri);
g_free (uri);
nautilus_directory_unref (directory);
}
static gboolean
......@@ -3326,7 +3380,6 @@ nautilus_directory_cancel (NautilusDirectory *directory)
async_job_wake_up ();
}
static void
cancel_directory_count_for_file (NautilusDirectory *directory,
NautilusFile *file)
......@@ -3336,7 +3389,6 @@ cancel_directory_count_for_file (NautilusDirectory *directory,
}
}
static void
cancel_deep_counts_for_file (NautilusDirectory *directory,
NautilusFile *file)
......@@ -3346,7 +3398,6 @@ cancel_deep_counts_for_file (NautilusDirectory *directory,
}
}
static void
cancel_mime_list_for_file (NautilusDirectory *directory,
NautilusFile *file)
......@@ -3385,7 +3436,6 @@ cancel_activation_uri_for_file (NautilusDirectory *directory,
}
}
static void
cancel_loading_attributes (NautilusDirectory *directory,
GList *file_attributes)
......
......@@ -2255,6 +2255,8 @@ nautilus_self_check_file_operations (void)
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (another copy)"), 1), _("foo (3rd copy)"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (another copy).txt"), 1), _("foo (3rd copy).txt"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo foo (another copy).txt"), 1), _("foo foo (3rd copy).txt"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (13th copy)"), 1), _("foo (14th copy)"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (13th copy).txt"), 1), _("foo (14th copy).txt"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (21st copy)"), 1), _("foo (22nd copy)"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (21st copy).txt"), 1), _("foo (22nd copy).txt"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (22nd copy)"), 1), _("foo (23rd copy)"));
......@@ -2266,6 +2268,14 @@ nautilus_self_check_file_operations (void)
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo foo (24th copy)"), 1), _("foo foo (25th copy)"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo foo (24th copy).txt"), 1), _("foo foo (25th copy).txt"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo foo (100000000000000th copy).txt"), 1), _("foo foo (copy).txt"));
/* FIXME bugzilla.eazel.com 7701: These are wrong. */
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (10th copy)"), 1), _("foo (11st copy)"));
NAUTILUS_CHECK_STRING_RESULT (get_duplicate_name (_("foo (10th copy).txt"), 1), _("foo (11st copy).txt"));
NAUTILUS_CHECK_STRING_RESULT