mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Introduce Debug::SELECTION mainly for copy/paste primary-selection debugging.
Up to now it was hell to debug it, since the selection messages was under different debug classes and the messages also get completely lost from mouse action events. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25624 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9c638a78ed
commit
9c87bee68d
@ -757,7 +757,7 @@ void saveSelection(Cursor & cur)
|
||||
if (cur.selection()
|
||||
&& cur.selBegin() == cur.bv().cursor().selBegin()
|
||||
&& cur.selEnd() == cur.bv().cursor().selEnd()) {
|
||||
LYXERR(Debug::ACTION, "'" << cur.selectionAsString(true) << "'");
|
||||
LYXERR(Debug::SELECTION, "saveSelection: '" << cur.selectionAsString(true) << "'");
|
||||
copySelectionToStack(cur, selectionBuffer);
|
||||
}
|
||||
}
|
||||
|
@ -1443,7 +1443,7 @@ bool GuiApplication::x11EventFilter(XEvent * xev)
|
||||
case SelectionRequest: {
|
||||
if (xev->xselectionrequest.selection != XA_PRIMARY)
|
||||
break;
|
||||
LYXERR(Debug::GUI, "X requested selection.");
|
||||
LYXERR(Debug::SELECTION, "X requested selection.");
|
||||
BufferView * bv = current_view_->view();
|
||||
if (bv) {
|
||||
docstring const sel = bv->requestSelection();
|
||||
@ -1455,7 +1455,7 @@ bool GuiApplication::x11EventFilter(XEvent * xev)
|
||||
case SelectionClear: {
|
||||
if (xev->xselectionclear.selection != XA_PRIMARY)
|
||||
break;
|
||||
LYXERR(Debug::GUI, "Lost selection.");
|
||||
LYXERR(Debug::SELECTION, "Lost selection.");
|
||||
BufferView * bv = current_view_->view();
|
||||
if (bv)
|
||||
bv->clearSelection();
|
||||
|
@ -71,7 +71,7 @@ docstring const GuiSelection::get() const
|
||||
{
|
||||
QString const str = qApp->clipboard()->text(QClipboard::Selection)
|
||||
.normalized(QString::NormalizationForm_C);
|
||||
LYXERR(Debug::ACTION, "GuiSelection::get: " << str);
|
||||
LYXERR(Debug::SELECTION, "GuiSelection::get: " << str);
|
||||
if (str.isNull())
|
||||
return docstring();
|
||||
|
||||
@ -81,7 +81,7 @@ docstring const GuiSelection::get() const
|
||||
|
||||
void GuiSelection::put(docstring const & str)
|
||||
{
|
||||
LYXERR(Debug::ACTION, "GuiSelection::put: " << to_utf8(str));
|
||||
LYXERR(Debug::SELECTION, "GuiSelection::put: " << to_utf8(str));
|
||||
|
||||
qApp->clipboard()->setText(toqstr(externalLineEnding(str)),
|
||||
QClipboard::Selection);
|
||||
@ -100,7 +100,7 @@ bool GuiSelection::empty() const
|
||||
if (!selection_supported_)
|
||||
return true;
|
||||
|
||||
LYXERR(Debug::ACTION, "GuiSelection::empty: " << text_selection_empty_);
|
||||
LYXERR(Debug::SELECTION, "GuiSelection::empty: " << text_selection_empty_);
|
||||
|
||||
return text_selection_empty_;
|
||||
}
|
||||
|
@ -65,6 +65,7 @@ ErrorItem errorTags[] = {
|
||||
{ Debug::MACROS, "macros", N_("Math macros")},
|
||||
{ Debug::RTL, "rtl", N_("RTL/Bidi")},
|
||||
{ Debug::LOCALE, "locale", N_("Locale/Internationalisation")},
|
||||
{ Debug::SELECTION, "selection", N_("Selection copy/paste mechanism")},
|
||||
{ Debug::DEBUG, "debug", N_("Developers' general debug messages")},
|
||||
{ Debug::ANY, "any", N_("All debugging messages")}
|
||||
};
|
||||
|
@ -96,7 +96,9 @@ namespace Debug {
|
||||
/// rtl-related
|
||||
RTL = (1 << 27),
|
||||
/// locale related
|
||||
LOCALE = (1 << 28),
|
||||
LOCALE = (1 << 28),
|
||||
/// selection
|
||||
SELECTION = (1 << 29),
|
||||
///
|
||||
DEBUG = (1 << 31),
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user