[bt-devel] Cross-reference question

Gary Holmlund gary.holmlund at gmail.com
Wed Jul 18 20:23:22 MST 2012


Ben,

I was on vacation when you sent this. I saw it but forgot to get back to 
it until now. I think you first problem with the code below is that the 
m_htmlPart is inside the CInfoWindow so the window pointer you got was 
the CInfoWindow (Mag Window).

I went ahead an wrote code to do what you were trying to do and checked 
it in. You can see it at:
http://gitorious.org/bibletime/bibletime

Gary


On 06/10/2012 06:47 PM, Ben wrote:
> Hello all,
>
> I have a little wish for BibleTime that I've been trying to implement, 
> but I'm running into some problems (and I'm not at all an expert in 
> C++). I thought I'd see if anyone had some insights to help.
>
> My problem/wish is that when I open BibleTime on a computer where 
> there's no default Bible defined, and I mouse-over a cross-reference, 
> nothing shows up in the Mag. I would like to change that so that if 
> there's no default Bible, it uses the current Bible being displayed to 
> show the cross-referenced verses.
>
> I've found CInfoDisplay::decodeCrossReference, and I see that in this 
> case, the "module" variable doesn't get initialized, so it can't pull 
> any verse data to be displayed.
>
> As I test, I'm using the ESV module, and I would like to get 
> cross-referenced verses displayed in ESV, so I've been trying to get 
> the current module being used in CInfoDisplay. I'm not sure if this is 
> the best or correct way to get the current module, but here's what I 
> tried in CInfoDisplay::decodeCrossReference:
>
> CDisplayWindow* window = m_htmlPart->parentWindow();
> CSwordKey* key = window->key();
> CSwordModuleInfo curMod(*(key->module()));
> if (!module) {
>     module = &curMod;
> }
>
> I was able to compile the code, but got a seg fault when I ran it.
>
> I also tried just getting the name of the current module, and this 
> seg-faulted as well:
> std::cout << 
> m_htmlPart->parentWindow()->key()->module()->name().toStdString();
>
> Is this the correct way to get the current module being viewed from 
> CInfoDisplay? Is there a better way? Any hints or tips?
>
> Thanks,
> -Ben




More information about the bt-devel mailing list