Update of /cvsroot/mahogany/M/src/mail
In directory sc8-pr-cvs1:/tmp/cvs-serv26637/src/mail
Modified Files:
ASMailFolder.cpp Address.cpp AddressCC.cpp HeaderInfoImpl.cpp
HeaderIterator.cpp LogCircle.cpp MailFolderCC.cpp
Log Message:
unicode fixes
Index: ASMailFolder.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/ASMailFolder.cpp,v
retrieving revision 1.71
retrieving revision 1.72
diff -b -u -2 -r1.71 -r1.72
--- ASMailFolder.cpp 19 Sep 2003 13:31:22 -0000 1.71
+++ ASMailFolder.cpp 12 Oct 2003 15:14:01 -0000 1.72
@@ -558,5 +558,5 @@
{
int rc = m_Op == ASMailFolder::Op_SaveMessagesToFile
- ? m_MailFolder->SaveMessagesToFile(m_Seq, "", m_Parent)
+ ? m_MailFolder->SaveMessagesToFile(m_Seq, _T(""), m_Parent)
: m_MailFolder->SaveMessages(m_Seq, m_Folder);
SendEvent(ASMailFolder::ResultInt::Create(m_ASMailFolder,
@@ -1233,5 +1233,5 @@
{
String s1 = MObjectRC::DebugDump(), s2;
- s2.Printf("name '%s'", GetName().c_str());
+ s2.Printf(_T("name '%s'"), GetName().c_str());
return s1 + s2;
@@ -1241,5 +1241,5 @@
{
String s1 = MObjectRC::DebugDump(), s2;
- s2.Printf("operation id = %d, folder '%s'", m_Id, m_Mf->GetName().c_str());
+ s2.Printf(_T("operation id = %d, folder '%s'"), m_Id, m_Mf->GetName().c_str());
return s1 + s2;
@@ -1248,5 +1248,5 @@
String ASTicketListImpl::DebugDump() const
{
- return ASTicketList::DebugDump() << m_Tickets.GetCount() << " tickets";
+ return ASTicketList::DebugDump() << m_Tickets.GetCount() << _T(" tickets");
}
Index: Address.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/Address.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -b -u -2 -r1.11 -r1.12
--- Address.cpp 18 Sep 2003 16:30:57 -0000 1.11
+++ Address.cpp 12 Oct 2003 15:14:01 -0000 1.12
@@ -167,8 +167,8 @@
if(subject.Length() > strlen("Re")
- && Stricmp(subject.Left(strlen("Re")), "Re") == 0)
+ && wxStricmp(subject.Left(strlen("Re")), _T("Re")) == 0)
idx = strlen("Re");
else if(subject.Length() > trPrefix.Length()
- && Stricmp(subject.Left(trPrefix.Length()), trPrefix) == 0)
+ && wxStricmp(subject.Left(trPrefix.Length()), trPrefix) == 0)
idx = trPrefix.Length();
@@ -225,11 +225,11 @@
// we need to quote the personal part if it's not an atext as defined by RFC
// 2822 (TODO: reuse IsATextChar() from matchurl.cpp!)
- bool doQuote = strpbrk(name, ",;\"") != (const char *)NULL;
+ bool doQuote = wxStrpbrk(name, _T(",;\"")) != (const wxChar *)NULL;
if ( doQuote )
{
- address = '"';
+ address = _T('"');
// escape all quotes
- personal.Replace("\"", "\\\"");
+ personal.Replace(_T("\""), _T("\\\""));
}
@@ -238,10 +238,10 @@
if ( doQuote )
{
- address += '"';
+ address += _T('"');
}
if ( !email.empty() )
{
- address << " <" << email << '>';
+ address << _T(" <") << email << _T('>');
}
//else: can it really be empty??
Index: AddressCC.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/AddressCC.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -b -u -2 -r1.20 -r1.21
--- AddressCC.cpp 18 Sep 2003 16:30:57 -0000 1.20
+++ AddressCC.cpp 12 Oct 2003 15:14:01 -0000 1.21
@@ -101,5 +101,5 @@
CHECK( m_adr, personal, _T("invalid address") );
- personal = m_adr->personal;
+ personal = wxConvertMB2WX(m_adr->personal);
return personal;
@@ -111,5 +111,5 @@
CHECK( m_adr, mailbox, _T("invalid address") );
- mailbox = m_adr->mailbox;
+ mailbox = wxConvertMB2WX(m_adr->mailbox);
return mailbox;
@@ -121,5 +121,5 @@
CHECK( m_adr, host, _T("invalid address") );
- host = m_adr->host;
+ host = wxConvertMB2WX(m_adr->host);
return host;
@@ -136,5 +136,5 @@
// case insensitive string compare of strings which may be NULL
-static inline bool SafeCompare(const char *s1, const char *s2)
+static inline bool SafeCompare(const wxChar *s1, const wxChar *s2)
{
if ( !s1 || !s2 )
@@ -155,6 +155,6 @@
// we also ignore adl field - IMHO the addresses differing only by source
// route should be considered identical, shouldn't they?
- return SafeCompare(m_adr->mailbox, addrCC.m_adr->mailbox) &&
- SafeCompare(m_adr->host, addrCC.m_adr->host);
+ return SafeCompare(wxConvertMB2WX(m_adr->mailbox),
wxConvertMB2WX(addrCC.m_adr->mailbox)) &&
+ SafeCompare(wxConvertMB2WX(m_adr->host),
wxConvertMB2WX(addrCC.m_adr->host));
}
@@ -250,5 +250,5 @@
// set personal name
ADDRESS *adr = mail_newaddr();
- adr->personal = cpystr(READ_CONFIG_TEXT(profile, MP_PERSONALNAME));
+ adr->personal = cpystr(wxConvertWX2MB(READ_CONFIG_TEXT(profile, MP_PERSONALNAME)));
// set mailbox/host
@@ -257,10 +257,10 @@
if ( pos != String::npos )
{
- adr->mailbox = cpystr(email.substr(0, pos).c_str());
- adr->host = cpystr(email.c_str() + pos + 1);
+ adr->mailbox = cpystr(wxConvertWX2MB(email.substr(0, pos).c_str()));
+ adr->host = cpystr(wxConvertWX2MB(email.c_str()) + pos + 1);
}
else // no '@'?
{
- adr->mailbox = cpystr(email);
+ adr->mailbox = cpystr(wxConvertWX2MB(email));
String host;
@@ -275,8 +275,8 @@
// instead of using a stupid MISSING.WHATEVER instead of the host
// part
- host = '@';
+ host = _T('@');
}
- adr->host = cpystr(host);
+ adr->host = cpystr(wxConvertWX2MB(host));
}
@@ -295,5 +295,5 @@
if ( !adr || adr->error )
{
- DBGMESSAGE(("Invalid RFC822 address '%s'.", address.c_str()));
+ DBGMESSAGE((_T("Invalid RFC822 address '%s'."), address.c_str()));
return NULL;
@@ -374,8 +374,8 @@
{
String str = MObjectRC::DebugDump();
- str << "address list";
+ str << _T("address list");
if ( m_addrCC )
{
- str << " (" << Adr2String(m_addrCC->m_adr) << ')';
+ str << _T(" (") << Adr2String(m_addrCC->m_adr) << _T(')');
}
@@ -394,17 +394,17 @@
// wspecials and rspecials string from c-client
-static const char *WORD_SPECIALS = " ()<>@,;:\\\"[]";
-const char *ALL_SPECIALS = "()<>@,;:\\\"[].";
+static const wxChar *WORD_SPECIALS = _T(" ()<>@,;:\\\"[]");
+const wxChar *ALL_SPECIALS = _T("()<>@,;:\\\"[].");
// this one is the replacement for rfc822_cat()
-static String Rfc822Quote(const char *src, const char *specials)
+static String Rfc822Quote(const wxChar *src, const wxChar *specials)
{
String dest;
// do we have any specials at all?
- if ( strpbrk(src, specials) )
+ if ( wxStrpbrk(src, specials) )
{
// need to quote
- dest = '"';
+ dest = _T('"');
while ( *src )
@@ -446,14 +446,14 @@
if ( adr->adl )
{
- email << adr->adl << ':';
+ email << wxConvertMB2WX(adr->adl) << ':';
}
// and now the mailbox name: we quote all characters forbidden in a word
- email << Rfc822Quote(adr->mailbox, WORD_SPECIALS);
+ email << Rfc822Quote(wxConvertMB2WX(adr->mailbox), WORD_SPECIALS);
// passing the NULL host suppresses printing the full address
if ( *adr->host != '@' )
{
- email << '@' << adr->host;
+ email << '@' << wxConvertMB2WX(adr->host);
}
}
@@ -506,5 +506,5 @@
{
// separate from the previous one
- address << ", ";
+ address << _T(", ");
}
}
@@ -521,7 +521,7 @@
{
if ( adr->personal )
- address << Rfc822Quote(adr->personal, ALL_SPECIALS);
+ address << Rfc822Quote(wxConvertMB2WX(adr->personal), ALL_SPECIALS);
- address << " <" << Adr2Email(adr) << '>';
+ address << _T(" <") << Adr2Email(adr) << _T('>');
}
}
@@ -529,5 +529,5 @@
{
// yes, write group name
- address << Rfc822Quote(adr->mailbox, ALL_SPECIALS) << ": ";
+ address << Rfc822Quote(wxConvertMB2WX(adr->mailbox), ALL_SPECIALS) << _T(":
");
// in a group
@@ -549,8 +549,8 @@
// NB: rfc822_parse_adrlist() modifies the string passed in, copy them!
- char *addressCopy = strdup(address);
+ char *addressCopy = strdup(wxConvertWX2MB(address));
// use '@' to trick c-client into accepting addresses without host names
- char *defhostCopy = strdup(defhost.empty() ? "@" : defhost.c_str());
+ char *defhostCopy = strdup(defhost.empty() ? "@" :
wxConvertWX2MB(defhost.c_str()));
ADDRESS *adr = NULL;
Index: HeaderInfoImpl.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/HeaderInfoImpl.cpp,v
retrieving revision 1.93
retrieving revision 1.94
diff -b -u -2 -r1.93 -r1.94
--- HeaderInfoImpl.cpp 19 Sep 2003 13:31:22 -0000 1.93
+++ HeaderInfoImpl.cpp 12 Oct 2003 15:14:01 -0000 1.94
@@ -130,5 +130,5 @@
// show the status message specified by the remaining arguments if frame is
// not NULL
- StatusIndicator(wxFrame *frame, const char *fmt, ...);
+ StatusIndicator(wxFrame *frame, const wxChar *fmt, ...);
// append "done" to the message given by the ctor if Fail() hadn't been
@@ -144,5 +144,5 @@
// ctor version which can be also called by derived classes
- void Init(wxFrame *frame, const char *fmt, va_list argptr);
+ void Init(wxFrame *frame, const wxChar *fmt, va_list argptr);
// our frame - may be NULL!
@@ -160,8 +160,8 @@
{
public:
- BusyIndicator(bool nonInteractive, MailFolder *mf, const char *fmt, ...);
+ BusyIndicator(bool nonInteractive, MailFolder *mf, const wxChar *fmt, ...);
~BusyIndicator();
- void SetLabel(const char *fmt, ...);
+ void SetLabel(const wxChar *fmt, ...);
private:
@@ -304,5 +304,5 @@
// ----------------------------------------------------------------------------
-StatusIndicator::StatusIndicator(wxFrame *frame, const char *fmt, ...)
+StatusIndicator::StatusIndicator(wxFrame *frame, const wxChar *fmt, ...)
{
va_list argptr;
@@ -312,5 +312,5 @@
}
-void StatusIndicator::Init(wxFrame *frame, const char *fmt, va_list argptr)
+void StatusIndicator::Init(wxFrame *frame, const wxChar *fmt, va_list argptr)
{
m_msgInitial.PrintfV(fmt, argptr);
@@ -344,5 +344,5 @@
BusyIndicator::BusyIndicator(bool nonInteractive,
MailFolder *mf,
- const char *fmt, ...)
+ const wxChar *fmt, ...)
{
va_list argptr;
@@ -365,5 +365,5 @@
}
-void BusyIndicator::SetLabel(const char *fmt, ...)
+void BusyIndicator::SetLabel(const wxChar *fmt, ...)
{
if ( m_progInfo )
@@ -2027,5 +2027,5 @@
{
String s1 = MObjectRC::DebugDump(), s2;
- s2.Printf("%u entries", (unsigned int)Count());
+ s2.Printf(_T("%u entries"), (unsigned int)Count());
return s1 + s2;
Index: HeaderIterator.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/HeaderIterator.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -b -u -2 -r1.5 -r1.6
--- HeaderIterator.cpp 18 Sep 2003 16:30:58 -0000 1.5
+++ HeaderIterator.cpp 12 Oct 2003 15:14:01 -0000 1.6
@@ -190,5 +190,5 @@
{
// append to the existing value
- (*values)[(size_t)idxName] << "\r\n" << value;
+ (*values)[(size_t)idxName] << _T("\r\n") << value;
}
}
Index: LogCircle.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/LogCircle.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -b -u -2 -r1.4 -r1.5
--- LogCircle.cpp 7 Oct 2003 12:42:00 -0000 1.4
+++ LogCircle.cpp 12 Oct 2003 15:14:01 -0000 1.5
@@ -85,22 +85,22 @@
err;
- if ( Find("No such host", &err) )
+ if ( Find(_T("No such host"), &err) )
{
guess = _("The server name could not be resolved "
"(maybe the network connection is down?)");
}
- else if ( Find("User unknown", &err) )
+ else if ( Find(_T("User unknown"), &err) )
{
guess = _("One or more email addresses were not recognised.");
}
// check for various POP3 bad login/password messages
- else if ( Find("authorization failed", &err) ||
- Find("password wrong", &err) ||
- Find("bad password", &err) ||
- Find("unknown user name", &err) ||
- Find("Bad authentication", &err) ||
- Find("Password supplied for", &err) || // ... <email addr> is incorrect
- Find("Invalid password", &err) ||
- Find("Invalid login", &err) )
+ else if ( Find(_T("authorization failed"), &err) ||
+ Find(_T("password wrong"), &err) ||
+ Find(_T("bad password"), &err) ||
+ Find(_T("unknown user name"), &err) ||
+ Find(_T("Bad authentication"), &err) ||
+ Find(_T("Password supplied for"), &err) || // ... <email addr> is
incorrect
+ Find(_T("Invalid password"), &err) ||
+ Find(_T("Invalid login"), &err) )
{
guess = _("Incorrect username or password: "
@@ -108,11 +108,11 @@
}
// SMTP 554 error
- else if ( Find("recipients failed", &err) )
+ else if ( Find(_T("recipients failed"), &err) )
{
guess = _("Mail server didn't accept one or more of the message recipients");
}
// these are generated by c-client
- else if ( Find("INVALID_ADDRESS", &err) ||
- Find(".SYNTAX-ERROR.", &err) )
+ else if ( Find(_T("INVALID_ADDRESS"), &err) ||
+ Find(_T(".SYNTAX-ERROR."), &err) )
{
guess = _("The message contained an invalid address specification.");
@@ -120,12 +120,12 @@
// check for various POP3 server messages telling us that another session
// is active
- else if ( Find("mailbox locked", &err) ||
- Find("lock busy", &err) ||
- Find("[IN-USE]", &err) )
+ else if ( Find(_T("mailbox locked"), &err) ||
+ Find(_T("lock busy"), &err) ||
+ Find(_T("[IN-USE]"), &err) )
{
guess = _("The mailbox is already opened from another session, "
"please close it first and retry.");
}
- else if ( Find("Self-signed certificate or untrusted authority", &err) )
+ else if ( Find(_T("Self-signed certificate or untrusted authority"), &err) )
{
guess = _("You chose not to trust the SSL certificate of this server.\n"
Index: MailFolderCC.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/MailFolderCC.cpp,v
retrieving revision 1.682
retrieving revision 1.683
diff -b -u -2 -r1.682 -r1.683
--- MailFolderCC.cpp 10 Oct 2003 22:34:45 -0000 1.682
+++ MailFolderCC.cpp 12 Oct 2003 15:14:01 -0000 1.683
@@ -182,8 +182,8 @@
// turn on to log [almost] all cclient callbacks
-#define TRACE_MF_CALLBACK "cccback"
+#define TRACE_MF_CALLBACK _T("cccback")
// turn on logging of MailFolderCC operations
-#define TRACE_MF_CALLS "mfcall"
+#define TRACE_MF_CALLS _T("mfcall")
// ----------------------------------------------------------------------------
@@ -241,5 +241,5 @@
/// the cclient mail folder driver name
-static const char *CCLIENT_DRIVER_NAME = "cclient";
+static const wxChar *CCLIENT_DRIVER_NAME = _T("cclient");
/// our mail folder factory object
@@ -658,5 +658,5 @@
m_msgProgress.Printf(_("Retrieving %lu message headers..."), m_nTotal);
- m_progdlg = new MProgressDialog(name, m_msgProgress + "\n\n", m_nTotal,
+ m_progdlg = new MProgressDialog(name, m_msgProgress + _T("\n\n"), m_nTotal,
NULL, false, true);
}
@@ -917,5 +917,5 @@
//
// returns false if we failed to parse the mailbox spec
- static bool CanonicalizeMailbox(const char *mailbox,
+ static bool CanonicalizeMailbox(const wxChar *mailbox,
NETMBX *mbx,
String *filename)
@@ -951,5 +951,5 @@
String filename;
NETMBX mbx;
- if ( !CanonicalizeMailbox(name, &mbx, &filename) )
+ if ( !CanonicalizeMailbox(wxConvertMB2WX(name), &mbx, &filename) )
{
FAIL_MSG( _T("c-client failed to parse its own spec?") );
@@ -1152,14 +1152,14 @@
String flags;
if(flag & MailFolder::MSG_STAT_SEEN)
- flags <<"\\SEEN ";
+ flags << _T("\\SEEN ");
// RECENT flag can't be set, it is handled entirely by server in IMAP
if(flag & MailFolder::MSG_STAT_ANSWERED)
- flags <<"\\ANSWERED ";
+ flags << _T("\\ANSWERED ");
if(flag & MailFolder::MSG_STAT_DELETED)
- flags <<"\\DELETED ";
+ flags << _T("\\DELETED ");
if(flag & MailFolder::MSG_STAT_FLAGGED)
- flags <<"\\FLAGGED ";
+ flags << _T("\\FLAGGED ");
if(flags.Length() > 0) // chop off trailing space
@@ -1256,9 +1256,9 @@
// this for NNTP however)
if ( type != MF_NNTP )
- spec << "/anonymous";
+ spec << _T("/anonymous");
}
else if ( !login.empty() )
{
- spec << "/user=" << login;
+ spec << _T("/user=") << login;
}
//else: we'll ask the user about his login later
@@ -1268,5 +1268,5 @@
{
case MF_INBOX:
- spec = "INBOX";
+ spec = _T("INBOX");
break;
@@ -1281,5 +1281,5 @@
wxString mhRoot = MailFolderCC::InitializeMH();
- const char *p;
+ const wxChar *p;
wxString nameReal;
if ( name.StartsWith(mhRoot, &nameReal) )
@@ -1297,5 +1297,5 @@
p, mhRoot.c_str());
- return "";
+ return _T("");
}
}
@@ -1308,5 +1308,5 @@
p++;
- spec << "#mh/" << p;
+ spec << _T("#mh/") << p;
}
break;
@@ -1318,21 +1318,21 @@
{
// turn authentification off forcefully
- spec << "/loser";
+ spec << _T("/loser");
}
}
- spec << "/pop3}";
+ spec << _T("/pop3}");
break;
case MF_IMAP:
- spec << '}' << name;
+ spec << _T('}') << name;
break;
case MF_NEWS:
- spec << "#news." << name;
+ spec << _T("#news.") << name;
break;
case MF_NNTP:
- spec << "/nntp}" << name;
+ spec << _T("/nntp}") << name;
break;
@@ -1362,5 +1362,5 @@
{
static const int lenPrefix = 4; // strlen("#mh/")
- if ( strncmp(specification, "#mh/", lenPrefix) != 0 )
+ if ( wxStrncmp(specification, _T("#mh/"), lenPrefix) != 0 )
{
FAIL_MSG(_T("invalid MH folder specification - no #mh/ prefix"));
@@ -1370,5 +1370,5 @@
// make sure that the folder name does not start with s;ash
- const char *start = specification.c_str() + lenPrefix;
+ const wxChar *start = specification.c_str() + lenPrefix;
while ( wxIsPathSeparator(*start) )
{
@@ -1392,5 +1392,5 @@
wxString protocol(specification.c_str() + 1, 4);
protocol.MakeLower();
- if ( protocol == "nntp" || protocol == "news" )
+ if ( protocol == _T("nntp") || protocol == _T("news") )
{
startIndex = specification.Find('}');
@@ -1402,6 +1402,6 @@
wxString lowercase = specification;
lowercase.MakeLower();
- if( lowercase.Contains("/nntp") ||
- lowercase.Contains("/news") )
+ if( lowercase.Contains(_T("/nntp")) ||
+ lowercase.Contains(_T("/news")) )
{
startIndex = specification.Find('}');
@@ -1435,7 +1435,7 @@
String GetFirstPartFromImapSpec(const String &imap)
{
- if(imap[0] != '{') return "";
+ if(imap[0] != '{') return _T("");
String first;
- const char *cptr = imap.c_str()+1;
+ const wxChar *cptr = imap.c_str()+1;
while(*cptr && *cptr != '}')
first << *cptr++;
@@ -1449,5 +1449,5 @@
if(imap[0] != '{') return imap;
- const char *cptr = imap.c_str()+1;
+ const wxChar *cptr = imap.c_str()+1;
while(*cptr && *cptr != '}')
cptr++;
@@ -1455,5 +1455,5 @@
return cptr+1;
else
- return ""; // error
+ return _T(""); // error
}
@@ -1510,5 +1510,5 @@
String out;
out.reserve(in.length());
- for ( const char *p = in.c_str(); *p; p++ )
+ for ( const wxChar *p = in.c_str(); *p; p++ )
{
if ( *p == '=' && *(p + 1) == '?' )
@@ -1517,5 +1517,5 @@
// save the start of it
- const char *pEncWordStart = p++;
+ const wxChar *pEncWordStart = p++;
// get the charset
@@ -1574,5 +1574,5 @@
// scan until the end of the encoded word
- const char *pEncWordEnd = strstr(p, "?=");
+ const wxChar *pEncWordEnd = wxStrstr(p, _T("?="));
if ( !pEncWordEnd )
{
@@ -1597,5 +1597,5 @@
// get the encoded text
bool hasUnderscore = false;
- const char *pEncTextStart = p;
+ const wxChar *pEncTextStart = p;
while ( *p && (p[0] != '?' || p[1] != '=') )
{
@@ -1639,5 +1639,5 @@
{
strWithoutUnderscores = String(pEncTextStart, lenEncWord);
- strWithoutUnderscores.Replace("_", " ");
+ strWithoutUnderscores.Replace(_T("_"), _T(" "));
start = (unsigned char *)strWithoutUnderscores.c_str();
}
@@ -1646,5 +1646,5 @@
}
- String word(text, (size_t)len);
+ String word(wxConvertMB2WX(text), (size_t)len);
fs_give((void **)&text);
@@ -1654,4 +1654,5 @@
// here as we don't have any UTF-7/8 fonts, so we should display a
// different string
+#if !wxUSE_UNICODE
if ( encoding == wxFONTENCODING_UTF7 ||
encoding == wxFONTENCODING_UTF8 )
@@ -1659,5 +1660,5 @@
encoding = ConvertUnicodeToSystem(&word, encoding);
}
-
+#endif
out += word;
}
@@ -1845,5 +1846,5 @@
CCErrorDisabler noErrs;
- stream = MailOpen(imapspec);
+ stream = MailOpen(wxConvertWX2MB(imapspec));
}
@@ -1877,5 +1878,5 @@
imapspec.c_str());
- stream = MailOpen(stream, imapspec);
+ stream = MailOpen(stream, wxConvertWX2MB(imapspec));
}
@@ -2012,5 +2013,5 @@
tmp += m_ImapSpec;
- mail_create(NIL, (char *)tmp.mb_str()); // const_cast for c-client
+ mail_create(NIL, strutil_strdup(wxConvertWX2MB(tmp))); // const_cast for
c-client
}
@@ -2039,5 +2040,5 @@
default:
FAIL_MSG( _T("unknown open mode") );
- name = "???";
+ name = _T("???");
}
@@ -2061,7 +2062,7 @@
// get INBOX path name
MCclientLocker lock;
- file = (char *) mail_parameters (NIL,GET_SYSINBOX,NULL);
+ file = (wxChar *) mail_parameters (NIL,GET_SYSINBOX,NULL);
if(file.empty()) // another c-client stupidity
- file = (char *) sysinbox();
+ file = (wxChar *) sysinbox();
}
#endif // OS_UNIX
@@ -2077,5 +2078,5 @@
{
// TODO: we should be using c-client's lockname() here
- String lockfile = wxFindFirstFile(file + ".lock*", wxFILE);
+ String lockfile = wxFindFirstFile(file + _T(".lock*"), wxFILE);
while ( !lockfile.empty() )
{
@@ -2121,5 +2122,5 @@
// remove the file but be prepared to the fact that it could have
// already disappeared by itself
- if ( remove(lockfile) != 0 && wxFile::Exists(lockfile) )
+ if ( wxRemove(lockfile) != 0 && wxFile::Exists(lockfile) )
{
wxLogSysError(_("Failed to remove the lock file"));
@@ -2266,5 +2267,5 @@
m_ImapSpec.c_str());
- m_MailStream = MailOpen(stream, m_ImapSpec, ccOptions);
+ m_MailStream = MailOpen(stream, wxConvertWX2MB(m_ImapSpec), ccOptions);
}
} // end of cclient lock block
@@ -2295,5 +2296,5 @@
CCDefaultFolder def(this);
MAILSTREAM *
- msHalfOpened = MailOpen(m_MailStream, m_ImapSpec, OP_HALFOPEN);
+ msHalfOpened = MailOpen(m_MailStream, wxConvertWX2MB(m_ImapSpec),
OP_HALFOPEN);
if ( msHalfOpened )
{
@@ -2646,7 +2647,7 @@
if ( GetType() == MF_FILE )
{
- if ( !wxFile::Exists(m_MailStream->mailbox) )
+ if ( !wxFile::Exists(wxConvertMB2WX(m_MailStream->mailbox)) )
{
- DBGMESSAGE(("MBOX folder '%s' already deleted.", m_MailStream->mailbox));
+ DBGMESSAGE((_T("MBOX folder '%s' already deleted."), m_MailStream->mailbox));
return;
}
@@ -2819,5 +2820,5 @@
CCCallbackDisabler noCallbacks;
- stream = MailOpen(spec, OP_HALFOPEN | OP_READONLY);
+ stream = MailOpen(wxConvertWX2MB(spec), OP_HALFOPEN | OP_READONLY);
if ( !stream )
{
@@ -2971,5 +2972,5 @@
GetName().c_str());
- CHECK_DEAD_RC(_T("Appending to closed folder '%s' failed."), false);
+ CHECK_DEAD_RC("Appending to closed folder '%s' failed.", false);
STRING str;
@@ -2996,5 +2997,5 @@
String date;
- msg.GetHeaderLine("Date", date);
+ msg.GetHeaderLine(_T("Date"), date);
char *dateptr = NULL;
@@ -3021,5 +3022,5 @@
INIT(&str, mail_string, (void *) tmp.c_str(), tmp.Length());
- CHECK_DEAD_RC(_T("Appending to closed folder '%s' failed."), false);
+ CHECK_DEAD_RC("Appending to closed folder '%s' failed.", false);
if ( !mail_append_full(m_MailStream,
@@ -3048,5 +3049,5 @@
{
CHECK( folder, false, _T("SaveMessages() needs a valid folder pointer") );
- CHECK_DEAD_RC( _T("SaveMessages(): folder is closed"), false );
+ CHECK_DEAD_RC( "SaveMessages(): folder is closed", false );
size_t count = selections->Count();
@@ -3219,5 +3220,5 @@
MailFolderCC::ExpungeMessages(void)
{
- CHECK_DEAD(_T("Cannot expunge messages from closed folder '%s'."));
+ CHECK_DEAD("Cannot expunge messages from closed folder '%s'.");
if ( PY_CALLBACK(MCB_FOLDEREXPUNGE,1,GetProfile()) )
@@ -3226,5 +3227,5 @@
GetName().c_str());
- CHECK_DEAD(_T("ExpungeMessages(): folder closed"));
+ CHECK_DEAD("ExpungeMessages(): folder closed");
mail_expunge(m_MailStream);
@@ -3350,5 +3351,5 @@
MailFolderCC::GetMessage(unsigned long uid) const
{
- CHECK_DEAD_RC(_T("Cannot access closed folder '%s'."), NULL);
+ CHECK_DEAD_RC("Cannot access closed folder '%s'.", NULL);
HeaderInfoList_obj headers(GetHeaders());
@@ -3577,5 +3578,5 @@
*slistMatch = mail_newstringlist();
- (*slistMatch)->text.data = (unsigned char *)strdup(crit->m_Key);
+ (*slistMatch)->text.data = (unsigned char *)strdup(wxConvertWX2MB(crit->m_Key));
(*slistMatch)->text.size = crit->m_Key.length();
@@ -3632,5 +3633,5 @@
bool set)
{
- CHECK_DEAD_RC(_T("Cannot access closed folder '%s'."), false);
+ CHECK_DEAD_RC("Cannot access closed folder '%s'.", false);
if ( !CanSetFlag(flag) )
@@ -3675,5 +3676,5 @@
void MailFolderCC::OnMsgStatusChanged()
{
- CHECK_RET( m_statusChangeData, "OnMsgStatusChanged() shouldn't be called!" );
+ CHECK_RET( m_statusChangeData, _T("OnMsgStatusChanged() shouldn't be called!") );
HeaderInfoList_obj headers(GetHeaders());
@@ -3699,5 +3700,5 @@
else
{
- FAIL_MSG( "connection broken?" );
+ FAIL_MSG( _T("connection broken?") );
status = 0;
@@ -3851,5 +3852,5 @@
{
String str = MObjectRC::DebugDump();
- str << "mailbox '" << m_ImapSpec << "' of type " << (int) GetType();
+ str << _T("mailbox '") << m_ImapSpec << _T("' of type ") << (int) GetType();
return str;
@@ -4328,5 +4329,5 @@
if ( folderType == MF_NNTP || folderType == MF_NEWS )
{
- entry.m_NewsGroups = env->newsgroups;
+ entry.m_NewsGroups = wxConvertMB2WX(env->newsgroups);
}
else
@@ -4367,5 +4368,5 @@
// subject
- entry.m_Subject = DecodeHeader(env->subject, &encoding);
+ entry.m_Subject = DecodeHeader(wxConvertMB2WX(env->subject), &encoding);
if ( (encoding != wxFONTENCODING_SYSTEM) &&
(encoding != encodingMsg) )
@@ -4384,7 +4385,7 @@
entry.m_Size = elt->rfc822_size;
entry.m_Lines = 0; // TODO: calculate them?
- entry.m_Id = env->message_id;
- entry.m_References = env->references;
- entry.m_InReplyTo = env->in_reply_to;
+ entry.m_Id = wxConvertMB2WX(env->message_id);
+ entry.m_References = wxConvertMB2WX(env->references);
+ entry.m_InReplyTo = wxConvertMB2WX(env->in_reply_to);
entry.m_UId = mail_uid(m_MailStream, elt->msgno);
@@ -4791,5 +4792,5 @@
{
// we are online, so we can close it properly:
- DBGMESSAGE(("CCStreamCleaner: closing stream"));
+ DBGMESSAGE((_T("CCStreamCleaner: closing stream")));
mail_close(stream);
@@ -4798,5 +4799,5 @@
{
// brutally free all memory without closing stream:
- DBGMESSAGE(("CCStreamCleaner: freeing stream offline"));
+ DBGMESSAGE((_T("CCStreamCleaner: freeing stream offline")));
// copied from c-client mail.c:
@@ -4859,5 +4860,5 @@
{
CClientInit();
- return (const char *)mail_parameters (NIL,GET_NEWSSPOOL,NULL);
+ return (const wxChar *)mail_parameters (NIL,GET_NEWSSPOOL,NULL);
}
@@ -4869,5 +4870,5 @@
MailFolderCCInit();
- gs_NewsSpoolDir = (char *)mail_parameters(NULL, GET_NEWSSPOOL, NULL);
+ gs_NewsSpoolDir = (wxChar *)mail_parameters(NULL, GET_NEWSSPOOL, NULL);
if ( !gs_NewsSpoolDir )
{
@@ -5044,5 +5045,5 @@
GetLogCircle().Add(str);
- if ( str.StartsWith("SELECT failed") )
+ if ( str.StartsWith(_T("SELECT failed")) )
{
// send this to the debug window anyhow, but don't show it to the user
@@ -5063,6 +5064,6 @@
String msg = _("Mail log");
if( mf )
- msg << " (" << mf->GetName() << ')';
- msg << ": " << str
+ msg << _T(" (") << mf->GetName() << _T(')');
+ msg << _T(": ") << str
#ifdef DEBUG
<< _(", error level: ") << strutil_ultoa(errflg)
@@ -5133,6 +5134,6 @@
ASSERT_MSG( !MF_user.empty(), _T("no username in mm_login()?") );
- strcpy(user, MF_user.c_str());
- strcpy(pwd, MF_pwd.c_str());
+ strcpy(user, wxConvertWX2MB(MF_user.c_str()));
+ strcpy(pwd, wxConvertWX2MB(MF_pwd.c_str()));
// they are used once only, don't keep them or they could be reused for
@@ -5161,5 +5162,5 @@
if ( stream )
{
- ms_LastCriticalFolder = stream->mailbox;
+ ms_LastCriticalFolder = wxConvertMB2WX(stream->mailbox);
MailFolderCC *mf = LookupObject(stream);
if(mf)
@@ -5170,5 +5171,5 @@
else
{
- ms_LastCriticalFolder = "";
+ ms_LastCriticalFolder = _T("");
}
}
@@ -5180,5 +5181,5 @@
MailFolderCC::mm_nocritical(MAILSTREAM *stream)
{
- ms_LastCriticalFolder = "";
+ ms_LastCriticalFolder = _T("");
if ( stream )
{
@@ -5209,5 +5210,5 @@
*/
void
-MailFolderCC::mm_fatal(char *str)
+MailFolderCC::mm_fatal(wxChar *str)
{
GetLogCircle().Add(str);
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates