From 2ab92aba6722a8967cab31c619cdbfaa4cee9b93 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Thu, 19 Jun 2008 20:48:49 +0000 Subject: [PATCH] retro commit a bit. Should hopefully fix the crashes on Mac. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25328 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiView.cpp | 27 +++++---------------------- src/frontends/qt4/GuiView.h | 2 -- 2 files changed, 5 insertions(+), 24 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 624ccbb692..94a05797dc 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -362,10 +362,11 @@ bool GuiView::restoreLayout() { QSettings settings; QString const key = "view-" + QString::number(id_); - if (!settings.contains(key)) + QString const icon_key = key + "/icon_size"; + if (!settings.contains(icon_key)) return false; - setIconSize(settings.value(key + "/icon_size").toSize()); + setIconSize(settings.value(icon_key).toSize()); #ifdef Q_WS_X11 QPoint pos = settings.value(key + "/pos", QPoint(50, 50)).toPoint(); QSize size = settings.value(key + "/size", QSize(690, 510)).toSize(); @@ -1692,24 +1693,6 @@ bool GuiView::closeBuffer() } -void GuiView::releaseBuffer(Buffer & buf) -{ - bool is_current_view = this == guiApp->currentView(); - theBufferList().release(&buf); - if (!is_current_view) - return; - - // Make sure this is still the current view because releasing a buffer - // can invalidate that in case this buffer was also displayed in - // another view. - guiApp->setCurrentView(this); - theLyXFunc().setLyXView(this); - // Bring this window to top. - raise(); - activateWindow(); -} - - bool GuiView::closeBuffer(Buffer & buf, bool tolastopened) { // goto bookmark to update bookmark pit. @@ -1720,7 +1703,7 @@ bool GuiView::closeBuffer(Buffer & buf, bool tolastopened) if (buf.isClean() || buf.paragraphs().empty()) { if (buf.masterBuffer() == &buf && tolastopened) LyX::ref().session().lastOpened().add(buf.fileName()); - releaseBuffer(buf); + theBufferList().release(&buf); return true; } // Switch to this Buffer. @@ -1767,7 +1750,7 @@ bool GuiView::closeBuffer(Buffer & buf, bool tolastopened) // Don't close child documents. removeWorkArea(d.current_work_area_); else - releaseBuffer(buf); + theBufferList().release(&buf); return true; } diff --git a/src/frontends/qt4/GuiView.h b/src/frontends/qt4/GuiView.h index 70a3e777fb..ef3d5e9cf5 100644 --- a/src/frontends/qt4/GuiView.h +++ b/src/frontends/qt4/GuiView.h @@ -285,8 +285,6 @@ private: bool saveBuffer(Buffer & b); /// bool closeBuffer(Buffer & buf, bool tolastopened = false); - /// - void releaseBuffer(Buffer & buf); /// Inset * getOpenInset(std::string const & name) const; -- 2.39.2