summaryrefslogtreecommitdiff
path: root/ui/qt/interface_tree_model.cpp
diff options
context:
space:
mode:
authorRoland Knall <rknall@gmail.com>2016-10-03 19:57:44 +0200
committerPeter Wu <peter@lekensteyn.nl>2016-10-04 01:26:31 +0000
commitfc234708a7d3837b6d705f06a0bd46651a01f6a5 (patch)
treec163847cc4648bdaa435a7cb9af46569101f43b9 /ui/qt/interface_tree_model.cpp
parenta59e64c9069aabd42a2df349e2d478e6f2147ffa (diff)
downloadwireshark-fc234708a7d3837b6d705f06a0bd46651a01f6a5.tar.gz
Interface View/Model: Fix pcap-less build
Change-Id: I88bc6c939b7ce6986299e4ebf99358437b758bd2 Reviewed-on: https://code.wireshark.org/review/18045 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'ui/qt/interface_tree_model.cpp')
-rw-r--r--ui/qt/interface_tree_model.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/ui/qt/interface_tree_model.cpp b/ui/qt/interface_tree_model.cpp
index ab1ee1d612..2841cb372f 100644
--- a/ui/qt/interface_tree_model.cpp
+++ b/ui/qt/interface_tree_model.cpp
@@ -341,7 +341,7 @@ void InterfaceTreeModel::getPoints(int idx, PointList *pts)
QItemSelection InterfaceTreeModel::selectedDevices()
{
QItemSelection mySelection;
-
+#ifdef HAVE_LIBPCAP
for( int idx = 0; idx < rowCount(); idx++ )
{
interface_t device = g_array_index(global_capture_opts.all_ifaces, interface_t, idx);
@@ -349,23 +349,20 @@ QItemSelection InterfaceTreeModel::selectedDevices()
if ( device.selected )
{
QModelIndex selectIndex = index(idx, 0);
- /* Proxy model has masked out the interface */
- if ( !selectIndex.isValid() )
- continue;
-
mySelection.merge(
QItemSelection( selectIndex, index(selectIndex.row(), columnCount() - 1) ),
QItemSelectionModel::SelectCurrent
);
}
}
-
+#endif
return mySelection;
}
bool InterfaceTreeModel::updateSelectedDevices(QItemSelection sourceSelection)
{
bool selectionHasChanged = false;
+#ifdef HAVE_LIBPCAP
QList<int> selectedIndices;
foreach(QItemSelectionRange selection, sourceSelection)
@@ -406,7 +403,9 @@ bool InterfaceTreeModel::updateSelectedDevices(QItemSelection sourceSelection)
g_array_insert_val(global_capture_opts.all_ifaces, idx, device);
}
}
-
+#else
+ Q_UNUSED(sourceSelection);
+#endif
return selectionHasChanged;
}