From 523a1493c2a79d6e0a90383277eb239e1b28468d Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Sun, 21 Apr 2024 21:09:30 +0300 Subject: [PATCH] Prefer internal ViewFile submodule functions Avoid redundant type checks. --- src/view-file/view-file-icon.cc | 16 ++++++++-------- src/view-file/view-file-list.cc | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/view-file/view-file-icon.cc b/src/view-file/view-file-icon.cc index 722680c4b..1eedd5f40 100644 --- a/src/view-file/view-file-icon.cc +++ b/src/view-file/view-file-icon.cc @@ -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) @@ -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); @@ -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); } @@ -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) { @@ -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); } @@ -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); } @@ -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) { @@ -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); } /* diff --git a/src/view-file/view-file-list.cc b/src/view-file/view-file-list.cc index 6a74e4071..32c2f131e 100644 --- a/src/view-file/view-file-list.cc +++ b/src/view-file/view-file-list.cc @@ -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; @@ -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); } } @@ -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)); } @@ -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; } @@ -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 */