Get rid of Buffer::setReadOnly() pseudo signal.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33222 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2010-01-25 13:31:07 +00:00
parent e4f796aee7
commit 11474f6b89
7 changed files with 11 additions and 24 deletions

View File

@ -603,7 +603,7 @@ void Buffer::setReadonly(bool const flag)
{
if (d->read_only != flag) {
d->read_only = flag;
setReadOnly(flag);
changed(false);
}
}
@ -2952,13 +2952,6 @@ void Buffer::setBusy(bool on) const
}
void Buffer::setReadOnly(bool on) const
{
if (d->wa_)
d->wa_->setReadOnly(on);
}
void Buffer::updateTitles() const
{
if (d->wa_)

View File

@ -492,8 +492,6 @@ public:
void errors(std::string const & err, bool from_master = false) const;
/// This function is called when the buffer busy status change.
void setBusy(bool on) const;
/// This function is called when the buffer readonly status change.
void setReadOnly(bool on) const;
/// Update window titles of all users.
void updateTitles() const;
/// Reset autosave timers for all users.

View File

@ -43,8 +43,6 @@ public:
/// close this work area.
/// Slot for Buffer::closing signal.
virtual void close() = 0;
/// This function is called when the buffer readonly status change.
virtual void setReadOnly(bool) = 0;
/// Update window titles of all users.
virtual void updateWindowTitle() = 0;

View File

@ -46,13 +46,6 @@ void WorkAreaManager::closeAll()
}
void WorkAreaManager::setReadOnly(bool on)
{
for (iterator it = work_areas_.begin(); it != work_areas_.end(); ++it)
(*it)->setReadOnly(on);
}
void WorkAreaManager::updateTitles()
{
for (iterator it = work_areas_.begin(); it != work_areas_.end(); ++it)

View File

@ -38,8 +38,6 @@ public:
void redrawAll(bool update_metrics);
///
void closeAll();
/// This function is called when the buffer readonly status change.
void setReadOnly(bool);
/// Update window titles of all users.
void updateTitles();

View File

@ -246,7 +246,7 @@ GuiWorkArea::GuiWorkArea(QWidget *)
GuiWorkArea::GuiWorkArea(Buffer & buffer, GuiView & gv)
: buffer_view_(0), lyx_view_(0),
: buffer_view_(0), read_only_(buffer.isReadonly()), lyx_view_(0),
cursor_visible_(false),
need_resize_(false), schedule_redraw_(false),
preedit_lines_(1), completer_(new GuiCompleter(this, this)),
@ -440,6 +440,8 @@ void GuiWorkArea::redraw(bool update_metrics)
if (lyxerr.debugging(Debug::WORKAREA))
buffer_view_->coordCache().dump();
setReadOnly(buffer_view_->buffer().isReadonly());
}
@ -1213,8 +1215,11 @@ void GuiWorkArea::updateWindowTitle()
}
void GuiWorkArea::setReadOnly(bool)
void GuiWorkArea::setReadOnly(bool read_only)
{
if (read_only_ == read_only)
return;
read_only_ = read_only;
updateWindowTitle();
if (this == lyx_view_->currentWorkArea())
lyx_view_->updateDialogs();

View File

@ -184,7 +184,7 @@ private:
/// hide the cursor
virtual void removeCursor();
/// This function is called when the buffer readonly status change.
/// This function should be called to update the buffer readonly status.
void setReadOnly(bool);
/// Update window titles of all users.
@ -231,6 +231,8 @@ private:
///
BufferView * buffer_view_;
/// Read only Buffer status cache.
bool read_only_;
///
GuiView * lyx_view_;
/// is the cursor currently displayed