Fixing and regulating certain types of search fields across KF5 apps

Aleix Pol aleixpol at kde.org
Tue Feb 10 12:01:02 UTC 2015


On Mon, Feb 9, 2015 at 9:03 PM, Eike Hein <hein at kde.org> wrote:
>
> Hi,
>
> we currently have numerous dynamic search fields across KDE
> apps that, for performance reasons, disregard input shorter
> than a particular QString::length(). Examples are KMail and
> some things in KRunner. It's a common pattern.
>
> This is very English-centric behavior; many scripts are
> more complex than this, in particular CJK ones. In Korean,
> a single character may be composed of multiple letters and
> form a complex syllable. Most Korean given names are two
> characters, many useful words are only one character.
> The situation in Japanese is similar - it's written using
> a mix of syllabaries and ideograms. The check for 3 has
> good intentions but breaks real use cases for these users,
> such as finding mail by name.
>
> Addressing this algorithmically is not all that hard. When
> normalizing to Unicode NFD, those complex Korean characters
> turn into a sequence of combining characters for the indi-
> vidual letters. Syllabic and ideographic code points are
> assigned the character class Lo in Unicode, which is info
> available via QChar. An NFD pass + counting Lo chars as 2
> would be simple and effective enough for this purpose.
>
> The way I'd like to see this fixed is placing an API like
> isMinimumSearchableLength(QString) somewhere in KF5 and to
> start using it everywhere. Realistically developers won't
> find this on their own, but it means I could go around and
> patch up all these places without copying code around.
>
> Which framework would be a good place for this?
>

I like the idea.
Have you checked whether ICU provides something like this? They might...

Aleix


More information about the Kde-frameworks-devel mailing list