[LyX/master] Fix debug output of FunCode

Jean-Marc Lasgouttes lasgouttes at lyx.org
Tue Mar 9 15:27:59 UTC 2021


commit 5d8f3a930770f4f6d3bbdaf3afb3e001ee824188
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date:   Tue Mar 9 16:26:44 2021 +0100

    Fix debug output of FunCode
    
    Outputing the FuncCode enum to a stream using the << operator does not
    work well. Actually I am not sure whether the << operator in LyXAction
    is supposed to work (don't we need an enum class for that?).
---
 src/frontends/qt/GuiApplication.cpp |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/frontends/qt/GuiApplication.cpp b/src/frontends/qt/GuiApplication.cpp
index 45e2d2b..392c4b2 100644
--- a/src/frontends/qt/GuiApplication.cpp
+++ b/src/frontends/qt/GuiApplication.cpp
@@ -2317,7 +2317,8 @@ bool GuiApplication::queryKeySym(KeySymbol const & keysym,
 		// seq has been reset at this point
 		func = seq.addkey(keysym, NoModifier);
 
-	LYXERR(Debug::KEY, " Key (queried) [action=" << func.action() << "]["
+	LYXERR(Debug::KEY, " Key (queried) [action="
+	       << lyxaction.getActionName(func.action()) << "]["
 	       << seq.print(KeySequence::Portable) << ']');
 	return func.action() != LFUN_UNKNOWN_ACTION;
 }
@@ -2344,7 +2345,8 @@ void GuiApplication::processKeySym(KeySymbol const & keysym, KeyModifier state)
 	d->cancel_meta_seq.reset();
 
 	FuncRequest func = d->cancel_meta_seq.addkey(keysym, state);
-	LYXERR(Debug::KEY, "action first set to [" << func.action() << ']');
+	LYXERR(Debug::KEY, "action first set to ["
+	       << lyxaction.getActionName(func.action()) << ']');
 
 	// When not cancel or meta-fake, do the normal lookup.
 	// Note how the meta_fake Mod1 bit is OR-ed in and reset afterwards.
@@ -2352,7 +2354,8 @@ void GuiApplication::processKeySym(KeySymbol const & keysym, KeyModifier state)
 	if ((func.action() != LFUN_CANCEL) && (func.action() != LFUN_META_PREFIX)) {
 		// remove Caps Lock and Mod2 as a modifiers
 		func = d->keyseq.addkey(keysym, (state | d->meta_fake_bit));
-		LYXERR(Debug::KEY, "action now set to [" << func.action() << ']');
+		LYXERR(Debug::KEY, "action now set to ["
+		       << lyxaction.getActionName(func.action()) << ']');
 	}
 
 	// Don't remove this unless you know what you are doing.
@@ -2362,8 +2365,9 @@ void GuiApplication::processKeySym(KeySymbol const & keysym, KeyModifier state)
 	if (func.action() == LFUN_NOACTION)
 		func = FuncRequest(LFUN_COMMAND_PREFIX);
 
-	LYXERR(Debug::KEY, " Key [action=" << func.action() << "]["
-		<< d->keyseq.print(KeySequence::Portable) << ']');
+	LYXERR(Debug::KEY, " Key [action="
+	       << lyxaction.getActionName(func.action()) << "]["
+	       << d->keyseq.print(KeySequence::Portable) << ']');
 
 	// already here we know if it any point in going further
 	// why not return already here if action == -1 and
@@ -2380,7 +2384,7 @@ void GuiApplication::processKeySym(KeySymbol const & keysym, KeyModifier state)
 		// If addkey looked up a command and did not find further commands then
 		// seq has been reset at this point
 		func = d->keyseq.addkey(keysym, NoModifier);
-		LYXERR(Debug::KEY, "Action now " << func.action());
+		LYXERR(Debug::KEY, "Action now " << lyxaction.getActionName(func.action()));
 	}
 
 	if (func.action() == LFUN_UNKNOWN_ACTION) {


More information about the lyx-cvs mailing list