Where is my Code?

What a nice feature that the Jucer instructs me where to put my code - but how rude that this precious code gets lost when I decide to rename some components!

So before I rewrite all this precious code that took half the bangalore population a decade to write, is this really discarded or is there some garbage bucket I can dig and search?

Stefan

The Jucer uses its own xml meta data to keep track of what you have created. It is this that provides the layout and code preview so any code that you change will get overridden if you change it outside of the Jucer.

If you need to add custom code you can do it within the commented sections. This code will not get shown in either the Jucer’s layout or code previews.

Hope that makes some sense.

Dave missed what you were saying. Yeah, probably gone. The only place it could be is down in the meta data. But I guess if you changed the name, then saved, Jucer regenerated stuff. Bummer.

Bruce

Yes, sorry! If it’s any consolation, I’ve also lost code a few times by doing the same thing…

But unless I’m missing an obvious trick, I’m really not sure what I could do to avoid this. Maybe it’d be possible for the jucer to do something like a diff on the files before and after saving, and warn you if it looks like it’ll be throwing away code… but I’m not sure if even that would be very reliable.

I feel very consoled now indeed.

You could perhaps to append the deleted code in some garbage collection at the end of the File:

#if 0 // orphaned code
some precious code …
#endif

However, not so important now that I do save my backups.

Stefan

Backup! Backup! Backup! Everyday! You have no idea how useful this has been to me.

you don’t need to backup if you properly use a version control system…

Sounds like a form of backup to me… :slight_smile: