mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 18:24:48 +00:00
Buffer: Pimpl gui_ and remove unused code. support/SignalSlot* should
probably go also as we agreed that if we need signal/slot in src/ we'll directly use Qt's. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33224 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
d9f22c0233
commit
a4e56ba613
@ -218,6 +218,8 @@ public:
|
|||||||
|
|
||||||
///
|
///
|
||||||
frontend::WorkAreaManager * wa_;
|
frontend::WorkAreaManager * wa_;
|
||||||
|
///
|
||||||
|
frontend::GuiBufferDelegate * gui_;
|
||||||
|
|
||||||
///
|
///
|
||||||
Undo undo_;
|
Undo undo_;
|
||||||
@ -297,7 +299,7 @@ Buffer::Impl::Impl(Buffer & parent, FileName const & file, bool readonly_,
|
|||||||
: lyx_clean(true), bak_clean(true), unnamed(false),
|
: lyx_clean(true), bak_clean(true), unnamed(false),
|
||||||
read_only(readonly_), filename(file), file_fully_loaded(false),
|
read_only(readonly_), filename(file), file_fully_loaded(false),
|
||||||
toc_backend(&parent), macro_lock(false), timestamp_(0),
|
toc_backend(&parent), macro_lock(false), timestamp_(0),
|
||||||
checksum_(0), wa_(0), undo_(parent), bibinfo_cache_valid_(false),
|
checksum_(0), wa_(0), gui_(0), undo_(parent), bibinfo_cache_valid_(false),
|
||||||
cloned_buffer_(cloned_buffer), parent_buffer(0)
|
cloned_buffer_(cloned_buffer), parent_buffer(0)
|
||||||
{
|
{
|
||||||
if (!cloned_buffer_) {
|
if (!cloned_buffer_) {
|
||||||
@ -318,7 +320,7 @@ Buffer::Impl::Impl(Buffer & parent, FileName const & file, bool readonly_,
|
|||||||
|
|
||||||
|
|
||||||
Buffer::Buffer(string const & file, bool readonly, Buffer const * cloned_buffer)
|
Buffer::Buffer(string const & file, bool readonly, Buffer const * cloned_buffer)
|
||||||
: d(new Impl(*this, FileName(file), readonly, cloned_buffer)), gui_(0)
|
: d(new Impl(*this, FileName(file), readonly, cloned_buffer))
|
||||||
{
|
{
|
||||||
LYXERR(Debug::INFO, "Buffer::Buffer()");
|
LYXERR(Debug::INFO, "Buffer::Buffer()");
|
||||||
if (cloned_buffer) {
|
if (cloned_buffer) {
|
||||||
@ -344,7 +346,7 @@ Buffer::~Buffer()
|
|||||||
// saved properly, before it goes into the void.
|
// saved properly, before it goes into the void.
|
||||||
|
|
||||||
// GuiView already destroyed
|
// GuiView already destroyed
|
||||||
gui_ = 0;
|
d->gui_ = 0;
|
||||||
|
|
||||||
if (isInternal()) {
|
if (isInternal()) {
|
||||||
// No need to do additional cleanups for internal buffer.
|
// No need to do additional cleanups for internal buffer.
|
||||||
@ -2907,36 +2909,36 @@ ErrorList & Buffer::errorList(string const & type) const
|
|||||||
void Buffer::updateTocItem(std::string const & type,
|
void Buffer::updateTocItem(std::string const & type,
|
||||||
DocIterator const & dit) const
|
DocIterator const & dit) const
|
||||||
{
|
{
|
||||||
if (gui_)
|
if (d->gui_)
|
||||||
gui_->updateTocItem(type, dit);
|
d->gui_->updateTocItem(type, dit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Buffer::structureChanged() const
|
void Buffer::structureChanged() const
|
||||||
{
|
{
|
||||||
if (gui_)
|
if (d->gui_)
|
||||||
gui_->structureChanged();
|
d->gui_->structureChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Buffer::errors(string const & err, bool from_master) const
|
void Buffer::errors(string const & err, bool from_master) const
|
||||||
{
|
{
|
||||||
if (gui_)
|
if (d->gui_)
|
||||||
gui_->errors(err, from_master);
|
d->gui_->errors(err, from_master);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Buffer::message(docstring const & msg) const
|
void Buffer::message(docstring const & msg) const
|
||||||
{
|
{
|
||||||
if (gui_)
|
if (d->gui_)
|
||||||
gui_->message(msg);
|
d->gui_->message(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Buffer::setBusy(bool on) const
|
void Buffer::setBusy(bool on) const
|
||||||
{
|
{
|
||||||
if (gui_)
|
if (d->gui_)
|
||||||
gui_->setBusy(on);
|
d->gui_->setBusy(on);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2949,20 +2951,20 @@ void Buffer::updateTitles() const
|
|||||||
|
|
||||||
void Buffer::resetAutosaveTimers() const
|
void Buffer::resetAutosaveTimers() const
|
||||||
{
|
{
|
||||||
if (gui_)
|
if (d->gui_)
|
||||||
gui_->resetAutosaveTimers();
|
d->gui_->resetAutosaveTimers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Buffer::hasGuiDelegate() const
|
bool Buffer::hasGuiDelegate() const
|
||||||
{
|
{
|
||||||
return gui_;
|
return d->gui_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Buffer::setGuiDelegate(frontend::GuiBufferDelegate * gui)
|
void Buffer::setGuiDelegate(frontend::GuiBufferDelegate * gui)
|
||||||
{
|
{
|
||||||
gui_ = gui;
|
d->gui_ = gui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3506,7 +3508,7 @@ void Buffer::updateLabels(UpdateScope scope, UpdateType utype) const
|
|||||||
master->updateLabels(UpdateMaster, utype);
|
master->updateLabels(UpdateMaster, utype);
|
||||||
// Do this here in case the master has no gui associated with it. Then,
|
// Do this here in case the master has no gui associated with it. Then,
|
||||||
// the TocModel is not updated and TocModel::toc_ is invalid (bug 5699).
|
// the TocModel is not updated and TocModel::toc_ is invalid (bug 5699).
|
||||||
if (!master->gui_)
|
if (!master->d->gui_)
|
||||||
structureChanged();
|
structureChanged();
|
||||||
|
|
||||||
// was buf referenced from the master (i.e. not in bufToUpdate anymore)?
|
// was buf referenced from the master (i.e. not in bufToUpdate anymore)?
|
||||||
|
14
src/Buffer.h
14
src/Buffer.h
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#include "support/strfwd.h"
|
#include "support/strfwd.h"
|
||||||
#include "support/types.h"
|
#include "support/types.h"
|
||||||
#include "support/SignalSlot.h"
|
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <set>
|
#include <set>
|
||||||
@ -596,19 +595,6 @@ private:
|
|||||||
class Impl;
|
class Impl;
|
||||||
/// The pointer never changes although *pimpl_'s contents may.
|
/// The pointer never changes although *pimpl_'s contents may.
|
||||||
Impl * const d;
|
Impl * const d;
|
||||||
///
|
|
||||||
frontend::GuiBufferDelegate * gui_;
|
|
||||||
|
|
||||||
/// This function is called when the buffer structure is changed.
|
|
||||||
Signal structureChanged_;
|
|
||||||
/// This function is called when some parsing error shows up.
|
|
||||||
//Signal errors(std::string const &) = 0;
|
|
||||||
/// This function is called when some message shows up.
|
|
||||||
//Signal message(docstring const &) = 0;
|
|
||||||
/// This function is called when the buffer busy status change.
|
|
||||||
//Signal setBusy(bool) = 0;
|
|
||||||
/// Reset autosave timers for all users.
|
|
||||||
Signal resetAutosaveTimers_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user