On 08/15/2009 04:52 PM, Vincent van Ravesteijn wrote:
rgh...@lyx.org schreef:
Author: rgheck
Date: Sat Aug 15 18:39:36 2009
New Revision: 31057
URL: http://www.lyx.org/trac/changeset/31057

Log:
As discussed on the list: Check for dirty Buffer when destroyed.
Write emergency file if necessary.
Richard,

This doesn't really work like it should. When quitting LyX and discarding my changes I arrive in the new piece of code (which I shouldn't).

Oh, sorry, I forgot a piece of this when I was adapting the old patch, I think because you had changed the same bit of code. Can you try the attached? Basically, we need to mark the Buffer clean when the user discards changes. Clean, in the sense of "Don't worry about saving this." Maybe we should even change Buffer::isClean() to Buffer::needsSaving().

Even worse, I got a strange assertion when the emergency file was written. And I had no clue how that was caused. I still don't understand why I didn't see that before. Probably because LyX crashes anyway when an emergency file was necessary.

Not sure about that, sorry. But thanks for fixing it.

rh

Index: frontends/qt4/GuiView.cpp
===================================================================
--- frontends/qt4/GuiView.cpp   (revision 31069)
+++ frontends/qt4/GuiView.cpp   (working copy)
@@ -2005,11 +2005,10 @@
                // have no autosave file but I guess
                // this is really improbable (Jug)
                buf.removeAutosaveFile();
-               if (hiding) {
+               if (hiding)
                        // revert all changes
                        buf.loadLyXFile(buf.fileName());
-                       buf.markClean();
-               }
+               buf.markClean();
                break;
        case 2:
                return false;

Reply via email to