Commit graph

14 commits

Author SHA1 Message Date
Marwan Tanager
ae59da30c8 Bookmark the exact position, not just the page number (along with a number of fixes).
This patch adds some enhancements/fixes to the bookmarking feature of Zathura:

    - Bookmark the exact vertical and horizontal adjustments values, along with
      the page number. This is done in a backward-compatible way for both the
      plain and sqlite database backends, so that bookmarks that was taken
      previously (bookmarking only the page number) will still work as expected
      and won't be lost.

    - Fix the issue of not being able to remove bookmarks from the plain
      database; removing a bookmark in plain_remove_bookmark using
      g_key_file_remove_key corrupts the bookmarks file.  This is due to not
      truncating the entire bookmarks file in zathura_db_write_key_file_to_file
      prior to overriding it with a new one not containing the removed line.
      This is why, I guess, plain_remove_bookmark hadn't been implemented as
      expected using g_key_file_remove_key, because apparently, someone thought
      that the problem is caused by this API.

    - Fix not being able to update existing bookmarks persistently; updating a
      bookmark works only during the current session, but after the file is
      closed and reopened, the updated bookmark still has it's old value. This
      is due to changing only the bookmark structure in memory; the proper way
      to do it, is to call zathura_db_remove_bookmark on the old bookmark, then
      follow that by a call to zathura_db_add_bookmark on a bookmark structure
      containing the new position and the same old ID.

    - Make zathura_bookmark_add updates the bookmark if it already exists,
      rather than doing this externally in cmd_bookmark_create. This allows us
      to have all the relevant girara_notify messages in cmd_bookmark_create.

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2013-06-21 09:45:36 +02:00
Moritz Lipp
89e7832047 Update style 2012-10-09 01:12:18 +02:00
Moritz Lipp
ab4c364e56 Update document information plugin api 2012-03-30 18:24:00 +02:00
Moritz Lipp
334b4fbb95 Introduce and use zathura_document wrapper functions 2012-03-27 21:59:35 +02:00
Moritz Lipp
394fbd934d Update style 2012-02-17 00:43:01 +01:00
Sebastian Ramacher
d18f255bc0 use girara_list_find 2011-10-23 20:18:44 +02:00
Sebastian Ramacher
911d84c908 update includes due to girara restructuring 2011-10-23 17:01:15 +02:00
Sebastian Ramacher
10fbf29125 adopt to girara changes 2011-10-17 11:16:14 +02:00
Sebastian Ramacher
712e4bd408 use the correct sorting function 2011-10-15 18:42:30 +02:00
Sebastian Ramacher
02e0c8b2d3 Fix a typo 2011-10-03 17:28:14 +02:00
Sebastian Ramacher
b34d21afaf implement content type support 2011-09-29 15:23:13 +02:00
Sebastian Ramacher
7b3d31a3e5 implement cmd_bookmark_remove 2011-09-03 13:40:28 +02:00
Sebastian Ramacher
6f567a6264 some initial work on the sqlite database backend 2011-09-02 20:46:16 +02:00
Sebastian Ramacher
a6596fb908 initial bookmarks implementation 2011-09-01 15:43:34 +02:00