Autosave Session (60 seconds timer)#874
Conversation
|
The latest commit could fix #845 |
|
The good thing about QTimer is it will run the session saving on the main thread. Scintilla is not thread safe. However, that being said it could possibly cause temporary lag spikes backing up the session. Have you tested this at all on having multiple and/or large files opened? I'm curious if there's any indication of when it may start to visually lag the UI and input for the user. In the end this is by far the safest/easiest. |
I often use QTimer for doing things (qt graphics, signals to UI in qt quick) from the main thread. Another idea could be:
This happens only in the "autosave" done by the QTimer. The |
Agreed.
Ah yes that would prevent accessing the Scintilla editor(s) from multiple threads by grabbing and passing the text to the background thread, rather than the thread using the editor. It could possibly have a memory spike "duplicating" all the files, but that is probably also acceptable. Or it could pass the text buffer one by one rather then all of them at once. Just an implementation difference is all. Overall I think this is a great and simple first implementation to see how well it works in the real world. No point in over-engineering a solution if it's not need yet. |
This is a simple implementation of a QTimer that saves the sessione each 60 seconds.
It could be improved by adding the interval inside the Preferences Dialog.
It fixes #871 and #658