]> git.lyx.org Git - features.git/commitdiff
retro commit a bit. Should hopefully fix the crashes on Mac.
authorAbdelrazak Younes <younes@lyx.org>
Thu, 19 Jun 2008 20:48:49 +0000 (20:48 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 19 Jun 2008 20:48:49 +0000 (20:48 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25328 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiView.h

index 624ccbb6922c632a26fa223432cda92e557893ed..94a05797dcc52cd13158aa96658d60bdc5b1db04 100644 (file)
@@ -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;
 }
index 70a3e777fbaaaed646099a2dd694062bfcd47244..ef3d5e9cf56ff8212420a5fc593652036956524d 100644 (file)
@@ -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;