dive_trip_list & dive_table
Dirk Hohndel
dirk at hohndel.org
Mon Apr 15 07:06:13 PDT 2013
Dirk Hohndel <dirk at hohndel.org> writes:
> Amit Chaudhuri <amit.k.chaudhuri at gmail.com> writes:
>
>> Hi all,
>>
>> I'm trying to amend my Qt treeview to show dives from the xml data in
>> subsurface. My current test dive set is grouped as 5 dives in 2 trips.
>>
>> When I query the members of struct dive_table from my mainwindow.cpp in
>> qt-gui/ I get a surprising result:
>>
>> int nr == 0
>> int preexisting == 0
>> int allocated == 0
>
> That should read 10, 10 and a few more.
I did a quick experiment and put a breakpoint at
MainWindow::on_actionOpen_triggered()
I start Subsurface, it loads my dives, I click open in the new UI and
get this:
(gdb) p dive_table
$2 = {nr = 222, allocated = 228, preexisting = 222, dives = 0x85c9600}
which looks pretty much as expected.
Is it possible that you are checking before parse_xml_buffer() has been
called? Just for fun, put a breakpoint on that function. If you can
point me to another spot that gets called AFTER parse_xml_buffer and
where dive_table is empty then I may be able to help you better.
>> So, grep -r -n '*dive_trip_list' *.c *.h and I get 4 hits.
>>
>> 1) a comment
>> 4) extern decl
>> 2) divelist.c:57 dive_trip_t *dive_trip_list;
>> 3) divelist-gtk.c:62 dive_trip_t *dive_trip_list;
>>
>> Is the duplication of dive_trip_list a bug? Should one of these be extern?
That's a bug and I'll push a fix in a minute
/D
More information about the subsurface
mailing list