[bt-devel] BibleTime 1.7 could display multiple lemmas properly, 2.0alpha2 cannot

Gary Holmlund gary.holmlund at gmail.com
Sun Mar 22 15:45:47 MST 2009


Tom Cornell wrote:
>
> Okay, I now see what is happening, and can propose a fix.
>
> The '|' character is used as a separator both between <w>-tag attributes
> and between components of those attributes. So, for example, the timeOutEvent(),
> which triggers displaying stuff in the mag (in 2.0, apparently not in
> 1.7?), will get
> the following string as its argument:
>
>   lemma=G746|ἀρχή|ἀρχή|morph=Robinson:N-NSF|
>
> It is now impossible to split this into the relevant pieces just using
> QString.split('|').
>
> Two distinct characters are needed, in order to reflect different
> depths of embedding
> in this structure.
>
> I modified bt_osishtml.cpp to insert ' ' (space) instead of '|'
> between components
> of the lemma attribute (around line 132),
> and modified CInfoDisplay::decodeStrongs() to split on " ", instead of "|".
> BtHtmlJsObject::timeOutEvent() still splits on "|", which remains as the divider
> between the lemma and morph attributes.
>
> So timeOutEvent is getting
>
>   lemma=G746 ἀρχή ἀρχή|morph=Robinson:N-NSF|
>
> and splitting it into
>
>   lemma=G746 ἀρχή ἀρχή
>   morph=Robinson:N-NSF
>
> and then decodeStrongs() is getting
>
>   G746 ἀρχή ἀρχή
>
> and splitting it into the obvious three parts.
>
> With the result that the Mag now looks pretty much like it did in 1.7,
> for modules like
> Tisch, with multiple lemma entries.
>
> -Tom Cornell
>   
Thanks Tom for finding the source of the issue. It was caused when I 
ported to QtWebkit from the previous KDE functions. I had to use 
javascript to get the dom attributes. I passed these from javascript to 
c++ by concatnating all attributes into a single string using "|" as the 
separator. I did not realize that "|" was in use within attributes. I 
have modified the javascript (bthtml.js) and the receiving c++ 
(bthtmljsobject.cpp) to use "||" for the separator. Since the list of 
attributes is split prior to the split within an attribute, this should 
work fine.

I could not find a test case with multiple lemma attributes so if you 
know of the test case please test this fix.

Gary



More information about the bt-devel mailing list