Refactor KernelDocType enum

This commit is contained in:
Yuriy Skalko 2020-11-30 22:46:46 +02:00
parent 6354ad60b4
commit 890ca6df7b
4 changed files with 10 additions and 10 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}

View File

@ -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.
*/