commit 890ca6df7b3360e0a80da8726bb413ac3d52e11f
Author: Yuriy Skalko <[email protected]>
Date:   Mon Nov 30 22:46:46 2020 +0200

    Refactor KernelDocType enum
---
 src/frontends/qt/Dialog.cpp    |    6 +++---
 src/frontends/qt/Dialog.h      |    2 +-
 src/frontends/qt/Validator.cpp |    7 ++++---
 src/frontends/qt/Validator.h   |    5 ++---
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/frontends/qt/Dialog.cpp b/src/frontends/qt/Dialog.cpp
index 7590a54..509727d 100644
--- a/src/frontends/qt/Dialog.cpp
+++ b/src/frontends/qt/Dialog.cpp
@@ -91,12 +91,12 @@ QString Dialog::bufferFilePath() const
 KernelDocType Dialog::docType() const
 {
        if (buffer().params().isLatex())
-               return LATEX;
+               return KernelDocType::LATEX;
        if (buffer().params().isLiterate())
-               return LITERATE;
+               return KernelDocType::LITERATE;
 
        // This case should not happen.
-       return LATEX;
+       return KernelDocType::LATEX;
 }
 
 
diff --git a/src/frontends/qt/Dialog.h b/src/frontends/qt/Dialog.h
index b4a3c8d..819dcf9 100644
--- a/src/frontends/qt/Dialog.h
+++ b/src/frontends/qt/Dialog.h
@@ -38,7 +38,7 @@ class GuiView;
  *  without making the kernel header files available to the
  *  dialog's Controller or View.
  */
-enum KernelDocType
+enum class KernelDocType : int
 {
        LATEX,
        LITERATE
diff --git a/src/frontends/qt/Validator.cpp b/src/frontends/qt/Validator.cpp
index 0fddd6d..1f72d56 100644
--- a/src/frontends/qt/Validator.cpp
+++ b/src/frontends/qt/Validator.cpp
@@ -13,14 +13,15 @@
 #include <config.h>
 
 #include "Validator.h"
-#include "qt_helpers.h"
 
-#include "support/gettext.h"
+#include "Dialog.h"
 #include "LyXRC.h"
+#include "qt_helpers.h"
 
 #include "frontends/alert.h"
 
 #include "support/docstring.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
 
 #include <QLineEdit>
@@ -233,7 +234,7 @@ QValidator::State PathValidator::validate(QString & qtext, 
int &) const
 
 void PathValidator::setChecker(KernelDocType const & type, LyXRC const & rc)
 {
-       latex_doc_ = type == LATEX;
+       latex_doc_ = type == KernelDocType::LATEX;
        tex_allows_spaces_ = rc.tex_allows_spaces;
 }
 
diff --git a/src/frontends/qt/Validator.h b/src/frontends/qt/Validator.h
index 72d08ae..87a1a1c 100644
--- a/src/frontends/qt/Validator.h
+++ b/src/frontends/qt/Validator.h
@@ -25,8 +25,6 @@
 #ifndef VALIDATOR_H
 #define VALIDATOR_H
 
-#include "Dialog.h" // KernelDocType
-
 #include "support/Length.h"
 
 #include <QValidator>
@@ -34,13 +32,14 @@
 class QWidget;
 class QLineEdit;
 
-
 namespace lyx {
 
 class LyXRC;
 
 namespace frontend {
 
+enum class KernelDocType : int;
+
 /** A class to ascertain whether the data passed to the @c validate()
  *  member function can be interpreted as a GlueLength.
  */
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to