source: SMSSender/lib/libgateway/src/business/validation/BCLoginAccountValidator.cpp @ 43:10dd65d71f7f

3.0
Last change on this file since 43:10dd65d71f7f was 43:10dd65d71f7f, checked in by Sämy Zehnder <saemy.zehnder@…>, 12 years ago
  • Did a lot of work...
File size: 737 bytes
Line 
1/*
2 * BCLoginAccountValidator.cpp
3 *
4 *  Created on: Dec 20, 2009
5 *      Author: saemy
6 */
7
8#include "BCLoginAccountValidator.h"
9
10#include <QObject>
11#include "../AbstractLoginAccount.h"
12
13IValidationResult* BCLoginAccountValidator::validate() const {
14    IValidationResult* result = BCStdAccountValidator::validate();
15
16    ILoginAccount* acc = account();
17
18    if (acc->username().trimmed() == "") {
19        result->addError(tr("The username can't be empty."));
20    }
21
22    if (acc->password().trimmed() == "") {
23        result->addError(tr("The password can't be empty."));
24    }
25
26    return result;
27}
28
29ILoginAccount* BCLoginAccountValidator::account() const {
30    return dynamic_cast<ILoginAccount*>(BCStdAccountValidator::account());
31}
Note: See TracBrowser for help on using the repository browser.