[bt-devel] Help with keys

Joachim Ansorg bt-devel@crosswire.org
Tue, 10 Dec 2002 16:05:55 +0100


Hi!

> I have been looking through the code to try and understand how it works
> and also to try and understand why the starting page is blank with the
> GenBooks modules (which Christian Renz has recently announced on
> sword-devel).

This is probably caused by the bahaviour of the Treekeychooser, which inserts 
into  the first (toplevel) chooser an empty entry at the beginning which will 
later be chosen as default.

> Could you please explain the relationship to the key being set in the
> constructor of CLexiconReadWindow (which is the base class for the
> CBookReadWindow) and the key set in CDisplayWindow::init which I think
> is alway NULL.

CDisplayWindow::init calls this code:
  if (key())
    key()->key(keyName);

The key returned by key() was set in the constructor of CLexiconReadWindow, 
which creates a key which type depends on the type of module it gets as 
parameter.
So key() returns normally something not null, otherwise something goes wrong. 
Why do you think it's NULL?

keyName might be sometimes equal to QString::null, but ony when no key was 
chosen at which the module should be opened.

Joachim
-- 
Joachim Ansorg
www.bibletime.de
www.ansorgs.de