diff options
Diffstat (limited to 'Source/Core/DolphinQt/Config/ControllerInterface/ServerStringValidator.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Config/ControllerInterface/ServerStringValidator.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt/Config/ControllerInterface/ServerStringValidator.cpp b/Source/Core/DolphinQt/Config/ControllerInterface/ServerStringValidator.cpp new file mode 100644 index 0000000000..1ab0935b53 --- /dev/null +++ b/Source/Core/DolphinQt/Config/ControllerInterface/ServerStringValidator.cpp @@ -0,0 +1,23 @@ +// Copyright 2020 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#include "DolphinQt/Config/ControllerInterface/ServerStringValidator.h" + +ServerStringValidator::ServerStringValidator(QObject* parent) : QValidator(parent) +{ +} + +QValidator::State ServerStringValidator::validate(QString& input, int& pos) const +{ + if (input.isEmpty()) + return Invalid; + + if (input.contains(QStringLiteral(":"))) + return Invalid; + + if (input.contains(QStringLiteral(";"))) + return Invalid; + + return Acceptable; +} |
