[haiku-commits] r42966 - in haiku/trunk: headers/os/mail src/kits/mail src/servers/mail

  • From: revol@xxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 29 Oct 2011 18:21:18 +0200 (CEST)

Author: mmu_man
Date: 2011-10-29 18:21:17 +0200 (Sat, 29 Oct 2011)
New Revision: 42966
Changeset: https://dev.haiku-os.org/changeset/42966

Modified:
   haiku/trunk/headers/os/mail/MailDaemon.h
   haiku/trunk/src/kits/mail/MailDaemon.cpp
   haiku/trunk/src/kits/mail/MailMessage.cpp
   haiku/trunk/src/kits/mail/MailSettings.cpp
   haiku/trunk/src/servers/mail/DeskbarView.cpp
   haiku/trunk/src/servers/mail/MailDaemon.cpp
Log:
Define B_MAIL_DAEMON_SIGNATURE and use it instead of hardcoding the signature 
everywhere.


Modified: haiku/trunk/headers/os/mail/MailDaemon.h
===================================================================
--- haiku/trunk/headers/os/mail/MailDaemon.h    2011-10-29 16:16:45 UTC (rev 
42965)
+++ haiku/trunk/headers/os/mail/MailDaemon.h    2011-10-29 16:21:17 UTC (rev 
42966)
@@ -10,6 +10,8 @@
 #include <E-mail.h>
 
 
+#define B_MAIL_DAEMON_SIGNATURE "application/x-vnd.Be-POST"
+
 const uint32 kMsgCheckAndSend = 'mbth';
 const uint32 kMsgCheckMessage = 'mnow';
 const uint32 kMsgSendMessages = 'msnd';
@@ -22,6 +24,9 @@
 const uint32 kMsgBodyFetched = 'mbfe';
 
 
+class BMessenger;
+
+
 class BMailDaemon {
 public:
        //! accountID = -1 means check all accounts

Modified: haiku/trunk/src/kits/mail/MailDaemon.cpp
===================================================================
--- haiku/trunk/src/kits/mail/MailDaemon.cpp    2011-10-29 16:16:45 UTC (rev 
42965)
+++ haiku/trunk/src/kits/mail/MailDaemon.cpp    2011-10-29 16:21:17 UTC (rev 
42966)
@@ -17,7 +17,7 @@
 status_t
 BMailDaemon::CheckMail(int32 accountID)
 {
-       BMessenger daemon("application/x-vnd.Be-POST");
+       BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
        if (!daemon.IsValid())
                return B_MAIL_NO_DAEMON;
 
@@ -30,7 +30,7 @@
 status_t
 BMailDaemon::CheckAndSendQueuedMail(int32 accountID)
 {
-       BMessenger daemon("application/x-vnd.Be-POST");
+       BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
        if (!daemon.IsValid())
                return B_MAIL_NO_DAEMON;
 
@@ -43,7 +43,7 @@
 status_t
 BMailDaemon::SendQueuedMail()
 {
-       BMessenger daemon("application/x-vnd.Be-POST");
+       BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
        if (!daemon.IsValid())
                return B_MAIL_NO_DAEMON;
        
@@ -54,7 +54,7 @@
 int32
 BMailDaemon::CountNewMessages(bool wait_for_fetch_completion)
 {
-       BMessenger daemon("application/x-vnd.Be-POST");
+       BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
        if (!daemon.IsValid())
                return B_MAIL_NO_DAEMON;
 
@@ -73,7 +73,7 @@
 status_t
 BMailDaemon::MarkAsRead(int32 account, const entry_ref& ref, read_flags flag)
 {
-       BMessenger daemon("application/x-vnd.Be-POST");
+       BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
        if (!daemon.IsValid())
                return B_MAIL_NO_DAEMON;
 
@@ -89,7 +89,7 @@
 status_t
 BMailDaemon::FetchBody(const entry_ref& ref, BMessenger* listener)
 {
-       BMessenger daemon("application/x-vnd.Be-POST");
+       BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
        if (!daemon.IsValid())
                return B_MAIL_NO_DAEMON;
 
@@ -106,7 +106,7 @@
 status_t
 BMailDaemon::Quit()
 {
-       BMessenger daemon("application/x-vnd.Be-POST");
+       BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
        if (!daemon.IsValid())
                return B_MAIL_NO_DAEMON;
        

Modified: haiku/trunk/src/kits/mail/MailMessage.cpp
===================================================================
--- haiku/trunk/src/kits/mail/MailMessage.cpp   2011-10-29 16:16:45 UTC (rev 
42965)
+++ haiku/trunk/src/kits/mail/MailMessage.cpp   2011-10-29 16:21:17 UTC (rev 
42966)
@@ -948,7 +948,7 @@
                        // TODO!
                }
 
-               BMessenger daemon("application/x-vnd.Be-POST");
+               BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
                if (!daemon.IsValid())
                        return B_MAIL_NO_DAEMON;
 

Modified: haiku/trunk/src/kits/mail/MailSettings.cpp
===================================================================
--- haiku/trunk/src/kits/mail/MailSettings.cpp  2011-10-29 16:16:45 UTC (rev 
42965)
+++ haiku/trunk/src/kits/mail/MailSettings.cpp  2011-10-29 16:21:17 UTC (rev 
42966)
@@ -19,6 +19,7 @@
 #include <Entry.h>
 #include <File.h>
 #include <FindDirectory.h>
+#include <MailDaemon.h>
 #include <Message.h>
 #include <Messenger.h>
 #include <Path.h>
@@ -72,7 +73,7 @@
        if (result < B_OK)
                return result;
 
-       BMessenger("application/x-vnd.Be-POST").SendMessage('mrrs');
+       BMessenger(B_MAIL_DAEMON_SIGNATURE).SendMessage('mrrs');
 
        return B_OK;
 }
@@ -224,7 +225,7 @@
 
        BMessage msg('wsch');
        msg.AddInt32("StatusWindowWorkSpace",workspace);
-       BMessenger("application/x-vnd.Be-POST").SendMessage(&msg);
+       BMessenger(B_MAIL_DAEMON_SIGNATURE).SendMessage(&msg);
 }
 
 
@@ -243,7 +244,7 @@
 
        BMessage msg('lkch');
        msg.AddInt32("StatusWindowLook", look);
-       BMessenger("application/x-vnd.Be-POST").SendMessage(&msg);
+       BMessenger(B_MAIL_DAEMON_SIGNATURE).SendMessage(&msg);
 }
 
 

Modified: haiku/trunk/src/servers/mail/DeskbarView.cpp
===================================================================
--- haiku/trunk/src/servers/mail/DeskbarView.cpp        2011-10-29 16:16:45 UTC 
(rev 42965)
+++ haiku/trunk/src/servers/mail/DeskbarView.cpp        2011-10-29 16:21:17 UTC 
(rev 42966)
@@ -122,7 +122,7 @@
 
        SetLowColor(ViewColor());
 
-       if (be_roster->IsRunning("application/x-vnd.Be-POST")) {
+       if (be_roster->IsRunning(B_MAIL_DAEMON_SIGNATURE)) {
                _RefreshMailQuery();
        } else {
                BDeskbar deskbar;
@@ -203,7 +203,7 @@
 {
        BView::Archive(data, deep);
 
-       data->AddString("add_on", "application/x-vnd.Be-POST");
+       data->AddString("add_on", B_MAIL_DAEMON_SIGNATURE);
        return B_NO_ERROR;
 }
 

Modified: haiku/trunk/src/servers/mail/MailDaemon.cpp
===================================================================
--- haiku/trunk/src/servers/mail/MailDaemon.cpp 2011-10-29 16:16:45 UTC (rev 
42965)
+++ haiku/trunk/src/servers/mail/MailDaemon.cpp 2011-10-29 16:21:17 UTC (rev 
42966)
@@ -105,7 +105,7 @@
 
 MailDaemonApp::MailDaemonApp()
        :
-       BApplication("application/x-vnd.Be-POST"),
+       BApplication(B_MAIL_DAEMON_SIGNATURE),
 
        fAutoCheckRunner(NULL)
 {
@@ -423,7 +423,7 @@
                BRoster roster;
                entry_ref ref;
 
-               status_t status = roster.FindApp("application/x-vnd.Be-POST", 
&ref);
+               status_t status = roster.FindApp(B_MAIL_DAEMON_SIGNATURE, &ref);
                if (status < B_OK) {
                        fprintf(stderr, "Can't find application to tell 
deskbar: %s\n",
                                strerror(status));


Other related posts:

  • » [haiku-commits] r42966 - in haiku/trunk: headers/os/mail src/kits/mail src/servers/mail - revol