This is the July 2023 update for Niepce.
The importer
Where we left, the workspace tree view didn't display the hierarchy.
First, I discovered bug in the SQL triggers for folder path update. I
was missing the AFTER
keyword to have it run after the update.
Workspace
Second, I need to specify a parent when adding items to the model, then locate the parent, add to it. The problem is that we get a list of folders in some order (I can order by any of the SQL columns). The problem is adding an item to a parent that is not yet int the model. There are few ways to go about it.
- Sort the folder list in order of a flattened tree. To be fair my SQL skills are not good enough, and I'm not even sure I can do that in sqlite. This would solve most of the problems.
- Sort the folder list once received. But this might not always work.
- Handle the case in the model: add with a placeholder parent and re-parent as needed when the parent is added.
For now I chose 3. The risk is that if the parent doesn't exist then the tree will stay lingering. It's just the view though.
Here is the result: