From 4b8376bbb399d1bdd8d7abd3d5031e6432f6a5df Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Mon, 4 May 2009 23:22:06 +0000 Subject: [PATCH] Revert r29532 and do something less risky. Now, the tabs are closed in reverse order, which is aesthetically better. Consequently, we have to open the files (read from the session file) also in reverse order. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29539 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiApplication.cpp | 6 ++++-- src/frontends/qt4/GuiView.cpp | 4 +--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index b6908c75d7..72b69b64d2 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -1207,8 +1207,10 @@ void GuiApplication::restoreGuiSession() // do not add to the lastfile list since these files are restored from // last session, and should be already there (regular files), or should // not be added at all (help files). - for_each(lastopened.begin(), lastopened.end(), - bind(&GuiView::loadDocument, current_view_, _1, false)); + // Note that we open them in reverse order. This is because we close + // buffers also in reverse order (aesthetically motivated). + for (size_t i = lastopened.size(); i > 0; --i) + current_view_->loadDocument(lastopened[i - 1], false); // clear this list to save a few bytes of RAM session.lastOpened().clear(); diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 8a2f8a4fc9..134c3dec87 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -538,12 +538,10 @@ void GuiView::closeEvent(QCloseEvent * close_event) int splitter_count = d.splitter_->count(); for (; splitter_count; --splitter_count) { TabWorkArea * twa = d.tabWorkArea(0); - twa->showBar(false); - twa->updateTabTexts(); int twa_count = twa->count(); for (; twa_count; --twa_count) { - twa->setCurrentIndex(0); + twa->setCurrentIndex(twa_count-1); GuiWorkArea * wa = twa->currentWorkArea(); Buffer * b = &wa->bufferView().buffer(); -- 2.39.2