Minor cleanup, no functional change.

This commit is contained in:
Axel Dörfler
2011-12-15 00:55:10 +01:00
parent c8677fb138
commit 3692fd58c5
+6 -13
View File
@@ -458,8 +458,7 @@ MailDaemonApp::GetNewMessages(BMessage* msg)
int32 account = -1; int32 account = -1;
if (msg->FindInt32("account", &account) == B_OK && account >= 0) { if (msg->FindInt32("account", &account) == B_OK && account >= 0) {
InboundProtocolThread* protocol = _FindInboundProtocol(account); InboundProtocolThread* protocol = _FindInboundProtocol(account);
if (!protocol) if (protocol != NULL)
return;
protocol->SyncMessages(); protocol->SyncMessages();
return; return;
} }
@@ -468,8 +467,7 @@ MailDaemonApp::GetNewMessages(BMessage* msg)
AccountMap::const_iterator it = fAccounts.begin(); AccountMap::const_iterator it = fAccounts.begin();
for (; it != fAccounts.end(); it++) { for (; it != fAccounts.end(); it++) {
InboundProtocolThread* protocol = it->second.inboundThread; InboundProtocolThread* protocol = it->second.inboundThread;
if (!protocol) if (protocol != NULL)
continue;
protocol->SyncMessages(); protocol->SyncMessages();
} }
} }
@@ -483,7 +481,6 @@ MailDaemonApp::SendPendingMessages(BMessage* msg)
map<int32, send_mails_info> messages; map<int32, send_mails_info> messages;
int32 account = -1; int32 account = -1;
if (msg->FindInt32("account", &account) != B_OK) if (msg->FindInt32("account", &account) != B_OK)
account = -1; account = -1;
@@ -738,7 +735,6 @@ MailDaemonApp::_CreateInboundProtocol(BMailAccountSettings& settings,
image_id& image) image_id& image)
{ {
const entry_ref& entry = settings.InboundPath(); const entry_ref& entry = settings.InboundPath();
InboundProtocol* (*instantiate_protocol)(BMailAccountSettings*); InboundProtocol* (*instantiate_protocol)(BMailAccountSettings*);
BPath path(&entry); BPath path(&entry);
@@ -746,13 +742,12 @@ MailDaemonApp::_CreateInboundProtocol(BMailAccountSettings& settings,
if (image < 0) if (image < 0)
return NULL; return NULL;
if (get_image_symbol(image, "instantiate_inbound_protocol", if (get_image_symbol(image, "instantiate_inbound_protocol",
B_SYMBOL_TYPE_TEXT, (void **)&instantiate_protocol) != B_OK) { B_SYMBOL_TYPE_TEXT, (void**)&instantiate_protocol) != B_OK) {
unload_add_on(image); unload_add_on(image);
image = -1; image = -1;
return NULL; return NULL;
} }
InboundProtocol* protocol = (*instantiate_protocol)(&settings); return (*instantiate_protocol)(&settings);
return protocol;
} }
@@ -761,7 +756,6 @@ MailDaemonApp::_CreateOutboundProtocol(BMailAccountSettings& settings,
image_id& image) image_id& image)
{ {
const entry_ref& entry = settings.OutboundPath(); const entry_ref& entry = settings.OutboundPath();
OutboundProtocol* (*instantiate_protocol)(BMailAccountSettings*); OutboundProtocol* (*instantiate_protocol)(BMailAccountSettings*);
BPath path(&entry); BPath path(&entry);
@@ -769,13 +763,12 @@ MailDaemonApp::_CreateOutboundProtocol(BMailAccountSettings& settings,
if (image < 0) if (image < 0)
return NULL; return NULL;
if (get_image_symbol(image, "instantiate_outbound_protocol", if (get_image_symbol(image, "instantiate_outbound_protocol",
B_SYMBOL_TYPE_TEXT, (void **)&instantiate_protocol) != B_OK) { B_SYMBOL_TYPE_TEXT, (void**)&instantiate_protocol) != B_OK) {
unload_add_on(image); unload_add_on(image);
image = -1; image = -1;
return NULL; return NULL;
} }
OutboundProtocol* protocol = (*instantiate_protocol)(&settings); return (*instantiate_protocol)(&settings);
return protocol;
} }