Commit 07c54fef authored by Sven Strickroth's avatar Sven Strickroth

Constify

Signed-off-by: Sven Strickroth's avatarSven Strickroth <email@cs-ware.de>
parent e3b9a127
......@@ -21,7 +21,7 @@
#include "stdafx.h"
#include "Patch.h"
CSendMailPatch::CSendMailPatch(CString &To, CString &CC, CString &subject, bool bAttachment, bool bCombine)
CSendMailPatch::CSendMailPatch(const CString& To, const CString& CC, const CString& subject, bool bAttachment, bool bCombine)
: CSendMailCombineable(To, CC, subject, bAttachment, bCombine)
{
}
......@@ -30,7 +30,7 @@ CSendMailPatch::~CSendMailPatch()
{
}
int CSendMailPatch::SendAsSingleMail(CTGitPath &path, CGitProgressList * instance)
int CSendMailPatch::SendAsSingleMail(const CTGitPath& path, CGitProgressList* instance)
{
ASSERT(instance);
......@@ -52,7 +52,7 @@ int CSendMailPatch::SendAsSingleMail(CTGitPath &path, CGitProgressList * instanc
return SendMail(path, instance, m_sSenderName, m_sSenderMail, m_sTo, m_sCC, patch.m_Subject, body, attachments);
}
int CSendMailPatch::SendAsCombinedMail(CTGitPathList &list, CGitProgressList * instance)
int CSendMailPatch::SendAsCombinedMail(const CTGitPathList &list, CGitProgressList* instance)
{
ASSERT(instance);
......@@ -96,7 +96,7 @@ CPatch::~CPatch()
{
}
int CPatch::Parse(CString& pathfile, bool parseBody)
int CPatch::Parse(const CString& pathfile, bool parseBody)
{
m_PathFile = pathfile;
......
......@@ -24,12 +24,12 @@
class CSendMailPatch : public CSendMailCombineable
{
public:
CSendMailPatch(CString &To, CString &CC, CString &subject, bool bAttachment, bool bCombine);
CSendMailPatch(const CString& To, const CString& CC, const CString& subject, bool bAttachment, bool bCombine);
~CSendMailPatch(void);
protected:
virtual int SendAsSingleMail(CTGitPath &path, CGitProgressList * instance);
virtual int SendAsCombinedMail(CTGitPathList &list, CGitProgressList * instance);
virtual int SendAsSingleMail(const CTGitPath& path, CGitProgressList* instance);
virtual int SendAsCombinedMail(const CTGitPathList& list, CGitProgressList* instance);
};
class CPatch
......@@ -38,7 +38,7 @@ public:
CPatch();
~CPatch(void);
int Parse(CString& pathfile, bool parseBody);
int Parse(const CString& pathfile, bool parseBody);
CString m_Author;
CString m_Date;
CString m_Subject;
......
......@@ -25,7 +25,7 @@
class CAppUtils;
CSendMail::CSendMail(CString &To, CString &CC, bool bAttachment)
CSendMail::CSendMail(const CString& To, const CString& CC, bool bAttachment)
{
m_sSenderName = g_Git.GetUserName();
m_sSenderMail = g_Git.GetUserEmail();
......@@ -38,7 +38,7 @@ CSendMail::~CSendMail(void)
{
}
int CSendMail::SendMail(const CTGitPath &item, CGitProgressList * instance, CString &FromName, CString &FromMail, CString &To, CString &CC, CString &subject, CString &body, CStringArray &attachments)
int CSendMail::SendMail(const CTGitPath &item, CGitProgressList * instance, const CString& FromName, const CString& FromMail, const CString& To, const CString& CC, const CString &subject, const CString& body, CStringArray &attachments)
{
ASSERT(instance);
int retry = 0;
......@@ -73,7 +73,7 @@ int CSendMail::SendMail(const CTGitPath &item, CGitProgressList * instance, CStr
return -1;
}
int CSendMail::SendMail(CString &FromName, CString &FromMail, CString &To, CString &CC, CString &subject, CString &body, CStringArray &attachments, CString *errortext)
int CSendMail::SendMail(const CString& FromName, const CString& FromMail, const CString& To, const CString& CC, const CString& subject, const CString& body, CStringArray &attachments, CString *errortext)
{
if (CRegDWORD(_T("Software\\TortoiseGit\\TortoiseProc\\SendMail\\DeliveryType"), SEND_MAIL_MAPI) == SEND_MAIL_MAPI)
{
......@@ -137,7 +137,7 @@ int CSendMail::SendMail(CString &FromName, CString &FromMail, CString &To, CStri
}
}
CSendMailCombineable::CSendMailCombineable(CString &To, CString &CC, CString &subject, bool bAttachment, bool bCombine)
CSendMailCombineable::CSendMailCombineable(const CString& To, const CString& CC, const CString& subject, bool bAttachment, bool bCombine)
: CSendMail(To, CC, bAttachment)
, m_sSubject(subject)
, m_bCombine(bCombine)
......@@ -148,7 +148,7 @@ CSendMailCombineable::~CSendMailCombineable()
{
}
int CSendMailCombineable::Send(CTGitPathList &list, CGitProgressList * instance)
int CSendMailCombineable::Send(const CTGitPathList& list, CGitProgressList* instance)
{
if (m_bCombine)
{
......@@ -160,7 +160,7 @@ int CSendMailCombineable::Send(CTGitPathList &list, CGitProgressList * instance)
for (int i = 0; i < list.GetCount(); ++i)
{
instance->SetItemProgress(i);
if (SendAsSingleMail((CTGitPath &)list[i], instance))
if (SendAsSingleMail((CTGitPath&)list[i], instance))
return -1;
}
instance->SetItemProgress(list.GetCount() + 1);
......@@ -187,7 +187,7 @@ int GetFileContents(CString &filename, CString &content)
return -1;
}
int CSendMailCombineable::SendAsSingleMail(CTGitPath &path, CGitProgressList * instance)
int CSendMailCombineable::SendAsSingleMail(const CTGitPath& path, CGitProgressList* instance)
{
ASSERT(instance);
......@@ -206,7 +206,7 @@ int CSendMailCombineable::SendAsSingleMail(CTGitPath &path, CGitProgressList * i
return SendMail(path, instance, m_sSenderName, m_sSenderMail, m_sTo, m_sCC, m_sSubject, body, attachments);
}
int CSendMailCombineable::SendAsCombinedMail(CTGitPathList &list, CGitProgressList * instance)
int CSendMailCombineable::SendAsCombinedMail(const CTGitPathList &list, CGitProgressList* instance)
{
ASSERT(instance);
......
......@@ -32,8 +32,8 @@ enum
class CSendMail
{
protected:
static int SendMail(CString &FromName, CString &FromMail, CString &To, CString &CC, CString &subject, CString &body, CStringArray &attachments, CString *errortext);
static int SendMail(const CTGitPath &item, CGitProgressList * instance, CString &FromName, CString &FromMail, CString &To, CString &CC, CString &subject, CString &body, CStringArray &attachments);
static int SendMail(const CString& FromName, const CString& FromMail, const CString& To, const CString& CC, const CString& subject, const CString& body, CStringArray &attachments, CString *errortext);
static int SendMail(const CTGitPath &item, CGitProgressList* instance, const CString& FromName, const CString& FromMail, const CString& To, const CString& CC, const CString &subject, const CString& body, CStringArray &attachments);
CString m_sSenderName;
CString m_sSenderMail;
CString m_sTo;
......@@ -41,22 +41,22 @@ protected:
bool m_bAttachment;
public:
CSendMail(CString &To, CString &CC, bool m_bAttachment);
CSendMail(const CString& To, const CString& CC, bool m_bAttachment);
~CSendMail(void);
virtual int Send(CTGitPathList &list, CGitProgressList * instance) = 0;
virtual int Send(const CTGitPathList& list, CGitProgressList* instance) = 0;
};
class CSendMailCombineable : public CSendMail
{
public:
CSendMailCombineable(CString &To, CString &CC, CString &subject, bool bAttachment, bool bCombine);
CSendMailCombineable(const CString& To, const CString& CC, const CString& subject, bool bAttachment, bool bCombine);
~CSendMailCombineable(void);
virtual int Send(CTGitPathList &list, CGitProgressList * instance);
virtual int Send(const CTGitPathList& list, CGitProgressList* instance);
protected:
virtual int SendAsSingleMail(CTGitPath &path, CGitProgressList * instance);
virtual int SendAsCombinedMail(CTGitPathList &list, CGitProgressList * instance);
virtual int SendAsSingleMail(const CTGitPath& path, CGitProgressList* instance);
virtual int SendAsCombinedMail(const CTGitPathList& list, CGitProgressList* instance);
CString m_sSubject;
bool m_bCombine;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment