aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorRoland Knall <rknall@gmail.com>2022-06-28 14:39:27 +0200
committerRoland Knall <r.knall@moba.cc>2022-06-28 14:39:27 +0200
commitf210edeaf04c17da1e209518aae0e009e1164a73 (patch)
treebd23d79e7893bb9ea6a2121db78f6cf8f1bd2d2e /ui
parentef8ed9dff9ae6896228412cf71995df3222e879e (diff)
Ui: Further simplify ws_ui_util
Remove duplicate functionality for jumping to packet and remove unused function to move to the end. Furthermore move the code for redraws of visible packets directly into the calling code
Diffstat (limited to 'ui')
-rw-r--r--ui/logwolf/logwolf_main_window.cpp6
-rw-r--r--ui/logwolf/logwolf_main_window_slots.cpp1
-rw-r--r--ui/qt/packet_list.cpp24
-rw-r--r--ui/qt/wireshark_main_window.cpp6
-rw-r--r--ui/qt/wireshark_main_window_slots.cpp1
-rw-r--r--ui/ws_ui_util.h2
6 files changed, 12 insertions, 28 deletions
diff --git a/ui/logwolf/logwolf_main_window.cpp b/ui/logwolf/logwolf_main_window.cpp
index 789b8e1813..2d5ad64556 100644
--- a/ui/logwolf/logwolf_main_window.cpp
+++ b/ui/logwolf/logwolf_main_window.cpp
@@ -1411,7 +1411,7 @@ bool LogwolfMainWindow::saveCaptureFile(capture_file *cf, bool dont_reopen) {
If we discarded comments, redraw the packet list to reflect
any packets that no longer have comments. */
if (discard_comments)
- packet_list_queue_draw();
+ packet_list_->redrawVisiblePackets();
cf->unsaved_changes = false; //we just saved so we signal that we have no unsaved changes
updateForUnsavedChanges(); // we update the title bar to remove the *
@@ -1525,7 +1525,7 @@ bool LogwolfMainWindow::saveAsCaptureFile(capture_file *cf, bool must_support_co
/* If we discarded comments, redraw the packet list to reflect
any packets that no longer have comments. */
if (discard_comments)
- packet_list_queue_draw();
+ packet_list_->redrawVisiblePackets();
cf->unsaved_changes = false; //we just saved so we signal that we have no unsaved changes
updateForUnsavedChanges(); // we update the title bar to remove the *
@@ -1667,7 +1667,7 @@ void LogwolfMainWindow::exportSelectedPackets() {
/* If we discarded comments, redraw the packet list to reflect
any packets that no longer have comments. */
if (discard_comments)
- packet_list_queue_draw();
+ packet_list_->redrawVisiblePackets();
/* Add this filename to the list of recent files in the "Recent Files" submenu */
add_menu_recent_capture_file(qUtf8Printable(file_name));
goto cleanup;
diff --git a/ui/logwolf/logwolf_main_window_slots.cpp b/ui/logwolf/logwolf_main_window_slots.cpp
index 1ce7a0cff1..e9900a1f8f 100644
--- a/ui/logwolf/logwolf_main_window_slots.cpp
+++ b/ui/logwolf/logwolf_main_window_slots.cpp
@@ -2367,7 +2367,6 @@ void LogwolfMainWindow::setTimestampPrecision(QAction *action)
}
ts_precision tsp = action->data().value<ts_precision>();
if (recent.gui_time_precision != tsp) {
- /* the actual precision will be set in packet_list_queue_draw() below */
timestamp_set_precision(tsp);
recent.gui_time_precision = tsp;
diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp
index c22e5202b1..3855f0a23b 100644
--- a/ui/qt/packet_list.cpp
+++ b/ui/qt/packet_list.cpp
@@ -98,15 +98,6 @@ const int tail_update_interval_ = 100; // Milliseconds.
const int overlay_update_interval_ = 100; // 250; // Milliseconds.
-// Copied from ui/gtk/packet_list.c
-void
-packet_list_select_first_row(void)
-{
- if (!gbl_cur_packet_list)
- return;
- gbl_cur_packet_list->goFirstPacket(false);
-}
-
/*
* Given a frame_data structure, scroll to and select the row in the
* packet list corresponding to that frame. If there is no such
@@ -124,7 +115,12 @@ packet_list_select_row_from_data(frame_data *fdata_needle)
return FALSE;
model->flushVisibleRows();
- int row = model->visibleIndexOf(fdata_needle);
+ int row = -1;
+ if (!fdata_needle)
+ row = 0;
+ else
+ row = model->visibleIndexOf(fdata_needle);
+
if (row >= 0) {
/* Calling ClearAndSelect with setCurrentIndex clears the "current"
* item, but doesn't clear the "selected" item. We want to clear
@@ -175,14 +171,6 @@ packet_list_get_row_data(gint row)
return NULL;
}
-// Called from cf_continue_tail and cf_finish_tail when auto_scroll_live
-// is enabled.
-void
-packet_list_moveto_end(void)
-{
- // gbl_cur_packet_list->scrollToBottom();
-}
-
/* Redraw the packet list *and* currently-selected detail */
void
packet_list_queue_draw(void)
diff --git a/ui/qt/wireshark_main_window.cpp b/ui/qt/wireshark_main_window.cpp
index 1e74722ceb..0779159fc7 100644
--- a/ui/qt/wireshark_main_window.cpp
+++ b/ui/qt/wireshark_main_window.cpp
@@ -1442,7 +1442,7 @@ bool WiresharkMainWindow::saveCaptureFile(capture_file *cf, bool dont_reopen) {
If we discarded comments, redraw the packet list to reflect
any packets that no longer have comments. */
if (discard_comments)
- packet_list_queue_draw();
+ packet_list_->redrawVisiblePackets();
cf->unsaved_changes = false; //we just saved so we signal that we have no unsaved changes
updateForUnsavedChanges(); // we update the title bar to remove the *
@@ -1556,7 +1556,7 @@ bool WiresharkMainWindow::saveAsCaptureFile(capture_file *cf, bool must_support_
/* If we discarded comments, redraw the packet list to reflect
any packets that no longer have comments. */
if (discard_comments)
- packet_list_queue_draw();
+ packet_list_->redrawVisiblePackets();
cf->unsaved_changes = false; //we just saved so we signal that we have no unsaved changes
updateForUnsavedChanges(); // we update the title bar to remove the *
@@ -1698,7 +1698,7 @@ void WiresharkMainWindow::exportSelectedPackets() {
/* If we discarded comments, redraw the packet list to reflect
any packets that no longer have comments. */
if (discard_comments)
- packet_list_queue_draw();
+ packet_list_->redrawVisiblePackets();
/* Add this filename to the list of recent files in the "Recent Files" submenu */
add_menu_recent_capture_file(qUtf8Printable(file_name));
goto cleanup;
diff --git a/ui/qt/wireshark_main_window_slots.cpp b/ui/qt/wireshark_main_window_slots.cpp
index 6104438eb6..93d4369dc2 100644
--- a/ui/qt/wireshark_main_window_slots.cpp
+++ b/ui/qt/wireshark_main_window_slots.cpp
@@ -2538,7 +2538,6 @@ void WiresharkMainWindow::setTimestampPrecision(QAction *action)
}
ts_precision tsp = action->data().value<ts_precision>();
if (recent.gui_time_precision != tsp) {
- /* the actual precision will be set in packet_list_queue_draw() below */
timestamp_set_precision(tsp);
recent.gui_time_precision = tsp;
diff --git a/ui/ws_ui_util.h b/ui/ws_ui_util.h
index 46545e396e..85038d026d 100644
--- a/ui/ws_ui_util.h
+++ b/ui/ws_ui_util.h
@@ -61,8 +61,6 @@ void packet_list_thaw(void);
guint packet_list_append(column_info *cinfo, frame_data *fdata);
frame_data *packet_list_get_row_data(gint row);
void packet_list_queue_draw(void);
-void packet_list_select_first_row(void);
-void packet_list_moveto_end(void);
gboolean packet_list_select_row_from_data(frame_data *fdata_needle);
gboolean packet_list_multi_select_active(void);