]> git.lyx.org Git - features.git/commitdiff
Revert r29532 and do something less risky.
authorVincent van Ravesteijn <vfr@lyx.org>
Mon, 4 May 2009 23:22:06 +0000 (23:22 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Mon, 4 May 2009 23:22:06 +0000 (23:22 +0000)
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
src/frontends/qt4/GuiView.cpp

index b6908c75d7b0d6744188c37143dd383aae240674..72b69b64d2d7bdcff4e15a304c621f5a69315819 100644 (file)
@@ -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();
index 8a2f8a4fc9593ed8b1a9fd143fdfc33054e59de8..134c3dec8768393f116bc32176655a6dea0e80d0 100644 (file)
@@ -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();