Cleanup(idvalidator): Just don't use isValid function and instead

directly check if input is a printable char
fix-osga-rotate-wildly
Dave Corley 11 months ago
parent 9fc66d5de6
commit 090a389feb

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

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

Loading…
Cancel
Save