From 99dc01f79ba75788a8f19b2faba902ec030aaa4c Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Sat, 9 May 2009 19:59:53 +0000 Subject: [PATCH] Fix bug #5458 (try 2): File reopens at LyX-start even though it was closed in previous session. We should of course clear the list before closing each of the views. Otherwise, the second view will remove the files from the first view from the list. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29596 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiApplication.cpp | 4 ++++ src/frontends/qt4/GuiView.cpp | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 59c99e0d23..ade73a6dd9 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -1411,6 +1411,10 @@ bool GuiApplication::closeAllViews() if (d->views_.empty()) return true; + // When a view/window was closed before without quitting LyX, there + // are already entries in the lastOpened list. + theSession().lastOpened().clear(); + QList views = d->views_.values(); foreach (GuiView * view, views) { if (!view->close()) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index a3532d1c6d..d5ebfbd4cc 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -536,10 +536,6 @@ void GuiView::closeEvent(QCloseEvent * close_event) GuiWorkArea * active_wa = currentMainWorkArea(); setCurrentWorkArea(active_wa); - // When a view/window was closed before without quitting LyX, there - // are already entries in the lastOpened list. - theSession().lastOpened().clear(); - int splitter_count = d.splitter_->count(); for (; splitter_count; --splitter_count) { TabWorkArea * twa = d.tabWorkArea(0); -- 2.39.2