GNOME Bugzilla – Bug 698311
quick open: fails to find files I've opened recently
Last modified: 2019-03-23 20:35:03 UTC
The Quick Open plugin often fails to find files I've opened recently. A glance at the function RecentDocumentsDirectory.fill in virtualdirs.py reveals a couple of problems: 1. The code sorts recent documents in *ascending* order by time, then grabs the first 10. So it's actually using the 10 *least* recently visited documents rather than the most recently visited ones. 2. I think the constant maxitems = 10 here is much too small. I can easily imagine editing dozens of files in a day and then wanting to quickly open one that I last opened the previous day. At the very least I think we should increase this constant. A better solution would be to include all recent documents in this virtual folder, but then to limit the number of search results displayed to 10 or so in the view layer. That way I could have hundreds of recent documents but still be able to recall any one of them by typing a few characters of its name.
Fixed point 1
About 2, the main problem is that right now quickopen is not async. This is something that we discussed some time ago but we really didn't have to implement. :(
I still bet we could increase the maxitems constant a lot without any noticeable lag. If we increase it to, say, 200, that might be good enough for now and we could always add asynchronous support later.
Unfortunately the recent change cac267a7 does not fix point 1: - items.sort(key=lambda a: a.get_visited()) + items.sort(key=lambda a: - a.get_visited(), reverse=True) Changing "a.get_visited()" to "- a.get_visited()" reverses the sort order, but reverse=True reverses it again, so in the end the order is unchanged.
urgh... forgot to remove the "-"
Pushed the new fix, thanks for pointing it.
200 seems fair enough. Probably we should close this bug and open another to make quickopen async.
Sounds reasonable to me.
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.