Version: (using KDE 4.2.0) OS: Linux Installed from: Mandriva RPMs I selected "sort files by URL". When I open a new file, it is added at the end of the file list. It will go to its expected sorted place only after opening another new file.
This is repeatable with version 3.2.2 (KDE 4.2.2), as well. I believe the bug lies somewhere in part of the code (the iterator?) that checks the number of files added. With this bug, if I open several files, the last one added is not sorted properly, while the all the rest are sorted. Manually changing sorting methods to another type, and then back corrects this, but adding yet another file results in that file not being sorted properly, while fixing the next-to-last file. This bug could be as caused by simply counting from zero, instead of from 1, breaking whatever iterator or code logic checks which files to sort.
*** Bug 185449 has been marked as a duplicate of this bug. ***
*** Bug 198570 has been marked as a duplicate of this bug. ***
*** Bug 196280 has been marked as a duplicate of this bug. ***
*** Bug 176401 has been marked as a duplicate of this bug. ***
I can confirm this bug with Kate 3.3.0 / KDE 4.3.0 : 0.) Create four text files a.txt, b.txt. c.txt and d.txt and open an empty kate window 1.) Open a.txt 2.) Open c.txt 3.) Right mouse click in the "documents" side panel -> sort by -> document name The displayed list of documents is correct "a.txt", then "c.txt" 4.) open b.txt -> list of documents is "b.txt", "a.txt", "c.txt" (expected: "a.txt", "b.txt", "c.txt" ) 5.) open d.txt -> list of documents now shows "d.txt", "a.txt", "b.txt", "c.txt" Without having the time atm to go through the source code I would speculate that the sorting operation takes place prior to the append operation. Regards Martin
I do have exactly the same issue with KDE 4.3.2, Kate 3.3.2
https://bugs.kde.org/show_bug.cgi?id=198570 says how to fix this. Any chance we could get this fixed by kde 4.4, or are you waiting for someone to actually submit a patch?
Created attachment 39320 [details] On opened its make the call to KateViewDocumentProxyModel::sort() On KateViewDocumentProxyModel::opened its make the call to KateViewDocumentProxyModel::sort()
Created attachment 39323 [details] sort the content of file list after the file get added to filelist Hi, This version of the patch is more refine which calls the sort function after file gets open as normal behavior of kate add the file in to file list 1st time when we open the file. in this I have removed the unwanted call to sort() from KateViewDocumentProxyModel::slotRowsInserted which is of no use. hope this will solve the BUG :)
Created attachment 39346 [details] sort the content of file list after the file get added to filelist ignore sorting on other filelist event More update to same patch but is performance issue solve.. While working on some other but i figured out that KateViewDocumentProxyModel::opened getting called on KateFileList clicked event to open and activate doc this will cause in unnecessary calls to Sort()so to protect it if the sender for this slot is KateFileList then ignore this calling sort().. this seems perfect for this..
Review request: http://reviewboard.kde.org/r/2447/
Fixed in r1070443 by abhishekpatil WebSVN: http://websvn.kde.org/?view=revision&revision=1070443
Thanks a lot :) Any chance of this being back-ported to the 4.4 (and maybe even 4.3?) branch?
It already exists in the 4.4 branch (commit was 7 days ago, didn't auto-resolve here for some reason).
Indeed, how about also porting the fix to 4.3 branch, given that 4.3.5 will be released (in two days)?
I did actually test the patch in 4.3 branch Kate, and it works as expected. I'm itching to commit it myself before tomorrow's tagging of 4.3.5. Is there a reason why I shouldn't?
Please, go ahead and backport it.
SVN commit 1077835 by ilic: Honor file list sorting when opening/creating new file. (bport: 1070443) CCBUG: 184055 M +7 -3 kateviewdocumentproxymodel.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1077835