KShare/src/filenamevalidator.cpp

13 lines
395 B
C++
Raw Normal View History

#include "filenamevalidator.hpp"
#include <formatter.hpp>
#include <platformbackend.hpp>
FilenameValidator::FilenameValidator(QObject *parent) : QValidator(parent) {
}
QValidator::State FilenameValidator::validate(QString &input, int &) const {
QString name = formatter::format(input, "lol");
return PlatformBackend::inst().filenameValid(name) ? State::Acceptable : State::Invalid;
}