From 768b216c83cbcb20379ac706bef9aef5850abbdd Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Sun, 19 Jul 2009 14:34:14 +0000 Subject: [PATCH] Fix bug #4906: Files always reopened in tabbed window on launch. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30690 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiApplication.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 001e3658fa..d138e6ad50 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -1214,9 +1214,18 @@ void GuiApplication::restoreGuiSession() // 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].file_name, false); + FileName const & file_name = lastopened[i - 1].file_name; + if (d->views_.empty() || (!lyxrc.open_buffers_in_tabs + && current_view_->buffer() != 0)) { + boost::crc_32_type crc; + string const & fname = file_name.absFilename(); + crc = for_each(fname.begin(), fname.end(), crc); + createView(crc.checksum()); + } + current_view_->loadDocument(file_name, false); + if (lastopened[i - 1].active) - active_file = lastopened[i - 1].file_name; + active_file = file_name; } // Restore last active buffer -- 2.39.2