Update of /cvsroot/mahogany/M/src/adb
In directory sc8-pr-cvs1:/tmp/cvs-serv6042/src/adb

Modified Files:
        ExportPalm.cpp ExportText.cpp ExportVCard.cpp ImportMailrc.cpp 
        ImportPine.cpp ImportText.cpp ImportVCard.cpp ImportXFMail.cpp 
Log Message:
unicode fixes

Index: ExportPalm.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/adb/ExportPalm.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -b -u -2 -r1.14 -r1.15
--- ExportPalm.cpp      19 Sep 2003 13:31:20 -0000      1.14
+++ ExportPalm.cpp      12 Oct 2003 22:03:37 -0000      1.15
@@ -134,5 +134,5 @@
                        gettext_noop("PalmOS format address book exporter"),
                        gettext_noop("PalmOS addressbook"),
-                       "Karsten Ball�der <[EMAIL PROTECTED]>");
+                       _T("Karsten Ball�der <[EMAIL PROTECTED]>"));
 
 
@@ -142,7 +142,7 @@
 
 #undef ADD
-#define ADD(n)       entry.GetField(n, &val); s << '"'<< EscapeQuotes(val) << "\","
+#define ADD(n)       entry.GetField(n, &val); s << _T('"') << EscapeQuotes(val) << 
_T("\",")
 #define ADDP(prefix,n)  entry.GetField(n, &val); \
-if(strlen(val)) s << prefix; s << '"'<< EscapeQuotes(val) << "\","
+if(wxStrlen(val)) s << prefix; s << _T('"') << EscapeQuotes(val) << _T("\",")
 
 bool AdbPalmExporter::DoExportEntry(const AdbEntry& entry,
@@ -188,18 +188,18 @@
       if(val.Length() == 0 && ! includeEmpty) // no name
          return TRUE; // ignore entry
-      s << '"' << EscapeQuotes(val) << "\",\"\",";
+      s << '"' << EscapeQuotes(val) << _T("\",\"\",");
    }
    entry.GetField(AdbField_Prefix, &val);
    entry.GetField(AdbField_Title, &tmp);
    if(tmp.Length()) val << ' ' << tmp;
-   s << '"' << EscapeQuotes(val) << "\",";
+   s << '"' << EscapeQuotes(val) << _T("\",");
    ADD(AdbField_Organization);
 
-   s << "\"\","; // unknown field after company
-   ADDP("\"E-mail\";", AdbField_EMail);
-   ADDP("\"Home\";", AdbField_H_Phone);
-   ADDP("\"Fax\";", AdbField_H_Fax);
-   ADDP("\"Work\";", AdbField_O_Phone);
-   ADDP("\"Fax\";", AdbField_O_Fax);
+   s << _T("\"\","); // unknown field after company
+   ADDP(_T("\"E-mail\";"), AdbField_EMail);
+   ADDP(_T("\"Home\";"), AdbField_H_Phone);
+   ADDP(_T("\"Fax\";"), AdbField_H_Fax);
+   ADDP(_T("\"Work\";"), AdbField_O_Phone);
+   ADDP(_T("\"Fax\";"), AdbField_O_Fax);
 
    entry.GetField(AdbField_H_City, &val);
@@ -212,5 +212,5 @@
          if(tmp) val << ' ' << tmp;
          if(! val) entry.GetField(AdbField_H_POBox, &val);
-         s << '"' << val << "\",";
+         s << '"' << val << _T("\",");
       }
       ADD(AdbField_H_City);
@@ -227,5 +227,5 @@
          if(tmp) val << ' ' << tmp;
          if(! val) entry.GetField(AdbField_O_POBox, &val);
-         s << '"' << val << "\",";
+         s << '"' << val << _T("\",");
       }
       ADD(AdbField_O_City);
@@ -245,7 +245,7 @@
    }
    else
-      s << "\"\","; // empty comment
+      s << _T("\"\","); // empty comment
 
-   s << "\"0\"";
+   s << _T("\"0\"");
    s += wxTextFile::GetEOL();
 
@@ -303,5 +303,5 @@
    if ( !filename )
    {
-      filename << group.GetDescription() << ".palm";
+      filename << group.GetDescription() << _T(".palm");
    }
 
@@ -317,5 +317,5 @@
    // create the file
    filename = dialog.GetFileName();
-   wxFFile file(filename, "w");
+   wxFFile file(filename, _T("w"));
    if ( file.IsOpened() )
    {
@@ -366,5 +366,5 @@
                                 NULL,
                                 _("Mahogany: Exporting address book"),
-                                "AdbTextExport"
+                                _T("AdbTextExport")
                                )
 {
@@ -414,14 +414,14 @@
    {
       Profile *appProfile = mApplication->GetProfile();
-      filename = appProfile->readEntry(ms_profilePathLastFile, "mahogany.txt");
+      filename = appProfile->readEntry(ms_profilePathLastFile, _T("mahogany.txt"));
    }
 
    m_textFileName->SetValue(
       mApplication->GetProfile()->readEntry(ms_profilePathLastFile,
-                                            ""));
+                                            _T("")));
 
    m_textCategoryName->SetValue(
       mApplication->GetProfile()->readEntry(ms_profilePathLastCategory,
-                                            "Unfiled"));
+                                            _T("Unfiled")));
    m_checkIncludeEmpty->SetValue(
       mApplication->GetProfile()->readEntry(ms_profileIncludeEmpty, 0) != 0);

Index: ExportText.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/adb/ExportText.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -b -u -2 -r1.11 -r1.12
--- ExportText.cpp      19 Sep 2003 13:31:20 -0000      1.11
+++ ExportText.cpp      12 Oct 2003 22:03:37 -0000      1.12
@@ -139,5 +139,5 @@
                        gettext_noop("Text format address book exporter"),
                        gettext_noop("Simple text format"),
-                       "Vadim Zeitlin <[EMAIL PROTECTED]>");
+                       _T("Vadim Zeitlin <[EMAIL PROTECTED]>"));
 
 // ----------------------------------------------------------------------------
@@ -182,5 +182,5 @@
    {
       entry.GetField(nField, &val);
-      for ( const char *pc = val.c_str(); *pc; pc++ )
+      for ( const wxChar *pc = val.c_str(); *pc; pc++ )
       {
          if ( !IsValidChar(*pc, delimiter) )
@@ -246,5 +246,5 @@
    if ( !filename )
    {
-      filename << group.GetDescription() << ".txt";
+      filename << group.GetDescription() << _T(".txt");
    }
 
@@ -260,5 +260,5 @@
    // create the file
    filename = dialog.GetFilename();
-   wxFFile file(filename, "w");
+   wxFFile file(filename, _T("w"));
    if ( file.IsOpened() )
    {
@@ -300,5 +300,5 @@
                                 NULL,
                                 _("Mahogany: Exporting address book"),
-                                "AdbTextExport"
+                                _T("AdbTextExport")
                                )
 {
@@ -328,5 +328,5 @@
    choices[Delimiter_Custom] = _("&Use custom character");
 
-   wxRadioBox *radiobox = new wxPRadioBox("AdbTextExportDelim",
+   wxRadioBox *radiobox = new wxPRadioBox(_T("AdbTextExportDelim"),
                                           parent, -1, _("&Delimiter"),
                                           wxDefaultPosition, wxDefaultSize,
@@ -343,5 +343,5 @@
    // a text with a label for entering the custom delimiter
    m_labelCustomSep = new wxStaticText(parent, -1, _("Field &separator:"));
-   m_textCustomSep = new wxPTextEntry("AdbTextExportSep", parent, -1, "");
+   m_textCustomSep = new wxPTextEntry(_T("AdbTextExportSep"), parent, -1, _T(""));
 
    c = new wxLayoutConstraints;
@@ -360,5 +360,5 @@
 
    // a hack: create an invisible static to take some place
-   wxStaticText *dummy = new wxStaticText(parent, -1, "");
+   wxStaticText *dummy = new wxStaticText(parent, -1, _T(""));
    c = new wxLayoutConstraints;
    c->top.Below(radiobox, 2*LAYOUT_Y_MARGIN);
@@ -381,5 +381,5 @@
    {
       Profile *appProfile = mApplication->GetProfile();
-      filename = appProfile->readEntry(ms_profilePathLastFile, "mahogany.csv");
+      filename = appProfile->readEntry(ms_profilePathLastFile, _T("mahogany.csv"));
    }
 
@@ -406,9 +406,9 @@
    {
       case Delimiter_Comma:
-         m_delim = ",";
+         m_delim = _T(",");
          break;
 
       case Delimiter_Tab:
-         m_delim = "\t";
+         m_delim = _T("\t");
          break;
 

Index: ExportVCard.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/adb/ExportVCard.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -u -2 -r1.2 -r1.3
--- ExportVCard.cpp     18 Sep 2003 16:30:47 -0000      1.2
+++ ExportVCard.cpp     12 Oct 2003 22:03:37 -0000      1.3
@@ -71,5 +71,5 @@
                        gettext_noop("vCard format address book exporter"),
                        gettext_noop("vCard (.vcf) file"),
-                       "Vadim Zeitlin <[EMAIL PROTECTED]>");
+                       _T("Vadim Zeitlin <[EMAIL PROTECTED]>"));
 
 // ----------------------------------------------------------------------------
@@ -100,5 +100,5 @@
       vcard.SetName(familyName,
                     firstName,
-                    "", // no middle name in the ADB
+                    _T(""), // no middle name in the ADB
                     prefix);
    }
@@ -247,5 +247,5 @@
       AdbEntryGroup *subgroup = group.GetGroup(names[nGroup]);
 
-      bool ok = DoExportGroup(*subgroup, dirname + '/' + names[nGroup]);
+      bool ok = DoExportGroup(*subgroup, dirname + DIR_SEPARATOR + names[nGroup]);
       subgroup->DecRef();
 
@@ -263,5 +263,5 @@
 
       wxString filename;
-      filename << dirname << '/' << names[nEntry] << ".vcf";
+      filename << dirname << DIR_SEPARATOR << names[nEntry] << _T(".vcf");
       bool ok = DoExportEntry(*entry, filename);
       entry->DecRef();
@@ -317,5 +317,5 @@
    {
       filename = wxFileSelector(_("Choose the name for vCard file"),
-                                NULL, NULL, ".vcf",
+                                NULL, NULL, _T(".vcf"),
                                 _("vCard files (*.vcf)|*.vcf|All files (*.*)|*.*"),
                                 wxSAVE | wxHIDE_READONLY);

Index: ImportMailrc.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/adb/ImportMailrc.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -b -u -2 -r1.9 -r1.10
--- ImportMailrc.cpp    18 Sep 2003 16:30:47 -0000      1.9
+++ ImportMailrc.cpp    12 Oct 2003 22:03:37 -0000      1.10
@@ -95,5 +95,5 @@
                        gettext_noop("Unix .mailrc file import module"),
                        gettext_noop("Unix .mailrc file"),
-                       "Vadim Zeitlin <[EMAIL PROTECTED]>");
+                       _T("Vadim Zeitlin <[EMAIL PROTECTED]>"));
 
 
@@ -106,5 +106,5 @@
                                              wxArrayString *addresses) const
 {
-   const char *pc = line.c_str() + lenAlias;
+   const wxChar *pc = line.c_str() + lenAlias;
    while ( isspace(*pc) )
       pc++;
@@ -214,5 +214,5 @@
 #ifdef OS_UNIX
    // the default location for Unix is $HOME/.mailrc
-   location = wxExpandEnvVars("$HOME/.mailrc");
+   location = wxExpandEnvVars(_T("$HOME/.mailrc"));
 
    if ( !wxFile::Exists(location) )
@@ -255,8 +255,8 @@
       line.Trim(FALSE /* from left */);
 
-      if ( line.StartsWith("alias ") ||
-           line.StartsWith("ignore ") ||
-           line.StartsWith("set ") ||
-           line.StartsWith("unset ") )
+      if ( line.StartsWith(_T("alias ")) ||
+           line.StartsWith(_T("ignore ")) ||
+           line.StartsWith(_T("set ")) ||
+           line.StartsWith(_T("unset ")) )
       {
          // good line, assume it's ok
@@ -308,5 +308,5 @@
       line.Trim(FALSE /* from left */);
 
-      if ( strncmp(line, "alias", lenAlias) != 0 )
+      if ( wxStrncmp(line, _T("alias"), lenAlias) != 0 )
       {
          // we're only interested in lines starting with "alias"

Index: ImportPine.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/adb/ImportPine.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -b -u -2 -r1.10 -r1.11
--- ImportPine.cpp      18 Sep 2003 16:30:47 -0000      1.10
+++ ImportPine.cpp      12 Oct 2003 22:03:37 -0000      1.11
@@ -102,5 +102,5 @@
    bool CheckHasNextField(size_t *index,
                           wxString *line,
-                          const char **ppc) const;
+                          const wxChar **ppc) const;
 
    // another ParsePineADBEntry helper: extracts one field which is supposed to
@@ -108,5 +108,5 @@
    wxString ExtractField(size_t *index,
                          wxString *line,
-                         const char **ppc) const;
+                         const wxChar **ppc) const;
 
    // the starting lines for the entries and groups
@@ -135,5 +135,5 @@
                        gettext_noop("PINE address book import module"),
                        gettext_noop("PINE address book"),
-                       "Vadim Zeitlin <[EMAIL PROTECTED]>");
+                       _T("Vadim Zeitlin <[EMAIL PROTECTED]>"));
 
 
@@ -144,8 +144,8 @@
 wxString AdbPineImporter::ExtractField(size_t *index,
                                        wxString *line,
-                                       const char **ppc) const
+                                       const wxChar **ppc) const
 {
    wxString field;
-   const char *pc = *ppc;
+   const wxChar *pc = *ppc;
 
    bool cont = TRUE;
@@ -187,7 +187,7 @@
 bool AdbPineImporter::CheckHasNextField(size_t *index,
                                         wxString *line,
-                                        const char **ppc) const
+                                        const wxChar **ppc) const
 {
-   const char *pc = *ppc;
+   const wxChar *pc = *ppc;
 
    if ( !*pc )
@@ -214,5 +214,5 @@
          // my PINE 4.10 inserts 3 spaces in the beginning of the continued lines
          // but I don't know whether all versions do it
-         if ( strncmp(lineNext, "   ", 3) == 0 )
+         if ( wxStrncmp(lineNext, _T("   "), 3) == 0 )
          {
             // yes, this entry is continued on the next line
@@ -273,5 +273,5 @@
    wxString line = m_textfile[*index];
 
-   const char *pc = line.c_str();
+   const wxChar *pc = line.c_str();
 
    if ( !*pc || isspace(*pc) )
@@ -386,5 +386,5 @@
       FAIL_MSG( _T("we may only have simple subgroups in PINE addressbooks") );
 
-      return "";
+      return _T("");
    }
 
@@ -394,5 +394,5 @@
       FAIL_MSG( _T("unknown group") );
 
-      return "";
+      return _T("");
    }
 
@@ -401,5 +401,5 @@
    if ( !ParsePineADBEntry(&indexLine, NULL, &addresses) )
    {
-      return "";
+      return _T("");
    }
 
@@ -426,5 +426,5 @@
 
    wxString address;
-   const char *pc = addresses.c_str() + 1;   // skip '('
+   const wxChar *pc = addresses.c_str() + 1;   // skip '('
    for ( ; ; pc++ )
    {
@@ -637,5 +637,5 @@
 #ifdef OS_UNIX
    // the default location for Unix is $HOME/.addresbook
-   location = wxExpandEnvVars("$HOME/.addresbook");
+   location = wxExpandEnvVars(_T("$HOME/.addresbook"));
 
    if ( !wxFile::Exists(location) )

Index: ImportText.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/adb/ImportText.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -b -u -2 -r1.10 -r1.11
--- ImportText.cpp      18 Sep 2003 16:30:47 -0000      1.10
+++ ImportText.cpp      12 Oct 2003 22:03:37 -0000      1.11
@@ -54,5 +54,5 @@
 
    // implement base class pure virtuals
-   virtual String GetDefaultFilename() const { return ""; }
+   virtual String GetDefaultFilename() const { return _T(""); }
    virtual bool CanImport(const String& filename);
    virtual bool StartImport(const String& filename);
@@ -68,5 +68,5 @@
    // split one field from the line, modify the pointer to point at the start
    // of the next field if !NULL
-   wxString SplitField(const char *start, const char **next = NULL) const;
+   wxString SplitField(const wxChar *start, const wxChar **next = NULL) const;
 
    // split the line of the input file into fields using our delimiter, return
@@ -77,9 +77,9 @@
    // m_textfile - if we think we found one, return TRUE and set m_chDelimiter,
    // otherwise return FALSE
-   bool TestDelimiter(char chDelimiter);
+   bool TestDelimiter(wxChar chDelimiter);
 
 private:
    // the character delimiting different fields
-   char m_chDelimiter;
+   wxChar m_chDelimiter;
 
    // the textfile containing the text of the file last used by CanImport()
@@ -104,5 +104,5 @@
                        gettext_noop("Comma/TAB separated text format address book 
import module"),
                        gettext_noop("Comma/TAB separated values"),
-                       "Vadim Zeitlin <[EMAIL PROTECTED]>");
+                       _T("Vadim Zeitlin <[EMAIL PROTECTED]>"));
 
 // ----------------------------------------------------------------------------
@@ -115,9 +115,9 @@
 }
 
-wxString AdbTextImporter::SplitField(const char *start,
-                                     const char **next) const
+wxString AdbTextImporter::SplitField(const wxChar *start,
+                                     const wxChar **next) const
 {
    wxString curField;
-   const char *pc;
+   const wxChar *pc;
    for ( pc = start; ; pc++ )
    {
@@ -165,5 +165,5 @@
    fields->Empty();
 
-   const char *pc = line.c_str();
+   const wxChar *pc = line.c_str();
    for ( ;; )
    {
@@ -179,5 +179,5 @@
 }
 
-bool AdbTextImporter::TestDelimiter(char chDelimiter)
+bool AdbTextImporter::TestDelimiter(wxChar chDelimiter)
 {
    // test first few lines
@@ -190,5 +190,5 @@
       size_t nDelimitersInLine = 0;
       wxString line = m_textfile[nLine];
-      for ( const char *pc = line.c_str(); *pc; pc++ )
+      for ( const wxChar *pc = line.c_str(); *pc; pc++ )
       {
          if ( *pc == chDelimiter )

Index: ImportVCard.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/adb/ImportVCard.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -b -u -2 -r1.8 -r1.9
--- ImportVCard.cpp     18 Sep 2003 16:30:47 -0000      1.8
+++ ImportVCard.cpp     12 Oct 2003 22:03:37 -0000      1.9
@@ -44,5 +44,5 @@
 
    // implement base class pure virtuals
-   virtual String GetDefaultFilename() const { return ""; }
+   virtual String GetDefaultFilename() const { return _T(""); }
    virtual bool CanImport(const String& filename);
    virtual bool StartImport(const String& filename);
@@ -83,5 +83,5 @@
                        gettext_noop("vCard address book import module"),
                        gettext_noop("vCard (.vcf) files"),
-                       "Vadim Zeitlin <[EMAIL PROTECTED]>");
+                       _T("Vadim Zeitlin <[EMAIL PROTECTED]>"));
 
 // ----------------------------------------------------------------------------
@@ -221,5 +221,5 @@
       // merge them together
       wxString orgfull;
-      orgfull << org << "; " << dept;
+      orgfull << org << _T("; ") << dept;
       entry->SetField(AdbField_Organization, orgfull);
    }

Index: ImportXFMail.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/adb/ImportXFMail.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -b -u -2 -r1.10 -r1.11
--- ImportXFMail.cpp    18 Sep 2003 16:30:47 -0000      1.10
+++ ImportXFMail.cpp    12 Oct 2003 22:03:37 -0000      1.11
@@ -76,5 +76,5 @@
                        gettext_noop("XFMail address book import module"),
                        gettext_noop("XFMail address book"),
-                       "Vadim Zeitlin <[EMAIL PROTECTED]>");
+                       _T("Vadim Zeitlin <[EMAIL PROTECTED]>"));
 
 // ----------------------------------------------------------------------------
@@ -88,5 +88,5 @@
 #ifdef OS_UNIX
    // the default location for Unix is $HOME/.xfmail/.xfbook
-   location = wxExpandEnvVars("$HOME/.xfmail/.xfbook");
+   location = wxExpandEnvVars(_T("$HOME/.xfmail/.xfbook"));
 
    if ( !wxFile::Exists(location) )
@@ -113,5 +113,5 @@
    wxString name = filename.AfterLast('/');
 
-   return strncmp(name, ".xfbook", 7) == 0;
+   return wxStrncmp(name, _T(".xfbook"), 7) == 0;
 }
 
@@ -173,5 +173,5 @@
          // escaped
          wxString nickname;
-         const char *pc = line;
+         const wxChar *pc = line;
 
          // skip the spaces in the start of line



-------------------------------------------------------
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

Reply via email to