From b0acdd1578a5ed63b53c9427ec7a6083fc62d650 Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Thu, 3 Mar 2011 21:42:29 +0000 Subject: [PATCH] Remove some code that pretty much looks like some legacy code to add additional attributes to a running system. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40797 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/mail/MailDaemon.cpp | 35 ++------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/src/servers/mail/MailDaemon.cpp b/src/servers/mail/MailDaemon.cpp index e3283e86b7..2f2a110195 100644 --- a/src/servers/mail/MailDaemon.cpp +++ b/src/servers/mail/MailDaemon.cpp @@ -643,8 +643,7 @@ MailDaemonApp::MakeMimeTypes(bool remakeMIMETypes) for (size_t i = 0; i < kNTypes; i++) { BMessage info; - BMimeType mime; - mime.SetTo(types[i]); + BMimeType mime(types[i]); if (mime.InitCheck() != B_OK) { fputs("could not init mime type.\n", stderr); return; @@ -652,7 +651,7 @@ MailDaemonApp::MakeMimeTypes(bool remakeMIMETypes) if (!mime.IsInstalled() || remakeMIMETypes) { // install the full mime type - mime.Delete (); + mime.Delete(); mime.Install(); // Set up the list of e-mail related attributes that Tracker will @@ -684,37 +683,7 @@ MailDaemonApp::MakeMimeTypes(bool remakeMIMETypes) mime.SetLongDescription("A Partially Downloaded E-mail"); mime.SetPreferredApp("application/x-vnd.Be-MAIL"); } - } else { - // Just add the e-mail related attribute types we use to the MIME - // system. - mime.GetAttrInfo(&info); - bool hasAccount = false; - bool hasThread = false; - bool hasSize = false; - const char* result; - for (int32 index = 0; info.FindString("attr:name", index, &result) - == B_OK; index++) { - if (!strcmp(result, B_MAIL_ATTR_ACCOUNT)) - hasAccount = true; - if (!strcmp(result, B_MAIL_ATTR_THREAD)) - hasThread = true; - if (!strcmp(result, "MAIL:fullsize")) - hasSize = true; - } - - if (!hasAccount) { - addAttribute(info, B_MAIL_ATTR_ACCOUNT, "Account", - B_STRING_TYPE, true, false, 100); - } - if (!hasThread) - addAttribute(info, B_MAIL_ATTR_THREAD, "Thread"); - /*if (!hasSize) - addAttribute(info,"MAIL:fullsize","Message Size",B_SIZE_T_TYPE,true,false,100);*/ - // TODO: Tracker can't display SIZT attributes. What a pain. - if (!hasAccount || !hasThread/* || !hasSize*/) - mime.SetAttrInfo(&info); } - mime.Unset(); } }