commit 64ec812da576af9e676bd37a5d6779fd1394aa63
Author: Juergen Spitzmueller <[email protected]>
Date:   Sun Apr 24 16:51:16 2022 +0200

    Amend d8f540f51
    
    Properly handle aliases
---
 src/frontends/qt/GuiProgressView.cpp |    2 +-
 src/support/debug.cpp                |    8 ++++++++
 src/support/debug.h                  |    7 ++++++-
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/frontends/qt/GuiProgressView.cpp 
b/src/frontends/qt/GuiProgressView.cpp
index b2e6ccc..9dc9263 100644
--- a/src/frontends/qt/GuiProgressView.cpp
+++ b/src/frontends/qt/GuiProgressView.cpp
@@ -89,7 +89,7 @@ GuiProgressView::GuiProgressView(GuiView & parent, 
Qt::DockWidgetArea area,
        DebugVector dmap;
        for (int i = 0 ; i < level_count; i++) {
                Debug::Type const level = Debug::value(i);
-               string const dbgname = Debug::name(level);
+               string const dbgname = Debug::realName(i);
                // ignore these
                if (dbgname == "any" || dbgname == "all"
                    || dbgname == "none" || dbgname == "latex")
diff --git a/src/support/debug.cpp b/src/support/debug.cpp
index fa40d59..4b32191 100644
--- a/src/support/debug.cpp
+++ b/src/support/debug.cpp
@@ -118,6 +118,14 @@ string const Debug::name(Debug::Type val)
 }
 
 
+string const Debug::realName(int idx)
+{
+       if (idx < numErrorTags)
+               return errorTags[idx].name;
+       return "unknown index";
+}
+
+
 Debug::Type Debug::value(string const & val)
 {
        Type l = Debug::NONE;
diff --git a/src/support/debug.h b/src/support/debug.h
index 2306524..e284b94 100644
--- a/src/support/debug.h
+++ b/src/support/debug.h
@@ -130,9 +130,14 @@ namespace Debug {
        /// Return description of level
        std::string const description(Type val);
 
-       /// Return name of level
+       /// Return name of level from value. In case of aliases,
+       /// this returns the first entry found
        std::string const name(Type val);
 
+       /// Return name of level from index, in case of aliases
+       /// this is unambiguous
+       std::string const realName(int i);
+
        /// Display the tags and descriptions of the current debug level
        void showLevel(std::ostream & os, Type level);
 
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to