[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    [PATCH] filter changes - part I
From:       Marc Mutz <Marc () Mutz ! com>
Date:       2001-04-17 7:41:07
[Download RAW message or body]

Hi!

I've finished the first part of the KMail filter extension and cleanup
of the accociated dialog. The patch was made from the modified 2.1.1
against the 2.1.1 release, but I've checked that it applies cleanly
against current HEAD cvs.

What this patch does:

1. Make a nice KMSearchPatternEdit in the KMFilterDlg
   (cf. the screenshot I sent to this list a while ago)
2. Lift the Two-rules limit. You can now have up to
   eight rules by default. If you need more, you only
   need to increase FILTER_MAX_RULES in kmsearchpattern.h
   (up to a maximum of 26, see below)
3. The filter config format has been slightly modified: It now has a
   new key 'rules', that gives the number of rules in that filter.
   If this key is not present, the KMSearchPattern::readConfig
   assumes a legacy config and converts the operators 'ignore' and
   'unless' accordingly. The third rule is saved as
   (fieldC/funcC/contentsC) and so on.
4. Incorporate Don's additions to kmfilter{dlg,mgr}.{h,cpp}. Don,
   could you have a look. This is the single point that I didn't
   test, but then I've only made the changes I've done to
   KMFilterDlg::slotBtnNew to createFilter().

How to apply the patch:

cd kdenetwork/kmail
bzcat kmail-filter-01-04-13-add-files.tar.bz | tar xf -
# adds kmsearchpattern{,edit}.{cpp,h}
patch -p2 < kmail-filter-01-04-13.diff

What this patch doesn't do:

1. anything involving filter actions. This will be the next patch.
2. There's a bit of ugliness in KMSearchPattern::slotMore.
   Will look into it.
3. I will audit the interfaces to KMFilter{,Mgr} and KMSearchPattern
   to make sure that there will never be an empty/invalid rule
   (and action) in any of them. Then the tests in *::writeConfig et
   al. can go away again.

I have tested these modifications quite heavily. But of course, I
couldn't think of all the things that people will do with their filters,
so please consider putting these changes into CVS for anyone to test.
  You should make a backup of your kmailrc, though - just in case you
want to go back to your previous KMail, though simple rules with exactly
two rules will be understood by both versions.

There's a known problem, though: If you use filters while the filter
dialog shows a filter, that filter may contain invalid data. This is
because the widgets operate directly on the filters.

I will work around this problem by making KMFilterDlg a subclass of
KDialogBase, which holds a deep copy of the filter list and provides an
'Apply' button to transfer the changes in the copy back to KMFilterMgr.

Marc

["kmail-filter-01-04-13-add-files.tar.bz2" (application/octet-stream)]
["kmail-filter-01-04-13.diff.bz2" (application/octet-stream)]
_______________________________________________
Kmail Developers mailing list
Kmail@master.kde.org
http://master.kde.org/mailman/listinfo/kmail


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic