diff options
author | Dario Lombardo <lomato@gmail.com> | 2017-08-14 23:08:56 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-08-15 14:44:11 +0000 |
commit | bc9bf64f8dc7053ebe3ae75152472d7149e077ce (patch) | |
tree | b7856e94faa6157ea6926c5dcf1f88810eca35f6 /ui | |
parent | 35f9349396d4dfbcccdf977cf9d7f3096df5aa0e (diff) |
Qt: fix compilation without pcap.
Change-Id: Ib8d21d63730ea6e18032b89ba0042ee7521645a8
Reviewed-on: https://code.wireshark.org/review/23078
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt/compiled_filter_output.cpp | 8 | ||||
-rw-r--r-- | ui/qt/compiled_filter_output.h | 2 | ||||
-rw-r--r-- | ui/qt/manage_interfaces_dialog.cpp | 9 | ||||
-rw-r--r-- | ui/qt/manage_interfaces_dialog.h | 2 |
4 files changed, 13 insertions, 8 deletions
diff --git a/ui/qt/compiled_filter_output.cpp b/ui/qt/compiled_filter_output.cpp index fda2332a33..1d27d5a48d 100644 --- a/ui/qt/compiled_filter_output.cpp +++ b/ui/qt/compiled_filter_output.cpp @@ -21,8 +21,6 @@ #include "config.h" -#ifdef HAVE_LIBPCAP - #include <ui_compiled_filter_output.h> #include "compiled_filter_output.h" @@ -62,7 +60,9 @@ CompiledFilterOutput::CompiledFilterOutput(QWidget *parent, QStringList &intList #else pcap_compile_mtx = g_mutex_new(); #endif +#ifdef HAVE_LIBPCAP compileFilter(); +#endif } CompiledFilterOutput::~CompiledFilterOutput() @@ -77,6 +77,7 @@ CompiledFilterOutput::~CompiledFilterOutput() delete ui; } +#ifdef HAVE_LIBPCAP void CompiledFilterOutput::compileFilter() { struct bpf_program fcode; @@ -115,6 +116,7 @@ void CompiledFilterOutput::compileFilter() } } } +#endif void CompiledFilterOutput::on_interfaceList_currentItemChanged(QListWidgetItem *current, QListWidgetItem *) { @@ -129,8 +131,6 @@ void CompiledFilterOutput::copyFilterText() wsApp->clipboard()->setText(ui->filterList->toPlainText()); } -#endif /* HAVE_LIBPCAP */ - // // Editor modelines - http://www.wireshark.org/tools/modelines.html // diff --git a/ui/qt/compiled_filter_output.h b/ui/qt/compiled_filter_output.h index f23e36e223..55e37310ef 100644 --- a/ui/qt/compiled_filter_output.h +++ b/ui/qt/compiled_filter_output.h @@ -47,7 +47,9 @@ private: QHash<QString, QString> compile_results; QListWidget *interface_list_; QPushButton *copy_bt_; +#ifdef HAVE_LIBPCAP void compileFilter(); +#endif public: explicit CompiledFilterOutput(QWidget *parent = 0, QStringList &intList = *new QStringList(), QString &filter = *new QString()); diff --git a/ui/qt/manage_interfaces_dialog.cpp b/ui/qt/manage_interfaces_dialog.cpp index 02a45e4713..6e7714eb73 100644 --- a/ui/qt/manage_interfaces_dialog.cpp +++ b/ui/qt/manage_interfaces_dialog.cpp @@ -45,8 +45,6 @@ #include <QDebug> -#ifdef HAVE_LIBPCAP - #include "ui/capture_ui_utils.h" #include <ui/qt/models/path_chooser_delegate.h> @@ -211,7 +209,9 @@ void ManageInterfacesDialog::updateWidgets() void ManageInterfacesDialog::on_buttonBox_accepted() { +#ifdef HAVE_LIBPCAP sourceModel->save(); +#endif #ifdef HAVE_PCAP_REMOTE remoteAccepted(); #endif @@ -220,6 +220,7 @@ void ManageInterfacesDialog::on_buttonBox_accepted() emit ifsChanged(); } +#ifdef HAVE_LIBPCAP void ManageInterfacesDialog::on_addPipe_clicked() { interface_t device; @@ -241,6 +242,7 @@ void ManageInterfacesDialog::on_addPipe_clicked() device.if_info.type = IF_PIPE; sourceModel->addDevice(&device); + updateWidgets(); } @@ -254,6 +256,7 @@ void ManageInterfacesDialog::on_delPipe_clicked() sourceModel->deleteDevice( pipeProxyModel->mapToSource(selIndex) ); updateWidgets(); } +#endif void ManageInterfacesDialog::on_buttonBox_helpRequested() { @@ -575,8 +578,6 @@ void ManageInterfacesDialog::setRemoteSettings(interface_t *iface) } #endif // HAVE_PCAP_REMOTE -#endif /* HAVE_LIBPCAP */ - /* * Editor modelines * diff --git a/ui/qt/manage_interfaces_dialog.h b/ui/qt/manage_interfaces_dialog.h index 2f95d27faa..90a8867638 100644 --- a/ui/qt/manage_interfaces_dialog.h +++ b/ui/qt/manage_interfaces_dialog.h @@ -73,8 +73,10 @@ private slots: void on_buttonBox_accepted(); +#ifdef HAVE_LIBPCAP void on_addPipe_clicked(); void on_delPipe_clicked(); +#endif void onSelectionChanged(const QItemSelection &sel, const QItemSelection &desel); |