Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numbering sort (Linux) #167

Open
sakkamade opened this issue Apr 26, 2021 · 5 comments
Open

Numbering sort (Linux) #167

sakkamade opened this issue Apr 26, 2021 · 5 comments

Comments

@sakkamade
Copy link
Contributor

sakkamade commented Apr 26, 2021

What is the problem
The issue #76 pretty much explains the current behaviour of sorting on Linux.

Upon choosing Sort by Filename, the files are sorted in this way:

name0.png name10.png name11.png name12.png ... name1.png name20.png ...
    --- or ---
0name.png 10name.png 11name.png 12name.png ... 1name.png 20name.png ...

Needless to say that reading any sort of book, or even viewing images, with such sorting is inconvenient.

What is the solution
Thus, the feature I would like to see is the "Sort by Number" such as in Geeqie (do not support archives).
Which would also sort the files by file names, but will take into account and numbers as well, like so:

name0.png name1.png name2.png name3.png ... name10.png name11.png ...
    --- or ---
0name.png 1name.png 2name.png 3name.png ... 10name.png 11name.png ...
@rezad1393
Copy link

this is still not fixed.
which seem to be a simple problem.

@kanryu
Copy link
Owner

kanryu commented Apr 5, 2022

@rezad1393 The problem of sorting filenames is much more complicated than you think.

This is because you don't know how many times a number appears in a file name, and there are complicated problems such as how to interpret the dots connected to the number. These issues should be resolved by the OS, not the application.

On Windows, the solution is the StrCmpLogicalW() API.

It is undefined because the API to be used on other OS is unknown.

If you know it, you will be able to modify the source code.

@rezad1393
Copy link

sorry if I came off as a arrogant person.
I am not a programmer.
what I meant was that some programs consider that issue and have fixed it. for example another comic viewer I used is mcomix and it uses the correct sort.
maybe you can check that our?

@kanryu
Copy link
Owner

kanryu commented Apr 5, 2022

@rezad1393
QuivkViewer is implemented by the Qt SDK. It usually doesn't make sense for you to discuss the implementation of other applications here. You just need to consider how other Qt-based applications are implemented.

Now, regarding this problem, I think that it can be solved to a certain level by using the QCollator class.

https://doc.qt.io/qt-5/qcollator.html

However, I currently have no positive motivation to support Linux. If there is someone you want to be in charge of, please come forward. It will be a volunteer task, but will be paid a small amount.

@rezad1393
Copy link

thank you for fast and concise answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants