pjrinaldi / wombatforensics

linux c++, fox-toolkit, multi-threaded forensic gui tool
GNU General Public License v2.0
47 stars 12 forks source link

Switch NodeData from QList<QVariant> to QHash<QString, QVariant> #392

Closed pjrinaldi closed 2 years ago

pjrinaldi commented 2 years ago

When adding a new column to column view, it requires a ton of work to update everything and stay backwards compatible, which makes the new column have to go at the end.

If I switch to a QHash<qstring, qvariant>, then i can have a new column go into its own entry, and then i can order them according to their key for the header, and their value for the contents...

Need to test this and see how it works for the headers, and then port to the rest of the node values.

pjrinaldi commented 2 years ago

gonna start on this change...

pjrinaldi commented 2 years ago

change is in progress. i converted treenode and treenodemodel, no just need to apply the change to the entire code framework.

pjrinaldi commented 2 years ago

biggest issue to figure out right now:

How to get the selectedindex.sibling(selectedindex.row(), column#).data().toString() and then ensure i am getting the right column since if i do this right, i will have reorderable columns as in xways or ad lab. I can hide/show them, but reordering would be nice as well. also being easier to add new columns would be nice as well.

pjrinaldi commented 2 years ago

working my way through the code upgrading... things i need to circle back around to:

  1. if i can handle node.contains() so i can replace it with "" and not have to populate empty ones with node.insert("0")
  2. opencase doesn't account for the moveable columns, so i need to build something to break them out.
pjrinaldi commented 2 years ago

switch is complete and seems to be working. need to look into if i can use contains to set blank.

pjrinaldi commented 2 years ago

i'll worry about the contains() and blank values later.

pjrinaldi commented 2 years ago

working on opencase with new hash columns. modified new TreeNode(data) code to check if data.contains("column")) and if so, itemdata.insert("column", data.value("column")) else itemdata.insert("column", [blankvalue]);

this change should allow me to only pass relevant values to nodedata, but still have all columns populated and if i add new columns, then adding the new if to the TreeNode() function should auto resolve existing cases so they migrate smoothly.

need to conduct initial test and further testing as I clean up and upgrade code throughout codebase

pjrinaldi commented 2 years ago

save/open case tree works for ext3 testimage example, and new TreeNode() function works and allows me to not bother with populating each node with empty values, since TreeNode() puts them in on new().