Zim

Comment 8 for bug 1181980

Revision history for this message
Andreas Wehler (andreas-wehler) wrote :

Concrete hint:

index.db depends on how zim has been invoked, on one and the same host.
Attached is a proof with an example zim book "~/info/Info_Zim/ScratchInfo".

Bad Case a)
===========
1) rm ~/info/Info_Zim/ScratchInfo/.zim/* # start with defined conditions
2) Launch zim via an own XFCE launcher or via the Desktop Application Menu.
   Keep in mind that the whole environment is minimum, shell startup
   scripts are not sourced and you just have no shell etc.
3) Within zim get access to he book ScratchInfo via
   File - Open Another Notebook # add it if needed, then open it
   I don't know if the location of zim books does matter, it should not.
4) # Pick Task List from Tool bar to enforce the build of a new index
   # leave zim now
5) create an sql dump of index.db
   cd ~/info/Info_Zim/ScratchInfo/.zim
   mkdir -p KeepMe/01
   sqlite3 index.db .dump >KeepMe/01/dump.sql # this file is broken
   less -NS KeepMe/01/dump.sql
  21 INSERT INTO "pages" VALUES(1,'','',0,0,1,NULL,NULL,NULL,NULL,1.42757454824159431454e+09);
  22 INSERT INTO "pages" VALUES(2,'Home','^S^Z^X^P^A ^A ',1,1,0,NULL,NULL,NULL,1.42635246455724644656e+09,NULL);
  23 INSERT INTO "pages" VALUES(3,'tmp','^_^XESC^A ^A ',1,1,0,NULL,NULL,NULL,1.42757454820559430124e+09,NULL);

Good Case b)
============
1) rm ~/info/Info_Zim/ScratchInfo/.zim/* # again, start with defined conditions
2) Launch zim via xterm or ssh -X
   zim --standalone ~/info/Info_Zim/ScratchInfo/
3) # we already are within the book, skip this step
4) # Tool bar: Task List
   # this will enforce a new index to be created
   # leave zim now
5) create an sql dump of index.db
   cd ~/info/Info_Zim/ScratchInfo/.zim
   mkdir -p KeepMe/02
   sqlite3 index.db .dump >KeepMe/02/dump.sql # this file looks good
   less -NS KeepMe/02/dump.sql
  22 INSERT INTO "pages" VALUES(1,'','',0,0,1,NULL,NULL,NULL,NULL,1.42757454824159431454e+09);
  23 INSERT INTO "pages" VALUES(2,'tmp','tmp',1,1,0,NULL,NULL,NULL,1.42757454820559430124e+09,NULL);
  24 INSERT INTO "pages" VALUES(3,'Home','home',1,1,0,NULL,NULL,NULL,1.42635246455724644656e+09,NULL);
  25 INSERT INTO "pages" VALUES(4,'Inkscape','inkscape',1,1,1,NULL,NULL,NULL,1.42670902619396615029e+09,1.4282495210700762272e+09);

You can work with the zim book with Bad Case a) as well as with Good Case b),
But if you decide to switch between the 2 different launch methods then the index is
totally broken and useless, the complete index pane is a whole mess.
I do need access to the zim book from several hosts and now I know a work around:
Just start local work also via xterm and enjoy. Local XFCE launcher will give
Bad Case a).
You can also build a launcher with a wrapper like:
   ssh -X localhost '$HOME/info/bin/StartZim.sh'
where the wrapper just holds:

#!/bin/bash
zim --standalone 2>&1 >/tmp/Zim_AW.log

This way you also can save the error messages.

Best regards, Andreas