Closed ludovicaelbrecht closed 1 year ago
Hi. To fix issue 156, I set the notetableview as sortable by calling setSortingEnabled(true), so that we can sort by clicking on the headers, but it caused such a side effect, which is not what I expected. In my case, narrow or wide does not matter, actually sorting from the menu does not work. If you just need to sort by one attribute(column) in 2.1.7 or later, you could do that by clicking on the notetableview's headers for now. And I'll try to find a way to fix the sorting from the menu later on.
Just built the develop branch, it's fixed indeed. Thanks a lot!
Expected vs. actual behavior
I use the "narrow note list" and sort notes through View -> Sort notes by -> Date Updated. This has worked perfectly until 2.1.6, and has been broken in every version since 2.1.7.
Steps to reproduce the problem
Specifications
Running nixnote2 on Linux (Fedora 38), reproduced this behavior both using the Fedora copr package and by building from source.
I looked at the changes introduced in 2.1.7 (since this is where the problem appears). In 2.1.7, this issue is closed: https://github.com/robert7/nixnote2/issues/156 ("editor fonts and sorting notes"). Which is fixed by this pull request: https://github.com/robert7/nixnote2/pull/187/commits Which contains this commit: https://github.com/robert7/nixnote2/pull/187/commits/4fb6706146cfce61309c062e544df55e6f1faa7d
If I undo this commit (i.e. comment out the sorting code and add "this->setSortingEnabled(false);" again), then recompile, the regression is no longer there for me.
I don't know what the correct fix is, but if I read issue #156 correctly it seems that this commit fixed a sorting issue in "wide note list" mode, but as a side effect breaks sorting in "narrow note list".
Thanks, Ludovic