Commit 79a6b5d0 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Don't need the want_foo calls, can just pass in the request type directly

2009-01-13  Alexander Larsson  <alexl@redhat.com>

        * libnautilus-private/nautilus-directory-async.c:
	Don't need the want_foo calls, can just pass in
	the request type directly now.


svn path=/trunk/; revision=14848
parent eda6ad89
2009-01-13 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-directory-async.c:
Don't need the want_foo calls, can just pass in
the request type directly now.
2009-01-13 Alexander Larsson <alexl@redhat.com> 2009-01-13 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-directory-async.c: * libnautilus-private/nautilus-directory-async.c:
......
...@@ -1687,12 +1687,6 @@ should_get_directory_count_now (NautilusFile *file) ...@@ -1687,12 +1687,6 @@ should_get_directory_count_now (NautilusFile *file)
&& !file->details->loading_directory; && !file->details->loading_directory;
} }
static gboolean
wants_directory_count (Request request)
{
return REQUEST_WANTS_TYPE (request, REQUEST_DIRECTORY_COUNT);
}
static gboolean static gboolean
lacks_top_left (NautilusFile *file) lacks_top_left (NautilusFile *file)
{ {
...@@ -1701,12 +1695,6 @@ lacks_top_left (NautilusFile *file) ...@@ -1701,12 +1695,6 @@ lacks_top_left (NautilusFile *file)
&& nautilus_file_should_get_top_left_text (file); && nautilus_file_should_get_top_left_text (file);
} }
static gboolean
wants_top_left (Request request)
{
return REQUEST_WANTS_TYPE (request, REQUEST_TOP_LEFT_TEXT);
}
static gboolean static gboolean
lacks_large_top_left (NautilusFile *file) lacks_large_top_left (NautilusFile *file)
{ {
...@@ -1715,13 +1703,6 @@ lacks_large_top_left (NautilusFile *file) ...@@ -1715,13 +1703,6 @@ lacks_large_top_left (NautilusFile *file)
file->details->got_large_top_left_text != file->details->got_top_left_text) file->details->got_large_top_left_text != file->details->got_top_left_text)
&& nautilus_file_should_get_top_left_text (file); && nautilus_file_should_get_top_left_text (file);
} }
static gboolean
wants_large_top_left (Request request)
{
return REQUEST_WANTS_TYPE (request, REQUEST_LARGE_TOP_LEFT_TEXT);
}
static gboolean static gboolean
lacks_info (NautilusFile *file) lacks_info (NautilusFile *file)
{ {
...@@ -1735,30 +1716,12 @@ lacks_filesystem_info (NautilusFile *file) ...@@ -1735,30 +1716,12 @@ lacks_filesystem_info (NautilusFile *file)
return !file->details->filesystem_info_is_up_to_date; return !file->details->filesystem_info_is_up_to_date;
} }
static gboolean
wants_info (Request request)
{
return REQUEST_WANTS_TYPE (request, REQUEST_FILE_INFO);
}
static gboolean
wants_filesystem_info (Request request)
{
return REQUEST_WANTS_TYPE (request, REQUEST_FILESYSTEM_INFO);
}
static gboolean static gboolean
lacks_deep_count (NautilusFile *file) lacks_deep_count (NautilusFile *file)
{ {
return file->details->deep_counts_status != NAUTILUS_REQUEST_DONE; return file->details->deep_counts_status != NAUTILUS_REQUEST_DONE;
} }
static gboolean
wants_deep_count (Request request)
{
return REQUEST_WANTS_TYPE (request, REQUEST_DEEP_COUNT);
}
static gboolean static gboolean
lacks_mime_list (NautilusFile *file) lacks_mime_list (NautilusFile *file)
{ {
...@@ -1772,11 +1735,6 @@ should_get_mime_list (NautilusFile *file) ...@@ -1772,11 +1735,6 @@ should_get_mime_list (NautilusFile *file)
&& !file->details->loading_directory; && !file->details->loading_directory;
} }
static gboolean
wants_mime_list (Request request)
{
return REQUEST_WANTS_TYPE (request, REQUEST_MIME_LIST);
}
static gboolean static gboolean
lacks_link_info (NautilusFile *file) lacks_link_info (NautilusFile *file)
{ {
...@@ -1793,24 +1751,12 @@ lacks_link_info (NautilusFile *file) ...@@ -1793,24 +1751,12 @@ lacks_link_info (NautilusFile *file)
} }
} }
static gboolean
wants_link_info (Request request)
{
return REQUEST_WANTS_TYPE (request, REQUEST_LINK_INFO);
}
static gboolean static gboolean
lacks_extension_info (NautilusFile *file) lacks_extension_info (NautilusFile *file)
{ {
return file->details->pending_info_providers != NULL; return file->details->pending_info_providers != NULL;
} }
static gboolean
wants_extension_info (Request request)
{
return REQUEST_WANTS_TYPE (request, REQUEST_EXTENSION_INFO);
}
static gboolean static gboolean
lacks_thumbnail (NautilusFile *file) lacks_thumbnail (NautilusFile *file)
{ {
...@@ -1819,12 +1765,6 @@ lacks_thumbnail (NautilusFile *file) ...@@ -1819,12 +1765,6 @@ lacks_thumbnail (NautilusFile *file)
!file->details->thumbnail_is_up_to_date; !file->details->thumbnail_is_up_to_date;
} }
static gboolean
wants_thumbnail (Request request)
{
return REQUEST_WANTS_TYPE (request, REQUEST_THUMBNAIL);
}
static gboolean static gboolean
lacks_mount (NautilusFile *file) lacks_mount (NautilusFile *file)
{ {
...@@ -1845,12 +1785,6 @@ lacks_mount (NautilusFile *file) ...@@ -1845,12 +1785,6 @@ lacks_mount (NautilusFile *file)
); );
} }
static gboolean
wants_mount (Request request)
{
return REQUEST_WANTS_TYPE (request, REQUEST_MOUNT);
}
static gboolean static gboolean
has_problem (NautilusDirectory *directory, NautilusFile *file, FileCheck problem) has_problem (NautilusDirectory *directory, NautilusFile *file, FileCheck problem)
{ {
...@@ -2475,7 +2409,7 @@ monitor_includes_file (const Monitor *monitor, ...@@ -2475,7 +2409,7 @@ monitor_includes_file (const Monitor *monitor,
static gboolean static gboolean
is_needy (NautilusFile *file, is_needy (NautilusFile *file,
FileCheck check_missing, FileCheck check_missing,
RequestCheck check_wanted) RequestType request_type_wanted)
{ {
NautilusDirectory *directory; NautilusDirectory *directory;
GList *node; GList *node;
...@@ -2491,7 +2425,7 @@ is_needy (NautilusFile *file, ...@@ -2491,7 +2425,7 @@ is_needy (NautilusFile *file,
node != NULL; node = node->next) { node != NULL; node = node->next) {
callback = node->data; callback = node->data;
if (callback->active && if (callback->active &&
(* check_wanted) (callback->request)) { REQUEST_WANTS_TYPE (callback->request, request_type_wanted)) {
if (callback->file == file) { if (callback->file == file) {
return TRUE; return TRUE;
} }
...@@ -2504,7 +2438,7 @@ is_needy (NautilusFile *file, ...@@ -2504,7 +2438,7 @@ is_needy (NautilusFile *file,
for (node = directory->details->monitor_list; for (node = directory->details->monitor_list;
node != NULL; node = node->next) { node != NULL; node = node->next) {
monitor = node->data; monitor = node->data;
if ((* check_wanted) (monitor->request)) { if (REQUEST_WANTS_TYPE (monitor->request, request_type_wanted)) {
if (monitor_includes_file (monitor, file)) { if (monitor_includes_file (monitor, file)) {
return TRUE; return TRUE;
} }
...@@ -2525,7 +2459,7 @@ directory_count_stop (NautilusDirectory *directory) ...@@ -2525,7 +2459,7 @@ directory_count_stop (NautilusDirectory *directory)
g_assert (file->details->directory == directory); g_assert (file->details->directory == directory);
if (is_needy (file, if (is_needy (file,
should_get_directory_count_now, should_get_directory_count_now,
wants_directory_count)) { REQUEST_DIRECTORY_COUNT)) {
return; return;
} }
} }
...@@ -2715,7 +2649,7 @@ directory_count_start (NautilusDirectory *directory, ...@@ -2715,7 +2649,7 @@ directory_count_start (NautilusDirectory *directory,
if (!is_needy (file, if (!is_needy (file,
should_get_directory_count_now, should_get_directory_count_now,
wants_directory_count)) { REQUEST_DIRECTORY_COUNT)) {
return; return;
} }
*doing_io = TRUE; *doing_io = TRUE;
...@@ -3020,7 +2954,7 @@ deep_count_stop (NautilusDirectory *directory) ...@@ -3020,7 +2954,7 @@ deep_count_stop (NautilusDirectory *directory)
g_assert (file->details->directory == directory); g_assert (file->details->directory == directory);
if (is_needy (file, if (is_needy (file,
lacks_deep_count, lacks_deep_count,
wants_deep_count)) { REQUEST_DEEP_COUNT)) {
return; return;
} }
} }
...@@ -3045,7 +2979,7 @@ deep_count_start (NautilusDirectory *directory, ...@@ -3045,7 +2979,7 @@ deep_count_start (NautilusDirectory *directory,
if (!is_needy (file, if (!is_needy (file,
lacks_deep_count, lacks_deep_count,
wants_deep_count)) { REQUEST_DEEP_COUNT)) {
return; return;
} }
*doing_io = TRUE; *doing_io = TRUE;
...@@ -3093,7 +3027,7 @@ mime_list_stop (NautilusDirectory *directory) ...@@ -3093,7 +3027,7 @@ mime_list_stop (NautilusDirectory *directory)
g_assert (file->details->directory == directory); g_assert (file->details->directory == directory);
if (is_needy (file, if (is_needy (file,
should_get_mime_list, should_get_mime_list,
wants_mime_list)) { REQUEST_MIME_LIST)) {
return; return;
} }
} }
...@@ -3291,7 +3225,7 @@ mime_list_start (NautilusDirectory *directory, ...@@ -3291,7 +3225,7 @@ mime_list_start (NautilusDirectory *directory,
/* Figure out which file to get a mime list for. */ /* Figure out which file to get a mime list for. */
if (!is_needy (file, if (!is_needy (file,
should_get_mime_list, should_get_mime_list,
wants_mime_list)) { REQUEST_MIME_LIST)) {
return; return;
} }
*doing_io = TRUE; *doing_io = TRUE;
...@@ -3351,10 +3285,10 @@ top_left_stop (NautilusDirectory *directory) ...@@ -3351,10 +3285,10 @@ top_left_stop (NautilusDirectory *directory)
g_assert (file->details->directory == directory); g_assert (file->details->directory == directory);
if (is_needy (file, if (is_needy (file,
lacks_top_left, lacks_top_left,
wants_top_left) || REQUEST_TOP_LEFT_TEXT) ||
is_needy (file, is_needy (file,
lacks_large_top_left, lacks_large_top_left,
wants_large_top_left)) { REQUEST_LARGE_TOP_LEFT_TEXT)) {
return; return;
} }
} }
...@@ -3472,7 +3406,7 @@ top_left_start (NautilusDirectory *directory, ...@@ -3472,7 +3406,7 @@ top_left_start (NautilusDirectory *directory,
if (is_needy (file, if (is_needy (file,
lacks_large_top_left, lacks_large_top_left,
wants_large_top_left)) { REQUEST_LARGE_TOP_LEFT_TEXT)) {
needs_large = TRUE; needs_large = TRUE;
} }
...@@ -3480,7 +3414,7 @@ top_left_start (NautilusDirectory *directory, ...@@ -3480,7 +3414,7 @@ top_left_start (NautilusDirectory *directory,
if (!(needs_large || if (!(needs_large ||
is_needy (file, is_needy (file,
lacks_top_left, lacks_top_left,
wants_top_left))) { REQUEST_TOP_LEFT_TEXT))) {
return; return;
} }
*doing_io = TRUE; *doing_io = TRUE;
...@@ -3596,7 +3530,7 @@ file_info_stop (NautilusDirectory *directory) ...@@ -3596,7 +3530,7 @@ file_info_stop (NautilusDirectory *directory)
if (file != NULL) { if (file != NULL) {
g_assert (NAUTILUS_IS_FILE (file)); g_assert (NAUTILUS_IS_FILE (file));
g_assert (file->details->directory == directory); g_assert (file->details->directory == directory);
if (is_needy (file, lacks_info, wants_info)) { if (is_needy (file, lacks_info, REQUEST_FILE_INFO)) {
return; return;
} }
} }
...@@ -3621,7 +3555,7 @@ file_info_start (NautilusDirectory *directory, ...@@ -3621,7 +3555,7 @@ file_info_start (NautilusDirectory *directory,
return; return;
} }
if (!is_needy (file, lacks_info, wants_info)) { if (!is_needy (file, lacks_info, REQUEST_FILE_INFO)) {
return; return;
} }
*doing_io = TRUE; *doing_io = TRUE;
...@@ -3703,7 +3637,7 @@ link_info_stop (NautilusDirectory *directory) ...@@ -3703,7 +3637,7 @@ link_info_stop (NautilusDirectory *directory)
g_assert (file->details->directory == directory); g_assert (file->details->directory == directory);
if (is_needy (file, if (is_needy (file,
lacks_link_info, lacks_link_info,
wants_link_info)) { REQUEST_LINK_INFO)) {
return; return;
} }
} }
...@@ -3818,7 +3752,7 @@ link_info_start (NautilusDirectory *directory, ...@@ -3818,7 +3752,7 @@ link_info_start (NautilusDirectory *directory,
if (!is_needy (file, if (!is_needy (file,
lacks_link_info, lacks_link_info,
wants_link_info)) { REQUEST_LINK_INFO)) {
return; return;
} }
*doing_io = TRUE; *doing_io = TRUE;
...@@ -3902,7 +3836,7 @@ thumbnail_stop (NautilusDirectory *directory) ...@@ -3902,7 +3836,7 @@ thumbnail_stop (NautilusDirectory *directory)
g_assert (file->details->directory == directory); g_assert (file->details->directory == directory);
if (is_needy (file, if (is_needy (file,
lacks_thumbnail, lacks_thumbnail,
wants_thumbnail)) { REQUEST_THUMBNAIL)) {
return; return;
} }
} }
...@@ -4078,7 +4012,7 @@ thumbnail_start (NautilusDirectory *directory, ...@@ -4078,7 +4012,7 @@ thumbnail_start (NautilusDirectory *directory,
if (!is_needy (file, if (!is_needy (file,
lacks_thumbnail, lacks_thumbnail,
wants_thumbnail)) { REQUEST_THUMBNAIL)) {
return; return;
} }
*doing_io = TRUE; *doing_io = TRUE;
...@@ -4122,7 +4056,7 @@ mount_stop (NautilusDirectory *directory) ...@@ -4122,7 +4056,7 @@ mount_stop (NautilusDirectory *directory)
g_assert (file->details->directory == directory); g_assert (file->details->directory == directory);
if (is_needy (file, if (is_needy (file,
lacks_mount, lacks_mount,
wants_mount)) { REQUEST_MOUNT)) {
return; return;
} }
} }
...@@ -4255,7 +4189,7 @@ mount_start (NautilusDirectory *directory, ...@@ -4255,7 +4189,7 @@ mount_start (NautilusDirectory *directory,
if (!is_needy (file, if (!is_needy (file,
lacks_mount, lacks_mount,
wants_mount)) { REQUEST_MOUNT)) {
return; return;
} }
*doing_io = TRUE; *doing_io = TRUE;
...@@ -4323,7 +4257,7 @@ filesystem_info_stop (NautilusDirectory *directory) ...@@ -4323,7 +4257,7 @@ filesystem_info_stop (NautilusDirectory *directory)
g_assert (file->details->directory == directory); g_assert (file->details->directory == directory);
if (is_needy (file, if (is_needy (file,
lacks_filesystem_info, lacks_filesystem_info,
wants_filesystem_info)) { REQUEST_FILESYSTEM_INFO)) {
return; return;
} }
} }
...@@ -4412,7 +4346,7 @@ filesystem_info_start (NautilusDirectory *directory, ...@@ -4412,7 +4346,7 @@ filesystem_info_start (NautilusDirectory *directory,
if (!is_needy (file, if (!is_needy (file,
lacks_filesystem_info, lacks_filesystem_info,
wants_filesystem_info)) { REQUEST_FILESYSTEM_INFO)) {
return; return;
} }
*doing_io = TRUE; *doing_io = TRUE;
...@@ -4471,7 +4405,7 @@ extension_info_stop (NautilusDirectory *directory) ...@@ -4471,7 +4405,7 @@ extension_info_stop (NautilusDirectory *directory)
if (file != NULL) { if (file != NULL) {
g_assert (NAUTILUS_IS_FILE (file)); g_assert (NAUTILUS_IS_FILE (file));
g_assert (file->details->directory == directory); g_assert (file->details->directory == directory);
if (is_needy (file, lacks_extension_info, wants_extension_info)) { if (is_needy (file, lacks_extension_info, REQUEST_EXTENSION_INFO)) {
return; return;
} }
} }
...@@ -4563,7 +4497,7 @@ extension_info_start (NautilusDirectory *directory, ...@@ -4563,7 +4497,7 @@ extension_info_start (NautilusDirectory *directory,
return; return;
} }
if (!is_needy (file, lacks_extension_info, wants_extension_info)) { if (!is_needy (file, lacks_extension_info, REQUEST_EXTENSION_INFO)) {
return; return;
} }
*doing_io = TRUE; *doing_io = TRUE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment