Update of /cvsroot/mahogany/M/src/classes
In directory usw-pr-cvs1:/tmp/cvs-serv7348/src/classes

Modified Files:
        CacheFile.cpp ComposeTemplate.cpp FolderMonitor.cpp 
        MApplication.cpp MessageTemplate.cpp MessageView.cpp 
Log Message:
Unicode fixes

Index: CacheFile.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/CacheFile.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -u -2 -r1.2 -r1.3
--- CacheFile.cpp       1 Dec 2001 03:29:20 -0000       1.2
+++ CacheFile.cpp       13 Sep 2002 01:27:47 -0000      1.3
@@ -75,5 +75,5 @@
 {
    int verMaj, verMin;
-   if ( sscanf(header, GetFileHeader(), &verMaj, &verMin) == 2 )
+   if ( wxSscanf(header, GetFileHeader(), &verMaj, &verMin) == 2 )
    {
       int verMajCurrent, verMinCurrent;

Index: ComposeTemplate.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/ComposeTemplate.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -b -u -2 -r1.37 -r1.38
--- ComposeTemplate.cpp 8 Sep 2002 19:23:09 -0000       1.37
+++ ComposeTemplate.cpp 13 Sep 2002 01:27:47 -0000      1.38
@@ -488,5 +488,5 @@
       //       it appears
       int deltaX = 0, deltaY = 0;
-      for ( const char *pc = text.c_str(); *pc; pc++ )
+      for ( const wxChar *pc = text.c_str(); *pc; pc++ )
       {
          if ( *pc == '\n' )
@@ -641,5 +641,5 @@
    // it's empty when Expand() returns the template parser will log a
    // misleading error message about "unknown variable"
-   *value = '?';
+   *value = _T('?');
 
    wxFFile file(filename);
@@ -788,5 +788,5 @@
    // first check if we don't want to ask user
    String filename = GetAbsFilename(name);
-   if ( arguments.Index("ask", FALSE /* no case */) != wxNOT_FOUND )
+   if ( arguments.Index(_T("ask"), FALSE /* no case */) != wxNOT_FOUND )
    {
       filename = MDialog_FileRequester(_("Select the file to insert"),
@@ -807,5 +807,5 @@
 
       // do we want to quote the files contents before inserting?
-      if ( arguments.Index("quote", FALSE /* no case */) != wxNOT_FOUND )
+      if ( arguments.Index(_T("quote"), FALSE /* no case */) != wxNOT_FOUND )
       {
          String prefix = READ_CONFIG(m_profile, MP_REPLY_MSGPREFIX);
@@ -813,5 +813,5 @@
          quotedValue.Alloc(value->length());
 
-         const char *cptr = value->c_str();
+         const wxChar *cptr = value->c_str();
          quotedValue = prefix;
          while ( *cptr )
@@ -844,5 +844,5 @@
 {
    String filename = GetAbsFilename(name);
-   if ( arguments.Index("ask", FALSE /* no case */) != wxNOT_FOUND )
+   if ( arguments.Index(_T("ask"), FALSE /* no case */) != wxNOT_FOUND )
    {
       filename = MDialog_FileRequester(_("Select the file to attach"),
@@ -862,5 +862,5 @@
 
       // guess MIME type from extension
-      m_sink.InsertAttachment(strdup(value->c_str()),
+      m_sink.InsertAttachment(wxStrdup(value->c_str()),
                               value->length(),
                               "", // will be determined from filename laer
@@ -899,5 +899,5 @@
          // forbid further expansion in the arguments by quoting them
          wxString arg = arguments[n];
-         arg.Replace("'", "\\'");
+         arg.Replace(_T("'"), _T("\\'"));
 
          command << " '" << arg << '\'';
@@ -906,5 +906,5 @@
       command << " > " << filename;
 
-      ok = system(command) == 0;
+      ok = wxSystem(command) == 0;
    }
 
@@ -918,5 +918,5 @@
       // make sure the value isn't empty to avoid message about unknown
       // variable from the parser
-      *value = '?';
+      *value = _T('?');
 
       return FALSE;
@@ -936,5 +936,5 @@
                  name.c_str());
 
-      *value = '?';
+      *value = _T('?');
 
       return FALSE;
@@ -1180,5 +1180,5 @@
                String str;
                m_msg->WriteToString(str);
-               m_sink.InsertAttachment(strdup(str), str.Length(),
+               m_sink.InsertAttachment(wxStrdup(str), str.Length(),
                                        "message/rfc822", "");
             }
@@ -1256,6 +1256,6 @@
                strSignFile = wxPFileSelector("sig",
                                              _("Choose signature file"),
-                                             NULL, ".signature", NULL,
-                                             _(wxALL_FILES),
+                                             NULL, _T(".signature"), NULL,
+                                             wxALL_FILES,
                                              0, m_cv.GetFrame());
             }
@@ -1301,5 +1301,5 @@
             msg.Printf(_("Your signature is %stoo long: it should "
                          "not be more than %d lines."),
-                       nLineCount > 10 ? _("way ") : "", nMaxSigLines);
+                       nLineCount > 10 ? _("way ") : _T(""), nMaxSigLines);
             MDialog_Message(msg, m_cv.GetFrame(),
                             _("Signature is too long"),
@@ -1385,5 +1385,5 @@
 // return the length of the line terminator if we're at the end of line or 0
 // otherwise
-static inline size_t IsEndOfLine(const char *p)
+static inline size_t IsEndOfLine(const wxChar *p)
 {
    // although the text of the mail message itself has "\r\n" at the end of
@@ -1482,5 +1482,5 @@
    int posSig = -1;
 
-   for ( const char *cptr = text.c_str(); ; cptr++ )
+   for ( const wxChar *cptr = text.c_str(); ; cptr++ )
    {
       // start of [real] new line?
@@ -1505,5 +1505,5 @@
                   // there may be an optional space after "--" (in fact the
                   // space should be there but some people don't put it)
-                  const char *p = cptr + 2;
+                  const wxChar *p = cptr + 2;
                   if ( IsEndOfLine(p) || (*p == ' ' && IsEndOfLine(p + 1)) )
                   {
@@ -1514,5 +1514,5 @@
                else if ( cptr[0] == '_' )
                {
-                  const char *p = cptr + 1;
+                  const wxChar *p = cptr + 1;
                   while ( *p == '_' )
                      p++;
@@ -1631,5 +1631,5 @@
    // TODO: really parse it using a specialized expanded and without any
    //       sink, just checking if message category appears in it
-   return templateValue.Lower().Find("message:") != wxNOT_FOUND;
+   return templateValue.Lower().Find(_T("message:")) != wxNOT_FOUND;
 }
 

Index: FolderMonitor.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/FolderMonitor.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -b -u -2 -r1.19 -r1.20
--- FolderMonitor.cpp   12 Sep 2002 02:36:49 -0000      1.19
+++ FolderMonitor.cpp   13 Sep 2002 01:27:47 -0000      1.20
@@ -66,5 +66,5 @@
 
 // trace mask
-#define TRACE_MONITOR "monitor"
+#define TRACE_MONITOR _T("monitor")
 
 // folder state

Index: MApplication.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/MApplication.cpp,v
retrieving revision 1.261
retrieving revision 1.262
diff -b -u -2 -r1.261 -r1.262
--- MApplication.cpp    8 Sep 2002 19:23:09 -0000       1.261
+++ MApplication.cpp    13 Sep 2002 01:27:47 -0000      1.262
@@ -1248,5 +1248,5 @@
 extern "C"
 {
-   void FatalError(const char *message)
+   void FatalError(const wxChar *message)
    {
       if(FatalErrorSemaphore)

Index: MessageTemplate.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/MessageTemplate.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -b -u -2 -r1.29 -r1.30
--- MessageTemplate.cpp 8 Sep 2002 19:23:09 -0000       1.29
+++ MessageTemplate.cpp 13 Sep 2002 01:27:47 -0000      1.30
@@ -55,6 +55,6 @@
 // if quoted is true, we behave as if there were double quotes surrounding the
 // word
-static String ExtractWord(const char **ppc,
-                          char endOfWordMarker,
+static String ExtractWord(const wxChar **ppc,
+                          wxChar endOfWordMarker,
                           bool quoted = false);
 
@@ -86,7 +86,7 @@
 // an error was encountered while processing it
 bool
-MessageTemplateParser::ExpandTemplate(const char **ppc, String *value) const
+MessageTemplateParser::ExpandTemplate(const wxChar **ppc, String *value) const
 {
-   const char *pc = *ppc;
+   const wxChar *pc = *ppc;
 
    ASSERT_MSG( *pc == '$', _T("we should be called for $expression only") );
@@ -101,5 +101,5 @@
    bool quoted = false;
 
-   char bracketClose,
+   wxChar bracketClose,
         bracketOpen = *++pc;
    switch ( bracketOpen )
@@ -129,5 +129,5 @@
          // it's just escaped '$' and not start of the expansion at all
          if ( m_expander )
-            *value = '$';
+            *value = _T('$');
          *ppc = ++pc;
          return TRUE;
@@ -288,5 +288,5 @@
 
                // extract the number (should be non zero)
-               if ( (sscanf(pc, "%u", &alignWidth) != 1) || !alignWidth )
+               if ( (wxSscanf(pc, _T("%u"), &alignWidth) != 1) || !alignWidth )
                {
                   wxLogWarning(_("Incorrect alignment width value at line "
@@ -441,5 +441,5 @@
    wxString templateText = wxTextFile::Translate(m_templateText,
                                                  wxTextFileType_Unix);
-   const char *pc = templateText.c_str();
+   const wxChar *pc = templateText.c_str();
    self->m_pStartOfLine = pc;
    while ( *pc )
@@ -483,7 +483,7 @@
 // ----------------------------------------------------------------------------
 
-String ExtractWord(const char **ppc, char endOfWordMarker, bool forceQuotes)
+String ExtractWord(const wxChar **ppc, wxChar endOfWordMarker, bool forceQuotes)
 {
-   const char *pc = *ppc;
+   const wxChar *pc = *ppc;
 
    bool quoted = *pc == '"';

Index: MessageView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/MessageView.cpp,v
retrieving revision 1.97
retrieving revision 1.98
diff -b -u -2 -r1.97 -r1.98
--- MessageView.cpp     12 Sep 2002 02:36:49 -0000      1.97
+++ MessageView.cpp     13 Sep 2002 01:27:47 -0000      1.98
@@ -926,16 +926,16 @@
    {
       // init it on first use
-      static const char *envelopHeadersNames[] =
+      static const wxChar *envelopHeadersNames[] =
       {
-         "From",
-         "To",
-         "Cc",
-         "Bcc",
-         "Subject",
-         "Date",
-         "Newsgroups",
-         "Message-Id",
-         "In-Reply-To",
-         "References",
+         _T("From"),
+         _T("To"),
+         _T("Cc"),
+         _T("Bcc"),
+         _T("Subject"),
+         _T("Date"),
+         _T("Newsgroups"),
+         _T("Message-Id"),
+         _T("In-Reply-To"),
+         _T("References"),
       };
 
@@ -984,5 +984,5 @@
    if ( countNonEnvHeaders )
    {
-      const char **headerPtrs = new const char *[countNonEnvHeaders + 1];
+      const wxChar **headerPtrs = new const wxChar *[countNonEnvHeaders + 1];
 
       // have to copy the headers into a temp buffer unfortunately
@@ -1180,5 +1180,5 @@
       // headers)
       bool highlightURLs = m_ProfileValues.highlightURLs &&
-                              !name.MakeUpper().Matches("*-ID");
+                              !name.MakeUpper().Matches(_T("*-ID"));
       do
       {
@@ -1262,5 +1262,5 @@
 
 size_t
-MessageView::GetQuotedLevel(const char *text) const
+MessageView::GetQuotedLevel(const wxChar *text) const
 {
    size_t qlevel = strutil_countquotinglevels
@@ -1417,6 +1417,6 @@
 
          // lineCur is the start of the current line, lineNext of the next one
-         char *lineCur = (char *)before.c_str();
-         char *lineNext = strchr(lineCur, '\n');
+         wxChar *lineCur = (wxChar *)before.c_str();
+         wxChar *lineNext = wxStrchr(lineCur, '\n');
          while ( lineNext )
          {
@@ -1439,5 +1439,5 @@
                   // although normally signature delimiter is just "--", allow for
                   // more dashes as people often put 4 or even 75 of them
-                  const char *p = lineNext + 2;
+                  const wxChar *p = lineNext + 2;
                   if ( *p == ' ' )
                   {
@@ -1467,12 +1467,12 @@
                            textPart.length() < 0x200 )
                      {
-                        static const char *SIG_END_MARKER = "--\r\n";
-                        if ( !strstr(p + 1, SIG_END_MARKER) &&
-                              !strstr(textPart, SIG_END_MARKER) )
+                        static const wxChar *SIG_END_MARKER = _T("--\r\n");
+                        if ( !wxStrstr(p + 1, SIG_END_MARKER) &&
+                              !wxStrstr(textPart, SIG_END_MARKER) )
                         {
                            // Check that there is not another sig marker below
-                           static const char *OTHER_SIG_END_MARKER = "-- \r\n";
-                           if ( !strstr(p + 1, OTHER_SIG_END_MARKER) &&
-                                 !strstr(textPart, OTHER_SIG_END_MARKER) )
+                           static const wxChar *OTHER_SIG_END_MARKER = _T("-- \r\n");
+                           if ( !wxStrstr(p + 1, OTHER_SIG_END_MARKER) &&
+                                 !wxStrstr(textPart, OTHER_SIG_END_MARKER) )
                            {
                               // ok, it passed all our empirical tests
@@ -1515,5 +1515,5 @@
 
             // FIXME: why +1 (bug?)?
-            lineNext = strchr(lineNext + 1, '\n');
+            lineNext = wxStrchr(lineNext + 1, '\n');
          }
 
@@ -1775,5 +1775,5 @@
    // if the disposition is set to attachment we force the part to be shown
    // as an attachment
-   bool isAttachment = mimepart->GetDisposition().IsSameAs("attachment", false);
+   bool isAttachment = mimepart->GetDisposition().IsSameAs(_T("attachment"), false);
 
    // first check for viewer specific formats, next for text, then for
@@ -1795,5 +1795,5 @@
          else
          {
-            String s((const char *)data, len);
+            String s((const wxChar *)data, len);
 
             m_viewer->InsertRawContents(s);
@@ -2010,5 +2010,5 @@
          // filenames are case-sensitive, don't modify them
          value = plist_it->value;
-         if ( name.CmpNoCase("name") != 0 )
+         if ( name.CmpNoCase(_T("name")) != 0 )
          {
             value.MakeLower();
@@ -2035,5 +2035,5 @@
 
          value = plist_it->value;
-         if ( name.CmpNoCase("filename") != 0 )
+         if ( name.CmpNoCase(_T("filename")) != 0 )
          {
             value.MakeLower();
@@ -2280,5 +2280,5 @@
                     mimetype.c_str());
       if ( !MInputBox(&command, _("Unknown MIME type"), prompt,
-                      GetParentFrame(), "MimeHandler") )
+                      GetParentFrame(), _T("MimeHandler")) )
       {
          // cancelled by user
@@ -2374,5 +2374,5 @@
                  mimetype.c_str());
    if ( !MInputBox(&command, _("Open with"), prompt,
-                   GetParentFrame(), "MimeHandler") )
+                   GetParentFrame(), _T("MimeHandler")) )
    {
       // cancelled by user
@@ -2413,5 +2413,5 @@
 
 bool
-MessageView::MimeSave(const MimePart *mimepart,const char *ifilename)
+MessageView::MimeSave(const MimePart *mimepart,const wxChar *ifilename)
 {
    String filename;
@@ -2455,5 +2455,5 @@
          // saving the messages is special, we have a separate function for
          // this as it's also done from elsewhere
-         ok = MailFolder::SaveMessageAsMBOX(filename, (const char *)content);
+         ok = MailFolder::SaveMessageAsMBOX(filename, (const wxChar *)content);
       }
       else // not a message
@@ -2504,5 +2504,5 @@
 
       MDialog_ShowText(GetParentFrame(), title,
-                       (const char *)content, "MimeView");
+                       (const wxChar *)content, _T("MimeView"));
    }
    else
@@ -2619,5 +2619,5 @@
          // cannot use wxFileExists here, because it's a link pointing to a
          // non-existing location!
-         if ( lstat(lockfile.c_str(), &statbuf) == 0 )
+         if ( lstat(lockfile.mb_str(), &statbuf) == 0 )
          {
             command << m_ProfileValues.browser << " -remote openURL(" << url;
@@ -2711,5 +2711,5 @@
                            _("   Find:"),
                            GetParentFrame(),
-                           "MsgViewFindString") )
+                           _T("MsgViewFindString")) )
             {
                if ( !m_viewer->Find(text) )
@@ -2793,5 +2793,5 @@
          wxString url;
          url.reserve(ci->GetUrl().length());
-         for ( const char *p = ci->GetUrl().c_str(); *p; p++ )
+         for ( const wxChar *p = ci->GetUrl().c_str(); *p; p++ )
          {
             if ( *p != '\r' && *p != '\n' )
@@ -2954,5 +2954,5 @@
                 "\n"
                 "Do you still want to download it?"),
-              part ? _(" part") : "", size, maxSize);
+              part ? _(" part") : _T(""), size, maxSize);
 
    return MDialog_YesNoDialog(msg, GetParentFrame());
@@ -3097,5 +3097,5 @@
 
       if ( !errormsg.empty() )
-         wxLogError("%s.", errormsg.c_str());
+         wxLogError(_T("%s."), errormsg.c_str());
 
       return false;



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to