woodruffr1973 / ardb

Automatically exported from code.google.com/p/ardb
0 stars 1 forks source link

Overall Card Totals not working #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add any crypt/library cards to inventory.
2. Save inventory.
3. Export inventory to HTML.
4. View outputted HTML file in any browser.

What is the expected output? What do you see instead?
At the top of each section, there's a Vampires [0] entry and a Cards [0] 
entry, which I'm assuming should be a card-total (ie. total number of 
vampire cards, and total number of library cards).

What version of the product are you using? On what operating system?
ARDB 3.1.1 (and same issue with 3.0.1), on Windows 7 Home Premium 64-bit.

Please provide any additional information below.
Had a look inside the XML file generated, when you save your inventory, 
and that also has <crypt size="0"> and <library size="0"> at the start of 
each section.

Don't know whether the Vampires [0] and Cards [0] in the generated HTML 
file are supposed to be a card-total for crypt and library cards, and 
couldn't see any previous issues raised for this, but thought I'd raise 
this just to check.

Original issue reported on code.google.com by goo...@baines-house.co.uk on 24 Apr 2010 at 11:18

GoogleCodeExporter commented 9 years ago
This does seem to be a problem.  I'm not sure when this will be fixed though as 
there 
are higher priority bugs to be fixed :-(

I will add it to the accept list.

Original comment by graham.r...@gmail.com on 20 May 2010 at 8:57

GoogleCodeExporter commented 9 years ago
This is caused in inventorymodel.cpp, the total size of the crypt and library 
are intialised to be 0 on line 286 and 328 and then the xml property set from 
this. The size is never updated after initialisation at 0. I verified this by 
changing the initialised value of 0 and compiling and the exports do indeed 
show whatever I set it to. 

 284     // Add the crypt node
 285     nCrypt = my_xmlNewChild (nRoot, NULL, wxT ("crypt"), wxT (""));
 286     sCount = wxT ("0");
 287     my_xmlNewProp (nCrypt, wxT("size"), sCount);
.
 326     // Add the library node
 327     nLibrary = my_xmlNewChild (nRoot, NULL, wxT ("library"), wxT (""));
 328     sCount = wxT ("0");
 329     my_xmlNewProp (nLibrary, wxT ("size"), sCount);

I am happy to fix this but what should the value be? Should it be the number of 
unique cards in the library/crypt in your inventory or the total number of 
cards you have/want/need?

E.G. Inventory contains only 1 Abdelsobek and 2 Adana de Sforza. Should the 
crypt count show 2 or 3 (3 since there is 1 of Abdelsobek and 2 Adana)?

If it is the former (i.e. a count of unique library/crypt cards in the 
inventory) then the attached patch will resolve this issue.

Original comment by JFHarden@gmail.com on 28 Jul 2010 at 1:57

Attachments:

GoogleCodeExporter commented 9 years ago
I think it should total number of owned cards.  In your example it should 3.

Original comment by graham.r...@gmail.com on 28 Jul 2010 at 6:44

GoogleCodeExporter commented 9 years ago
No problem, new patch attached which sets to the total to be the total number 
of library/crypt cards the user has. I thought about adjusting the SQL to have 
SQLite calculate it but I don't think it's as efficient as just adding it up 
since the model already traverses all of the library and crypt cards.

Original comment by JFHarden@gmail.com on 28 Jul 2010 at 8:29

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Based on Revision 245, I assume this bug is fixed. It is included in 3.2 
release. Closing.

Original comment by gokturk....@gmail.com on 21 Jan 2013 at 3:19