]> git.lyx.org Git - lyx.git/commitdiff
Introduce Debug::SELECTION mainly for copy/paste primary-selection debugging.
authorPavel Sanda <sanda@lyx.org>
Mon, 14 Jul 2008 23:47:54 +0000 (23:47 +0000)
committerPavel Sanda <sanda@lyx.org>
Mon, 14 Jul 2008 23:47:54 +0000 (23:47 +0000)
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

src/CutAndPaste.cpp
src/frontends/qt4/GuiApplication.cpp
src/frontends/qt4/GuiSelection.cpp
src/support/debug.cpp
src/support/debug.h

index 79f81f29fbd25e4b925e96b12de2a79f024ccad3..ee639f3c6c27ad95feb43329e7515a68546e3a06 100644 (file)
@@ -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);
        }
 }
index e13b3159c7bc616ce2f5ae4e5462d1b20df048d9..9494aab98da342ba3c2aa12ccbb412e67f26bdf2 100644 (file)
@@ -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();
index e6ee835521f2b4adb555f0522027a8ce037da1b8..7f5d4368c27f2405ef8e1e49b0ac61e4030c5c9d 100644 (file)
@@ -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_;
 }
index aebc0c44a04aa55b8d41aae3053fcd73a0f507f0..44ef69f4060ab9a6df59161ee89615a86365d606 100644 (file)
@@ -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")}
 };
index a3045bcf88fc9a7bdffb44a9d4d054cc66658dd7..a126cb81e596b4c5664240193517fc2bda689f1e 100644 (file)
@@ -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),
                ///