I recently noticed the file name sorting issue in Dolphin and Gwenview. I am currently using KDE Applications 20.04.1 in openSUSE Tumbleweed snapshot 20200526.
For me, neither Natural sorting nor Alphabetical sorting could give me the right (to me) order of sorting. For example, I create a series of files in a folder and sort them,
for ((i=0;i<101;i++)) ; do touch $i.jpg ; done
The files are always sorted as,
0.jpg
1.jpg
10.jpg
100.jpg
11.jpg
12.jpg
...
It is the same as the sorting in Konsole using ls -1, as well as when viewing the folder or browsing by Left/Right Arrow keys in Gwenview.
Do you guys have this problem? Or, it’s just because of my wrong settings?
I also noticed that the Dolphin will not change sorting order after change of setting unless a new instance of Dolphin is started.
I have read a post by wolfi323 on 16-Feb-2017, saying the patch had not been accepted. But I see that the bug has been fixed in Framework 5.34. Then, I am confused.
If there is nothing wrong with sorting feature in KDE, how should I do to solve the issues?
Good suggestion. And I found another weird thing: I cannot correctly create a new user. I created a new user test, then I found I cannot login with it. It’s uid is 3. Then I created another one ztest and got this,
cnzhx@ostp:~> id ztest
id: ‘ztest’: no such user
I cannot figure out the problem. Maybe I should reinstall the OS later when I finish stuff in hand.
Thanks. I restarted Dolphin, even the OS, but Dolphin still cannot sort the files naturally.
Then you confirmed the bug was fixed and the problem might only be with my system. The output is,
By default only ids 1000…60000 can login. Check out in Login Screen (SDDM), Advanced settings. You can change the user id for an user:
sudo usermod -u 1010 test
It shouldn’t require restarting Dolphin, but it only worked for me when I did that (LANG is en_US.UTF-8). That’s still an issue, but yet it can work. Try with the new user again.
Yes, changing uid corrected the login issue. Wonderfully, the natural sorting in the new user works as promised. Do you happen to know how to fix it for my normal user? It’s better not to reinstall the OS lol!
Regarding the issue of new user creation, I guess I was hit by the change to /etc/nsswitch.conf according a search result from here. Here is the content of my /etc/nsswitch.conf file,
Ok, got it. Just as wolfi323 suggested, the issue is caused by locale settings. In order to use SI units, I changed LC_COLLATE, LC_MONETARY and LC_MEASUREMENT in System Settings > Regional Settings. After changing them back to language default, the natural sorting works like a charm.
ostp:~ # grep UID_ {/usr,}/etc/login.defs
/usr/etc/login.defs:# No LASTLOG_UID_MAX means that there is no user ID limit for writing
/usr/etc/login.defs:#LASTLOG_UID_MAX
/usr/etc/login.defs:# No LASTLOG_UID_MAX means that there is no user ID limit for writing
/usr/etc/login.defs:#LASTLOG_UID_MAX
/usr/etc/login.defs:# SYS_UID_MIN to SYS_UID_MAX inclusive is the range for
/usr/etc/login.defs:# UID_MIN to UID_MAX inclusive is the range of UIDs of dynamically
/usr/etc/login.defs:UID_MIN 1000
/usr/etc/login.defs:UID_MAX 60000
/usr/etc/login.defs:SYS_UID_MIN 100
/usr/etc/login.defs:SYS_UID_MAX 499
/usr/etc/login.defs:SUB_UID_MIN 100000
/usr/etc/login.defs:SUB_UID_MAX 600100000
/usr/etc/login.defs:SUB_UID_COUNT 65536
/etc/login.defs:UID_MAX "0"
/etc/login.defs:UID_MIN "0"
ostp:~ # rpmconfigcheck
Searching for unresolved configuration files
I have /etc/login.defs. It looks like this file should be removed in previous upgrade but did not.
And I have /etc/nsswitch.conf and /usr/etc/nsswitch.conf, both of which have the same content.
I have always run rpmconfigcheck after an upgrade and manually updated config files accordingly. Maybe I missed something in the processes.