Monday, November 08, 2010 at 12:03 AM.

system.verbs.builtins.Frontier.tools.windowTypes.isWindowDirty

on isWindowDirty (adr) {
	<<Return true if the window needs to be saved.
	
	bundle { //a windowType can override the isDirty behavior
		local (adrtype);
		if Frontier.tools.windowTypes.findWindowType (adradrtable:@adrtype, adrwindow:adr) {
			if defined (adrtype^.isDirty) {
				return (adrtype^.isDirty (adr))}}};
	
	local (d, modTime = timeModified (adr));
	
	if window.attributes.getOne ("lastSaved", @d, adr) {
		return (d < modTime)};
	if window.attributes.getOne ("lastOpened", @d, adr) {
		return (d < modTime)};
	if window.attributes.getOne ("timeCreated", @d, adr) {
		return (d < modTime)};
	
	return (false)};

<<bundle //debugging
	<<msg (isWindowDirty (window.frontmost ()))



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.