Version: 4.1.85 (using Devel) OS: Linux Installed from: Compiled sources Hi, The file open dialog has a bug in the sorting of elements: When opened the column header of the filename column indicates ascending sorting of entries -> OK. But the files are sorted descending actually (Wrong!). Changing the sort-order two times "fixes" this. To reproduce: For example in konqueror: File -> Open file (Dialog Config: Detailed View, Sort by Name) Take a closer look at the sorting order: It shows that it has sorted ascending (a->z) but the files are sorted descending (z->a), clicking on the name column header changes the display to correct order (descending), then when switching back to ascending the files will correctly be sorted. See this screenshot which shows the wrong initial display http://linuxcc.de/kde-bugs/file-open.png
It seems inverted, instead it should behave like dolphin (imho)
Yes inverted, and wrong because not like the columns heading tells you until you click the column heading: one time will just "fix" the columns heading, sorting order stays descending (z->a), and clicking again changes back the columns heading to its original state *and* changes the ordering of the files like it sould be.
Created attachment 29566 [details] Corrects the relationship between sort arrow and loading sort order from saved options. This touches some KDirOperator code so I would like some code review before I commit, but basically this simplifies the code that handles the sorting option code in the hopes of getting it right. i.e. instead of noting that the sort option is changed and manually flipping the bit we just set it based on whether the appropriate action is checked or not. In addition a "triggered" signal is changed to "toggled" that way even programmatic changes to the "Reversed" action update the UI. This could probably be done in many other places where triggered is used but I haven't looked. Last step was to move the setSorting() call on initial widget creation until after all options are read so that the initial UI is correct. By the way I'm back from patrol, hi all.
I think the patch looks fine. Wouldn't be, however, the next part of the patch enough to fix the problem ? @@ -2090,7 +2096,6 @@ } d->sorting = sorting; - setSorting(d->sorting); if (configGroup.readEntry(QLatin1String("Show hidden files"), DefaultShowHidden)) { @@ -2104,6 +2109,7 @@ d->sorting = d->sorting | QDir::Reversed; } + setSorting(d->sorting); if (d->inlinePreviewState == Private::NotForced) { d->showPreviews = configGroup.readEntry(QLatin1String("Previews"), false); } But in any case, I like the other changes... I have no comments on this. Peter, do you ? (since AFAIR you wrote this part when porting KDirOperator)
> I think the patch looks fine. Wouldn't be, however, the next part of the patch > enough to fix the problem ? I thought I had already tried just moving the setSorting() call but I had manually called the "synchronize UI with sort status" function instead (unsuccessfully). Your suggestion should probably work but I don't feel like recompiling kfile right now, Peter probably knows better than I anyways.
> But in any case, I like the other changes... I have no comments on > this. Peter, do you ? (since AFAIR you wrote this part when > porting KDirOperator) Yes, I did the initial porting but have to admit that I'm not really an expert for kdiroperator... However I think the patch looks fine!
Please Michael, commit :)
SVN commit 900764 by mpyne: Fix bug 178425 (wrong initial sorting order in File Open dialog). BUG:178425 M +15 -14 kdiroperator.cpp M +1 -1 kdiroperator.h WebSVN link: http://websvn.kde.org/?view=rev&revision=900764
*** Bug 171158 has been marked as a duplicate of this bug. ***
Using Kubuntu 9.04, KDE 4.4.2. Still some problem with initial sort order: When opening a file dialog in detailed view, or if I select "detailed view" after having "short view" selected, the files are sorted wrong (z-a). The setting in the sort-menu is initially set to "descending"; i.e. it's consistent, but initial sorting is wrong, so the bug seems to have been partially fixed(?). My ~/.kde/share/config/kdeglobals says: [KFileDialog Settings] Sort reversed=false But I also tried on a fresh account.