Renamed MailDaemon{App|.cpp|.h} to MailDaemonApplication[.{cpp|h}].
This commit is contained in:
parent
ae9d8c6add
commit
daf972c99c
@ -6,7 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "MailDaemon.h"
|
#include "MailDaemonApplication.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -171,7 +171,7 @@ account_protocols::account_protocols()
|
|||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
MailDaemonApp::MailDaemonApp()
|
MailDaemonApplication::MailDaemonApplication()
|
||||||
:
|
:
|
||||||
BApplication(B_MAIL_DAEMON_SIGNATURE),
|
BApplication(B_MAIL_DAEMON_SIGNATURE),
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ MailDaemonApp::MailDaemonApp()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MailDaemonApp::~MailDaemonApp()
|
MailDaemonApplication::~MailDaemonApplication()
|
||||||
{
|
{
|
||||||
delete fAutoCheckRunner;
|
delete fAutoCheckRunner;
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ MailDaemonApp::~MailDaemonApp()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MailDaemonApp::ReadyToRun()
|
MailDaemonApplication::ReadyToRun()
|
||||||
{
|
{
|
||||||
InstallDeskbarIcon();
|
InstallDeskbarIcon();
|
||||||
|
|
||||||
@ -271,7 +271,7 @@ MailDaemonApp::ReadyToRun()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MailDaemonApp::RefsReceived(BMessage* message)
|
MailDaemonApplication::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++) {
|
||||||
@ -299,7 +299,7 @@ MailDaemonApp::RefsReceived(BMessage* message)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MailDaemonApp::MessageReceived(BMessage* msg)
|
MailDaemonApplication::MessageReceived(BMessage* msg)
|
||||||
{
|
{
|
||||||
switch (msg->what) {
|
switch (msg->what) {
|
||||||
case 'moto':
|
case 'moto':
|
||||||
@ -457,7 +457,7 @@ MailDaemonApp::MessageReceived(BMessage* msg)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MailDaemonApp::Pulse()
|
MailDaemonApplication::Pulse()
|
||||||
{
|
{
|
||||||
bigtime_t idle = idle_time();
|
bigtime_t idle = idle_time();
|
||||||
if (fLEDAnimation->IsRunning() && idle < 100000)
|
if (fLEDAnimation->IsRunning() && idle < 100000)
|
||||||
@ -466,7 +466,7 @@ MailDaemonApp::Pulse()
|
|||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
MailDaemonApp::QuitRequested()
|
MailDaemonApplication::QuitRequested()
|
||||||
{
|
{
|
||||||
RemoveDeskbarIcon();
|
RemoveDeskbarIcon();
|
||||||
return true;
|
return true;
|
||||||
@ -474,7 +474,7 @@ MailDaemonApp::QuitRequested()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MailDaemonApp::InstallDeskbarIcon()
|
MailDaemonApplication::InstallDeskbarIcon()
|
||||||
{
|
{
|
||||||
BDeskbar deskbar;
|
BDeskbar deskbar;
|
||||||
|
|
||||||
@ -500,7 +500,7 @@ MailDaemonApp::InstallDeskbarIcon()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MailDaemonApp::RemoveDeskbarIcon()
|
MailDaemonApplication::RemoveDeskbarIcon()
|
||||||
{
|
{
|
||||||
BDeskbar deskbar;
|
BDeskbar deskbar;
|
||||||
if (deskbar.HasItem("mail_daemon"))
|
if (deskbar.HasItem("mail_daemon"))
|
||||||
@ -509,7 +509,7 @@ MailDaemonApp::RemoveDeskbarIcon()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MailDaemonApp::GetNewMessages(BMessage* msg)
|
MailDaemonApplication::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) {
|
||||||
@ -532,7 +532,7 @@ MailDaemonApp::GetNewMessages(BMessage* msg)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MailDaemonApp::SendPendingMessages(BMessage* msg)
|
MailDaemonApplication::SendPendingMessages(BMessage* msg)
|
||||||
{
|
{
|
||||||
BVolumeRoster roster;
|
BVolumeRoster roster;
|
||||||
BVolume volume;
|
BVolume volume;
|
||||||
@ -608,7 +608,7 @@ MailDaemonApp::SendPendingMessages(BMessage* msg)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MailDaemonApp::MakeMimeTypes(bool remakeMIMETypes)
|
MailDaemonApplication::MakeMimeTypes(bool remakeMIMETypes)
|
||||||
{
|
{
|
||||||
// Add MIME database entries for the e-mail file types we handle. Either
|
// 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
|
// do a full rebuild from nothing, or just add on the new attributes that
|
||||||
@ -665,7 +665,7 @@ MailDaemonApp::MakeMimeTypes(bool remakeMIMETypes)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MailDaemonApp::_InitAccounts()
|
MailDaemonApplication::_InitAccounts()
|
||||||
{
|
{
|
||||||
BMailAccounts accounts;
|
BMailAccounts accounts;
|
||||||
for (int i = 0; i < accounts.CountAccounts(); i++)
|
for (int i = 0; i < accounts.CountAccounts(); i++)
|
||||||
@ -674,7 +674,7 @@ MailDaemonApp::_InitAccounts()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MailDaemonApp::_InitAccount(BMailAccountSettings& settings)
|
MailDaemonApplication::_InitAccount(BMailAccountSettings& settings)
|
||||||
{
|
{
|
||||||
account_protocols account;
|
account_protocols account;
|
||||||
|
|
||||||
@ -712,7 +712,7 @@ MailDaemonApp::_InitAccount(BMailAccountSettings& settings)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MailDaemonApp::_ReloadAccounts(BMessage* message)
|
MailDaemonApplication::_ReloadAccounts(BMessage* message)
|
||||||
{
|
{
|
||||||
type_code typeFound;
|
type_code typeFound;
|
||||||
int32 countFound;
|
int32 countFound;
|
||||||
@ -739,7 +739,7 @@ MailDaemonApp::_ReloadAccounts(BMessage* message)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MailDaemonApp::_RemoveAccount(const account_protocols& account)
|
MailDaemonApplication::_RemoveAccount(const account_protocols& account)
|
||||||
{
|
{
|
||||||
if (account.inboundProtocol != NULL) {
|
if (account.inboundProtocol != NULL) {
|
||||||
account.inboundProtocol->Lock();
|
account.inboundProtocol->Lock();
|
||||||
@ -758,7 +758,7 @@ MailDaemonApp::_RemoveAccount(const account_protocols& account)
|
|||||||
|
|
||||||
|
|
||||||
BInboundMailProtocol*
|
BInboundMailProtocol*
|
||||||
MailDaemonApp::_CreateInboundProtocol(BMailAccountSettings& settings,
|
MailDaemonApplication::_CreateInboundProtocol(BMailAccountSettings& settings,
|
||||||
image_id& image)
|
image_id& image)
|
||||||
{
|
{
|
||||||
const entry_ref& entry = settings.InboundAddOnRef();
|
const entry_ref& entry = settings.InboundAddOnRef();
|
||||||
@ -780,7 +780,7 @@ MailDaemonApp::_CreateInboundProtocol(BMailAccountSettings& settings,
|
|||||||
|
|
||||||
|
|
||||||
BOutboundMailProtocol*
|
BOutboundMailProtocol*
|
||||||
MailDaemonApp::_CreateOutboundProtocol(BMailAccountSettings& settings,
|
MailDaemonApplication::_CreateOutboundProtocol(BMailAccountSettings& settings,
|
||||||
image_id& image)
|
image_id& image)
|
||||||
{
|
{
|
||||||
const entry_ref& entry = settings.OutboundAddOnRef();
|
const entry_ref& entry = settings.OutboundAddOnRef();
|
||||||
@ -802,7 +802,7 @@ MailDaemonApp::_CreateOutboundProtocol(BMailAccountSettings& settings,
|
|||||||
|
|
||||||
|
|
||||||
BInboundMailProtocol*
|
BInboundMailProtocol*
|
||||||
MailDaemonApp::_InboundProtocol(int32 account)
|
MailDaemonApplication::_InboundProtocol(int32 account)
|
||||||
{
|
{
|
||||||
AccountMap::iterator found = fAccounts.find(account);
|
AccountMap::iterator found = fAccounts.find(account);
|
||||||
if (found == fAccounts.end())
|
if (found == fAccounts.end())
|
||||||
@ -812,7 +812,7 @@ MailDaemonApp::_InboundProtocol(int32 account)
|
|||||||
|
|
||||||
|
|
||||||
BOutboundMailProtocol*
|
BOutboundMailProtocol*
|
||||||
MailDaemonApp::_OutboundProtocol(int32 account)
|
MailDaemonApplication::_OutboundProtocol(int32 account)
|
||||||
{
|
{
|
||||||
if (account < 0)
|
if (account < 0)
|
||||||
account = BMailSettings().DefaultOutboundAccount();
|
account = BMailSettings().DefaultOutboundAccount();
|
||||||
@ -825,7 +825,7 @@ MailDaemonApp::_OutboundProtocol(int32 account)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MailDaemonApp::_UpdateAutoCheck(bigtime_t interval)
|
MailDaemonApplication::_UpdateAutoCheck(bigtime_t interval)
|
||||||
{
|
{
|
||||||
if (interval > 0) {
|
if (interval > 0) {
|
||||||
if (fAutoCheckRunner != NULL) {
|
if (fAutoCheckRunner != NULL) {
|
||||||
@ -843,7 +843,7 @@ MailDaemonApp::_UpdateAutoCheck(bigtime_t interval)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MailDaemonApp::_AddMessage(send_mails_info& info, const BEntry& entry,
|
MailDaemonApplication::_AddMessage(send_mails_info& info, const BEntry& entry,
|
||||||
const BNode& node)
|
const BNode& node)
|
||||||
{
|
{
|
||||||
entry_ref ref;
|
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.
|
/*! Work-around for a broken index that contains out-of-date information.
|
||||||
*/
|
*/
|
||||||
/*static*/ bool
|
/*static*/ bool
|
||||||
MailDaemonApp::_IsPending(BNode& node)
|
MailDaemonApplication::_IsPending(BNode& node)
|
||||||
{
|
{
|
||||||
int32 flags;
|
int32 flags;
|
||||||
if (node.ReadAttr(B_MAIL_ATTR_FLAGS, B_INT32_TYPE, 0, &flags, sizeof(int32))
|
if (node.ReadAttr(B_MAIL_ATTR_FLAGS, B_INT32_TYPE, 0, &flags, sizeof(int32))
|
||||||
@ -870,7 +870,7 @@ MailDaemonApp::_IsPending(BNode& node)
|
|||||||
|
|
||||||
|
|
||||||
/*static*/ bool
|
/*static*/ bool
|
||||||
MailDaemonApp::_IsEntryInTrash(BEntry& entry)
|
MailDaemonApplication::_IsEntryInTrash(BEntry& entry)
|
||||||
{
|
{
|
||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
entry.GetRef(&ref);
|
entry.GetRef(&ref);
|
@ -4,8 +4,8 @@
|
|||||||
* Copyright 2011, Clemens Zeidler <haiku@clemens-zeidler.de>
|
* Copyright 2011, Clemens Zeidler <haiku@clemens-zeidler.de>
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef MAIL_DAEMON_APP_H
|
#ifndef MAIL_DAEMON_APPLICATION_H
|
||||||
#define MAIL_DAEMON_APP_H
|
#define MAIL_DAEMON_APPLICATION_H
|
||||||
|
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
@ -41,10 +41,10 @@ struct account_protocols {
|
|||||||
typedef std::map<int32, account_protocols> AccountMap;
|
typedef std::map<int32, account_protocols> AccountMap;
|
||||||
|
|
||||||
|
|
||||||
class MailDaemonApp : public BApplication {
|
class MailDaemonApplication : public BApplication {
|
||||||
public:
|
public:
|
||||||
MailDaemonApp();
|
MailDaemonApplication();
|
||||||
virtual ~MailDaemonApp();
|
virtual ~MailDaemonApplication();
|
||||||
|
|
||||||
virtual void ReadyToRun();
|
virtual void ReadyToRun();
|
||||||
virtual void RefsReceived(BMessage* message);
|
virtual void RefsReceived(BMessage* message);
|
||||||
@ -113,4 +113,4 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // MAIL_DAEMON_APP_H
|
#endif // MAIL_DAEMON_APPLICATION_H
|
@ -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 2001-2002 Dr. Zoidberg Enterprises. All rights reserved.
|
||||||
* Copyright 2011, Clemens Zeidler <haiku@clemens-zeidler.de>
|
* Copyright 2011, Clemens Zeidler <haiku@clemens-zeidler.de>
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "MailDaemon.h"
|
#include "MailDaemonApplication.h"
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -19,12 +19,11 @@ main(int argc, const char** argv)
|
|||||||
if (!BMailSettings().DaemonAutoStarts())
|
if (!BMailSettings().DaemonAutoStarts())
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (strcmp(argv[i], "-M") == 0) {
|
if (strcmp(argv[i], "-M") == 0)
|
||||||
remakeMIMETypes = true;
|
remakeMIMETypes = true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MailDaemonApp app;
|
MailDaemonApplication app;
|
||||||
if (remakeMIMETypes)
|
if (remakeMIMETypes)
|
||||||
app.MakeMimeTypes(true);
|
app.MakeMimeTypes(true);
|
||||||
app.Run();
|
app.Run();
|
||||||
|
Loading…
Reference in New Issue
Block a user