xn-todos: write_file() issues with categories


I’ve fixed the read_file() bugs so now xn-todos will correctly stuff Todos with unknown categories into Unfiled and stash an XML tag with the XNotes category in the Notes field. This works well on the outbound data. Now I have to muck with the inbound data. And therein lies a problem.

Inbound data from the Pilot first writes out the known categories then writes out the Todo entries. However, to get the XNotes categories I need to know ahead of time what those categories are so I can write them at the same time the Pilot categories are written. Catch22.

I can either run the list of Todo entries twice – once to get the categories and once to write them out or I can leave processing of XNotes categories to the UI. I think I prefer the two pass solution because the data is already in an array and easy to process, doesn’t require two roundtrip data xfers to the Pilot and keeps this processing out of the UI.

Guess I need a new function in xn-todos.c (and the other pilot tools once I finally port support for category edits to them).

—-
15:05PM

Just checked in the changes to xn-todos.c to handle preprocessing the XNotes categories. It compiles find but has not been tested. I’ll try to test it tonight when I get home.

Related posts