After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 380283 - Last criteria in Advanced Search is not removable
Last criteria in Advanced Search is not removable
Status: RESOLVED DUPLICATE of bug 263207
Product: evolution
Classification: Applications
Component: Mailer
2.10.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2006-11-28 20:59 UTC by Matthew Barnes
Modified: 2009-01-08 16:17 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Matthew Barnes 2006-11-28 20:59:46 UTC
Forwarding this from a downstream bug report:
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=212116

The Advanced Search dialog does not allow the last criteria to be removed.  Clicking its "Remove" button has no effect.  This applies to both the Mail and Contacts components.  It also applies to the "Edit Rule" dialog in the Mail component.

I've traced the reason for this behavior to the "Remove" button's callback function in filter/filter-rule.c:

    static void
    less_parts (GtkWidget *button, struct _rule_data *data)
    {
            FilterPart *part;
            GtkWidget *rule;

            if (g_list_length (data->fr->parts) < 2)
                    return;

            rule = g_object_get_data ((GObject *) button, "rule");
            part = g_object_get_data ((GObject *) rule, "part");

            /* remove the part from the list */
            filter_rule_remove_part (data->fr, part);
            g_object_unref (part);

            /* and from the display */
            gtk_container_remove (GTK_CONTAINER (data->parts), rule);
            gtk_container_remove (GTK_CONTAINER (data->parts), button);
    }

The "if" statement is preventing the last criteria from being removed.

I could maybe see an argument that you have to have at least one criteria in an advanced search or filter rule.  But in that case, the "Remove" button for the last criteria should be disabled.  Furthermore, the Contacts component's "Advanced Search" dialog initially has no criteria at all.  So as soon as you add a criteria, you can't put the dialog back in it's initial state.  That seems bizarre to me.

Personally I think a better approach is to disable the "OK" button when the "Advanced Search" or "Edit Rule" dialog is missing required criteria.  The user may then add the required criteria or click "Cancel".

I'd like to get a second opinion on this from one of the upstream guys.
Comment 1 Matthew Barnes 2008-03-11 00:32:04 UTC
Bumping version to a stable release.
Comment 2 Philipp Cordes 2008-10-10 22:11:53 UTC
I don’t experience this bug in version 2.22.3.1. It’s probably been fixed.
Comment 3 Milan Crha 2009-01-08 16:17:31 UTC
You've right, Philipp.

*** This bug has been marked as a duplicate of 263207 ***