1
// =============================================================================
3
// --- kvi_aliasnamevalidator.cpp ---
5
// This file is part of the KVIrc IRC client distribution
6
// Copyright (C) 1999-2000 Szymon Stefanek (stefanek@tin.it)
7
// Copyright (C) 1999-2000 Till Busch (buti@geocities.com)
9
// This program is FREE software. You can redistribute it and/or
10
// modify it under the terms of the GNU General Public License
11
// as published by the Free Software Foundation; either version 2
12
// of the License, or (at your opinion) any later version.
14
// This program is distributed in the HOPE that it will be USEFUL,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
// See the GNU General Public License for more details.
19
// You should have received a copy of the GNU General Public License
20
// along with this program. If not, write to the Free Software Foundation,
21
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
// =============================================================================
25
#define _KVI_DEBUG_CHECK_RANGE_
26
#define _KVI_DEBUG_CLASS_NAME_ "KviAliasNameValidator"
30
#include "kvi_aliasnamevalidator.h"
31
#include "kvi_string.h"
33
KviAliasNameValidator::KviAliasNameValidator(QWidget *parent)
39
KviAliasNameValidator::~KviAliasNameValidator()
44
QValidator::State KviAliasNameValidator::validate(QString &str, int&) const
47
const char *p = s.ptr();
49
if( (!isalnum(*p)) && (*p != '.') && (*p != '_') )
50
return QValidator::Invalid;
53
return QValidator::Acceptable;
56
#include "m_kvi_aliasnamevalidator.moc"