Let empty() be const.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25961 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Pavel Sanda 2008-07-29 09:53:34 +00:00
parent 07719210df
commit 221812b6e0
3 changed files with 5 additions and 5 deletions

View File

@ -62,7 +62,7 @@ public:
* This does always return true on systems that don't have a real * This does always return true on systems that don't have a real
* selection. * selection.
*/ */
virtual bool empty() = 0; virtual bool empty() const = 0;
}; };
} // namespace frontend } // namespace frontend

View File

@ -96,7 +96,7 @@ void GuiSelection::on_dataChanged()
} }
bool GuiSelection::empty() bool GuiSelection::empty() const
{ {
if (!selection_supported_) if (!selection_supported_)
return true; return true;

View File

@ -37,7 +37,7 @@ public:
void haveSelection(bool own); void haveSelection(bool own);
docstring const get() const; docstring const get() const;
void put(docstring const & str); void put(docstring const & str);
bool empty(); bool empty() const;
//@} //@}
private Q_SLOTS: private Q_SLOTS:
@ -46,7 +46,7 @@ private Q_SLOTS:
private: private:
// Cache which is to speed up selection-status read // Cache which is to speed up selection-status read
// (4 calls when openi Edit menu). // (4 calls when openi Edit menu).
bool text_selection_empty_; mutable bool text_selection_empty_;
// Direct call clipboard()->text(QClipboard::Selection) inside onDataChanged causes // Direct call clipboard()->text(QClipboard::Selection) inside onDataChanged causes
// selection to be obtained. Now imagine the some LyX instance A, when making selection - // selection to be obtained. Now imagine the some LyX instance A, when making selection -
// each change triggers onDataChange in all others instances for each mouse // each change triggers onDataChange in all others instances for each mouse
@ -54,7 +54,7 @@ private:
// which interferes with the selecting itself. As a result middle button pasting // which interferes with the selecting itself. As a result middle button pasting
// for more instances don't work and debugging is a hell. So we just schedule // for more instances don't work and debugging is a hell. So we just schedule
// obtaining of selection on the time empty() is actually called. // obtaining of selection on the time empty() is actually called.
bool schedule_check_; mutable bool schedule_check_;
bool const selection_supported_; bool const selection_supported_;
}; };