Bug 157246 - Bookmarks and reviews are not saved immediately and can be lost after a crash
Summary: Bookmarks and reviews are not saved immediately and can be lost after a crash
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 0.6
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-06 07:27 UTC by Vladimir Kuznetsov
Modified: 2009-12-26 17:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kuznetsov 2008-02-06 07:27:31 UTC
Version:           0.6 (using 4.00.00 (KDE 4.0.0), Kubuntu packages)
Compiler:          gcc
OS:                Linux (i686) release 2.6.22-14-generic

Currently okular saves bookmarks and reviews only when closing a document. But the user usually keeps the document opened for a long time (can be several days in my case) and could create bookmarks and annotations while reading it. Than if okular (or X or power) crashes all that bookmarks are lost.
Comment 1 Pino Toscano 2008-02-06 09:54:03 UTC
> Currently okular saves bookmarks and reviews only when closing a document.

Not entirely true, annotations are saves each 5 minutes.
I could have bookmarks saved at the same time, but it would be so important save after ANY change?
Comment 2 Vladimir Kuznetsov 2008-02-06 10:18:47 UTC
Actually, I've observed the bug with bookmarks after actual power failure and only then I've tested it manually with annotations. I think that saving bookmarks and annotations every 5 minutes should be fine enough. Another possibility is to save them when they lose the focus, or when the user scrolls to another page.
Comment 3 kde2eran 2008-02-06 20:47:40 UTC
Saving on focus loss (in addition to 5 minutes) is a good idea. KNotes does this.
Comment 4 FiNeX 2008-11-19 20:25:01 UTC
Changed severity to "crash". I hope to have selected only the right bugs (>100) :-)
Comment 5 Bartemius Crouch 2009-05-07 23:37:19 UTC
Hi, this is indeed a problem, loosing your recent bookmarks. However the problem here is much worse. In case of a crash Okular will not only loose bookmarks set in the last run but *ALL* bookmarks for the file that was open. I am using Okular 0.8.3 on KDE 4.2.2/3 on Arch GNU/Linux and I saw this happen numerous times.

P.S to make it worse, Okular is the main reason for crashes and freezes on my machine due to Intel drivers being broken for months now, and scrolling in Okular drags X and then my system to hell.

P.P.S I keep my books on remote storage and only symlink the one I'm reading to my home. When I remove the symlink bookmarks, and everything else, for the file are lost. I don't want to open a bug report for this - as you will say it's not a bug. But was changing this behaviour ever considered?
Comment 6 Pino Toscano 2009-12-26 17:57:12 UTC
SVN commit 1066286 by pino:

Change the saving strategy for bookmarks: instead of saving them manually or at closing, save them after each action.
This should avoid any bookmark loss due to premature crash or similar abnormal closing.
BUG: 157246
BUG: 213206
Also, the above change triggers the D-Bus synchronisation of the internal bookmark manager of the various Okular instances;
react to those changes properly by updating the own info (because of the changes in the bookmark manager of another instance).
BUG: 216239

On the technical note, keep the cache of known file just with the bookmark address instead of the group itself
(which gets changed behind our back).


 M  +98 -25    bookmarkmanager.cpp  
 M  +2 -0      bookmarkmanager.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1066286