summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-directory.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnautilus-private/nautilus-directory.c')
-rw-r--r--libnautilus-private/nautilus-directory.c39
1 files changed, 9 insertions, 30 deletions
diff --git a/libnautilus-private/nautilus-directory.c b/libnautilus-private/nautilus-directory.c
index 674dcf402..1f92ad36b 100644
--- a/libnautilus-private/nautilus-directory.c
+++ b/libnautilus-private/nautilus-directory.c
@@ -1137,12 +1137,17 @@ get_files_cb (NautilusDirectory *directory, GList *files, gpointer data)
file_count += g_list_length (files);
}
+/* Return the number of extant NautilusDirectories */
+int
+nautilus_directory_number_outstanding ()
+{
+ return g_hash_table_size (directory_objects);
+}
+
void
nautilus_self_check_directory (void)
{
NautilusDirectory *directory;
- NautilusFile *file_1;
- NautilusFile *file_2;
directory = nautilus_directory_get ("file:///etc");
@@ -1195,34 +1200,6 @@ nautilus_self_check_directory (void)
NAUTILUS_CHECK_STRING_RESULT (nautilus_directory_get_metadata (directory, "TEST", "default"), "value");
- file_1 = nautilus_file_get ("file:///home/");
-
- NAUTILUS_CHECK_STRING_RESULT (nautilus_file_get_name (file_1), "home");
-
- NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_file_get ("file:///home/") == file_1, TRUE);
- NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_file_get ("file:///home") == file_1, TRUE);
- nautilus_file_unref (file_1);
-
- nautilus_file_unref (file_1);
-
- file_1 = nautilus_file_get ("file:///home");
- NAUTILUS_CHECK_STRING_RESULT (nautilus_file_get_name (file_1), "home");
- nautilus_file_unref (file_1);
-
- /* sorting */
- file_1 = nautilus_file_get ("file:///etc");
- file_2 = nautilus_file_get ("file:///usr");
-
- NAUTILUS_CHECK_INTEGER_RESULT (file_1->ref_count, 1);
- NAUTILUS_CHECK_INTEGER_RESULT (file_2->ref_count, 1);
-
- NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_file_compare_for_sort (file_1, file_2, NAUTILUS_FILE_SORT_BY_NAME) < 0, TRUE);
- NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_file_compare_for_sort_reversed (file_1, file_2, NAUTILUS_FILE_SORT_BY_NAME) > 0, TRUE);
- NAUTILUS_CHECK_BOOLEAN_RESULT (nautilus_file_compare_for_sort (file_1, file_1, NAUTILUS_FILE_SORT_BY_NAME) == 0, TRUE);
-
- nautilus_file_unref (file_1);
- nautilus_file_unref (file_2);
-
/* nautilus_directory_escape_slashes */
NAUTILUS_CHECK_STRING_RESULT (nautilus_directory_escape_slashes (""), "");
NAUTILUS_CHECK_STRING_RESULT (nautilus_directory_escape_slashes ("a"), "a");
@@ -1232,6 +1209,8 @@ nautilus_self_check_directory (void)
NAUTILUS_CHECK_STRING_RESULT (nautilus_directory_escape_slashes ("a%a"), "a%25a");
NAUTILUS_CHECK_STRING_RESULT (nautilus_directory_escape_slashes ("%25"), "%2525");
NAUTILUS_CHECK_STRING_RESULT (nautilus_directory_escape_slashes ("%2F"), "%252F");
+
+ gtk_object_unref (GTK_OBJECT (directory));
}
#endif /* !NAUTILUS_OMIT_SELF_CHECK */