Andrius
2014-01-23 12:40:19 UTC
When loading project, we add filenames to the filebrowser and marking them bold in advance, before filling tree model with entries. This works satisfactory in flat or dual view mode in filebrowser. However, in tree view mode there is one problem. If we have project with files located in several folders (the more complicated structure of folders is the more visible this issue is), then after project load we are getting "floating" file names in the tree that looks weird. The reason of this is that while filename is added to the tree model, the folder where file belongs might not yet exists in tree model.
I am attaching patch that is free of this issue. The marking of files bold is moved to dir_changed_lcb() callback, which is fired after certain directory is refreshed. We check if opened documents filenames are marked bold, and if not, we mark them. The files that are already marked are skipped. When we gradually fill tree model with entries, all opened files are marked. There is probably small performance penalty, but it is really small, I think.
Any comments?
Andrius
I am attaching patch that is free of this issue. The marking of files bold is moved to dir_changed_lcb() callback, which is fired after certain directory is refreshed. We check if opened documents filenames are marked bold, and if not, we mark them. The files that are already marked are skipped. When we gradually fill tree model with entries, all opened files are marked. There is probably small performance penalty, but it is really small, I think.
Any comments?
Andrius