[Kde-pim] For review: Better support of rich text summary/location

Thomas Thrainer tom_t at gmx.at
Thu Jun 12 20:31:12 BST 2008


Hello,

> If you think this is the best solution then I'm fine with the changes you
> propose.
Well, just to make sure that I am sure, I explain the changes a little 
further ;-) :

Incidences have the possibility to have rich text summaries, locations and 
description. To check if one of those is rich text, there are the methods 
xIsRich(). However, only descriptions can be rich text ATM, because there is 
only GUI for them.

It was possible up to now to enter summaries like "I want this <b>bold</b>". 
This would be stored as such, with summaryIsRich() == false (the default 
value for setSummary's isRich parameter). But this just worked in the 
tooltips and sidepane, because there is no check at all wether the text is 
rich text or not.
OTOH, if you enter "Ensure spendings < income" as summary, this would skrew up 
the tooltip and sidepane, as there is no escaping at all.

Because I'm not sure if it's a good idea to add 2 additional "Is rich" 
checkboxes in the incidence editor, I changed the behaviour when a 
summary/location/description is set without second parameter: 
Qt::mightBeRichText() guesses if the text could be rich text, and sets the 
internal flag accordingly. If the caller has more information, there is still 
the old version with the second parameter.

Furthermore, I went over IncidenceFormatter in order to go through the 
instances where the summary/location/description is copied without escaping 
to rich text output strings. I changed those occurences so that not-rich text 
will be properly escaped.

One implication of this is that "old" summaries with HTML tags are now 
displayed verbose in the tooltips and sidepane. That's because their 
xIsRich() methods still return false, so they are treated as non-rich text 
strings.
Editing and re-saving the incidences should fix this behaviour in such a case.

If nobody thinks that that's not the right way to deal with rich text 
summaries/locations/descriptions, I will commit the patch (modulo "@since 
4.1" and i18n issues) during the weekend.

Regards,
Thomas
_______________________________________________
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