KCompletion

kemailvalidator.cpp
1/*
2 SPDX-FileCopyrightText: 2010 Casey Link <unnamedrambler@gmail.com>
3 SPDX-FileCopyrightText: 2009-2010 Klaralvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "kemailvalidator.h"
8
9#include <KEmailAddress>
10
11KEmailValidator::KEmailValidator(QObject *parent)
12 : QValidator(parent)
13{
14}
15
16KEmailValidator::~KEmailValidator() = default;
17
18QValidator::State KEmailValidator::validate(QString &str, int &pos) const
19{
20 Q_UNUSED(pos)
21
24 }
25 const auto containsSpace = std::any_of(str.begin(), str.end(), [](QChar c) {
26 return c.isSpace();
27 });
28 if (containsSpace) {
30 }
32}
33
34void KEmailValidator::fixup(QString &str) const
35{
36 str = str.trimmed();
37}
38
39#include "moc_kemailvalidator.cpp"
KCODECS_EXPORT bool isValidSimpleAddress(const QString &aStr)
iterator begin()
iterator end()
QString trimmed() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:12:50 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.