GNOME Bugzilla – Bug 340769
notes changes are not saved on hide or soon after modification
Last modified: 2010-01-24 01:06:01 UTC
Please describe the problem: It appears (via strace) that notes are saved every five minutes, or on certain window activity. The current behavior saves the file lots of times during note resizes and usually doesn't save soon after changes. This is inefficient and can cause data loss. It would be better if every 10s or so, the notes are saved if the notes have been modified since the last save. Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information: ubuntu dapper beta
Yes, this is what the code does, and I agree it is sub-optimal. I have the start of a patch which I will attach shortly.
Created attachment 74380 [details] [review] initial patch This patch implements this behavior to some degree. Now a change to a text buffer starts a 10 second timer. If there are no changes in those 10 seconds, the notes are saved. I think this could be improved by changing other places that call stickynotes_save() to use this same sort of timeout as well. Also I wasn't sure what to do with the old timeout value in the schema. I left it there (and I left a little bit of commented-out code to use it, as well) -- is it ok to delete this?
This looks pretty good from a first inspection. On the schema value, it should be fine to completely delete it.
Created attachment 74996 [details] [review] updated patch - warning fix, remove schema Oops -- I've had this updated patch for a while but forgot to upload it. This removes the schema entry. It also fixes a warning that I'd missed earlier.
Put it in HEAD.
Commited.