[Kde-pim] Initializing IndexPolicyAttribute

Christian Mollekopf chrigi_1 at fastmail.fm
Sun Dec 4 22:59:12 GMT 2011


On Saturday 03 December 2011 22.30:56 Will Stephenson wrote:
> I'm working on a couple of features to reduce the volume of mail
> that is indexed by default:
> 

Cool, that probably makes a lot of sense. At least until the performance of 
the indexing is drastically improved.

> * Reduce the number of collections that are indexed by Nepomuk by
> default (drastically)
> * Add a dialog to multiple-select those to be indexed from all
> collections so people don't have to go through the maintenance
> folder properties tab for all folders.
> 
> #2 is the subject of http://git.reviewboard.kde.org/r/103318 and
> 103320
> 
> For #1, I am not sure where to set IndexPolicyAttribute to
> indexingEnabled=false on mail collections.
> 
> 1) In each mail resource as it fetches collections?
> 2) In KMail, as it knows which collections have special roles?
> 3) Some other central location that I'm not aware of
> 4) All of the above?
> 

It might make sense to add this code to the feeder, where the attribute is 
actually used. Just check if there is already an attribute existing, otherwise 
add one with the default value.
Of course that way you need to have the same logic in the selection dialog, so 
some code sharing would be needed.

I think logically this code belongs to the feeder (the email plugin actually) 
and neither the resources nor kmail. Also I would think that the feeder might 
actually already start indexing collections it wasn't meant to if the code 
setting the attribute wasn't called before.

> Assuming I have some policy like "index only sent-mail and inbox by
> default", what is the locus where whether a collection is a sent-
> mail or inbox is known?  I don't want to start playing guessing
> games based on the collection's name.
> 

I don't think there is any sane way to do this with IMAP unless the IMAP 
resource and server support something like imap's  SPECIAL-USE. Of course one 
could add heuristics to decide this based on the name, but that's going to be 
ugly.

The only folder that *might* be constant is the Inbox, so I suppose here you 
could go on the name (not sure if it is really defined by RFC). For the rest I 
would just not index them if they are not marked as sent-mail or alike.

Cheers,
Christian

> Will
> _______________________________________________
> KDE PIM mailing list kde-pim at kde.org
> https://mail.kde.org/mailman/listinfo/kde-pim
> KDE PIM home page at http://pim.kde.org/
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list