Skip to content

Commit

Permalink
Prefer internal ViewFile submodule functions
Browse files Browse the repository at this point in the history
Avoid redundant type checks.
  • Loading branch information
qarkai authored and caclark committed Apr 22, 2024
1 parent d0fb546 commit 523a149
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions src/view-file/view-file-icon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void vficon_pop_menu_show_star_rating_cb(ViewFile *vf)

void vficon_pop_menu_refresh_cb(ViewFile *vf)
{
vf_refresh(vf);
vficon_refresh(vf);
}

void vficon_popup_destroy_cb(ViewFile *vf)
Expand Down Expand Up @@ -466,7 +466,7 @@ void vficon_dnd_end(ViewFile *vf, GdkDragContext *context)

if (gdk_drag_context_get_selected_action(context) == GDK_ACTION_MOVE)
{
vf_refresh(vf);
vficon_refresh(vf);
}

tip_unschedule(vf);
Expand Down Expand Up @@ -803,7 +803,7 @@ void vficon_select_by_fd(ViewFile *vf, FileData *fd)

if (!(fd->selected & SELECTION_SELECTED))
{
vf_select_none(vf);
vficon_select_none(vf);
vficon_select(vf, fd);
}

Expand Down Expand Up @@ -875,7 +875,7 @@ void vficon_selection_to_mark(ViewFile *vf, gint mark, SelectionToMarkMode mode)

g_assert(mark >= 1 && mark <= FILEDATA_MARKS_SIZE);

slist = vf_selection_get_list(vf);
slist = vficon_selection_get_list(vf);
work = slist;
while (work)
{
Expand Down Expand Up @@ -1153,7 +1153,7 @@ gboolean vficon_press_key_cb(ViewFile *vf, GtkWidget *widget, GdkEventKey *event
}
else
{
vf_select_none(vf);
vficon_select_none(vf);
vficon_select(vf, fd);
vficon_send_layout_select(vf, fd);
}
Expand Down Expand Up @@ -1205,7 +1205,7 @@ gboolean vficon_press_key_cb(ViewFile *vf, GtkWidget *widget, GdkEventKey *event
else
{
vf->click_fd = new_fd;
vf_select_none(vf);
vficon_select_none(vf);
vficon_select(vf, new_fd);
vficon_send_layout_select(vf, new_fd);
}
Expand Down Expand Up @@ -1333,7 +1333,7 @@ gboolean vficon_release_cb(ViewFile *vf, GtkWidget *widget, GdkEventButton *beve
}
else
{
vf_select_none(vf);
vficon_select_none(vf);

if ((bevent->state & GDK_SHIFT_MASK) && VFICON(vf)->prev_selection)
{
Expand Down Expand Up @@ -1597,7 +1597,7 @@ void vficon_sort_set(ViewFile *vf, SortType type, gboolean ascend, gboolean case

if (!vf->list) return;

vf_refresh(vf);
vficon_refresh(vf);
}

/*
Expand Down
10 changes: 5 additions & 5 deletions src/view-file/view-file-list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ void vflist_dnd_begin(ViewFile *vf, GtkWidget *widget, GdkDragContext *context)
guint items;

if (vflist_row_is_selected(vf, vf->click_fd))
items = vf_selection_count(vf, nullptr);
items = vflist_selection_count(vf, nullptr);
else
items = 1;

Expand All @@ -243,7 +243,7 @@ void vflist_dnd_end(ViewFile *vf, GdkDragContext *context)

if (gdk_drag_context_get_selected_action(context) == GDK_ACTION_MOVE)
{
vf_refresh(vf);
vflist_refresh(vf);
}
}

Expand Down Expand Up @@ -379,7 +379,7 @@ void vflist_pop_menu_show_star_rating_cb(ViewFile *vf)
void vflist_pop_menu_refresh_cb(ViewFile *vf)
{
vflist_color_set(vf, vf->click_fd, FALSE);
vf_refresh(vf);
vflist_refresh(vf);
gtk_tree_view_columns_autosize(GTK_TREE_VIEW(vf->listview));
}

Expand Down Expand Up @@ -1999,7 +1999,7 @@ gboolean vflist_set_fd(ViewFile *vf, FileData *dir_fd)
filelist_free(vf->list);
vf->list = nullptr;

ret = vf_refresh(vf);
ret = vflist_refresh(vf);
gtk_tree_view_columns_autosize(GTK_TREE_VIEW(vf->listview));
return ret;
}
Expand Down Expand Up @@ -2104,7 +2104,7 @@ void vflist_thumb_set(ViewFile *vf, gboolean enable)

VFLIST(vf)->thumbs_enabled = enable;

/* vflist_populate_view is better than vf_refresh:
/* vflist_populate_view is better than vflist_refresh:
- no need to re-read the directory
- force update because the formatted string has changed
*/
Expand Down

0 comments on commit 523a149

Please sign in to comment.