[Kde-pim] KNotes issues

Allen Winter winter at kde.org
Wed Aug 1 14:06:47 BST 2007


On Tuesday 31 July 2007 8:58:21 pm Reinhold Kainhofer wrote:
> Am Mittwoch, 1. August 2007 schrieb Allen Winter:
> > Wuestion.. why can't we simply use
> > if (  Qt::mightBeRichText( journal()->description() ) ) ...
> >
> > Then we don't have to store the custom property.
> >
> > Qt::mightBeRichtText() simply looks for any supported tag
> > before it sees a newline.
> 
> Imagine a journal entry like:
> -) Fixed that bad bug with <td>
> 
> Won't this text-only entry be falsely detected as rich text by
> Qt::mightBeRichText? 
No, because there aren't any tags before the first newline.
But I get your point.

> Heuristics always have cases where they break... 
Yes. that's why they need to "learn".

> 
> I admit, currently it breaks badly, too, since korganizer simply relies on
> QTextEditor (which uses mightBeRichText...). Simply try to add a journal with
> the contents:
> "test: <ul><li> is completely broken in flopzilla, version -1, but </ul> works
> just fine!"
> 
Use cases:
1) user types in free-form data and we need to guess if they entered
valid richtext.  In which case we must use a heuristic.  We could write
our own heuristic so we can "learn as we go".

2) user first selects "rich text" mode.  just like in the kmail composer
when the user does html composing.  In this case we can simply
surround the entered data with "<qt>data</qt>".  Then we reading
that data back in a simple heuristic will detect it as richtext.

3) we read an incidence with data generated from a non-KDE PIM app.
Again, we'll need to guess.

4) ??

Do we really want to have X-KDE-RICHTEXT-DESCRIPTION, X-KDE-RICHTEXT-SUMMARY,
X-KDE-RICHTEXT-LOCATION, etc flags?

So.. my idea is to have our own isRichText() method.  Initially it would simply
use Qt::mightBeRichText(). But we could make it smarter as we go.

??
-Allen

_______________________________________________
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