Minor coding style cleanup.

This commit is contained in:
Axel Dörfler
2015-01-06 15:21:21 +01:00
parent 7135c4f8fe
commit 20537ad067
+11 -9
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2007-2011, Haiku, Inc. All rights reserved. * Copyright 2007-2015, Haiku, Inc. All rights reserved.
* Copyright 2001-2002 Dr. Zoidberg Enterprises. All rights reserved. * Copyright 2001-2002 Dr. Zoidberg Enterprises. All rights reserved.
* Copyright 2011, Clemens Zeidler <[email protected]> * Copyright 2011, Clemens Zeidler <[email protected]>
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
@@ -178,8 +178,8 @@ MailDaemonApp::ReadyToRun()
BString string; BString string;
if (fNewMessages > 0) { if (fNewMessages > 0) {
static BMessageFormat format(B_TRANSLATE( BMessageFormat format(B_TRANSLATE(
"{0, plural, one{# new message} other{# new messages}}")); "{0, plural, one{One new message} other{# new messages}}"));
format.Format(string, fNewMessages); format.Format(string, fNewMessages);
} else } else
@@ -210,16 +210,16 @@ MailDaemonApp::RefsReceived(BMessage* message)
entry_ref ref; entry_ref ref;
for (int32 i = 0; message->FindRef("refs", i, &ref) == B_OK; i++) { for (int32 i = 0; message->FindRef("refs", i, &ref) == B_OK; i++) {
BNode node(&ref); BNode node(&ref);
if (node.InitCheck() < B_OK) if (node.InitCheck() != B_OK)
continue; continue;
int32 account; int32 account;
if (node.ReadAttr(B_MAIL_ATTR_ACCOUNT_ID, B_INT32_TYPE, 0, &account, if (node.ReadAttr(B_MAIL_ATTR_ACCOUNT_ID, B_INT32_TYPE, 0, &account,
sizeof(account)) < 0) sizeof(account)) < 0)
continue; continue;
InboundProtocolThread* protocolThread = _FindInboundProtocol(account); InboundProtocolThread* protocolThread = _FindInboundProtocol(account);
if (!protocolThread) if (protocolThread == NULL)
continue; continue;
BMessenger target; BMessenger target;
@@ -425,7 +425,8 @@ MailDaemonApp::InstallDeskbarIcon()
status = deskbar.AddItem(&ref); status = deskbar.AddItem(&ref);
if (status < B_OK) { if (status < B_OK) {
fprintf(stderr, "Can't add deskbar replicant: %s\n", strerror(status)); fprintf(stderr, "Can't add deskbar replicant: %s\n",
strerror(status));
return; return;
} }
} }
@@ -691,7 +692,7 @@ MailDaemonApp::_ReloadAccounts(BMessage* message)
if (it != fAccounts.end()) if (it != fAccounts.end())
_RemoveAccount(it); _RemoveAccount(it);
BMailAccountSettings* settings = accounts.AccountByID(account); BMailAccountSettings* settings = accounts.AccountByID(account);
if (settings) if (settings != NULL)
_InitAccount(*settings); _InitAccount(*settings);
} }
} }
@@ -791,9 +792,10 @@ MailDaemonApp::_UpdateAutoCheck(bigtime_t interval)
if (fAutoCheckRunner != NULL) { if (fAutoCheckRunner != NULL) {
fAutoCheckRunner->SetInterval(interval); fAutoCheckRunner->SetInterval(interval);
fAutoCheckRunner->SetCount(-1); fAutoCheckRunner->SetCount(-1);
} else } else {
fAutoCheckRunner = new BMessageRunner(be_app_messenger, fAutoCheckRunner = new BMessageRunner(be_app_messenger,
new BMessage('moto'), interval); new BMessage('moto'), interval);
}
} else { } else {
delete fAutoCheckRunner; delete fAutoCheckRunner;
fAutoCheckRunner = NULL; fAutoCheckRunner = NULL;