Code cleanup

Make precedence of && over || explicit.
Explicitly convert between char * and unsigned char *.
Don't assign potentially negative return code to an unsigend variable.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-07-06 13:59:14 -07:00
parent e76675d4df
commit b1538c809d
6 changed files with 18 additions and 15 deletions

View file

@ -417,7 +417,7 @@ void PreferencesDialog::syncSettings()
if (!email.isEmpty() && !password.isEmpty()) {
// connect to backend server to check / create credentials
QRegularExpression reg("^[a-zA-Z0-9@.+_-]+$");
if (!reg.match(email).hasMatch() || !password.isEmpty() && !reg.match(password).hasMatch()) {
if (!reg.match(email).hasMatch() || (!password.isEmpty() && !reg.match(password).hasMatch())) {
report_error(qPrintable(tr("Cloud storage email and password can only consist of letters, numbers, and '.', '-', '_', and '+'.")));
} else {
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);