source: SMSSender/lib/libdatatypes/src/validation/sloginaccountvalidator.cpp @ 71:415b45c71663

3.0
Last change on this file since 71:415b45c71663 was 71:415b45c71663, checked in by Sämy Zehnder <saemy.zehnder@…>, 12 years ago
  • Reorganized all the libraries. libinterfaces and libgateways are removed now and libdatatypes contains now all these files.
File size: 715 bytes
Line 
1/*
2 * BCLoginAccountValidator.cpp
3 *
4 *  Created on: Dec 20, 2009
5 *      Author: saemy
6 */
7
8#include "sloginaccountvalidator.h"
9
10#include <QObject>
11
12IValidationResult* SLoginAccountValidator::validate() const {
13    IValidationResult* result = SStdAccountValidator::validate();
14
15    AbstractLoginAccount* acc = account();
16
17    if (acc->username().trimmed() == "") {
18        result->addError(tr("The username can't be empty."));
19    }
20
21    if (acc->password().trimmed() == "") {
22        result->addError(tr("The password can't be empty."));
23    }
24
25    return result;
26}
27
28AbstractLoginAccount* SLoginAccountValidator::account() const {
29    return static_cast<AbstractLoginAccount*>(SStdAccountValidator::account());
30}
Note: See TracBrowser for help on using the repository browser.