Menu

#763 Opening Code::Blocks adds lots of files to recent file list

Undefined
open
nobody
None
Bug_Report
2018-11-17
2018-11-12
No

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.

Discussion

  • Teodor Petrov

    Teodor Petrov - 2018-11-12

    Can you please explain the problem with a bit more details?
    What do you mean by system list?

     
  • Fabián Inostroza

    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).

     
  • Miguel Gimenez

    Miguel Gimenez - 2018-11-16

    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.

     
  • Miguel Gimenez

    Miguel Gimenez - 2018-11-17

    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
  • Fabián Inostroza

    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).

     
  • Teodor Petrov

    Teodor Petrov - 2018-11-17

    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...

     
  • Fabián Inostroza

    Using wxFileHistoryBase avoids that part and at least work fine on Linux

     
  • Teodor Petrov

    Teodor Petrov - 2018-11-17

    What do you mean? Why don't you just remove the call to AddFileToHistory from C::B's sources?

     
  • Fabián Inostroza

    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.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.