https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=16692

--- Comment #5 from Guy Harris <ghar...@sonic.net> ---
LOLWUT?

WelcomePage::interfaceSelected() does

    QPair <const QString, bool> sf_pair =
CaptureFilterEdit::getSelectedFilter();
    const QString user_filter = sf_pair.first;
    bool conflict = sf_pair.second;

    if (conflict) {
        welcome_ui_->captureFilterComboBox->lineEdit()->clear();
        welcome_ui_->captureFilterComboBox->setConflict(true);
    } else {
        welcome_ui_->captureFilterComboBox->lineEdit()->setText(user_filter);
    }

CaptureFilterEdit::getSelectedFilter() does

    QString user_filter;
    bool filter_conflict = false;
#ifdef HAVE_LIBPCAP
    int selected_devices = 0;

    for (guint i = 0; i < global_capture_opts.all_ifaces->len; i++) {
        interface_t *device = &g_array_index(global_capture_opts.all_ifaces,
interface_t, i);
        if (device->selected) {
            selected_devices++;
            if (selected_devices == 1) {
                user_filter = device->cfilter;
            } else {
                if (user_filter.compare(device->cfilter)) {
                    filter_conflict = true;
                }
            }
        }
    }
#endif // HAVE_LIBPCAP
    return QPair<const QString, bool>(user_filter, filter_conflict);

and, if I type a filter into the filter text box and then select lo0, it finds
that:

the first interface in global_capture_opts.all_ifaces, en0, is selected and has
a filter of "host www.sonic.com";

the tenth interface, lo0, is selected and has a null pointer as the filter;

so it concludes that ZOMG I HAZ A CONFLICT, so WelcomePage::interfaceSelected()
says there's a conflict and clears the filter.

This is broken, from the UI point of view, for two reasons:

1) both interfaces aren't selected, from the point of view of the user -
they've clicked on the new interface, which de-selects the old interface;

2) the filter should be carried over from the old interface to the new.

-- 
You are receiving this mail because:
You are watching all bug changes.
___________________________________________________________________________
Sent via:    Wireshark-bugs mailing list <wireshark-bugs@wireshark.org>
Archives:    https://www.wireshark.org/lists/wireshark-bugs
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-bugs
             mailto:wireshark-bugs-requ...@wireshark.org?subject=unsubscribe

Reply via email to