kanryu / quickviewer

A image/comic viewer application for Windows, Mac and Linux, it can show images very fast
https://kanryu.github.io/quickviewer/
GNU General Public License v3.0
535 stars 63 forks source link

Numbering sort (Linux) #167

Open sakkamade opened 3 years ago

sakkamade commented 3 years ago

What is the problem The issue https://github.com/kanryu/quickviewer/issues/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 commented 2 years ago

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

kanryu commented 2 years ago

@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 commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

thank you for fast and concise answer.