Merge lp://staging/~przemub/rednotebook/lock-journal into lp://staging/~jendrikseipp/rednotebook/trunk
Proposed by
Przemysław Buczkowski
Status: | Needs review |
---|---|
Proposed branch: | lp://staging/~przemub/rednotebook/lock-journal |
Merge into: | lp://staging/~jendrikseipp/rednotebook/trunk |
Diff against target: |
151 lines (+84/-1) 5 files modified
rednotebook/files/main_window.glade (+29/-0) rednotebook/gui/main_window.py (+13/-0) rednotebook/journal.py (+12/-0) rednotebook/storage.py (+3/-1) rednotebook/util/filesystem.py (+27/-0) |
To merge this branch: | bzr merge lp://staging/~przemub/rednotebook/lock-journal |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Przemysław Buczkowski (community) | Disapprove | ||
Jendrik Seipp | Needs Fixing | ||
Review via email: mp+233637@code.staging.launchpad.net |
Description of the change
Hello!
This is a proposition to solve bug #974590. The program now checks is a lock file existing in the journal directory. The lock file (.pid.lock) is created at the opening time and removed while the journal is changed or the RedNotebook instance is closed.
It doesn't watch have the journal files been modified externally, because I see point neither in modifing them outside RedNotebook nor in using two instances at once.
PS. Sorry for posting it twice. I don't understand both Bazaar and Launchpad sufficiently yet :-)
To post a comment you must log in.
Unmerged revisions
- 1421. By Przemysław Buczkowski
-
create and detect the lock files for the journals
Thanks for the patch! Actually this solution (a file lock) was used in RedNotebook once. Unfortunately, it caused many false-positives, i.e. the user was prompted with "Your Journal is still open" when actually the lock just hadn't been removed. This can happen if the system crashes while RedNotebook is running or if RedNotebook itself has a bug that causes a crash.
I think a better solution would be to warn the user once he wants to save a month file that has changed while he opened it (we would have to save the time of opening the file). Then he should be presented with the differences and be able to decide if he wants to merge the changes or just keep one of the versions. This would also allow to use multiple copies of RedNotebook (which is actually useful, because people often use multiple journals).