aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Knall <rknall@gmail.com>2018-03-28 10:04:50 +0200
committerRoland Knall <rknall@gmail.com>2018-04-17 13:16:46 +0000
commit57bf7e43470f9dc4129a21395a67b5a9b6c959ca (patch)
tree18b26038621137bf918f9466f5adaffa96d08134
parentfebaa4f119458c3754580d9c847da13c458345be (diff)
Qt: Fix memory leak for CaptureEvent
Make the argument to the events a non-memory object Change-Id: I46d8c24415aa2bc48b2a2d3b1fccffa6956d08b5 Reviewed-on: https://code.wireshark.org/review/26671 Reviewed-by: Roland Knall <rknall@gmail.com>
-rw-r--r--ui/qt/capture_file.cpp62
-rw-r--r--ui/qt/capture_file.h8
-rw-r--r--ui/qt/expert_info_dialog.cpp10
-rw-r--r--ui/qt/expert_info_dialog.h2
-rw-r--r--ui/qt/export_object_action.cpp8
-rw-r--r--ui/qt/export_object_action.h2
-rw-r--r--ui/qt/export_object_dialog.cpp6
-rw-r--r--ui/qt/export_object_dialog.h2
-rw-r--r--ui/qt/follow_stream_dialog.cpp6
-rw-r--r--ui/qt/follow_stream_dialog.h2
-rw-r--r--ui/qt/iax2_analysis_dialog.cpp6
-rw-r--r--ui/qt/iax2_analysis_dialog.h2
-rw-r--r--ui/qt/io_graph_dialog.cpp6
-rw-r--r--ui/qt/io_graph_dialog.h2
-rw-r--r--ui/qt/main_status_bar.cpp14
-rw-r--r--ui/qt/main_status_bar.h2
-rw-r--r--ui/qt/main_window.cpp12
-rw-r--r--ui/qt/main_window.h2
-rw-r--r--ui/qt/main_window_slots.cpp34
-rw-r--r--ui/qt/multicast_statistics_dialog.cpp6
-rw-r--r--ui/qt/multicast_statistics_dialog.h2
-rw-r--r--ui/qt/traffic_table_dialog.cpp6
-rw-r--r--ui/qt/traffic_table_dialog.h2
-rw-r--r--ui/qt/wireshark_application.cpp8
-rw-r--r--ui/qt/wireshark_application.h2
-rw-r--r--ui/qt/wireshark_dialog.cpp8
-rw-r--r--ui/qt/wireshark_dialog.h2
27 files changed, 117 insertions, 107 deletions
diff --git a/ui/qt/capture_file.cpp b/ui/qt/capture_file.cpp
index 69d502b..63121ef 100644
--- a/ui/qt/capture_file.cpp
+++ b/ui/qt/capture_file.cpp
@@ -53,6 +53,14 @@ CaptureEvent::CaptureEvent(Context ctx, EventType evt, capture_session * session
qDebug() << "CaptureEvent [" << ctx <<"]: " << evt << " with session";
}
+CaptureEvent::CaptureEvent(const CaptureEvent &ce)
+{
+ _ctx = ce._ctx;
+ _evt = ce._evt;
+ _session = ce._session;
+ _filePath = ce._filePath;
+}
+
CaptureEvent::Context CaptureEvent::captureContext() const
{ return _ctx; }
@@ -195,50 +203,50 @@ void CaptureFile::captureFileEvent(int event, gpointer data)
switch(event) {
case(cf_cb_file_opened):
cap_file_ = (capture_file *) data;
- emit captureEvent(new CaptureEvent(CaptureEvent::File, CaptureEvent::Opened));
+ emit captureEvent(CaptureEvent(CaptureEvent::File, CaptureEvent::Opened));
break;
case(cf_cb_file_closing):
file_state_ = tr(" [closing]");
- emit captureEvent(new CaptureEvent(CaptureEvent::File, CaptureEvent::Closing));
+ emit captureEvent(CaptureEvent(CaptureEvent::File, CaptureEvent::Closing));
break;
case(cf_cb_file_closed):
file_state_ = tr(" [closed]");
- emit captureEvent(new CaptureEvent(CaptureEvent::File, CaptureEvent::Closed));
+ emit captureEvent(CaptureEvent(CaptureEvent::File, CaptureEvent::Closed));
cap_file_ = NULL;
file_name_ = no_capture_file_;
file_state_ = QString();
break;
case(cf_cb_file_read_started):
- emit captureEvent(new CaptureEvent(CaptureEvent::File, CaptureEvent::Started));
+ emit captureEvent(CaptureEvent(CaptureEvent::File, CaptureEvent::Started));
break;
case(cf_cb_file_read_finished):
- emit captureEvent(new CaptureEvent(CaptureEvent::File, CaptureEvent::Finished));
+ emit captureEvent(CaptureEvent(CaptureEvent::File, CaptureEvent::Finished));
break;
case(cf_cb_file_reload_started):
- emit captureEvent(new CaptureEvent(CaptureEvent::Reload, CaptureEvent::Started));
+ emit captureEvent(CaptureEvent(CaptureEvent::Reload, CaptureEvent::Started));
break;
case(cf_cb_file_reload_finished):
- emit captureEvent(new CaptureEvent(CaptureEvent::Reload, CaptureEvent::Finished));
+ emit captureEvent(CaptureEvent(CaptureEvent::Reload, CaptureEvent::Finished));
break;
case(cf_cb_file_rescan_started):
- emit captureEvent(new CaptureEvent(CaptureEvent::Rescan, CaptureEvent::Started));
+ emit captureEvent(CaptureEvent(CaptureEvent::Rescan, CaptureEvent::Started));
break;
case(cf_cb_file_rescan_finished):
- emit captureEvent(new CaptureEvent(CaptureEvent::Rescan, CaptureEvent::Finished));
+ emit captureEvent(CaptureEvent(CaptureEvent::Rescan, CaptureEvent::Finished));
break;
case(cf_cb_file_retap_started):
- emit captureEvent(new CaptureEvent(CaptureEvent::Retap, CaptureEvent::Started));
+ emit captureEvent(CaptureEvent(CaptureEvent::Retap, CaptureEvent::Started));
break;
case(cf_cb_file_retap_finished):
/* Flush any pending tapped packet before emitting captureFileRetapFinished() */
- emit captureEvent(new CaptureEvent(CaptureEvent::Retap, CaptureEvent::Finished));
- emit captureEvent(new CaptureEvent(CaptureEvent::Retap, CaptureEvent::Flushed));
+ emit captureEvent(CaptureEvent(CaptureEvent::Retap, CaptureEvent::Finished));
+ emit captureEvent(CaptureEvent(CaptureEvent::Retap, CaptureEvent::Flushed));
break;
case(cf_cb_file_merge_started):
- emit captureEvent(new CaptureEvent(CaptureEvent::Merge, CaptureEvent::Started));
+ emit captureEvent(CaptureEvent(CaptureEvent::Merge, CaptureEvent::Started));
break;
case(cf_cb_file_merge_finished):
- emit captureEvent(new CaptureEvent(CaptureEvent::Merge, CaptureEvent::Finished));
+ emit captureEvent(CaptureEvent(CaptureEvent::Merge, CaptureEvent::Finished));
break;
case(cf_cb_file_fast_save_finished):
@@ -248,17 +256,17 @@ void CaptureFile::captureFileEvent(int event, gpointer data)
case(cf_cb_file_save_started):
{
- emit captureEvent(new CaptureEvent(CaptureEvent::Save, CaptureEvent::Started, QString((const char *)data)));
+ emit captureEvent(CaptureEvent(CaptureEvent::Save, CaptureEvent::Started, QString((const char *)data)));
break;
}
case(cf_cb_file_save_finished):
- emit captureEvent(new CaptureEvent(CaptureEvent::Save, CaptureEvent::Finished));
+ emit captureEvent(CaptureEvent(CaptureEvent::Save, CaptureEvent::Finished));
break;
case(cf_cb_file_save_failed):
- emit captureEvent(new CaptureEvent(CaptureEvent::Save, CaptureEvent::Failed));
+ emit captureEvent(CaptureEvent(CaptureEvent::Save, CaptureEvent::Failed));
break;
case(cf_cb_file_save_stopped):
- emit captureEvent(new CaptureEvent(CaptureEvent::Save, CaptureEvent::Stopped));
+ emit captureEvent(CaptureEvent(CaptureEvent::Save, CaptureEvent::Stopped));
break;
default:
@@ -276,34 +284,34 @@ void CaptureFile::captureSessionEvent(int event, capture_session *cap_session)
#else
switch(event) {
case(capture_cb_capture_prepared):
- emit captureEvent(new CaptureEvent(CaptureEvent::Capture, CaptureEvent::Prepared, cap_session));
+ emit captureEvent(CaptureEvent(CaptureEvent::Capture, CaptureEvent::Prepared, cap_session));
cap_file_ = cap_session->cf;
break;
case(capture_cb_capture_update_started):
- emit captureEvent(new CaptureEvent(CaptureEvent::Update, CaptureEvent::Started, cap_session));
+ emit captureEvent(CaptureEvent(CaptureEvent::Update, CaptureEvent::Started, cap_session));
break;
case(capture_cb_capture_update_continue):
- emit captureEvent(new CaptureEvent(CaptureEvent::Update, CaptureEvent::Continued, cap_session));
+ emit captureEvent(CaptureEvent(CaptureEvent::Update, CaptureEvent::Continued, cap_session));
break;
case(capture_cb_capture_update_finished):
- emit captureEvent(new CaptureEvent(CaptureEvent::Update, CaptureEvent::Finished, cap_session));
+ emit captureEvent(CaptureEvent(CaptureEvent::Update, CaptureEvent::Finished, cap_session));
break;
case(capture_cb_capture_fixed_started):
- emit captureEvent(new CaptureEvent(CaptureEvent::Fixed, CaptureEvent::Started, cap_session));
+ emit captureEvent(CaptureEvent(CaptureEvent::Fixed, CaptureEvent::Started, cap_session));
break;
case(capture_cb_capture_fixed_continue):
- emit captureEvent(new CaptureEvent(CaptureEvent::Fixed, CaptureEvent::Continued, cap_session));
+ emit captureEvent(CaptureEvent(CaptureEvent::Fixed, CaptureEvent::Continued, cap_session));
break;
case(capture_cb_capture_fixed_finished):
- emit captureEvent(new CaptureEvent(CaptureEvent::Fixed, CaptureEvent::Finished, cap_session));
+ emit captureEvent(CaptureEvent(CaptureEvent::Fixed, CaptureEvent::Finished, cap_session));
break;
case(capture_cb_capture_stopping):
/* Beware: this state won't be called, if the capture child
* closes the capturing on it's own! */
- emit captureEvent(new CaptureEvent(CaptureEvent::Capture, CaptureEvent::Stopping, cap_session));
+ emit captureEvent(CaptureEvent(CaptureEvent::Capture, CaptureEvent::Stopping, cap_session));
break;
case(capture_cb_capture_failed):
- emit captureEvent(new CaptureEvent(CaptureEvent::Capture, CaptureEvent::Failed, cap_session));
+ emit captureEvent(CaptureEvent(CaptureEvent::Capture, CaptureEvent::Failed, cap_session));
break;
default:
qWarning() << "main_capture_callback: event " << event << " unknown";
diff --git a/ui/qt/capture_file.h b/ui/qt/capture_file.h
index a6a75f6..cf5e367 100644
--- a/ui/qt/capture_file.h
+++ b/ui/qt/capture_file.h
@@ -22,9 +22,9 @@ typedef struct _capture_session capture_session;
struct _packet_info;
-class CaptureEvent : public QObject
+class CaptureEvent
{
- Q_OBJECT
+
public:
enum Context {
#ifdef HAVE_LIBPCAP
@@ -58,6 +58,8 @@ public:
CaptureEvent(Context ctx, EventType evt, QString file);
CaptureEvent(Context ctx, EventType evt, capture_session * session);
+ CaptureEvent(const CaptureEvent &ce);
+
Context captureContext() const;
EventType eventType() const;
QString filePath() const;
@@ -129,7 +131,7 @@ public:
gpointer window();
signals:
- void captureEvent(CaptureEvent *);
+ void captureEvent(CaptureEvent);
public slots:
/** Retap the capture file. Convenience wrapper for cf_retap_packets.
diff --git a/ui/qt/expert_info_dialog.cpp b/ui/qt/expert_info_dialog.cpp
index c6aa2c7..5b7407e 100644
--- a/ui/qt/expert_info_dialog.cpp
+++ b/ui/qt/expert_info_dialog.cpp
@@ -102,8 +102,8 @@ ExpertInfoDialog::ExpertInfoDialog(QWidget &parent, CaptureFile &capture_file) :
ctx_menu_.addAction(expand);
connect(expand, SIGNAL(triggered()), this, SLOT(expandTree()));
- connect(&cap_file_, SIGNAL(captureEvent(CaptureEvent *)),
- this, SLOT(captureEvent(CaptureEvent *)));
+ connect(&cap_file_, SIGNAL(captureEvent(CaptureEvent)),
+ this, SLOT(captureEvent(CaptureEvent)));
setDisplayFilter();
QTimer::singleShot(0, this, SLOT(retapPackets()));
}
@@ -151,11 +151,11 @@ void ExpertInfoDialog::retapPackets()
cap_file_.retapPackets();
}
-void ExpertInfoDialog::captureEvent(CaptureEvent *e)
+void ExpertInfoDialog::captureEvent(CaptureEvent e)
{
- if (e->captureContext() == CaptureEvent::Retap)
+ if (e.captureContext() == CaptureEvent::Retap)
{
- switch (e->eventType())
+ switch (e.eventType())
{
case CaptureEvent::Started:
ui->limitCheckBox->setEnabled(false);
diff --git a/ui/qt/expert_info_dialog.h b/ui/qt/expert_info_dialog.h
index 0840a57..0caa6ca 100644
--- a/ui/qt/expert_info_dialog.h
+++ b/ui/qt/expert_info_dialog.h
@@ -53,7 +53,7 @@ private:
private slots:
void retapPackets();
- void captureEvent(CaptureEvent *e);
+ void captureEvent(CaptureEvent e);
void updateWidgets();
diff --git a/ui/qt/export_object_action.cpp b/ui/qt/export_object_action.cpp
index 0ed8fe6..1ed7e0b 100644
--- a/ui/qt/export_object_action.cpp
+++ b/ui/qt/export_object_action.cpp
@@ -28,13 +28,13 @@ ExportObjectAction::ExportObjectAction(QObject *parent, register_eo_t *eo) :
}
}
-void ExportObjectAction::captureFileEvent(CaptureEvent *e)
+void ExportObjectAction::captureFileEvent(CaptureEvent e)
{
- if ( e->captureContext() == CaptureEvent::File )
+ if ( e.captureContext() == CaptureEvent::File )
{
- if ( e->eventType() == CaptureEvent::Opened )
+ if ( e.eventType() == CaptureEvent::Opened )
setEnabled(true);
- else if ( e->eventType() == CaptureEvent::Closed )
+ else if ( e.eventType() == CaptureEvent::Closed )
setEnabled(false);
}
}
diff --git a/ui/qt/export_object_action.h b/ui/qt/export_object_action.h
index 077d979..1b02eeb 100644
--- a/ui/qt/export_object_action.h
+++ b/ui/qt/export_object_action.h
@@ -30,7 +30,7 @@ public:
register_eo_t* exportObject() {return eo_;}
public slots:
- void captureFileEvent(CaptureEvent *e);
+ void captureFileEvent(CaptureEvent e);
private:
register_eo_t *eo_;
diff --git a/ui/qt/export_object_dialog.cpp b/ui/qt/export_object_dialog.cpp
index f005799..da0b05f 100644
--- a/ui/qt/export_object_dialog.cpp
+++ b/ui/qt/export_object_dialog.cpp
@@ -113,10 +113,10 @@ void ExportObjectDialog::accept()
// Don't close the dialog.
}
-void ExportObjectDialog::captureEvent(CaptureEvent *e)
+void ExportObjectDialog::captureEvent(CaptureEvent e)
{
- if ((e->captureContext() == CaptureEvent::File) &&
- (e->eventType() == CaptureEvent::Closing))
+ if ((e.captureContext() == CaptureEvent::File) &&
+ (e.eventType() == CaptureEvent::Closing))
{
close();
}
diff --git a/ui/qt/export_object_dialog.h b/ui/qt/export_object_dialog.h
index 5fa8735..178a2cf 100644
--- a/ui/qt/export_object_dialog.h
+++ b/ui/qt/export_object_dialog.h
@@ -41,7 +41,7 @@ public slots:
private slots:
void accept();
- void captureEvent(CaptureEvent *e);
+ void captureEvent(CaptureEvent e);
void on_buttonBox_helpRequested();
void on_buttonBox_clicked(QAbstractButton *button);
diff --git a/ui/qt/follow_stream_dialog.cpp b/ui/qt/follow_stream_dialog.cpp
index 1bd97b0..a9da39e 100644
--- a/ui/qt/follow_stream_dialog.cpp
+++ b/ui/qt/follow_stream_dialog.cpp
@@ -960,10 +960,10 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index,
return true;
}
-void FollowStreamDialog::captureEvent(CaptureEvent *e)
+void FollowStreamDialog::captureEvent(CaptureEvent e)
{
- if ((e->captureContext() == CaptureEvent::File) &&
- (e->eventType() == CaptureEvent::Closing)) {
+ if ((e.captureContext() == CaptureEvent::File) &&
+ (e.eventType() == CaptureEvent::Closing)) {
QString tooltip = tr("File closed.");
ui->streamNumberSpinBox->setToolTip(tooltip);
ui->streamNumberLabel->setToolTip(tooltip);
diff --git a/ui/qt/follow_stream_dialog.h b/ui/qt/follow_stream_dialog.h
index 070c376..df10886 100644
--- a/ui/qt/follow_stream_dialog.h
+++ b/ui/qt/follow_stream_dialog.h
@@ -44,7 +44,7 @@ public:
bool follow(QString previous_filter = QString(), bool use_stream_index = false, int stream_num = -1);
public slots:
- void captureEvent(CaptureEvent *e);
+ void captureEvent(CaptureEvent e);
protected:
bool eventFilter(QObject *obj, QEvent *event);
diff --git a/ui/qt/iax2_analysis_dialog.cpp b/ui/qt/iax2_analysis_dialog.cpp
index 30ea031..ea206cb 100644
--- a/ui/qt/iax2_analysis_dialog.cpp
+++ b/ui/qt/iax2_analysis_dialog.cpp
@@ -415,10 +415,10 @@ Iax2AnalysisDialog::~Iax2AnalysisDialog()
delete rev_tempfile_;
}
-void Iax2AnalysisDialog::captureEvent(CaptureEvent *e)
+void Iax2AnalysisDialog::captureEvent(CaptureEvent e)
{
- if ((e->captureContext() == CaptureEvent::File) &&
- (e->eventType() == CaptureEvent::Closing))
+ if ((e.captureContext() == CaptureEvent::File) &&
+ (e.eventType() == CaptureEvent::Closing))
{
updateWidgets();
}
diff --git a/ui/qt/iax2_analysis_dialog.h b/ui/qt/iax2_analysis_dialog.h
index a29207f..c19a74c 100644
--- a/ui/qt/iax2_analysis_dialog.h
+++ b/ui/qt/iax2_analysis_dialog.h
@@ -54,7 +54,7 @@ signals:
void goToPacket(int packet_num);
protected slots:
- void captureEvent(CaptureEvent *e);
+ void captureEvent(CaptureEvent e);
virtual void updateWidgets();
private slots:
diff --git a/ui/qt/io_graph_dialog.cpp b/ui/qt/io_graph_dialog.cpp
index 0ee85cb..6106e7c 100644
--- a/ui/qt/io_graph_dialog.cpp
+++ b/ui/qt/io_graph_dialog.cpp
@@ -1960,10 +1960,10 @@ void IOGraph::scaleGraphData(DataMap &map, int scalar)
}
}
-void IOGraph::captureEvent(CaptureEvent *e)
+void IOGraph::captureEvent(CaptureEvent e)
{
- if ((e->captureContext() == CaptureEvent::File) &&
- (e->eventType() == CaptureEvent::Closing))
+ if ((e.captureContext() == CaptureEvent::File) &&
+ (e.eventType() == CaptureEvent::Closing))
{
remove_tap_listener(this);
}
diff --git a/ui/qt/io_graph_dialog.h b/ui/qt/io_graph_dialog.h
index 9f85c7e..77a9579 100644
--- a/ui/qt/io_graph_dialog.h
+++ b/ui/qt/io_graph_dialog.h
@@ -79,7 +79,7 @@ public:
public slots:
void recalcGraphData(capture_file *cap_file, bool enable_scaling);
- void captureEvent(CaptureEvent *e);
+ void captureEvent(CaptureEvent e);
void reloadValueUnitField();
signals:
diff --git a/ui/qt/main_status_bar.cpp b/ui/qt/main_status_bar.cpp
index 54ec5ba..8fda4a5 100644
--- a/ui/qt/main_status_bar.cpp
+++ b/ui/qt/main_status_bar.cpp
@@ -632,26 +632,26 @@ void MainStatusBar::manageProfile()
}
}
-void MainStatusBar::captureEventHandler(CaptureEvent * ev)
+void MainStatusBar::captureEventHandler(CaptureEvent ev)
{
- switch(ev->captureContext())
+ switch(ev.captureContext())
{
#ifdef HAVE_LIBPCAP
case CaptureEvent::Update:
- switch ( ev->eventType() )
+ switch ( ev.eventType() )
{
case CaptureEvent::Continued:
- updateCaptureStatistics(ev->capSession());
+ updateCaptureStatistics(ev.capSession());
break;
default:
break;
}
break;
case CaptureEvent::Fixed:
- switch ( ev->eventType() )
+ switch ( ev.eventType() )
{
case CaptureEvent::Continued:
- updateCaptureFixedStatistics(ev->capSession());
+ updateCaptureFixedStatistics(ev.capSession());
break;
default:
break;
@@ -659,7 +659,7 @@ void MainStatusBar::captureEventHandler(CaptureEvent * ev)
break;
#endif
case CaptureEvent::Save:
- switch ( ev->eventType() )
+ switch ( ev.eventType() )
{
case CaptureEvent::Finished:
case CaptureEvent::Failed:
diff --git a/ui/qt/main_status_bar.h b/ui/qt/main_status_bar.h
index c0674d7..79b9f53 100644
--- a/ui/qt/main_status_bar.h
+++ b/ui/qt/main_status_bar.h
@@ -87,7 +87,7 @@ public slots:
void updateCaptureStatistics(capture_session * cap_session);
void updateCaptureFixedStatistics(capture_session * cap_session);
- void captureEventHandler(CaptureEvent *ev);
+ void captureEventHandler(CaptureEvent ev);
private slots:
void pushPacketStatus(const QString &message);
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index 1d5aebf..afbcb2a 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -539,12 +539,12 @@ MainWindow::MainWindow(QWidget *parent) :
setTabOrder(df_combo_box_->lineEdit(), packet_list_);
setTabOrder(packet_list_, proto_tree_);
- connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent *)),
- this, SLOT(captureEventHandler(CaptureEvent *)));
- connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent *)),
- wsApp, SLOT(captureEventHandler(CaptureEvent *)));
- connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent *)),
- main_ui_->statusBar, SLOT(captureEventHandler(CaptureEvent *)));
+ connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent)),
+ this, SLOT(captureEventHandler(CaptureEvent)));
+ connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent)),
+ wsApp, SLOT(captureEventHandler(CaptureEvent)));
+ connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent)),
+ main_ui_->statusBar, SLOT(captureEventHandler(CaptureEvent)));
connect(wsApp, SIGNAL(columnsChanged()),
packet_list_, SLOT(columnsChanged()));
diff --git a/ui/qt/main_window.h b/ui/qt/main_window.h
index daa0bdb..427edce 100644
--- a/ui/qt/main_window.h
+++ b/ui/qt/main_window.h
@@ -331,7 +331,7 @@ public slots:
private slots:
- void captureEventHandler(CaptureEvent * ev);
+ void captureEventHandler(CaptureEvent ev);
// Manually connected slots (no "on_<object>_<signal>").
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp
index ceb1873..95bf870 100644
--- a/ui/qt/main_window_slots.cpp
+++ b/ui/qt/main_window_slots.cpp
@@ -749,12 +749,12 @@ void MainWindow::captureCaptureFailed(capture_session *) {
// Callbacks from cfile.c and file.c via CaptureFile::captureFileCallback
-void MainWindow::captureEventHandler(CaptureEvent * ev)
+void MainWindow::captureEventHandler(CaptureEvent ev)
{
- switch (ev->captureContext()) {
+ switch (ev.captureContext()) {
case CaptureEvent::File:
- switch (ev->eventType()) {
+ switch (ev.eventType()) {
case CaptureEvent::Opened:
captureFileOpened();
break;
@@ -776,7 +776,7 @@ void MainWindow::captureEventHandler(CaptureEvent * ev)
break;
case CaptureEvent::Reload:
- switch (ev->eventType()) {
+ switch (ev.eventType()) {
case CaptureEvent::Started:
captureFileReadStarted(tr("Reloading"));
break;
@@ -789,7 +789,7 @@ void MainWindow::captureEventHandler(CaptureEvent * ev)
break;
case CaptureEvent::Rescan:
- switch (ev->eventType()) {
+ switch (ev.eventType()) {
case CaptureEvent::Started:
setMenusForCaptureFile(true);
captureFileReadStarted(tr("Rescanning"));
@@ -803,7 +803,7 @@ void MainWindow::captureEventHandler(CaptureEvent * ev)
break;
case CaptureEvent::Retap:
- switch (ev->eventType()) {
+ switch (ev.eventType()) {
case CaptureEvent::Started:
freeze();
break;
@@ -819,7 +819,7 @@ void MainWindow::captureEventHandler(CaptureEvent * ev)
break;
case CaptureEvent::Merge:
- switch (ev->eventType()) {
+ switch (ev.eventType()) {
case CaptureEvent::Started:
main_ui_->statusBar->popFileStatus();
main_ui_->statusBar->pushFileStatus(tr("Merging files"), QString());
@@ -833,10 +833,10 @@ void MainWindow::captureEventHandler(CaptureEvent * ev)
break;
case CaptureEvent::Save:
- switch (ev->eventType()) {
+ switch (ev.eventType()) {
case CaptureEvent::Started:
{
- QFileInfo file_info(ev->filePath());
+ QFileInfo file_info(ev.filePath());
main_ui_->statusBar->popFileStatus();
main_ui_->statusBar->pushFileStatus(tr("Saving %1" UTF8_HORIZONTAL_ELLIPSIS).arg(file_info.baseName()));
break;
@@ -848,28 +848,28 @@ void MainWindow::captureEventHandler(CaptureEvent * ev)
#ifdef HAVE_LIBPCAP
case CaptureEvent::Capture:
- switch (ev->eventType()) {
+ switch (ev.eventType()) {
case CaptureEvent::Prepared:
- captureCapturePrepared(ev->capSession());
+ captureCapturePrepared(ev.capSession());
break;
case CaptureEvent::Stopping:
capture_stopping_ = true;
setMenusForCaptureStopping();
break;
case CaptureEvent::Failed:
- captureCaptureFailed(ev->capSession());
+ captureCaptureFailed(ev.capSession());
default:
break;
}
break;
case CaptureEvent::Update:
- switch (ev->eventType()) {
+ switch (ev.eventType()) {
case CaptureEvent::Started:
- captureCaptureUpdateStarted(ev->capSession());
+ captureCaptureUpdateStarted(ev.capSession());
break;
case CaptureEvent::Finished:
- captureCaptureUpdateFinished(ev->capSession());
+ captureCaptureUpdateFinished(ev.capSession());
break;
default:
break;
@@ -877,9 +877,9 @@ void MainWindow::captureEventHandler(CaptureEvent * ev)
break;
case CaptureEvent::Fixed:
- switch (ev->eventType()) {
+ switch (ev.eventType()) {
case CaptureEvent::Finished:
- captureCaptureFixedFinished(ev->capSession());
+ captureCaptureFixedFinished(ev.capSession());
break;
default:
break;
diff --git a/ui/qt/multicast_statistics_dialog.cpp b/ui/qt/multicast_statistics_dialog.cpp
index eaa39d1..63bdceb 100644
--- a/ui/qt/multicast_statistics_dialog.cpp
+++ b/ui/qt/multicast_statistics_dialog.cpp
@@ -445,10 +445,10 @@ void MulticastStatisticsDialog::fillTree()
updateWidgets();
}
-void MulticastStatisticsDialog::captureEvent(CaptureEvent *e)
+void MulticastStatisticsDialog::captureEvent(CaptureEvent e)
{
- if ((e->captureContext() == CaptureEvent::File) &&
- (e->eventType() == CaptureEvent::Closing))
+ if ((e.captureContext() == CaptureEvent::File) &&
+ (e.eventType() == CaptureEvent::Closing))
{
/* Remove the stream tap listener */
remove_tap_listener_mcast_stream(tapinfo_);
diff --git a/ui/qt/multicast_statistics_dialog.h b/ui/qt/multicast_statistics_dialog.h
index 37aeb16..49439e0 100644
--- a/ui/qt/multicast_statistics_dialog.h
+++ b/ui/qt/multicast_statistics_dialog.h
@@ -42,7 +42,7 @@ private slots:
void updateWidgets();
void updateMulticastParameters();
virtual void fillTree();
- void captureEvent(CaptureEvent *e);
+ void captureEvent(CaptureEvent e);
};
#endif // MULTICASTSTATISTICSDIALOG_H
diff --git a/ui/qt/traffic_table_dialog.cpp b/ui/qt/traffic_table_dialog.cpp
index f114b80..7219c6d 100644
--- a/ui/qt/traffic_table_dialog.cpp
+++ b/ui/qt/traffic_table_dialog.cpp
@@ -218,11 +218,11 @@ void TrafficTableDialog::on_displayFilterCheckBox_toggled(bool checked)
cap_file_.retapPackets();
}
-void TrafficTableDialog::captureEvent(CaptureEvent *e)
+void TrafficTableDialog::captureEvent(CaptureEvent e)
{
- if (e->captureContext() == CaptureEvent::Retap)
+ if (e.captureContext() == CaptureEvent::Retap)
{
- switch (e->eventType())
+ switch (e.eventType())
{
case CaptureEvent::Started:
ui->displayFilterCheckBox->setEnabled(false);
diff --git a/ui/qt/traffic_table_dialog.h b/ui/qt/traffic_table_dialog.h
index 73b9b0e..98c0559 100644
--- a/ui/qt/traffic_table_dialog.h
+++ b/ui/qt/traffic_table_dialog.h
@@ -161,7 +161,7 @@ private slots:
void on_displayFilterCheckBox_toggled(bool checked);
void setTabText(QWidget *tree, const QString &text);
void toggleTable();
- void captureEvent(CaptureEvent *e);
+ void captureEvent(CaptureEvent e);
void copyAsCsv();
void copyAsYaml();
diff --git a/ui/qt/wireshark_application.cpp b/ui/qt/wireshark_application.cpp
index cf76419..a00ef6b 100644
--- a/ui/qt/wireshark_application.cpp
+++ b/ui/qt/wireshark_application.cpp
@@ -1325,14 +1325,14 @@ void WiresharkApplication::softwareUpdateShutdownRequest() {
}
#endif
-void WiresharkApplication::captureEventHandler(CaptureEvent * ev)
+void WiresharkApplication::captureEventHandler(CaptureEvent ev)
{
- switch(ev->captureContext())
+ switch(ev.captureContext())
{
#ifdef HAVE_LIBPCAP
case CaptureEvent::Update:
case CaptureEvent::Fixed:
- switch ( ev->eventType() )
+ switch ( ev.eventType() )
{
case CaptureEvent::Started:
active_captures_++;
@@ -1350,7 +1350,7 @@ void WiresharkApplication::captureEventHandler(CaptureEvent * ev)
case CaptureEvent::File:
case CaptureEvent::Reload:
case CaptureEvent::Rescan:
- switch ( ev->eventType() )
+ switch ( ev.eventType() )
{
case CaptureEvent::Started:
QTimer::singleShot(TAP_UPDATE_DEFAULT_INTERVAL / 5, this, SLOT(updateTaps()));
diff --git a/ui/qt/wireshark_application.h b/ui/qt/wireshark_application.h
index 24d662b..55db153 100644
--- a/ui/qt/wireshark_application.h
+++ b/ui/qt/wireshark_application.h
@@ -202,7 +202,7 @@ public slots:
void clearRecentCaptures();
void refreshRecentCaptures();
- void captureEventHandler(CaptureEvent *);
+ void captureEventHandler(CaptureEvent);
private slots:
void updateTaps();
diff --git a/ui/qt/wireshark_dialog.cpp b/ui/qt/wireshark_dialog.cpp
index 5ea9246..9130c59 100644
--- a/ui/qt/wireshark_dialog.cpp
+++ b/ui/qt/wireshark_dialog.cpp
@@ -114,12 +114,12 @@ bool WiresharkDialog::registerTapListener(const char *tap_name, void *tap_data,
return true;
}
-void WiresharkDialog::captureEvent(CaptureEvent *e)
+void WiresharkDialog::captureEvent(CaptureEvent e)
{
- switch (e->captureContext())
+ switch (e.captureContext())
{
case CaptureEvent::Retap:
- switch (e->eventType())
+ switch (e.eventType())
{
case CaptureEvent::Started:
beginRetapPackets();
@@ -132,7 +132,7 @@ void WiresharkDialog::captureEvent(CaptureEvent *e)
}
break;
case CaptureEvent::File:
- switch (e->eventType())
+ switch (e.eventType())
{
case CaptureEvent::Closing:
captureFileClosing();
diff --git a/ui/qt/wireshark_dialog.h b/ui/qt/wireshark_dialog.h
index 2e4a750..ab1a0ec 100644
--- a/ui/qt/wireshark_dialog.h
+++ b/ui/qt/wireshark_dialog.h
@@ -121,7 +121,7 @@ protected:
virtual void captureFileClosed();
protected slots:
- void captureEvent(CaptureEvent *e);
+ void captureEvent(CaptureEvent);
private:
void setWindowTitleFromSubtitle();