[sword-devel] How to detect books available in a given module ?

Pierre Amadio amadio.pierre at gmail.com
Tue May 15 11:47:47 MST 2018


Hello !

On 15/05/2018 19:30, David Haslam wrote:
> Hi Pierre,
> 
> Aside: It might be useful to outline the context for which you require that data.

I am trying to build a small qml frontend where a listView used to
select a book should be populated only with books actually available in
the current selected module.

> You might just wish to consider using the Sword utility emptyvss.

Ahh, i did not know this tool. I do not understand all it does, but I
guess the important part is where it check if a verse has no length:

                        if (!mod->renderText().length())

I was first using something similar, without checking for a module error
before rendering the text, but when the module was OSHB (hebrew) and the
verse key was set to Mark 1.1, I had a content maching "II Chronicles
1:1" (instead of nothing).

Indeed if i run "./emptyvss OSHB" i get no output at all. May be _that_
is a bug after all :-)

Anyway, thanks for the feedback, using both checks (module error and
verse length, it looks like i can find which book is available or not in
a given module.





More information about the sword-devel mailing list