aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/models
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2018-01-06 21:39:26 +0100
committerAnders Broman <a.broman58@gmail.com>2018-01-08 05:50:15 +0000
commite80b40adbe823be084fb49cd84336939916120bb (patch)
treed712734b953f7df6f1f79519c7abc73029152e1d /ui/qt/models
parent6f93baced0fba7d07425e14ea698f4607964c6ed (diff)
extcap: remove conditional compilation.
Change-Id: Ia54bba388755cf27a343fe6d69d244bf1ab897f9 Reviewed-on: https://code.wireshark.org/review/25186 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/qt/models')
-rw-r--r--ui/qt/models/interface_tree_cache_model.cpp9
-rw-r--r--ui/qt/models/interface_tree_model.cpp8
-rw-r--r--ui/qt/models/interface_tree_model.h2
3 files changed, 2 insertions, 17 deletions
diff --git a/ui/qt/models/interface_tree_cache_model.cpp b/ui/qt/models/interface_tree_cache_model.cpp
index b093478916..e193f58a9e 100644
--- a/ui/qt/models/interface_tree_cache_model.cpp
+++ b/ui/qt/models/interface_tree_cache_model.cpp
@@ -186,14 +186,12 @@ void InterfaceTreeCacheModel::save()
{
device->hidden = saveValue.toBool();
}
-#ifdef HAVE_EXTCAP
else if ( device->if_info.type == IF_EXTCAP )
{
/* extcap interfaces do not have the following columns.
* ATTENTION: all generic columns must be added, BEFORE this
* if-clause, or they will be ignored for extcap interfaces */
}
-#endif
else if ( col == IFTREE_COL_PROMISCUOUSMODE )
{
device->pmode = saveValue.toBool();
@@ -237,10 +235,10 @@ void InterfaceTreeCacheModel::save()
prefStorage[&prefs.capture_devices_descr] << QString("%1(%2)").arg(device->name).arg(content.toString());
bool allowExtendedColumns = true;
-#ifdef HAVE_EXTCAP
+
if ( device->if_info.type == IF_EXTCAP )
allowExtendedColumns = false;
-#endif
+
if ( allowExtendedColumns )
{
content = getColumnContent(idx, IFTREE_COL_PROMISCUOUSMODE, Qt::CheckStateRole);
@@ -352,7 +350,6 @@ bool InterfaceTreeCacheModel::isAllowedToBeEdited(const QModelIndex &index) cons
if ( device == 0 )
return false;
-#ifdef HAVE_EXTCAP
InterfaceTreeColumns col = (InterfaceTreeColumns) index.column();
if ( device->if_info.type == IF_EXTCAP )
{
@@ -365,8 +362,6 @@ bool InterfaceTreeCacheModel::isAllowedToBeEdited(const QModelIndex &index) cons
#endif
}
#endif
-
-#endif
return true;
}
diff --git a/ui/qt/models/interface_tree_model.cpp b/ui/qt/models/interface_tree_model.cpp
index c57859ad72..bd96411e6d 100644
--- a/ui/qt/models/interface_tree_model.cpp
+++ b/ui/qt/models/interface_tree_model.cpp
@@ -41,9 +41,7 @@
/* Needed for the meta type declaration of QList<int>* */
#include <ui/qt/models/sparkline_delegate.h>
-#ifdef HAVE_EXTCAP
#include "extcap.h"
-#endif
const QString InterfaceTreeModel::DefaultNumericValue = QObject::tr("default");
@@ -144,12 +142,10 @@ QVariant InterfaceTreeModel::data(const QModelIndex &index, int role) const
if ( device->cfilter && strlen(device->cfilter) > 0 )
return html_escape(QString(device->cfilter));
}
-#ifdef HAVE_EXTCAP
else if ( col == IFTREE_COL_EXTCAP_PATH )
{
return QString(device->if_info.extcap);
}
-#endif
else if ( col == IFTREE_COL_SNAPLEN )
{
return device->has_snaplen ? QString::number(device->snaplen) : DefaultNumericValue;
@@ -222,7 +218,6 @@ QVariant InterfaceTreeModel::data(const QModelIndex &index, int role) const
return QVariant::fromValue((bool)device->hidden);
}
}
-#ifdef HAVE_EXTCAP
/* Displays the configuration icon for extcap interfaces */
else if ( role == Qt::DecorationRole )
{
@@ -239,7 +234,6 @@ QVariant InterfaceTreeModel::data(const QModelIndex &index, int role) const
return Qt::AlignRight;
}
}
-#endif
/* Displays the tooltip for each row */
else if ( role == Qt::ToolTipRole )
{
@@ -362,12 +356,10 @@ QVariant InterfaceTreeModel::toolTipForInterface(int idx) const
.arg(html_escape(device->addresses))
.replace('\n', ", ");
}
-#ifdef HAVE_EXTCAP
else if ( device->if_info.type == IF_EXTCAP )
{
tt_str = QString(tr("Extcap interface: %1")).arg(get_basename(device->if_info.extcap));
}
-#endif
else
{
tt_str = tr("No addresses");
diff --git a/ui/qt/models/interface_tree_model.h b/ui/qt/models/interface_tree_model.h
index a441b39e33..b850078da6 100644
--- a/ui/qt/models/interface_tree_model.h
+++ b/ui/qt/models/interface_tree_model.h
@@ -41,10 +41,8 @@ typedef QList<int> PointList;
enum InterfaceTreeColumns
{
-#ifdef HAVE_EXTCAP
IFTREE_COL_EXTCAP,
IFTREE_COL_EXTCAP_PATH,
-#endif
IFTREE_COL_NAME,
IFTREE_COL_INTERFACE_NAME,
IFTREE_COL_INTERFACE_COMMENT,