summaryrefslogtreecommitdiff
path: root/src/nautilus-files-view.c
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2018-10-20 20:37:42 +0100
committerAntónio Fernandes <antoniof@gnome.org>2018-11-22 13:33:52 +0000
commit61e772e33460b3978f81fb56ce765f7e1bcbfbb5 (patch)
treea42425c781d5165243ddc5ffeb6ac8f1e7cc98ef /src/nautilus-files-view.c
parent5ef85de45ca9f6a297071f6f3982f9b56e97fa56 (diff)
downloadnautilus-61e772e33460b3978f81fb56ce765f7e1bcbfbb5.tar.gz
files-view: Use FileAndDirectory more
The still_should_show_file() function is only ever meant to take the fields of a FileAndDirectory as arguments. This makes its call lines too wide. Pass it a pointer to the FileAndDirectory struct instead to simplify.
Diffstat (limited to 'src/nautilus-files-view.c')
-rw-r--r--src/nautilus-files-view.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index fef204eed..3630f9226 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -3864,29 +3864,27 @@ copy_move_done_callback (GHashTable *debuting_files,
static gboolean
view_file_still_belongs (NautilusFilesView *view,
- NautilusFile *file,
- NautilusDirectory *directory)
+ FileAndDirectory *fad)
{
NautilusFilesViewPrivate *priv;
priv = nautilus_files_view_get_instance_private (view);
- if (priv->model != directory &&
- g_list_find (priv->subdirectory_list, directory) == NULL)
+ if (priv->model != fad->directory &&
+ g_list_find (priv->subdirectory_list, fad->directory) == NULL)
{
return FALSE;
}
- return nautilus_directory_contains_file (directory, file);
+ return nautilus_directory_contains_file (fad->directory, fad->file);
}
static gboolean
still_should_show_file (NautilusFilesView *view,
- NautilusFile *file,
- NautilusDirectory *directory)
+ FileAndDirectory *fad)
{
- return nautilus_files_view_should_show_file (view, file) &&
- view_file_still_belongs (view, file, directory);
+ return nautilus_files_view_should_show_file (view, fad->file) &&
+ view_file_still_belongs (view, fad);
}
static gboolean
@@ -3995,12 +3993,12 @@ process_new_files (NautilusFilesView *view)
{
next = node->next;
pending = (FileAndDirectory *) node->data;
- if (!still_should_show_file (view, pending->file, pending->directory) || ready_to_load (pending->file))
+ if (!still_should_show_file (view, pending) || ready_to_load (pending->file))
{
if (g_hash_table_lookup (non_ready_files, pending) != NULL)
{
g_hash_table_remove (non_ready_files, pending);
- if (still_should_show_file (view, pending->file, pending->directory))
+ if (still_should_show_file (view, pending))
{
new_changed_files = g_list_delete_link (new_changed_files, node);
old_added_files = g_list_prepend (old_added_files, pending);
@@ -4164,7 +4162,7 @@ process_old_files (NautilusFilesView *view)
{
gboolean should_show_file;
pending = node->data;
- should_show_file = still_should_show_file (view, pending->file, pending->directory);
+ should_show_file = still_should_show_file (view, pending);
g_signal_emit (view,
signals[should_show_file ? FILE_CHANGED : REMOVE_FILE], 0,
pending->file, pending->directory);