From e621339aae571c01e8ea52b2d9b991a925939833 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Mon, 17 Oct 2011 21:19:00 +0000 Subject: [PATCH] get rid of GuiWorkArea::Private::setReadOnly(). Calling updateWindowTitle() is cheap compared to redraw and GuiView::updateDialogs() will be called anyway (with restartCursor() among others). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39880 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiWorkArea.cpp | 16 ++-------------- src/frontends/qt4/GuiWorkArea_Private.h | 3 --- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index 10075dcf4a..dcf747bc38 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -237,7 +237,7 @@ SyntheticMouseEvent::SyntheticMouseEvent() GuiWorkArea::Private::Private(GuiWorkArea * parent) -: p(parent), buffer_view_(0), read_only_(false), lyx_view_(0), cursor_visible_(false), +: p(parent), buffer_view_(0), lyx_view_(0), cursor_visible_(false), need_resize_(false), schedule_redraw_(false), preedit_lines_(1), completer_(new GuiCompleter(p, p)) { @@ -253,7 +253,6 @@ GuiWorkArea::GuiWorkArea(QWidget * /* w */) GuiWorkArea::GuiWorkArea(Buffer & buffer, GuiView & gv) : d(new Private(this)) { - d->read_only_ = buffer.isReadonly(); setGuiView(gv); setBuffer(buffer); init(); @@ -476,7 +475,7 @@ void GuiWorkArea::redraw(bool update_metrics) if (lyxerr.debugging(Debug::WORKAREA)) d->buffer_view_->coordCache().dump(); - d->setReadOnly(d->buffer_view_->buffer().isReadonly()); + updateWindowTitle(); d->updateCursorShape(); } @@ -1349,17 +1348,6 @@ void GuiWorkArea::updateWindowTitle() } -void GuiWorkArea::Private::setReadOnly(bool read_only) -{ - if (read_only_ == read_only) - return; - read_only_ = read_only; - p->updateWindowTitle(); - if (p == lyx_view_->currentWorkArea()) - lyx_view_->updateDialogs(); -} - - bool GuiWorkArea::isFullScreen() const { return d->lyx_view_ && d->lyx_view_->isFullScreen(); diff --git a/src/frontends/qt4/GuiWorkArea_Private.h b/src/frontends/qt4/GuiWorkArea_Private.h index 3058047f02..b53d3d8b38 100644 --- a/src/frontends/qt4/GuiWorkArea_Private.h +++ b/src/frontends/qt4/GuiWorkArea_Private.h @@ -105,9 +105,6 @@ struct GuiWorkArea::Private /// hide the cursor virtual void removeCursor(); - - /// This function should be called to update the buffer readonly status. - void setReadOnly(bool); /// void dispatch(FuncRequest const & cmd0, KeyModifier = NoModifier); /// hide the visible cursor, if it is visible