When I open Code::Blocks all of the recent projects (.cbp) and recent files listed in C::B "Start here" page are added to the system list of recent files.
I'm using C::B Release 17.12 rev 11263, SDK 1.33.0 on linux.
Sure, I use GNOME and in Nautilus there is entry to a recent file list. If I clean the recent file list and then open codeblocks the files listed on the "Start here" C::B tab are added to nautilus recent file list (actually to a standard file recently-used.xbel used by ¿all? desktop environments).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
CB checks for file existence before showing them in the list, and removes those that weren't found. May be Nautilus is too picky with this existence check or the check is too agressive, actually opening the files.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
CB uses wxFileExists() (in recentitemslist.cpp:128), which in Linux uses wxStat() and then stat() for checking the existence. This should not add an entry in Nautilus' recent list, I think the problem is in Nautilus side.
Last edit: Miguel Gimenez 2018-11-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Miguel, is not that line, I commented it out and the files are still added to the recent file list.
Also made a simple project where I call that function checking for the existence of a file in my drive and it is not added to the recent file list.
I don't think Nautilus is the problem, it just interprets the recently-used.xbel file (I don't know if directly or through a library or service).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The code responsible for manipulating the recent file list is AddFileToHistory.
It is called from multiple places. We do this when we initialise the recent file list, we do this when a file is opened, we do this when a file is opened from thread search plugin, the code snippet plugin also calls this.
My guess (without testing in practice) is that the call during recent file list initialization is causing the problem. So I'd try to comment the call inside RecentItemsList::Initialize and see what happens...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Because then the recent project and files list shown on the C::B startup page is always empty after closing and opening C::B.
Changing to wxFileHistoryBase has the side effect of no adding the opened files and project to the system recent file list, but since C::B seems to manage it's own list that is no a big problem, at least for me.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can you please explain the problem with a bit more details?
What do you mean by system list?
Sure, I use GNOME and in Nautilus there is entry to a recent file list. If I clean the recent file list and then open codeblocks the files listed on the "Start here" C::B tab are added to nautilus recent file list (actually to a standard file recently-used.xbel used by ¿all? desktop environments).
CB checks for file existence before showing them in the list, and removes those that weren't found. May be Nautilus is too picky with this existence check or the check is too agressive, actually opening the files.
CB uses wxFileExists() (in recentitemslist.cpp:128), which in Linux uses wxStat() and then stat() for checking the existence. This should not add an entry in Nautilus' recent list, I think the problem is in Nautilus side.
Last edit: Miguel Gimenez 2018-11-17
Hi Miguel, is not that line, I commented it out and the files are still added to the recent file list.
Also made a simple project where I call that function checking for the existence of a file in my drive and it is not added to the recent file list.
I don't think Nautilus is the problem, it just interprets the recently-used.xbel file (I don't know if directly or through a library or service).
The code responsible for manipulating the recent file list is AddFileToHistory.
It is called from multiple places. We do this when we initialise the recent file list, we do this when a file is opened, we do this when a file is opened from thread search plugin, the code snippet plugin also calls this.
My guess (without testing in practice) is that the call during recent file list initialization is causing the problem. So I'd try to comment the call inside RecentItemsList::Initialize and see what happens...
That is, also seems to be intentional https://github.com/wxWidgets/wxWidgets/blob/29bd2c92747f7bd53c74610f0683cc3e91ffbc17/src/gtk/filehistory.cpp#L49
I though the purpose of that class was to handle the recent files menu only.
Using wxFileHistoryBase avoids that part and at least work fine on Linux
What do you mean? Why don't you just remove the call to AddFileToHistory from C::B's sources?
Because then the recent project and files list shown on the C::B startup page is always empty after closing and opening C::B.
Changing to wxFileHistoryBase has the side effect of no adding the opened files and project to the system recent file list, but since C::B seems to manage it's own list that is no a big problem, at least for me.