Renamed MailDaemon{App|.cpp|.h} to MailDaemonApplication[.{cpp|h}].

This commit is contained in:
Axel Dörfler 2012-10-31 00:08:20 +01:00
parent ae9d8c6add
commit daf972c99c
3 changed files with 35 additions and 36 deletions

View File

@ -6,7 +6,7 @@
*/
#include "MailDaemon.h"
#include "MailDaemonApplication.h"
#include <stdio.h>
#include <stdlib.h>
@ -171,7 +171,7 @@ account_protocols::account_protocols()
// #pragma mark -
MailDaemonApp::MailDaemonApp()
MailDaemonApplication::MailDaemonApplication()
:
BApplication(B_MAIL_DAEMON_SIGNATURE),
@ -187,7 +187,7 @@ MailDaemonApp::MailDaemonApp()
}
MailDaemonApp::~MailDaemonApp()
MailDaemonApplication::~MailDaemonApplication()
{
delete fAutoCheckRunner;
@ -205,7 +205,7 @@ MailDaemonApp::~MailDaemonApp()
void
MailDaemonApp::ReadyToRun()
MailDaemonApplication::ReadyToRun()
{
InstallDeskbarIcon();
@ -271,7 +271,7 @@ MailDaemonApp::ReadyToRun()
void
MailDaemonApp::RefsReceived(BMessage* message)
MailDaemonApplication::RefsReceived(BMessage* message)
{
entry_ref ref;
for (int32 i = 0; message->FindRef("refs", i, &ref) == B_OK; i++) {
@ -299,7 +299,7 @@ MailDaemonApp::RefsReceived(BMessage* message)
void
MailDaemonApp::MessageReceived(BMessage* msg)
MailDaemonApplication::MessageReceived(BMessage* msg)
{
switch (msg->what) {
case 'moto':
@ -457,7 +457,7 @@ MailDaemonApp::MessageReceived(BMessage* msg)
void
MailDaemonApp::Pulse()
MailDaemonApplication::Pulse()
{
bigtime_t idle = idle_time();
if (fLEDAnimation->IsRunning() && idle < 100000)
@ -466,7 +466,7 @@ MailDaemonApp::Pulse()
bool
MailDaemonApp::QuitRequested()
MailDaemonApplication::QuitRequested()
{
RemoveDeskbarIcon();
return true;
@ -474,7 +474,7 @@ MailDaemonApp::QuitRequested()
void
MailDaemonApp::InstallDeskbarIcon()
MailDaemonApplication::InstallDeskbarIcon()
{
BDeskbar deskbar;
@ -500,7 +500,7 @@ MailDaemonApp::InstallDeskbarIcon()
void
MailDaemonApp::RemoveDeskbarIcon()
MailDaemonApplication::RemoveDeskbarIcon()
{
BDeskbar deskbar;
if (deskbar.HasItem("mail_daemon"))
@ -509,7 +509,7 @@ MailDaemonApp::RemoveDeskbarIcon()
void
MailDaemonApp::GetNewMessages(BMessage* msg)
MailDaemonApplication::GetNewMessages(BMessage* msg)
{
int32 account = -1;
if (msg->FindInt32("account", &account) == B_OK && account >= 0) {
@ -532,7 +532,7 @@ MailDaemonApp::GetNewMessages(BMessage* msg)
void
MailDaemonApp::SendPendingMessages(BMessage* msg)
MailDaemonApplication::SendPendingMessages(BMessage* msg)
{
BVolumeRoster roster;
BVolume volume;
@ -608,7 +608,7 @@ MailDaemonApp::SendPendingMessages(BMessage* msg)
void
MailDaemonApp::MakeMimeTypes(bool remakeMIMETypes)
MailDaemonApplication::MakeMimeTypes(bool remakeMIMETypes)
{
// Add MIME database entries for the e-mail file types we handle. Either
// do a full rebuild from nothing, or just add on the new attributes that
@ -665,7 +665,7 @@ MailDaemonApp::MakeMimeTypes(bool remakeMIMETypes)
void
MailDaemonApp::_InitAccounts()
MailDaemonApplication::_InitAccounts()
{
BMailAccounts accounts;
for (int i = 0; i < accounts.CountAccounts(); i++)
@ -674,7 +674,7 @@ MailDaemonApp::_InitAccounts()
void
MailDaemonApp::_InitAccount(BMailAccountSettings& settings)
MailDaemonApplication::_InitAccount(BMailAccountSettings& settings)
{
account_protocols account;
@ -712,7 +712,7 @@ MailDaemonApp::_InitAccount(BMailAccountSettings& settings)
void
MailDaemonApp::_ReloadAccounts(BMessage* message)
MailDaemonApplication::_ReloadAccounts(BMessage* message)
{
type_code typeFound;
int32 countFound;
@ -739,7 +739,7 @@ MailDaemonApp::_ReloadAccounts(BMessage* message)
void
MailDaemonApp::_RemoveAccount(const account_protocols& account)
MailDaemonApplication::_RemoveAccount(const account_protocols& account)
{
if (account.inboundProtocol != NULL) {
account.inboundProtocol->Lock();
@ -758,7 +758,7 @@ MailDaemonApp::_RemoveAccount(const account_protocols& account)
BInboundMailProtocol*
MailDaemonApp::_CreateInboundProtocol(BMailAccountSettings& settings,
MailDaemonApplication::_CreateInboundProtocol(BMailAccountSettings& settings,
image_id& image)
{
const entry_ref& entry = settings.InboundAddOnRef();
@ -780,7 +780,7 @@ MailDaemonApp::_CreateInboundProtocol(BMailAccountSettings& settings,
BOutboundMailProtocol*
MailDaemonApp::_CreateOutboundProtocol(BMailAccountSettings& settings,
MailDaemonApplication::_CreateOutboundProtocol(BMailAccountSettings& settings,
image_id& image)
{
const entry_ref& entry = settings.OutboundAddOnRef();
@ -802,7 +802,7 @@ MailDaemonApp::_CreateOutboundProtocol(BMailAccountSettings& settings,
BInboundMailProtocol*
MailDaemonApp::_InboundProtocol(int32 account)
MailDaemonApplication::_InboundProtocol(int32 account)
{
AccountMap::iterator found = fAccounts.find(account);
if (found == fAccounts.end())
@ -812,7 +812,7 @@ MailDaemonApp::_InboundProtocol(int32 account)
BOutboundMailProtocol*
MailDaemonApp::_OutboundProtocol(int32 account)
MailDaemonApplication::_OutboundProtocol(int32 account)
{
if (account < 0)
account = BMailSettings().DefaultOutboundAccount();
@ -825,7 +825,7 @@ MailDaemonApp::_OutboundProtocol(int32 account)
void
MailDaemonApp::_UpdateAutoCheck(bigtime_t interval)
MailDaemonApplication::_UpdateAutoCheck(bigtime_t interval)
{
if (interval > 0) {
if (fAutoCheckRunner != NULL) {
@ -843,7 +843,7 @@ MailDaemonApp::_UpdateAutoCheck(bigtime_t interval)
void
MailDaemonApp::_AddMessage(send_mails_info& info, const BEntry& entry,
MailDaemonApplication::_AddMessage(send_mails_info& info, const BEntry& entry,
const BNode& node)
{
entry_ref ref;
@ -858,7 +858,7 @@ MailDaemonApp::_AddMessage(send_mails_info& info, const BEntry& entry,
/*! Work-around for a broken index that contains out-of-date information.
*/
/*static*/ bool
MailDaemonApp::_IsPending(BNode& node)
MailDaemonApplication::_IsPending(BNode& node)
{
int32 flags;
if (node.ReadAttr(B_MAIL_ATTR_FLAGS, B_INT32_TYPE, 0, &flags, sizeof(int32))
@ -870,7 +870,7 @@ MailDaemonApp::_IsPending(BNode& node)
/*static*/ bool
MailDaemonApp::_IsEntryInTrash(BEntry& entry)
MailDaemonApplication::_IsEntryInTrash(BEntry& entry)
{
entry_ref ref;
entry.GetRef(&ref);

View File

@ -4,8 +4,8 @@
* Copyright 2011, Clemens Zeidler <haiku@clemens-zeidler.de>
* Distributed under the terms of the MIT License.
*/
#ifndef MAIL_DAEMON_APP_H
#define MAIL_DAEMON_APP_H
#ifndef MAIL_DAEMON_APPLICATION_H
#define MAIL_DAEMON_APPLICATION_H
#include <map>
@ -41,10 +41,10 @@ struct account_protocols {
typedef std::map<int32, account_protocols> AccountMap;
class MailDaemonApp : public BApplication {
class MailDaemonApplication : public BApplication {
public:
MailDaemonApp();
virtual ~MailDaemonApp();
MailDaemonApplication();
virtual ~MailDaemonApplication();
virtual void ReadyToRun();
virtual void RefsReceived(BMessage* message);
@ -113,4 +113,4 @@ private:
};
#endif // MAIL_DAEMON_APP_H
#endif // MAIL_DAEMON_APPLICATION_H

View File

@ -1,12 +1,12 @@
/*
* Copyright 2007-2011, Haiku, Inc. All rights reserved.
* Copyright 2007-2012, Haiku, Inc. All rights reserved.
* Copyright 2001-2002 Dr. Zoidberg Enterprises. All rights reserved.
* Copyright 2011, Clemens Zeidler <haiku@clemens-zeidler.de>
* Distributed under the terms of the MIT License.
*/
#include "MailDaemon.h"
#include "MailDaemonApplication.h"
int
@ -19,12 +19,11 @@ main(int argc, const char** argv)
if (!BMailSettings().DaemonAutoStarts())
return 0;
}
if (strcmp(argv[i], "-M") == 0) {
if (strcmp(argv[i], "-M") == 0)
remakeMIMETypes = true;
}
}
MailDaemonApp app;
MailDaemonApplication app;
if (remakeMIMETypes)
app.MakeMimeTypes(true);
app.Run();