mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-01 03:21:41 +00:00
Cleanup(idvalidator): Just don't use isValid function and instead
directly check if input is a printable char
This commit is contained in:
parent
9fc66d5de6
commit
090a389feb
@ -2,11 +2,6 @@
|
||||
|
||||
#include <components/misc/strings/lower.hpp>
|
||||
|
||||
bool CSVWorld::IdValidator::isValid(const QChar& c, bool first) const
|
||||
{
|
||||
return c.isPrint() ? true : false;
|
||||
}
|
||||
|
||||
CSVWorld::IdValidator::IdValidator(bool relaxed, QObject* parent)
|
||||
: QValidator(parent)
|
||||
, mRelaxed(relaxed)
|
||||
@ -86,7 +81,7 @@ QValidator::State CSVWorld::IdValidator::validate(QString& input, int& pos) cons
|
||||
{
|
||||
prevScope = false;
|
||||
|
||||
if (!isValid(*iter, first))
|
||||
if (!iter->isPrint())
|
||||
return QValidator::Invalid;
|
||||
}
|
||||
}
|
||||
|
@ -13,9 +13,6 @@ namespace CSVWorld
|
||||
std::string mNamespace;
|
||||
mutable std::string mError;
|
||||
|
||||
private:
|
||||
bool isValid(const QChar& c, bool first) const;
|
||||
|
||||
public:
|
||||
IdValidator(bool relaxed = false, QObject* parent = nullptr);
|
||||
///< \param relaxed Relaxed rules for IDs that also functino as user visible text
|
||||
|
Loading…
Reference in New Issue
Block a user