1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-27 03:40:24 +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:
Dave Corley 2024-02-22 02:52:58 -06:00
parent 9fc66d5de6
commit 090a389feb
2 changed files with 1 additions and 9 deletions

View file

@ -2,11 +2,6 @@
#include <components/misc/strings/lower.hpp> #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) CSVWorld::IdValidator::IdValidator(bool relaxed, QObject* parent)
: QValidator(parent) : QValidator(parent)
, mRelaxed(relaxed) , mRelaxed(relaxed)
@ -86,7 +81,7 @@ QValidator::State CSVWorld::IdValidator::validate(QString& input, int& pos) cons
{ {
prevScope = false; prevScope = false;
if (!isValid(*iter, first)) if (!iter->isPrint())
return QValidator::Invalid; return QValidator::Invalid;
} }
} }

View file

@ -13,9 +13,6 @@ namespace CSVWorld
std::string mNamespace; std::string mNamespace;
mutable std::string mError; mutable std::string mError;
private:
bool isValid(const QChar& c, bool first) const;
public: public:
IdValidator(bool relaxed = false, QObject* parent = nullptr); IdValidator(bool relaxed = false, QObject* parent = nullptr);
///< \param relaxed Relaxed rules for IDs that also functino as user visible text ///< \param relaxed Relaxed rules for IDs that also functino as user visible text