mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Refactor KernelDocType enum
This commit is contained in:
parent
6354ad60b4
commit
890ca6df7b
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user