From: James L. <jrl...@co...> - 2006-04-27 09:39:46
|
As part of my prefs work, I've found it necessary to make some changes to gtkpod_confirmation and get rid of the ConfHandlerOpt type and replace them with prefs keys used in the new system. While getting rid of that part was easy, I've come upon a small dillemma: The option handlers need a pointer to the ConfData structure so that they can handle these "invert states." Naturally, my first thought was to add the prefs key strings to the struct, but that would require that I free them when I'm done with them, and that would make the code more complex, which is something I'd really like to avoid. So then my next idea would be to get rid of the CONF_STATE_INVERT* flags totally so that the callbacks wouldn't need the conf data, just the key. I've noticed that these flags are used only once in the whole codebase. I think it would make things easier if we just made it so that the checkboxes were set such that we didn't have to worry about the invert stuff. As the only example in the code right now, there is a gtkpod_confirmation in the sync_dir_ok function with a checkbox that says "Never delete any files when syncing," and it is set to CONF_STATE_INVERT_FALSE. I take this to mean that if this box is checked, set_sync_remove would be false and vice-versa. Wouldn't it simplify things a little if we changed the label to something like "Remove files deleted from synced directories" or something like that, and set that box according to the prefs. OK, so this has gotten longer than I hoped...;) If no one objects I'll commit a patch to this effect. James |