]> git.lyx.org Git - lyx.git/commitdiff
Fix the storage of the last opened files list when having multiple windows. We need...
authorVincent van Ravesteijn <vfr@lyx.org>
Mon, 7 Jun 2010 22:07:38 +0000 (22:07 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Mon, 7 Jun 2010 22:07:38 +0000 (22:07 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34621 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiApplication.cpp
src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiView.h

index ead359faa7e3d76f9976ca61b0daf2107c3932f3..7a2036171627eeabb2133a719b45776bea26f36a 100644 (file)
@@ -1250,7 +1250,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                // clear the last opened list, because
                // maybe this will end the session
                theSession().lastOpened().clear();
-               current_view_->close();
+               current_view_->closeScheduled();
                break;
 
        case LFUN_LYX_QUIT:
@@ -2254,7 +2254,7 @@ bool GuiApplication::closeAllViews()
 
        QList<GuiView *> views = d->views_.values();
        foreach (GuiView * view, views) {
-               if (!view->close())
+               if (!view->closeScheduled())
                        return false;
        }
 
index 7823cc9e8ce47f90f7e0df30fc5791c58b501a0a..735919925f16958a3631e00caf3ff359ee0ecd8d 100644 (file)
@@ -663,6 +663,13 @@ void GuiView::showEvent(QShowEvent * e)
 }
 
 
+bool GuiView::closeScheduled()
+{
+       closing_ = true;
+       return close();
+}
+
+
 /** Destroy only all tabbed WorkAreas. Destruction of other WorkAreas
  ** is responsibility of the container (e.g., dialog)
  **/
@@ -676,6 +683,10 @@ void GuiView::closeEvent(QCloseEvent * close_event)
                return;
        }
 
+       // If the user pressed the x (so we didn't call closeView
+       // programmatically), we want to clear all existing entries.
+       if (!closing_)
+               theSession().lastOpened().clear();
        closing_ = true;
 
        writeSession();
index 33f9fb310860e3b814a2788943dbcae41c869aed..72a53dbdc6129b8796ca5a1fd20fe18dbc2c4708 100644 (file)
@@ -71,6 +71,10 @@ public:
 
        ~GuiView();
 
+       /// closes the view such that the view knows that is closed
+       /// programmatically and not by the user clicking the x.
+       bool closeScheduled();
+
        int id() const { return id_; }
 
        ///