Menu

#531 [default.conf] config changes lost after crash

Undefined
open
nobody
None
Bug_Report
2017-08-05
2017-07-28
Jannick
No

After a crash configuration changes in the current session are not stored in default.conf and appear to be lost.

Currently in such a case the config changes - which could be many - need to be manually entered again.

Related

Tickets: #537

Discussion

  • Jannick

    Jannick - 2017-07-28

    Sorry - applies to Win10 | nightly build 11112 (and earlier)

     
  • ollydbg

    ollydbg - 2017-08-01

    By reading the source code, it looks like you have to click the "save all" button.

    void MainFrame::OnFileSaveAll(cb_unused wxCommandEvent& event)
    {
        Manager::Get()->GetConfigManager(_T("app"))->Flush();
        Manager::Get()->GetEditorManager()->SaveAll();
        ProjectManager *prjManager = Manager::Get()->GetProjectManager();
        prjManager->SaveAllProjects();
    
        if (prjManager->GetWorkspace()->GetModified()
            && !prjManager->GetWorkspace()->IsDefault()
            && prjManager->SaveWorkspace())
        {
            m_projectsHistory.AddToHistory(prjManager->GetWorkspace()->GetFilename());
        }
        DoUpdateStatusBar();
        DoUpdateAppTitle();
    }
    

    The first line

    Manager::Get()->GetConfigManager(_T("app"))->Flush();
    

    Should save the configure file for the application.

     
  • Jannick

    Jannick - 2017-08-01

    Great - that's helpful. However, it is not the "save all files" button which writes to default.conf, but it is the menu item "Files > Save everything (Alt + Shift + S)".

    Would it be an idea to invoke

    Manager::Get()->GetConfigManager(_T("app"))->Flush();
    

    once one of the settings dialog is closed with "OK", since then the user really means the config changes.

     
    • ollydbg

      ollydbg - 2017-08-03

      I agree on this, but I'm not sure this would cause other issue, I'm not too familar with that piece of the source code. ^_^.

       
  • Jannick

    Jannick - 2017-08-04

    I see. At least there is the 'Save-everything' fall-back for this.

    I am hoping that this gets implemented such that the configs are really saved for any user.

     
  • bluehazzard

    bluehazzard - 2017-08-05

    The OK button should really flush the settings to disk... I don't see any reason why the configuration should only be saved if I hit the "save everything" button

     
    • Jannick

      Jannick - 2017-08-05

      The OK button should really flush the settings to disk... I don't see any reason why the configuration should only be saved if I hit the "save everything" button

      1. Yes, it should, but this is not what happens here. Would you mind pointing to where in the code the flush to the disk really happens?
      2. On my machine (Win10) default.conf remains untouched until CB properly closes or if the button 'save everything' is hit. Is this the case on your side as well or rather different when re-reading your comment?
       
  • Teodor Petrov

    Teodor Petrov - 2017-08-05

    In the past I've also been frustrated by this, but after discussions in the forum with the other devs - it has been concluded that the current behaviour is fine and should stay.

    Search the forum for the rationale. I don't remember it exactly.

     
  • bluehazzard

    bluehazzard - 2017-08-05

    i have searched the forum but i didn't found anything related to this, except people complaining about this odd behaviour....
    Saving something only on a clean closing of the program is a really bad behaviour. There are tons of reasons why a program can crash/ not perform a clean exit (power loss, crash of the operating system ecc...). And if the user hits "OK" he knows that the settings will be stored. 99% of all programs out there behave like this and i don't see why codeblocks should not...
    There is the save everything button, but if you don't have open a project it wont be activated, so no chance to save your settings..

     
    • Jannick

      Jannick - 2017-08-05

      Saving something only on a clean closing of the program is a really bad behaviour. There are tons of reasons why a program can crash/ not perform a clean exit (power loss, crash of the operating system ecc...). And if the user hits "OK" he knows that the settings will be stored. 99% of all programs out there behave like this and i don't see why codeblocks should not...

      Yes - fully agree.

      There is the save everything button, but if you don't have open a project it wont be activated, so no chance to save your settings..

      Feature already requested: [tickets:#537] activate 'Save everything' btn when no project opened

      Many thanks!

       

      Related

      Tickets: #537


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.