aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/imap
diff options
context:
space:
mode:
authorGravatar Paul Young <paulyoungonline@gmail.com>2013-07-06 08:07:58 -0400
committerGravatar Paul Young <paulyoungonline@gmail.com>2013-07-06 08:07:58 -0400
commitb815d65756371787d491b79264ca7aadcf1c7810 (patch)
tree79a88c3910ece63e726090ee815fdd31c2f7fd42 /src/core/imap
parentf71bb2c0c2fb722f606b10250a3a57c133402af1 (diff)
Removed ivars for message rendering callbacks.
Diffstat (limited to 'src/core/imap')
-rw-r--r--src/core/imap/MCIMAPSession.cc22
-rw-r--r--src/core/imap/MCIMAPSession.h5
2 files changed, 14 insertions, 13 deletions
diff --git a/src/core/imap/MCIMAPSession.cc b/src/core/imap/MCIMAPSession.cc
index 55958254..5702f878 100644
--- a/src/core/imap/MCIMAPSession.cc
+++ b/src/core/imap/MCIMAPSession.cc
@@ -19,6 +19,8 @@
#include "MCHTMLRenderer.h"
#include "MCString.h"
#include "MCUtils.h"
+#include "MCHTMLRendererCallback.h"
+#include "MCHTMLBodyRendererTemplateCallback.h"
using namespace mailcore;
@@ -347,8 +349,6 @@ void IMAPSession::init()
mProgressCallback = NULL;
mProgressItemsCount = 0;
mConnectionLogger = NULL;
- mDataCallback = new HTMLRendererIMAPCallback();
- mHtmlCallback = new HTMLBodyRendererTemplateCallback();
}
IMAPSession::IMAPSession()
@@ -366,8 +366,6 @@ IMAPSession::~IMAPSession()
MC_SAFE_RELEASE(mDefaultNamespace);
MC_SAFE_RELEASE(mCurrentFolder);
pthread_mutex_destroy(&mIdleLock);
- MC_SAFE_RELEASE(mDataCallback);
- MC_SAFE_RELEASE(mHtmlCallback);
}
void IMAPSession::setHostname(String * hostname)
@@ -3026,21 +3024,29 @@ ConnectionLogger * IMAPSession::connectionLogger()
String * IMAPSession::htmlRendering(IMAPMessage * message, String * folder)
{
+ HTMLRendererIMAPCallback * dataCallback = new HTMLRendererIMAPCallback();
+
String * htmlString = HTMLRenderer::htmlForIMAPMessage(folder,
message,
- mDataCallback,
+ dataCallback,
NULL);
-
+
+ MC_SAFE_RELEASE(dataCallback);
return htmlString;
}
String * IMAPSession::htmlBodyRendering(IMAPMessage * message, String * folder)
{
+ HTMLRendererIMAPCallback * dataCallback = new HTMLRendererIMAPCallback();
+ HTMLBodyRendererTemplateCallback * htmlCallback = new HTMLBodyRendererTemplateCallback();
+
String * htmlBodyString = HTMLRenderer::htmlForIMAPMessage(folder,
message,
- mDataCallback,
- mHtmlCallback);
+ dataCallback,
+ htmlCallback);
+ MC_SAFE_RELEASE(dataCallback);
+ MC_SAFE_RELEASE(htmlCallback);
return htmlBodyString;
}
diff --git a/src/core/imap/MCIMAPSession.h b/src/core/imap/MCIMAPSession.h
index 77cf19f8..5c453e63 100644
--- a/src/core/imap/MCIMAPSession.h
+++ b/src/core/imap/MCIMAPSession.h
@@ -5,8 +5,6 @@
#include <MailCore/MCBaseTypes.h>
#include <MailCore/MCMessageConstants.h>
#include <MailCore/MCIMAPMessage.h>
-#include <MailCore/MCHTMLRendererCallback.h>
-#include <MailCore/MCHTMLBodyRendererTemplateCallback.h>
#ifdef __cplusplus
@@ -199,9 +197,6 @@ namespace mailcore {
unsigned int mProgressItemsCount;
ConnectionLogger * mConnectionLogger;
- HTMLRendererIMAPCallback * mDataCallback;
- HTMLBodyRendererTemplateCallback * mHtmlCallback;
-
void init();
void bodyProgress(unsigned int current, unsigned int maximum);
void itemsProgress(unsigned int current, unsigned int maximum);