Bug 406867 - Dolphin name grouping feature doesn't work with cyrillic names
Summary: Dolphin name grouping feature doesn't work with cyrillic names
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: view-engine: general (show other bugs)
Version: 19.04.0
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2019-04-25 02:10 UTC by Andrey Kozlovskiy
Modified: 2019-07-28 20:14 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 19.11.80


Attachments
Russian folders with different first letters in single 'A' group (16.49 KB, image/png)
2019-04-25 02:10 UTC, Andrey Kozlovskiy
Details
Grouping works fine with some non-latin chars (7.13 KB, image/png)
2019-05-16 01:03 UTC, Andrey Kozlovskiy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Kozlovskiy 2019-04-25 02:10:39 UTC
Created attachment 119619 [details]
Russian folders with different first letters in single 'A' group

All files and folders with cyrillic names are placed in latin 'A' group. They're expected to be in groups according to their first letter.
See screenshot with russian names for example.

STEPS TO REPRODUCE
1. Create some files with cyrillic names
2. Select View -> Sort By -> Names
3. Enable View -> Show in groups
Comment 1 Christoph Feck 2019-05-16 00:11:00 UTC
Indeed the latin letter range 'A'...'Z' is hardcoded, see https://cgit.kde.org/dolphin.git/tree/src/kitemviews/kfileitemmodel.cpp#n1899

We could add (at least) greek and cyrillic letter ranges.
Comment 2 Andrey Kozlovskiy 2019-05-16 01:03:38 UTC
Created attachment 120098 [details]
Grouping works fine with some non-latin chars

Sorry, forgot to mention that not all non-latin symbols maps to latin A..Z. That's why I only wrote about cyrillic names.
Greek symbols works fine for me, also chinese and japanese, for example.
Comment 3 Andrey Kozlovskiy 2019-05-16 02:18:00 UTC
It turned out that the problem depends on the language. For example, grouping works fine with English (GB and US) and German, but not with Russian (ru_RU.UTF-8). Run dolphin with LANGUAGE variable to test:
> LANGUAGE="en_US.UTF-8" dolphin
Comment 4 Andrey Yashkin 2019-07-07 09:59:28 UTC
For some reason QCollator thinks that cyrillic(or at least russian) symbols are less than latin characters, while the code seems to be written with the assumption than they are bigger.

I made a patch to consider such case.
https://phabricator.kde.org/D22303
Comment 5 Elvis Angelaccio 2019-07-28 15:12:29 UTC
Git commit dc586ada63d1822fbbe38a0dd3449c73b03928e0 by Elvis Angelaccio, on behalf of Andrey Yashkin.
Committed on 28/07/2019 at 15:07.
Pushed by elvisangelaccio into branch 'master'.

Fix name grouping feature for cyrillic names

Summary:
All files and folders with cyrillic names are placed in latin 'A' group. This patch fixes this issue.
FIXED-IN: 19.11.80

Test Plan:
Make grouping by name in the dir with cyrillic files or dirs in it.
See screenshots below.
Before {F6985465}
After {F6985459}

Reviewers: #dolphin, ngraham, cfeck, elvisangelaccio

Reviewed By: #dolphin, ngraham, elvisangelaccio

Subscribers: hein, cfeck, ngraham, elvisangelaccio, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D22303

M  +2    -24   src/kitemviews/kfileitemmodel.cpp

https://commits.kde.org/dolphin/dc586ada63d1822fbbe38a0dd3449c73b03928e0
Comment 6 Elvis Angelaccio 2019-07-28 20:14:59 UTC
Git commit e9d8bab20bdc99996aa43beefdd038483a4c02d8 by Elvis Angelaccio, on behalf of Andrey Yashkin.
Committed on 28/07/2019 at 20:14.
Pushed by elvisangelaccio into branch 'master'.

Fix name grouping feature for cyrillic names

Summary:
All files and folders with cyrillic names are placed in latin 'A' group. This patch fixes this issue.

Test Plan:
Make grouping by name in the dir with cyrillic files or dirs in it.
See screenshots below.
Before {F6985465}
After {F6985459}

Reviewers: #dolphin, ngraham, cfeck, elvisangelaccio

Reviewed By: #dolphin, ngraham, elvisangelaccio

Subscribers: hein, cfeck, ngraham, elvisangelaccio, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D22303

M  +24   -17   src/kitemviews/kfileitemmodel.cpp

https://commits.kde.org/dolphin/e9d8bab20bdc99996aa43beefdd038483a4c02d8
Comment 7 Elvis Angelaccio 2019-07-28 20:14:59 UTC
Git commit b8849f74aab2e22cc1b891c7dcf4f759fb523ea9 by Elvis Angelaccio.
Committed on 28/07/2019 at 20:14.
Pushed by elvisangelaccio into branch 'master'.

Revert "Fix name grouping feature for cyrillic names"

This reverts commit dc586ada63d1822fbbe38a0dd3449c73b03928e0.

D22303 had a wrong diff.

M  +24   -2    src/kitemviews/kfileitemmodel.cpp

https://commits.kde.org/dolphin/b8849f74aab2e22cc1b891c7dcf4f759fb523ea9