[M-git] Mahogany sources repository. branch master updated. v0.67-841-g2cea6d1b
vadz via Mahogany-cvsupdates <[email protected]> Tue, 19 Sep 2023 16:14:45 +0000
| Newsgroups | gmane.mail.mahogany.cvs |
|---|---|
| Message-ID | <[email protected]> |
--===============2193924283070179240==
Content-Type: text/plain
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Mahogany sources repository.".
The branch, master has been updated
via 2cea6d1be3661a1029ace9cd27de7a47cc07e9cd (commit)
via 9cbf607726014dd3cb86fb261193b213a6adbd8c (commit)
via d65955f3db1b4f650a2aab50ba1cfa803b6bb1a6 (commit)
via b8875f4d5dd62165c0b1642452f699fb6076e7c5 (commit)
via 4b39405e268dd56dfaf0448b8316dd6cff5eea1d (commit)
via 13453cfafc9e0775d44bc0cd9f0ac1fc4ef12d94 (commit)
via 01e50709c305c21913803905347bfbd535ad6fd5 (commit)
via f7a43f1f8080357555c9f14c9bd88a44638db1bc (commit)
via d34c249f70ed5f302789b5ab40d18b2875768b8c (commit)
via 466ad2c0277a25d730c524e8554d558557f374d1 (commit)
from 403f3c88baa7e085a2b3eb311e66e2cc20d8a509 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2cea6d1be3661a1029ace9cd27de7a47cc07e9cd
Author: Vadim Zeitlin <[email protected]>
Date: Tue Sep 19 18:12:06 2023 +0200
Fix comparing "From" addresses containing commas with own ones
Using AddressList was wrong here as it's supposed to be used with the
raw header values and the value we get here is already decoded, so
parsing it using the RFC 822 rules doesn't work correctly if it contains
any commas, for example, as they are address separators when decoded,
but can be included in the encoded form.
This fixes spurious warning messages about "Must use commas to separate
addresses" and wrong comparison results for the (decoded) address of the
form "Foo, Bar <[email protected]>".
This commit is best viewed ignoring whitespace-only changes.
diff --git a/src/mail/HeaderInfoImpl.cpp b/src/mail/HeaderInfoImpl.cpp
index feccab01..f204137a 100644
--- a/src/mail/HeaderInfoImpl.cpp
+++ b/src/mail/HeaderInfoImpl.cpp
@@ -405,38 +405,30 @@ HeaderInfo::GetFromOrTo(const HeaderInfo *hi,
// the user himself
if ( replaceFromWithTo )
{
- size_t nAdrCount = ownAddresses.GetCount();
- if ( nAdrCount )
+ for ( const auto& ownAddress : ownAddresses )
{
- AddressList_obj addrList(*value);
- const Address* const addr = addrList->GetFirst();
- if ( addr )
+ // Allow the use of wildcards, e.g. to support own addresses of
+ // the form "localpart+*@domain", and match them anywhere inside the
+ // header for simplicity (otherwise we'd have to extract the email
+ // part of it for matching).
+ if ( value->Matches("*" + ownAddress + "*") )
{
- const String email = addr->GetEMail();
- for ( size_t nAdr = 0; nAdr < nAdrCount; nAdr++ )
+ // sender is the user himself, do the replacement
+ *value = hi->GetTo();
+
+ if ( value->empty() )
{
- // Allow the use of wildcards, e.g. to support own addresses of
- // the form "localpart+*@domain".
- if ( email.Matches(ownAddresses[nAdr]) )
+ // hmm, must be a newsgroup message
+ String ng = hi->GetNewsgroups();
+ if ( !ng.empty() )
{
- // sender is the user himself, do the replacement
- *value = hi->GetTo();
-
- if ( value->empty() )
- {
- // hmm, must be a newsgroup message
- String ng = hi->GetNewsgroups();
- if ( !ng.empty() )
- {
- *value = ng;
- return Newsgroup;
- }
- //else: weird, both to and newsgroup are empty??
- }
-
- return To;
+ *value = ng;
+ return Newsgroup;
}
+ //else: weird, both to and newsgroup are empty??
}
+
+ return To;
}
}
}
commit 9cbf607726014dd3cb86fb261193b213a6adbd8c
Author: Vadim Zeitlin <[email protected]>
Date: Fri Sep 15 14:26:45 2023 +0200
Use the same name and email for all Nerijus's commits
diff --git a/.mailmap b/.mailmap
new file mode 100644
index 00000000..333d359f
--- /dev/null
+++ b/.mailmap
@@ -0,0 +1,2 @@
+Nerijus Baliƫnas <[email protected]> Nerijus Baliunas <[email protected]>
+Nerijus Baliƫnas <[email protected]> Nerijus <[email protected]>
commit d65955f3db1b4f650a2aab50ba1cfa803b6bb1a6
Author: Vadim Zeitlin <[email protected]>
Date: Fri Sep 15 14:23:08 2023 +0200
Remove now unused SSL-related options
This should have been part of e4c01c74 (Always link with OpenSSL
libraries under Unix, 2023-07-31): as we never load SSL libraries during
run-time any more, we don't need the options specifying the libraries to
load neither.
diff --git a/doc/tech/config.txt b/doc/tech/config.txt
index cf7c484a..2665c6b1 100644
--- a/doc/tech/config.txt
+++ b/doc/tech/config.txt
@@ -227,8 +227,6 @@ MP_SMTPHOST_PASSWORD MailHostPw ""
MP_SMTPHOST_USE_SSL MailHostSSL 0l
MP_SPLASHDELAY SplashDelay 5
MP_SSH_PATH SshPath "ssh"
-MP_SSL_DLL_CRYPTO CryptoDll "libcrypto.dll" or "libcrypto.so.0"
-MP_SSL_DLL_SSL SSLDll "libssl.dll" or "libssl.so.0"
MP_STARTUPSCRIPT StartupScript "Minit"
MP_SYNC_DATE SyncDate 0L
MP_SYNC_FILTERS SyncFilters 0L
diff --git a/include/Moptions.h b/include/Moptions.h
index 4b4b12a6..c00ad4ce 100644
--- a/include/Moptions.h
+++ b/include/Moptions.h
@@ -383,8 +383,6 @@ extern const MOption MP_AUTOCOLLECT_ADB;
extern const MOption MP_AUTOCOLLECT_NAMED;
extern const MOption MP_AUTOCOLLECT_SENDER;
extern const MOption MP_AUTOCOLLECT_OUTGOING;
-extern const MOption MP_SSL_DLL_SSL;
-extern const MOption MP_SSL_DLL_CRYPTO;
extern const MOption MP_INCFAX_SUPPORT;
extern const MOption MP_INCFAX_DOMAINS;
extern const MOption MP_ADB_SUBSTRINGEXPANSION;
diff --git a/src/classes/Moptions.cpp b/src/classes/Moptions.cpp
index 4f9d73ed..869ba492 100644
--- a/src/classes/Moptions.cpp
+++ b/src/classes/Moptions.cpp
@@ -443,8 +443,6 @@ const MOption MP_AUTOCOLLECT_SENDER;
const MOption MP_AUTOCOLLECT_OUTGOING;
const MOption MP_AUTOCOLLECT_NAMED;
-const MOption MP_SSL_DLL_SSL;
-const MOption MP_SSL_DLL_CRYPTO;
const MOption MP_INCFAX_SUPPORT;
const MOption MP_INCFAX_DOMAINS;
const MOption MP_ADB_SUBSTRINGEXPANSION;
@@ -864,8 +862,6 @@ static const MOptionData MOptions[] =
DEFINE_OPTION(MP_AUTOCOLLECT_SENDER),
DEFINE_OPTION(MP_AUTOCOLLECT_OUTGOING),
DEFINE_OPTION(MP_AUTOCOLLECT_NAMED),
- DEFINE_OPTION(MP_SSL_DLL_SSL),
- DEFINE_OPTION(MP_SSL_DLL_CRYPTO),
DEFINE_OPTION(MP_INCFAX_SUPPORT),
DEFINE_OPTION(MP_INCFAX_DOMAINS),
DEFINE_OPTION(MP_ADB_SUBSTRINGEXPANSION),
diff --git a/src/gui/wxOptionsDlg.cpp b/src/gui/wxOptionsDlg.cpp
index 1eff6af7..ff2c8d40 100644
--- a/src/gui/wxOptionsDlg.cpp
+++ b/src/gui/wxOptionsDlg.cpp
@@ -557,13 +557,6 @@ enum ConfigFields
ConfigField_ExternalEditor,
ConfigField_AutoLaunchExtEditor,
-#ifdef USE_OPENSSL
- ConfigField_HelpersSkip4,
- ConfigField_SslHelp,
- ConfigField_SslDllName,
- ConfigField_CryptoDllName,
-#endif // USE_OPENSSL
-
ConfigField_HelpersSkip5,
ConfigField_PGPHelp,
ConfigField_PGPCommand,
@@ -1839,16 +1832,6 @@ const wxOptionsPage::FieldInfo wxOptionsPageStandard::ms_aFields[] =
{ gettext_noop("&External editor"), Field_File, -1 },
{ gettext_noop("Always &use it"), Field_Bool, ConfigField_ExternalEditor },
-#ifdef USE_OPENSSL
- { "", Field_Message, -1 },
- { gettext_noop("Mahogany can use SSL (Secure Sockets Layer) for secure, encrypted\n"
- "communications, if you have the libssl and libcrypto shared libraries\n"
- "(DLLs) on your system."),
- Field_Message, -1 },
- { gettext_noop("Location of lib&ssl"), Field_File, -1 },
- { gettext_noop("Location of libcr&ypto"), Field_File, -1 },
-#endif // USE_OPENSSL
-
{ "", Field_Message, -1 },
{ gettext_noop("GNU Privacy Guard or a compatible program may be used to verify the\n"
"cryptographic signatures of the messages you receive and decrypt them.\n"
@@ -2366,12 +2349,7 @@ const ConfigValueDefault wxOptionsPageStandard::ms_aConfigDefaults[] =
CONFIG_NONE(),
CONFIG_ENTRY(MP_EXTERNALEDITOR),
CONFIG_ENTRY(MP_ALWAYS_USE_EXTERNALEDITOR),
-#ifdef USE_OPENSSL
- CONFIG_NONE(),
- CONFIG_NONE(),
- CONFIG_ENTRY(MP_SSL_DLL_SSL),
- CONFIG_ENTRY(MP_SSL_DLL_CRYPTO),
-#endif // USE_OPENSSL
+
CONFIG_NONE(),
CONFIG_NONE(), // PGP help
CONFIG_ENTRY(MP_PGP_COMMAND),
commit b8875f4d5dd62165c0b1642452f699fb6076e7c5
Author: Vadim Zeitlin <[email protected]>
Date: Tue Aug 29 00:49:30 2023 +0200
Fold "References:" header in the sent messages properly
This should be done for all headers, but for now do it just for this one
as it's the only one which can become longer than 998 characters in
practice.
diff --git a/src/mail/SendMessageCC.cpp b/src/mail/SendMessageCC.cpp
index b7d4e217..4c4eaac2 100644
--- a/src/mail/SendMessageCC.cpp
+++ b/src/mail/SendMessageCC.cpp
@@ -2261,6 +2261,58 @@ long Rfc822OutputRedirector::FullRfc822Output(char *headers,
{
for ( size_t n = 0; ms_HeaderNames[n]; n++ )
{
+ // We should wrap all headers, but this might break something, so wrap
+ // just the one which regularly gets too long to fit the maximum
+ // message line length (998 bytes).
+ constexpr const char* REFERENCES_HEADER = "References";
+
+ if ( strcmp(ms_HeaderNames[n], REFERENCES_HEADER) == 0 )
+ {
+ // Note that we don't bother null-terminating headers while we're
+ // inside this block, we just do it once at the end. The pointer is
+ // just always positioned at the end of the string, as done here.
+ headers += strlen(headers);
+
+ auto output = [&headers](const char* s, size_t len = 0)
+ {
+ if ( !len )
+ len = strlen(s);
+ memcpy(headers, s, len);
+ headers += len;
+ };
+
+ output(REFERENCES_HEADER);
+ output(": ");
+
+ const char* value = ms_HeaderValues[n];
+ for ( ;; )
+ {
+ auto space = strchr(value, ' ');
+ if ( !space )
+ {
+ // Output the rest of the header.
+ output(value);
+ output("\r\n");
+
+ break;
+ }
+
+ // Output just the part until the next space and add a
+ // continuation line.
+ output(value, space - value);
+ output("\r\n "); // Same indent as c-client RFC822BUFFER.
+
+ value = space;
+ while ( isspace(*value) )
+ value++;
+ }
+
+ *headers = '\0';
+
+ // Skip generic case below.
+ continue;
+ }
+
rfc822_header_line(&headers,
const_cast<char *>(ms_HeaderNames[n]),
env,
commit 4b39405e268dd56dfaf0448b8316dd6cff5eea1d
Author: Vadim Zeitlin <[email protected]>
Date: Mon Aug 28 23:59:58 2023 +0200
Fix constructing "References" header in replies
This was broken since a very long time (and possibly ever) because
multiline "References:" in the original message were collapsed into a
single line, without any spaces between them.
Use HeaderIterator::MultiLineOk if the headers being retrieved includes
"References" to preserve the original header structure.
This is not ideal but at least doesn't mangle the header in the replies
any longer.
diff --git a/src/mail/MessageCC.cpp b/src/mail/MessageCC.cpp
index 55a4ac37..9cf67a28 100644
--- a/src/mail/MessageCC.cpp
+++ b/src/mail/MessageCC.cpp
@@ -270,6 +270,11 @@ wxArrayString
MessageCC::GetHeaderLines(const char **headersOrig,
wxArrayInt *encodings) const
{
+ // Some headers have to be returned as multiline, but others must always be
+ // on the same line. This should probably be specified by caller, but for
+ // now decide what to do ourselves here depending on the headers requests.
+ int flags = HeaderIterator::Collapse;
+
// loop variable for iterating over headersOrig
const char **headers;
@@ -279,6 +284,13 @@ MessageCC::GetHeaderLines(const char **headersOrig,
wxArrayString values;
for ( headers = headersOrig; *headers; headers++ )
{
+ if ( strcmp(*headers, "References") == 0 )
+ {
+ // This header must be preserved as it can be too long to fit on a
+ // single line.
+ flags = HeaderIterator::MultiLineOk;
+ }
+
values.Add(wxEmptyString);
if ( encodings )
{
@@ -331,7 +343,7 @@ MessageCC::GetHeaderLines(const char **headersOrig,
// extract the headers values
HeaderIterator hdrIter(wxString::From8BitData(rc));
- hdrIter.GetAll(&names, &valuesInDisorder);
+ hdrIter.GetAll(&names, &valuesInDisorder, flags);
// and then copy the headers in order into the dst array
size_t nHdr = 0;
commit 13453cfafc9e0775d44bc0cd9f0ac1fc4ef12d94
Author: Vadim Zeitlin <[email protected]>
Date: Mon Aug 28 23:59:23 2023 +0200
Use proper end of line characters for multiline headers
Use "\r\n" and not just "\n".
diff --git a/src/mail/HeaderIterator.cpp b/src/mail/HeaderIterator.cpp
index 6de3b60e..9bf9ba9f 100644
--- a/src/mail/HeaderIterator.cpp
+++ b/src/mail/HeaderIterator.cpp
@@ -118,7 +118,7 @@ bool HeaderIterator::GetNext(String *name, String *value, int flags)
{
if ( flags & MultiLineOk )
{
- m_str += _T('\n');
+ m_str += "\r\n";
m_str += *m_pcCurrent;
}
commit 01e50709c305c21913803905347bfbd535ad6fd5
Author: Vadim Zeitlin <[email protected]>
Date: Mon Aug 28 23:58:22 2023 +0200
Show horizontal scrollbar in MTextDialog with wxGTK
Unlike in wxMSW, we need to specify wxTE_DONTWRAP explicitly to prevent
the text control from wrapping overlong lines.
Do it here as we want to see the text as it really is in e.g. raw email
text and not wrapped.
diff --git a/src/gui/wxTextDialog.cpp b/src/gui/wxTextDialog.cpp
index 0f758700..7db3076e 100644
--- a/src/gui/wxTextDialog.cpp
+++ b/src/gui/wxTextDialog.cpp
@@ -153,7 +153,8 @@ MTextDialog::MTextDialog(wxWindow *parent,
wxTE_MULTILINE |
wxTE_READONLY |
wxTE_NOHIDESEL |
- wxTE_RICH2);
+ wxTE_RICH2 |
+ wxTE_DONTWRAP);
// use fixed-width font and latin1 encoding in which all text is valid:
// without encoding information (which wouldn't make sense anyhow as we can
commit f7a43f1f8080357555c9f14c9bd88a44638db1bc
Author: Vadim Zeitlin <[email protected]>
Date: Wed Aug 23 15:28:25 2023 +0200
Adjust menu accelerators to work with GTK
Shift-Ctrl-U is intercepted by the IME and can't be used.
Shift-Ctrl-Del is not received for some other, unknown, reason.
diff --git a/src/gui/wxMenuDefs.cpp b/src/gui/wxMenuDefs.cpp
index f9bbdce0..6c13dbf9 100644
--- a/src/gui/wxMenuDefs.cpp
+++ b/src/gui/wxMenuDefs.cpp
@@ -435,10 +435,10 @@ static const MenuItemInfo g_aMenuItems[] =
{ WXMENU_MSG_FLAG, gettext_noop("&Flag as important\tCtrl-I"), gettext_noop("Mark message as flagged/unflagged") , wxITEM_NORMAL },
{ WXMENU_MSG_MARK_ANSWERED, gettext_noop("Mark ans&wered"), gettext_noop("Mark message as answered/not answered") , wxITEM_NORMAL },
{ WXMENU_MSG_MARK_READ, gettext_noop("Mark &read"), gettext_noop("Mark message as read"), wxITEM_NORMAL },
- { WXMENU_MSG_MARK_UNREAD, gettext_noop("Mar&k unread\tShift-Ctrl-U"), gettext_noop("Mark message as unread"), wxITEM_NORMAL },
+ { WXMENU_MSG_MARK_UNREAD, gettext_noop("Mar&k unread\tShift-Ctrl-+"), gettext_noop("Mark message as unread"), wxITEM_NORMAL },
{ WXMENU_SEPARATOR, "", "" , wxITEM_NORMAL },
{ WXMENU_SUBMENU, gettext_noop("&Spam"), "", wxITEM_NORMAL },
- { WXMENU_MSG_SPAM_MARK, gettext_noop("Dispose as &spam\tShift-Ctrl-Del"), gettext_noop("Classify the message as spam and treat it accordingly"), wxITEM_NORMAL },
+ { WXMENU_MSG_SPAM_MARK, gettext_noop("Dispose as &spam\tShift-Ctrl-_"), gettext_noop("Classify the message as spam and treat it accordingly"), wxITEM_NORMAL },
{ WXMENU_MSG_SPAM_UNMARK, gettext_noop("Mark as &ham"), gettext_noop("Classify the message as non-spam"), wxITEM_NORMAL },
{ WXMENU_MSG_SPAM_CHECK, gettext_noop("Chec&k message...\tShift-Ctrl-K"), gettext_noop("Check if this message is spam"), wxITEM_NORMAL },
{ WXMENU_SUBMENU, "", "", wxITEM_NORMAL },
commit d34c249f70ed5f302789b5ab40d18b2875768b8c
Author: Vadim Zeitlin <[email protected]>
Date: Wed Aug 23 15:51:18 2023 +0200
Remove unnecessary c_str() calls from wxLogXXX() etc in GUI code
Don't call c_str() explicitly, this is unnecessary since wx 3.0 and just
results in extra verbosity and run-time overhead.
There are still many of probably unneeded such calls left, but remove at
least those that could be trivially removed.
diff --git a/src/gui/ClickURL.cpp b/src/gui/ClickURL.cpp
index f6504756..0a45fd50 100644
--- a/src/gui/ClickURL.cpp
+++ b/src/gui/ClickURL.cpp
@@ -220,7 +220,7 @@ UrlPopup::OnCommandEvent(wxCommandEvent &event)
if ( !addr )
{
wxLogError(_("Failed to parse address \"%s\""),
- m_clickableURL->GetUrl().c_str());
+ m_clickableURL->GetUrl());
break;
}
@@ -239,8 +239,7 @@ UrlPopup::OnCommandEvent(wxCommandEvent &event)
READ_CONFIG(profile, MP_WHITE_LIST)));
if ( whitelist.Index(str) != wxNOT_FOUND )
{
- wxLogStatus(frame, _("\"%s\" is already in the white list"),
- str.c_str());
+ wxLogStatus(frame, _("\"%s\" is already in the white list"), str);
break;
}
@@ -248,7 +247,7 @@ UrlPopup::OnCommandEvent(wxCommandEvent &event)
profile->writeEntry(MP_WHITE_LIST, strutil_flatten_array(whitelist));
- wxLogStatus(frame, _("Added \"%s\" to the white list"), str.c_str());
+ wxLogStatus(frame, _("Added \"%s\" to the white list"), str);
}
break;
@@ -377,7 +376,7 @@ void ClickableURL::OpenInBrowser(int options) const
bool anotherBrowser = (options & URLOpen_Other) != 0;
wxFrame *frame = m_msgView->GetParentFrame();
- wxLogStatus(frame, _("Opening URL '%s'..."), m_url.c_str());
+ wxLogStatus(frame, _("Opening URL '%s'..."), m_url);
MBusyCursor bc;
@@ -433,8 +432,7 @@ void ClickableURL::OpenInBrowser(int options) const
if ( !command.empty() )
{
wxString errmsg;
- errmsg.Printf(_("Could not launch browser: '%s' failed."),
- command.c_str());
+ errmsg.Printf(_("Could not launch browser: '%s' failed."), command);
bOk = m_msgView->LaunchProcess(command, errmsg);
}
else // easy case: open in the same window
@@ -473,8 +471,7 @@ void ClickableURL::OpenInBrowser(int options) const
command = ExpandExternalCommand(browser, m_url);
wxString errmsg;
- errmsg.Printf(_("Couldn't launch browser: '%s' failed"),
- command.c_str());
+ errmsg.Printf(_("Couldn't launch browser: '%s' failed"), command);
bOk = m_msgView->LaunchProcess(command, errmsg);
}
@@ -482,11 +479,11 @@ void ClickableURL::OpenInBrowser(int options) const
if ( bOk )
{
- wxLogStatus(frame, _("Opening URL '%s'... done."), m_url.c_str());
+ wxLogStatus(frame, _("Opening URL '%s'... done."), m_url);
}
else
{
- wxLogStatus(frame, _("Opening URL '%s' failed."), m_url.c_str());
+ wxLogStatus(frame, _("Opening URL '%s' failed."), m_url);
}
}
diff --git a/src/gui/CreateFolderWizard.cpp b/src/gui/CreateFolderWizard.cpp
index d4a35b2b..ca37f8e8 100644
--- a/src/gui/CreateFolderWizard.cpp
+++ b/src/gui/CreateFolderWizard.cpp
@@ -557,7 +557,7 @@ MWizard_CreateFolder_ServerPage(MWizard *wizard,
"it here you will be asked for it later.");
}
- text.Printf(msg, entry.c_str());
+ text.Printf(msg, entry);
}
wxStaticText *msgCtrl = new wxStaticText(this, -1, text);
@@ -747,7 +747,7 @@ MWizard_CreateFolder_ServerPage::TransferDataFromWindow()
{
wxLogError(_("The path '%s' is invalid for a MH folder. All MH "
"folders should be under the directory '%s'."),
- name.c_str(), root.c_str());
+ name, root);
return false;
}
@@ -994,7 +994,7 @@ MWizard_CreateFolder_FinalPage::MWizard_CreateFolder_FinalPage(MWizard *wizard)
"the folder properties dialog later. Simply\n"
"click the right mouse button on the\n"
"entry in the tree and choose \"Properties\"."
- ), params->m_Name.c_str());
+ ), params->m_Name);
MFolderType ftype = params->m_FolderType;
if ( ftype != MF_ILLEGAL &&
diff --git a/src/gui/MImport.cpp b/src/gui/MImport.cpp
index 6d7a5a72..5508a09f 100644
--- a/src/gui/MImport.cpp
+++ b/src/gui/MImport.cpp
@@ -148,7 +148,7 @@ public:
const wxLongLong t = info.timestampMS;
m_dialog->GetLogListBox()->Append(
wxString::Format(_T("%s:\t%s"),
- wxDateTime(t).FormatTime().c_str(),
+ wxDateTime(t).FormatTime(),
szString)
);
}
@@ -409,8 +409,7 @@ static bool FindAllImporters(wxArrayImporters& importers,
}
else
{
- wxLogDebug(_T("Couldn't load importer module '%s'."),
- entry.GetName().c_str());
+ wxLogDebug(_T("Couldn't load importer module '%s'."), entry.GetName());
}
}
diff --git a/src/gui/wxAttachDialog.cpp b/src/gui/wxAttachDialog.cpp
index 83083574..358a890c 100644
--- a/src/gui/wxAttachDialog.cpp
+++ b/src/gui/wxAttachDialog.cpp
@@ -219,7 +219,7 @@ bool wxAttachmentDialog::TransferDataFromWindow()
propsNew.mimetype = strMime;
if ( !propsNew.mimetype.IsOk() )
{
- wxLogError(_("MIME type \"%s\" is illegal."), strMime.c_str());
+ wxLogError(_("MIME type \"%s\" is illegal."), strMime);
return false;
}
diff --git a/src/gui/wxColumnsDlg.cpp b/src/gui/wxColumnsDlg.cpp
index 2a5c2947..f7b77e1f 100644
--- a/src/gui/wxColumnsDlg.cpp
+++ b/src/gui/wxColumnsDlg.cpp
@@ -143,7 +143,7 @@ wxFolderViewColumnsDialog(const String& folderName,
: wxSelectionsOrderDialogSimple
(
_("&Select the columns to show:"),
- String::Format(_("Configure columns for '%s'"), folderName.c_str()),
+ String::Format(_("Configure columns for '%s'"), folderName),
names,
status,
_T("FolderViewCol"),
diff --git a/src/gui/wxComposeView.cpp b/src/gui/wxComposeView.cpp
index 06b730c3..817c8be6 100644
--- a/src/gui/wxComposeView.cpp
+++ b/src/gui/wxComposeView.cpp
@@ -1153,8 +1153,7 @@ AttachmentMenu::OnCommandEvent(wxCommandEvent &event)
const wxFileOffset len = file.Length();
if ( len == 0 )
{
- wxLogWarning(_("Attached file \"%s\" is empty"),
- filename.c_str());
+ wxLogWarning(_("Attached file \"%s\" is empty"), filename);
break;
}
@@ -1177,15 +1176,14 @@ AttachmentMenu::OnCommandEvent(wxCommandEvent &event)
if ( !ok )
{
- wxLogError(_("Failed to get data of attached file \"%s\"."),
- filename.c_str());
+ wxLogError(_("Failed to get data of attached file \"%s\"."), filename);
break;
}
MDialog_ShowText
(
GetFrame(m_window),
- wxString::Format(_("Attached file \"%s\""), filename.c_str()),
+ wxString::Format(_("Attached file \"%s\""), filename),
content,
"AttachView"
);
@@ -1975,7 +1973,7 @@ Composer::EditMessage(Profile *profile, Message *msg)
else // bad header format
{
wxLogDebug(_T("Corrupted ") HEADER_GEOMETRY _T(" header '%s'."),
- value.c_str());
+ value);
}
}
}
@@ -2168,7 +2166,7 @@ wxComposeView::~wxComposeView()
if ( !wxRemoveFile(m_filenameAutoSave) )
{
wxLogSysError(_("Failed to remove stale composer autosave file '%s'"),
- m_filenameAutoSave.c_str());
+ m_filenameAutoSave);
}
}
}
@@ -2602,7 +2600,7 @@ wxComposeView::CreateEditor()
wxLogError(_("Failed to load the default message editor '%s'.\n"
"\n"
"Builtin message editing will not work!"),
- nameFirst.c_str());
+ nameFirst);
}
}
@@ -2866,7 +2864,7 @@ wxComposeView::AddRecipient(const String& addr, RecipientType addrType)
wxLogStatus(this,
_("Address '%s' is already in the recipients list, "
"not added."),
- addr.c_str());
+ addr);
}
else // found with a different type
{
@@ -2878,7 +2876,7 @@ wxComposeView::AddRecipient(const String& addr, RecipientType addrType)
wxLogStatus(this,
_("Address '%s' was already in the recipients list "
"with a different type, just changed the type."),
- addr.c_str());
+ addr);
m_rcptExtra[n]->SetType(addrType);
}
@@ -2887,7 +2885,7 @@ wxComposeView::AddRecipient(const String& addr, RecipientType addrType)
wxLogStatus(this,
_("Address '%s' was already in the recipients list "
"with a different type, not added."),
- addr.c_str());
+ addr);
}
}
@@ -3298,7 +3296,7 @@ wxComposeView::DoInitText(Message *msgOrig)
wxLog::FlushActive();
msg.Printf(_("Couldn't read vCard file '%s'."),
- filename.c_str());
+ filename);
}
}
@@ -3746,12 +3744,11 @@ wxComposeView::OnMenuCommand(int id)
}
else if ( InsertFileAsText(filename, MessageEditor::Insert_Append) )
{
- wxLogStatus(this, _("Inserted file '%s'."), filename.c_str());
+ wxLogStatus(this, _("Inserted file '%s'."), filename);
}
else
{
- wxLogError(_("Failed to insert the text file '%s'."),
- filename.c_str());
+ wxLogError(_("Failed to insert the text file '%s'."), filename);
}
}
break;
@@ -3776,8 +3773,7 @@ wxComposeView::OnMenuCommand(int id)
// we have been saved
ResetDirty();
- wxLogStatus(this, _("Message text saved to file '%s'."),
- filename.c_str());
+ wxLogStatus(this, _("Message text saved to file '%s'."), filename);
}
else
{
@@ -3823,7 +3819,7 @@ wxComposeView::OnMenuCommand(int id)
//else: we will take it from the profile when we will send the msg
wxLogStatus(this, _("Added custom header '%s' to the message."),
- headerName.c_str());
+ headerName);
}
//else: cancelled
}
@@ -4001,7 +3997,7 @@ bool wxComposeView::StartExternalEditor()
if ( !m_pidEditor )
{
- wxLogError(_("Execution of '%s' failed."), command.c_str());
+ wxLogError(_("Execution of '%s' failed."), command);
}
else // editor launched
{
@@ -4090,7 +4086,7 @@ void wxComposeView::OnExtEditorTerm(wxProcessEvent& event)
{
if ( wxRemove(m_tmpFileName) != 0 )
{
- wxLogDebug(_T("Stale temp file '%s' left."), m_tmpFileName.c_str());
+ wxLogDebug(_T("Stale temp file '%s' left."), m_tmpFileName);
}
ok = true;
@@ -4119,8 +4115,7 @@ void wxComposeView::OnExtEditorTerm(wxProcessEvent& event)
if ( !ok )
{
- wxLogError(_("The text was left in the file '%s'."),
- m_tmpFileName.c_str());
+ wxLogError(_("The text was left in the file '%s'."), m_tmpFileName);
}
m_pidEditor = 0;
@@ -4261,8 +4256,7 @@ wxComposeView::InsertFile(const wxChar *fileName,
strMimeType = props.mimetype.GetFull();
DoInsertAttachment(mc, strMimeType);
- wxLogStatus(this, _("Inserted file '%s' (as '%s')"),
- filename.c_str(), strMimeType.c_str());
+ wxLogStatus(this, _("Inserted file '%s' (as '%s')"), filename, strMimeType);
}
@@ -4283,8 +4277,7 @@ wxComposeView::InsertFileAsText(const String& filename,
{
if ( insMode != MessageEditor::Insert_Replace )
{
- wxLogVerbose(_("File '%s' is empty, no text to insert."),
- filename.c_str());
+ wxLogVerbose(_("File '%s' is empty, no text to insert."), filename);
return true;
}
//else: replace old text with new (empty) one
@@ -4648,7 +4641,7 @@ bool wxComposeView::CheckForForgottenAttachments() const
"Please change it in the program options and reenable "
"the check for forgotten attachments there\n"
"as it will be temporarily disabled now."),
- reText.c_str()
+ reText
),
this
);
@@ -4834,8 +4827,8 @@ wxComposeView::EncodeText(const wxString& text,
_("Text of this message can't be converted "
"to the encoding \"%s\", would you like "
" to send it in encoding \"%s\" instead?"),
- wxFontMapper::GetEncodingName(m_encoding).c_str(),
- wxFontMapper::GetEncodingName(encodingPart).c_str()
+ wxFontMapper::GetEncodingName(m_encoding),
+ wxFontMapper::GetEncodingName(encodingPart)
),
this,
MDIALOG_YESNOTITLE,
@@ -4871,8 +4864,7 @@ wxComposeView::EncodeText(const wxString& text,
_("Text of this message can't be converted "
"to the encoding \"%s\", would you like "
"to send it in UTF-8 instead?"),
- wxFontMapper::
- GetEncodingName(encodingPart).c_str()
+ wxFontMapper::GetEncodingName(encodingPart)
),
this,
MDIALOG_YESNOTITLE,
@@ -5023,7 +5015,7 @@ wxComposeView::BuildMessage(int flags) const
else if ( flags & Interactive )
{
wxLogError(_("Cannot read file '%s' included in "
- "this message!"), filename.c_str());
+ "this message!"), filename);
}
delete [] buffer;
@@ -5031,7 +5023,7 @@ wxComposeView::BuildMessage(int flags) const
else if ( flags & Interactive )
{
wxLogError(_("Cannot open file '%s' included in "
- "this message!"), filename.c_str());
+ "this message!"), filename);
}
if ( !partOk )
@@ -5322,7 +5314,7 @@ void wxComposeView::OnSendResult(const SendThreadResult& res)
if ( res.outbox.empty() )
{
s.Printf(_("Message has been posted to %s"),
- GetRecipients(Recipient_Newsgroup).c_str());
+ GetRecipients(Recipient_Newsgroup));
}
else
{
@@ -5335,13 +5327,13 @@ void wxComposeView::OnSendResult(const SendThreadResult& res)
{
// NB: don't show BCC as the message might be saved in the log file
s.Printf(_("Message has been sent to %s"),
- GetRecipients(Recipient_To).c_str());
+ GetRecipients(Recipient_To));
String rcptCC = GetRecipients(Recipient_Cc);
if ( !rcptCC.empty() )
{
s += String::Format(_(" (with courtesy copy sent to %s)"),
- rcptCC.c_str());
+ rcptCC);
}
else // no CC
{
@@ -5355,7 +5347,7 @@ void wxComposeView::OnSendResult(const SendThreadResult& res)
}
// avoid crashes if the message has any stray '%'s
- wxLogStatus(this, _T("%s"), s.c_str());
+ wxLogStatus(this, _T("%s"), s);
// we can now safely remove the draft message, if any
DeleteDraft();
@@ -5710,7 +5702,7 @@ bool wxComposeView::DeleteDraft()
if ( !mf->DeleteMessage(m_DraftMessage->GetUId()) )
{
wxLogError(_("Failed to delete the original draft message from "
- "the folder '%s'."), mf->GetName().c_str());
+ "the folder '%s'."), mf->GetName());
return false;
}
@@ -5849,7 +5841,7 @@ bool wxComposeView::SaveAsDraft() const
_("Your message has been saved in the folder '%s',\n"
"simply open it and choose \"Message|Edit in composer\" to\n"
"continue writing it."),
- nameDrafts.c_str()
+ nameDrafts
),
self->GetFrame(),
M_MSGBOX_DRAFT_SAVED,
@@ -5907,13 +5899,13 @@ wxComposeView::AutoSave()
if ( !wxMkdir(name, 0700) )
{
wxLogSysError(_("Failed to create the directory '%s' for the "
- "temporary composer files"), name.c_str());
+ "temporary composer files"), name);
wxLogError(_("Composer messages won't be saved automatically "
"for the duration of this session.\n"
"Please make sure that Mahogany can create the "
"directory \"%s\" and restart the program."),
- name.c_str());
+ name);
s_autosaveEnabled = false;
return false;
@@ -6046,7 +6038,7 @@ bool Composer::RestoreAll()
}
wxLogError(_("Failed to resume composing the message from file '%s'"),
- filename.c_str());
+ filename);
}
if ( nResumed )
diff --git a/src/gui/wxFiltersDialog.cpp b/src/gui/wxFiltersDialog.cpp
index 77201e02..792b4fc0 100644
--- a/src/gui/wxFiltersDialog.cpp
+++ b/src/gui/wxFiltersDialog.cpp
@@ -1817,7 +1817,7 @@ wxAllFiltersDialog::OnAddFiter(wxCommandEvent& /* event */)
"a folder to which you'd like to assign this filter\n"
"right now (otherwise you can do it later by using\n"
"the \"Filters\" entry in the \"Folder\" menu)?"),
- name.c_str());
+ name);
if ( MDialog_YesNoDialog(msg,
this,
@@ -2000,7 +2000,7 @@ wxAllFiltersDialog::DoCopyFilter(const wxString& nameOld,
String msg;
msg.Printf(_("Filter '%s' already exists, are you sure you want "
"to overwrite it with the filter '%s'?"),
- nameOld.c_str(), nameNew.c_str());
+ nameOld, nameNew);
if ( !MDialog_YesNoDialog(msg,
this,
_("Overwrite filter?"),
@@ -2098,7 +2098,7 @@ public:
m_filterNames(filterNames)
{
SetTitle(String::Format(_("Filters copying messages to \"%s\""),
- folderName.c_str()));
+ folderName));
}
virtual bool TransferDataToWindow()
@@ -2136,7 +2136,7 @@ private:
static String GetCaption(MFolder *folder)
{
return wxString::Format(_("Configure filters for '%s'"),
- folder->GetName().c_str());
+ folder->GetName());
}
// the folder which we are working with
@@ -2773,7 +2773,7 @@ bool wxQuickFilterDialog::TransferDataFromWindow()
wxLogWarning(_("Only a single sender address can be specified "
"here, \"%s\" will be used and the rest of "
"the sender string will be ignored."),
- addr->GetAddress().c_str());
+ addr->GetAddress());
}
const String& email = addr->GetEMail();
@@ -2913,7 +2913,7 @@ static String CreateNewFilter(wxWindow *parent, ConfigSource *config)
{
String msg;
msg.Printf(_("The filter '%s' already exists, do you want "
- "to replace it?"), name.c_str());
+ "to replace it?"), name);
if ( !MDialog_YesNoDialog(msg, parent, _("Replace filter?"),
M_DLG_NO_DEFAULT,
M_MSGBOX_FILTER_REPLACE) )
@@ -3038,7 +3038,7 @@ extern bool FindFiltersForFolder(MFolder *folder, wxWindow *parent)
{
wxLogStatus(GetFrame(parent),
_("No filters copying messages to folder \"%s\" found."),
- fullname.c_str());
+ fullname);
return false;
}
diff --git a/src/gui/wxFolderTree.cpp b/src/gui/wxFolderTree.cpp
index 738dc9af..7cd1ba61 100644
--- a/src/gui/wxFolderTree.cpp
+++ b/src/gui/wxFolderTree.cpp
@@ -1026,7 +1026,7 @@ bool wxFolderTree::OnDelete(MFolder *folder, bool removeOnly)
if ( folder->GetFlags() & MF_FLAGS_DONTDELETE )
{
wxLogError(_("The folder '%s' is used by Mahogany and cannot be deleted"),
- folder->GetFullName().c_str());
+ folder->GetFullName());
return false;
}
@@ -1046,13 +1046,13 @@ bool wxFolderTree::OnDelete(MFolder *folder, bool removeOnly)
{
msg.Printf(_("Do you really want to remove folder '%s' and all of its\n"
"subfolders? You will permanently lose all the settings\n"
- "for the removed folders!"), folder->GetName().c_str());
+ "for the removed folders!"), folder->GetName());
}
else // remove and delete
{
msg.Printf(_("Do you really want to delete folder '%s' and all of its\n"
"subfolders? All messages contained in them will be "
- "permanently lost!"), folder->GetFullName().c_str());
+ "permanently lost!"), folder->GetFullName());
}
}
else
@@ -1064,13 +1064,13 @@ bool wxFolderTree::OnDelete(MFolder *folder, bool removeOnly)
msgbox = M_MSGBOX_CONFIRM_FOLDER_DELETE;
msg.Printf(_("Do you really want to remove folder '%s'?"),
- folder->GetFullName().c_str());
+ folder->GetFullName());
}
else // remove and delete
{
msg.Printf(_("Do you really want to delete folder '%s' with\n"
"all the messages contained in it?"),
- folder->GetFullName().c_str());
+ folder->GetFullName());
}
}
@@ -1094,7 +1094,7 @@ bool wxFolderTree::OnDelete(MFolder *folder, bool removeOnly)
if ( !ok )
{
wxLogError(_("Failed to physically delete folder '%s'."),
- folder->GetFullName().c_str());
+ folder->GetFullName());
}
}
@@ -1133,7 +1133,7 @@ bool wxFolderTree::OnRename(MFolder *folder,
{
wxLogStatus(wxGetTopLevelParent(m_tree),
_("Successfully renamed folder '%s'."),
- folder->GetFullName().c_str());
+ folder->GetFullName());
}
else
{
@@ -1172,12 +1172,12 @@ bool wxFolderTree::OnMove(MFolder *folder,
{
wxLogStatus(wxGetTopLevelParent(m_tree),
_("Successfully moved folder '%s' to '%s'."),
- folder->GetFullName().c_str(), newParent->GetFullName().c_str());
+ folder->GetFullName(), newParent->GetFullName());
}
else
{
wxLogError(_("Failed to move the folder '%s' from '%s' to '%s'."),
- name.c_str(), oldPath.c_str(), newPath.c_str());
+ name, oldPath, newPath);
}
return false;
}
@@ -1191,7 +1191,7 @@ void wxFolderTree::OnClear(MFolder *folder)
"folder '%s'?\n"
"\n"
"Warning: it will be impossible to undelete them!"),
- fullname.c_str());
+ fullname);
wxWindow *parent = m_tree->wxWindow::GetParent();
@@ -1212,13 +1212,13 @@ void wxFolderTree::OnClear(MFolder *folder)
if ( n < 0 )
{
wxLogError(_("Failed to delete messages from folder '%s'."),
- fullname.c_str());
+ fullname);
}
else
{
wxLogStatus(GetFrame(parent),
- _("%lu messages were deleted from folder '%s'."),
- (unsigned long)n, fullname.c_str());
+ _("%ld messages were deleted from folder '%s'."),
+ n, fullname);
}
}
}
@@ -1232,13 +1232,13 @@ void wxFolderTree::OnUpdate(MFolder *folder)
if ( !MailFolder::CheckFolder(folder) )
{
wxLogError(_("Failed to update the status of the folder '%s'."),
- folder->GetFullName().c_str());
+ folder->GetFullName());
}
else
{
wxLogStatus(wxGetTopLevelParent(m_tree),
_("Updated status of the folder '%s'"),
- folder->GetFullName().c_str());
+ folder->GetFullName());
}
}
else // update subfolders
@@ -1268,7 +1268,7 @@ bool wxFolderTree::OnClose(MFolder *folder)
wxLogStatus(wxGetTopLevelParent(m_tree),
_("Folder '%s' closed."),
- folder->GetFullName().c_str());
+ folder->GetFullName());
m_tree->SetOpenFolderName(wxEmptyString);
@@ -1581,7 +1581,7 @@ void wxFolderTreeNode::UpdateShownStatus(wxTreeCtrl *tree,
{
if ( !ParseColourString(colorName, &col) )
{
- wxLogDebug(_T("Invalid colour string '%s'."), colorName.c_str());
+ wxLogDebug(_T("Invalid colour string '%s'."), colorName);
col = *wxBLACK;
}
}
@@ -1854,7 +1854,7 @@ void wxFolderTreeImpl::DoPopupMenu(const wxPoint& pos)
*menu = new FolderMenu(isRoot);
}
- (*menu)->SetTitle(wxString::Format(_("Folder '%s'"), title.c_str()));
+ (*menu)->SetTitle(wxString::Format(_("Folder '%s'"), title));
// some items (all WXMENU_FOLDEX_XXX ones) are taken care of there already
m_sink->UpdateMenu(*menu, folder);
@@ -1984,7 +1984,7 @@ bool wxFolderTreeImpl::CanRenameFolder(const MFolder *folder) const
else if ( folder->GetFlags() & MF_FLAGS_DONTDELETE )
{
wxLogError(_("The folder '%s' is used by Mahogany and cannot be renamed."),
- folder->GetName().c_str());
+ folder->GetName());
}
else
{
@@ -2135,7 +2135,7 @@ void wxFolderTreeImpl::DoFolderDelete(bool removeOnly)
}
wxLogStatus(GetFrame(this), _("Folder '%s' %s"),
- folder->GetName().c_str(),
+ folder->GetName(),
removeOnly ? _("removed from the tree")
: _("deleted"));
}
@@ -2657,7 +2657,7 @@ void wxFolderTreeImpl::OnTreeBeginDrag(wxTreeEvent& event)
{
wxLogStatus(GetFrame(this),
_("The folder \"%s\" cannot be moved."),
- folder->GetFullName().c_str());
+ folder->GetFullName());
return;
}
@@ -2710,15 +2710,15 @@ void wxFolderTreeImpl::OnTreeEndDrag(wxTreeEvent& event)
if ( !folderSrc->Move(folderDst) )
{
wxLogError(_("Failed to move the folder \"%s\" to \"%s\"."),
- folderSrc->GetFullName().c_str(),
- folderDst->GetFullName().c_str());
+ folderSrc->GetFullName(),
+ folderDst->GetFullName());
}
else // moved ok
{
wxLogStatus(GetFrame(this),
_("Successfully moved the folder \"%s\" to \"%s\"."),
- folderSrc->GetFullName().c_str(),
- folderDst->GetFullName().c_str());
+ folderSrc->GetFullName(),
+ folderDst->GetFullName());
}
}
}
@@ -3367,7 +3367,7 @@ ProcessFolderTreeChange(const MEventFolderTreeChangeData& event)
void wxFolderTreeImpl::ProcessMsgNumberChange(const wxString& folderName)
{
wxLogTrace(M_TRACE_MFSTATUS, _T("Folder tree: status changed for '%s'."),
- folderName.c_str());
+ folderName);
// check if we need to react to this event at all
// ----------------------------------------------
@@ -3418,7 +3418,7 @@ void wxFolderTreeImpl::ProcessMsgNumberChange(const wxString& folderName)
MailFolder_obj mf(MailFolder::GetOpenedFolderFor(folder));
if ( !mf )
{
- wxLogDebug(_T("Failed to update status for '%s'"), folderName.c_str());
+ wxLogDebug(_T("Failed to update status for '%s'"), folderName);
}
else
{
@@ -3487,7 +3487,7 @@ void wxFolderTreeImpl::ProcessMsgNumberChange(const wxString& folderName)
node->SetStatus(this, statusFormat, status);
wxLogTrace(M_TRACE_MFSTATUS, _T("Folder tree: updated status for '%s'"),
- folderName.c_str());
+ folderName);
}
// ----------------------------------------------------------------------------
diff --git a/src/gui/wxFolderView.cpp b/src/gui/wxFolderView.cpp
index ca16b3dc..109dbf90 100644
--- a/src/gui/wxFolderView.cpp
+++ b/src/gui/wxFolderView.cpp
@@ -1944,9 +1944,9 @@ void wxFolderListCtrl::OnColumnRightClick(wxListEvent& event)
String colName = GetColumnName(col).Lower();
menu.Append(WXMENU_FVIEW_SORT_BY_COL + col,
- wxString::Format(_("Sort by %s"), colName.c_str()));
+ wxString::Format(_("Sort by %s"), colName));
menu.Append(WXMENU_FVIEW_SORT_BY_COL_REV + col,
- wxString::Format(_("Reverse sort by %s"), colName.c_str()));
+ wxString::Format(_("Reverse sort by %s"), colName));
menu.AppendSeparator();
}
//else: clicked outside any column or on a column we can't use for sorting
@@ -2075,7 +2075,7 @@ void wxFolderListCtrl::OnColumnClick(wxListEvent& event)
// we can't sort by this column
wxLogStatus(GetFrame(this),
_("Impossible to sort messages using %s column"),
- GetColumnName(col).Lower().c_str());
+ GetColumnName(col).Lower());
return;
}
@@ -2736,7 +2736,7 @@ void wxFolderListCtrl::SetSortOrder(Profile *profile,
bool reverse)
{
wxLogStatus(GetFrame(this), _("Now sorting by %s%s"),
- GetColumnName(col).Lower().c_str(),
+ GetColumnName(col).Lower(),
reverse ? _(" (reverse)") : "");
profile->writeEntry(MP_MSGS_SORTBY, sortOrder);
@@ -3532,8 +3532,8 @@ void wxFolderView::MoveToNextSearchMatch(bool forward)
wxLogStatus(m_Frame, _("Search result %lu of %lu for \"%s\"%s"),
(unsigned long)(m_searchData.idx + 1),
(unsigned long)count,
- m_searchData.str.c_str(),
- status.c_str());
+ m_searchData.str,
+ status);
}
}
@@ -3936,7 +3936,7 @@ wxFolderView::DoClear(bool keepTheViewer)
{
wxString msg;
msg.Printf(_("Mark all articles in\n'%s'\nas read?"),
- m_ASMailFolder->GetName().c_str());
+ m_ASMailFolder->GetName());
if ( MDialog_YesNoDialog
(
@@ -4140,7 +4140,7 @@ wxFolderView::OpenFolder(MFolder *folder, bool readonly)
if ( AddAllSubfoldersToTree(folder, asmf) > 0 )
{
wxLogStatus(_("You can now open any of the folders on the "
- "IMAP server '%s'"), folder->GetName().c_str());
+ "IMAP server '%s'"), folder->GetName());
}
asmf->DecRef();
@@ -4163,7 +4163,7 @@ wxFolderView::OpenFolder(MFolder *folder, bool readonly)
_("The folder '%s' couldn't be opened last time, "
"do you still want to try to open it (it "
"will probably fail again)?"),
- m_fullname.c_str()
+ m_fullname
),
m_Frame,
MDIALOG_YESNOTITLE,
@@ -4193,7 +4193,7 @@ wxFolderView::OpenFolder(MFolder *folder, bool readonly)
{
// the dialog was cancelled
wxLogStatus(m_Frame, _("Opening the folder '%s' cancelled."),
- m_fullname.c_str());
+ m_fullname);
mApplication->SetLastError(M_ERROR_CANCEL);
return false;
@@ -4236,7 +4236,7 @@ wxFolderView::OpenFolder(MFolder *folder, bool readonly)
"If you believe this message to be incorrect, "
"you may reset \"Can be opened\" flag in the\n"
"folder properties dialog and try again."),
- m_fullname.c_str());
+ m_fullname);
break;
default:
@@ -4265,7 +4265,7 @@ wxFolderView::OpenFolder(MFolder *folder, bool readonly)
(
wxString::Format(_("The folder '%s' could not be opened, "
"would you like to change its settings?"),
- m_fullname.c_str()),
+ m_fullname),
m_Frame,
MDIALOG_YESNOTITLE,
M_DLG_YES_DEFAULT,
@@ -5051,7 +5051,7 @@ void wxFolderView::OnFolderDeleteEvent(const String& folderName)
// assume we're in a folder view frame
wxLogStatus(GetFrame(m_Parent),
_("Closing folder '%s' because the underlying mail "
- "folder was deleted."), m_folderName.c_str());
+ "folder was deleted."), m_folderName);
Clear();
}
@@ -5313,7 +5313,7 @@ wxFolderView::OnASFolderResultEvent(MEventASFolderResultData &event)
{
wxLogStatus(m_Frame,
_("No messages matching \"%s\" found."),
- m_searchData.str.c_str());
+ m_searchData.str);
}
}
break;
diff --git a/src/gui/wxHeadersDialogs.cpp b/src/gui/wxHeadersDialogs.cpp
index 36b19ea8..ac5a1763 100644
--- a/src/gui/wxHeadersDialogs.cpp
+++ b/src/gui/wxHeadersDialogs.cpp
@@ -372,7 +372,7 @@ wxComposeHeadersDialog::wxComposeHeadersDialog(Profile *profile,
wxString foldername = profile->GetFolderName();
wxString labelBox;
if ( !foldername.empty() )
- labelBox.Printf(_("&Headers for folder '%s'"), foldername.c_str());
+ labelBox.Printf(_("&Headers for folder '%s'"), foldername);
else
labelBox.Printf(_("Default headers"));
wxStaticBox *box = CreateStdButtonsAndBox(labelBox);
@@ -641,7 +641,7 @@ wxCustomHeaderDialog::wxCustomHeaderDialog(Profile *profile,
wxString foldername = profile->GetFolderName();
wxString labelBox;
if ( !foldername.empty() )
- labelBox.Printf(_("Custom header for folder '%s'"), foldername.c_str());
+ labelBox.Printf(_("Custom header for folder '%s'"), foldername);
else
labelBox.Printf(_("Default custom header"));
wxStaticBox *box = CreateStdButtonsAndBox(labelBox);
@@ -798,7 +798,7 @@ bool wxCustomHeaderDialog::TransferDataFromWindow()
if ( !reason.empty() )
{
- wxLogError(_("Specified header name is invalid: %s."), reason.c_str());
+ wxLogError(_("Specified header name is invalid: %s."), reason);
return false;
}
@@ -841,7 +841,7 @@ wxCustomHeadersDialog::wxCustomHeadersDialog(Profile *profile,
wxString foldername = profile->GetFolderName();
wxString labelBox;
if ( !foldername.empty() )
- labelBox.Printf(_("Custom &headers for folder '%s'"), foldername.c_str());
+ labelBox.Printf(_("Custom &headers for folder '%s'"), foldername);
else
labelBox.Printf(_("Default custom headers"));
diff --git a/src/gui/wxIconManager.cpp b/src/gui/wxIconManager.cpp
index 97388196..b93f8f8b 100644
--- a/src/gui/wxIconManager.cpp
+++ b/src/gui/wxIconManager.cpp
@@ -208,14 +208,14 @@ wxIconManager::LoadImage(String filename, bool *success, bool showDlg)
"exactly two '%%s' format specificators.\n"
"The current setting '%s' is incorrect and "
"the default value will be used instead."),
- strConvertProgram.c_str());
+ strConvertProgram);
strConvertProgram = GetStringDefault(MP_CONVERTPROGRAM);
}
String command;
- command.Printf(strConvertProgram, filename.c_str(), tempfile.c_str());
+ command.Printf(strConvertProgram, filename, tempfile);
wxLogTrace(wxTraceIconLoading,
_T("wxIconManager::LoadImage() calling '%s'..."),
- command.c_str());
+ command);
if(wxSystem(command) == 0)
{
wxLogNull lo; // suppress error messages
@@ -264,7 +264,7 @@ wxIconManager::LoadImageXpm(String filename)
char **cpptr = NULL;
wxLogTrace(wxTraceIconLoading, _T("wxIconManager::LoadImage(%s) called..."),
- filename.c_str());
+ filename);
wxFileName fn(filename);
if ( fn.GetExt() == _T("xpm") )
@@ -281,11 +281,10 @@ wxIconManager::LoadImageXpm(String filename)
String tempfile(fnXPM.GetFullPath());
String command;
- command.Printf(READ_APPCONFIG_TEXT(MP_CONVERTPROGRAM),
- filename.c_str(), tempfile.c_str());
+ command.Printf(READ_APPCONFIG_TEXT(MP_CONVERTPROGRAM), filename, tempfile);
wxLogTrace(wxTraceIconLoading,
_T("wxIconManager::LoadImage() calling '%s'..."),
- command.c_str());
+ command);
if(wxSystem(command) == 0)
cpptr = LoadXpm(tempfile);
@@ -504,7 +503,7 @@ wxIconManager::GetIcon(const String &iconNameOrig)
strutil_tolower(iconName);
wxLogTrace(wxTraceIconLoading, _T("wxIconManager::GetIcon(%s) called..."),
- iconNameOrig.c_str());
+ iconNameOrig);
wxIcon icon;
@@ -567,7 +566,7 @@ wxIconManager::GetIcon(const String &iconNameOrig)
id.iconRef = icon;
id.iconName = iconName;
wxLogTrace(wxTraceIconLoading, _T("... icon found in '%s'"),
- name.c_str());
+ name);
m_iconList.push_front(id);
return icon;
}
diff --git a/src/gui/wxMApp.cpp b/src/gui/wxMApp.cpp
index 097a7117..7e4cd68f 100644
--- a/src/gui/wxMApp.cpp
+++ b/src/gui/wxMApp.cpp
@@ -961,7 +961,7 @@ wxMApp::OnInit()
if ( !m_snglInstChecker->Create
(
wxString::Format(_T(".mahogany-%s.lock"),
- wxGetUserId().c_str()),
+ wxGetUserId()),
_T("/tmp")
) )
{
@@ -1197,13 +1197,13 @@ wxMApp::OnInit()
{
msg.Printf("Locale '%s' couldn't be set, do you want to "
"retry setting it the next time?",
- locale.c_str());
+ locale);
}
else // failedToLoadMsgs
{
msg.Printf("Impossible to load message catalog(s) for the "
"locale '%s', do you want to retry next time?",
- locale.c_str());
+ locale);
}
if ( wxMessageBox(msg, _T("Error"),
@@ -1569,7 +1569,7 @@ bool wxMApp::InitHelp()
"\n"
"Would you like to specify another help files "
"location (otherwise help will be unavailable)?"),
- helpdir.c_str());
+ helpdir);
if ( !MDialog_YesNoDialog(msg, NULL, _("Mahogany Help")) )
{
@@ -1698,7 +1698,7 @@ wxMApp::LoadModules(void)
if ( !module )
{
- ERRORMESSAGE((_("Cannot load module '%s'."), name.c_str()));
+ ERRORMESSAGE((_("Cannot load module '%s'."), name));
}
else
{
@@ -2268,7 +2268,7 @@ void wxMApp::SetLogFile(const String& filename)
}
wxLogVerbose(_("Started logging to the log file '%s'."),
- filename.c_str());
+ filename);
}
}
}
@@ -2581,7 +2581,7 @@ static String GetIPCSocket()
// seems to be better than UID as, although it seems unlikely, we might
// have the same user logged in from 2 different machines sharing the
// same /tmp directory
- s_socketName.Printf(_T("/tmp/.mahogany-%s.ipc"), wxGetUserId().c_str());
+ s_socketName.Printf(_T("/tmp/.mahogany-%s.ipc"), wxGetUserId());
}
return s_socketName;
diff --git a/src/gui/wxMDialogs.cpp b/src/gui/wxMDialogs.cpp
index a90261b1..9a1d0df5 100644
--- a/src/gui/wxMDialogs.cpp
+++ b/src/gui/wxMDialogs.cpp
@@ -561,7 +561,7 @@ MDialog_SystemErrorMessage(const wxString& message,
msg = String(message) + _("\nSystem error: ")
+ wxSafeConvertMB2WX(strerror(errno));
- MDialog_ErrorMessage(msg.c_str(), parent, wxString(M_TITLE_PREFIX)+title, modal);
+ MDialog_ErrorMessage(msg, parent, wxString(M_TITLE_PREFIX)+title, modal);
}
@@ -634,7 +634,7 @@ bool MDialog_Message(const wxString& message,
configPath = GetPersMsgBoxName(persMsg);
return MDialog_Message(message, parent, title,
- persMsg ? configPath.c_str()
+ persMsg ? (const char *)configPath.c_str()
: (const char *)NULL,
flags);
}
@@ -1241,7 +1241,7 @@ wxDateFmtDialog::wxDateFmtDialog(Profile *profile, wxWindow *parent)
wxString foldername = profile->GetFolderName();
wxString labelBox;
if ( !foldername.empty() )
- labelBox.Printf(_("&Date format for folder '%s'"), foldername.c_str());
+ labelBox.Printf(_("&Date format for folder '%s'"), foldername);
else
labelBox.Printf(_("&Default date format"));
@@ -1852,7 +1852,7 @@ void CheckExpungeDialog(ASMailFolder *asmf, wxWindow *parent)
String msg;
msg.Printf(_("Do you want to expunge all deleted messages\n"
"in folder '%s'?"),
- mf->GetName().c_str());
+ mf->GetName());
if ( MDialog_YesNoDialog(msg, parent, MDIALOG_YESNOTITLE,
M_DLG_NO_DEFAULT,
@@ -2537,7 +2537,7 @@ bool wxSelectionsOrderDialog::OnItemAdd(const wxString& item)
if ( m_checklstBox->GetString(n) == item )
{
wxLogWarning(_("The string \"%s\" is already present in the list."),
- item.c_str());
+ item);
return false;
}
@@ -3071,7 +3071,7 @@ public:
: MPasswordDialog(
parent,
_("Please enter login/password to access this folder"),
- wxString::Format(_("Folder '%s':"), folderName.c_str()),
+ wxString::Format(_("Folder '%s':"), folderName),
username,
password
)
@@ -3110,7 +3110,7 @@ public:
_("Please enter login/password to %s this message"),
protocol == Prot_SMTP ? _("send") : _("post")
),
- wxString::Format(_("Server '%s':"), server.c_str()),
+ wxString::Format(_("Server '%s':"), server),
username,
password
)
diff --git a/src/gui/wxMFolderDialogs.cpp b/src/gui/wxMFolderDialogs.cpp
index fc5b54e6..20d5d8f5 100644
--- a/src/gui/wxMFolderDialogs.cpp
+++ b/src/gui/wxMFolderDialogs.cpp
@@ -908,7 +908,7 @@ bool wxFolderCreateDialog::TransferDataFromWindow()
{
wxLogError(_("Folder '%s' specified as the parent for the new folder "
"doesn't exist. Please choose an existing folder as "
- "parent or leave it blank."), folderName.c_str());
+ "parent or leave it blank."), folderName);
ok = FALSE;
}
@@ -2321,8 +2321,7 @@ wxFolderPropertiesPage::TransferDataFromWindow(void)
wxString mhName = path;
if ( !MailFolder::GetMHFolderName(&mhName) )
{
- wxLogError(_("Impossible to create MH folder '%s'."),
- path.c_str());
+ wxLogError(_("Impossible to create MH folder '%s'."), path);
wxLog::FlushActive();
@@ -2400,7 +2399,7 @@ wxFolderPropertiesPage::TransferDataFromWindow(void)
"if you don't want this to happen you should fill "
"it in here or,\n"
"alternatively, select anonymous access.\n"),
- what.c_str()
+ what
);
if ( msgbox == M_MSGBOX_ASK_PWD )
@@ -2418,7 +2417,7 @@ wxFolderPropertiesPage::TransferDataFromWindow(void)
<< wxString::Format
(
_("So would you like to leave the %s empty?"),
- what.c_str()
+ what
);
if ( !MDialog_YesNoDialog(msg, this, MDIALOG_YESNOTITLE,
diff --git a/src/gui/wxMFrame.cpp b/src/gui/wxMFrame.cpp
index bfba8723..97cda697 100644
--- a/src/gui/wxMFrame.cpp
+++ b/src/gui/wxMFrame.cpp
@@ -219,7 +219,7 @@ wxMFrame::SetTitle(String const &title)
t += _(" [debug build]");
#endif
- wxFrame::SetTitle(t.c_str());
+ wxFrame::SetTitle(t);
}
void
@@ -737,12 +737,12 @@ wxMFrame::OnMenuCommand(int id)
{
wxLogStatus(this,
_("Settings successfully exported to file \"%s\""),
- path.c_str());
+ path);
}
else
{
wxLogError(_("Failed to export settings to the file \"%s\"."),
- path.c_str());
+ path);
}
}
else // import
@@ -751,12 +751,12 @@ wxMFrame::OnMenuCommand(int id)
{
wxLogStatus(this,
_("Settings successfully imported from \"%s\""),
- path.c_str());
+ path);
}
else
{
wxLogError(_("Failed to import settings from the file \"%s\"."),
- path.c_str());
+ path);
}
}
}
@@ -878,7 +878,7 @@ wxMFrame::OnMenuCommand(int id)
}
}
- wxLogStatus(this, _("Created new identity '%s'."), ident.c_str());
+ wxLogStatus(this, _("Created new identity '%s'."), ident);
}
}
break;
@@ -1023,7 +1023,7 @@ wxMFrame::OnMenuCommand(int id)
combo->Delete(combo->FindString(ident));
}
- wxLogStatus(this, _("Identity '%s' deleted."), ident.c_str());
+ wxLogStatus(this, _("Identity '%s' deleted."), ident);
}
}
break;
diff --git a/src/gui/wxMIMETreeDialog.cpp b/src/gui/wxMIMETreeDialog.cpp
index 0a19b7cc..85c119d9 100644
--- a/src/gui/wxMIMETreeDialog.cpp
+++ b/src/gui/wxMIMETreeDialog.cpp
@@ -290,7 +290,7 @@ void wxMIMETreeDialog::OnSave(wxCommandEvent& WXUNUSED(event))
if ( !mimepart )
{
wxLogWarning(_("Failed to save MIME part \"%s\", skipping."),
- m_treectrl->GetItemText(selections[n]).c_str());
+ m_treectrl->GetItemText(selections[n]));
continue;
}
diff --git a/src/gui/wxMainFrame.cpp b/src/gui/wxMainFrame.cpp
index 89b4348b..0c34b2d6 100644
--- a/src/gui/wxMainFrame.cpp
+++ b/src/gui/wxMainFrame.cpp
@@ -171,7 +171,7 @@ public:
// useful ones
#if 0
wxLogStatus(m_frame, _("Selected folder '%s'."),
- newsel->GetFullName().c_str());
+ newsel->GetFullName());
#endif // 0
m_frame->UpdateFolderMenuUI(newsel);
@@ -771,7 +771,7 @@ wxMainFrame::OpenFolder(MFolder *pFolder, bool readonly)
if ( m_folderName == folderName )
{
wxLogStatus(this, _("The folder '%s' is already opened."),
- m_folderName.c_str());
+ m_folderName);
return true;
}
@@ -787,7 +787,7 @@ wxMainFrame::OpenFolder(MFolder *pFolder, bool readonly)
{
// don't set the unaccessible flag - may be it's ok
wxLogStatus(this, _("Opening folder '%s' cancelled."),
- m_folderName.c_str());
+ m_folderName);
}
m_folderName.clear();
@@ -1031,7 +1031,7 @@ wxMainFrame::OnCommandEvent(wxCommandEvent &event)
if ( count )
{
wxLogStatus(this, _("Created %u folders under '%s'."),
- count, folder->GetPath().c_str());
+ count, folder->GetPath());
}
folder->DecRef();
@@ -1063,12 +1063,12 @@ wxMainFrame::OnCommandEvent(wxCommandEvent &event)
{
wxLogError(_("Failed to update the status of "
"the folder '%s'."),
- folder->GetFullName().c_str());
+ folder->GetFullName());
}
else
{
wxLogStatus(this, _("Updated status of the folder '%s'"),
- folder->GetFullName().c_str());
+ folder->GetFullName());
}
}
}
@@ -1388,7 +1388,7 @@ void wxMainFrame::DoFolderSearch()
{
wxLogError(_("Can't search for messages in a "
"non existent folder '%s'."),
- name.c_str());
+ name);
continue;
}
@@ -1399,7 +1399,7 @@ void wxMainFrame::DoFolderSearch()
{
wxLogError(_("Can't search for messages in the "
"folder '%s'."),
- name.c_str());
+ name);
continue;
}
@@ -1613,7 +1613,7 @@ public:
(
_("Checking status of the folder \"%s\" failed, do you\n"
"want to continue updating the other folders?"),
- folderName.c_str()
+ folderName
),
m_winParent,
MDIALOG_YESNOTITLE,
diff --git a/src/gui/wxMenuDefs.cpp b/src/gui/wxMenuDefs.cpp
index 61966fed..f9bbdce0 100644
--- a/src/gui/wxMenuDefs.cpp
+++ b/src/gui/wxMenuDefs.cpp
@@ -671,13 +671,13 @@ void AppendToMenu(wxMenu *menu, int nFirst, int nLast)
const wxChar *p = wxStrchr(label, _T('&'));
if ( p == NULL ) {
wxLogWarning(_T("Menu label '%s' doesn't have keyboard accelerator."),
- label.c_str());
+ label);
}
else {
char c = toupper(*++p);
if ( strAccels.Find(c) != -1 ) {
wxLogWarning(_T("Duplicate accelerator %c (in '%s')"),
- c, label.c_str());
+ c, label);
}
strAccels += c;
diff --git a/src/gui/wxMimeDialog.cpp b/src/gui/wxMimeDialog.cpp
index 36e91142..0938be8c 100644
--- a/src/gui/wxMimeDialog.cpp
+++ b/src/gui/wxMimeDialog.cpp
@@ -115,7 +115,7 @@ wxMimeOpenWithDialog::wxMimeOpenWithDialog(wxWindow *parent,
"The command may contain the string \"%%s\" which will "
"be replaced by the file name and if you don't specify it, "
"the file name will be appended at the end."),
- mimetype.c_str()
+ mimetype
);
if ( m_openAsMsg )
{
diff --git a/src/gui/wxMsgCmdProc.cpp b/src/gui/wxMsgCmdProc.cpp
index d1f0992d..1bb986a4 100644
--- a/src/gui/wxMsgCmdProc.cpp
+++ b/src/gui/wxMsgCmdProc.cpp
@@ -770,8 +770,7 @@ MsgCmdProcImpl::ShowUIDL(UIdType uid)
if ( uidString.empty() )
wxLogWarning("This message doesn't have a valid UID.");
else
- wxLogMessage("The UID of this message is '%s'.",
- uidString.c_str());
+ wxLogMessage("The UID of this message is '%s'.", uidString);
}
#endif // EXPERIMENTAL_show_uid
@@ -840,14 +839,14 @@ void MsgCmdProcImpl::RemoveAttachments(UIdType uid)
wxLogError(_("Messages in the folder \"%s\" can't be modified, "
"please copy the message to a local or IMAP folder "
"before removing attachments from it."),
- mf->GetName().c_str());
+ mf->GetName());
return;
}
if ( mf->IsReadOnly() )
{
wxLogError(_("Folder \"%s\" is read-only, please reopen it in "
- "read-write mode."), mf->GetName().c_str());
+ "read-write mode."), mf->GetName());
return;
}
@@ -868,7 +867,7 @@ void MsgCmdProcImpl::RemoveAttachments(UIdType uid)
if ( desc.empty() )
desc = mimepart->GetFilename();
if ( desc.empty() )
- desc.Printf(_("Unnamed %s #%d"), mimetype.GetFull().c_str(), i);
+ desc.Printf(_("Unnamed %s #%d"), mimetype.GetFull(), i);
desc << " ("
<< SizeInBytesToString(mimepart->GetSize(), SizeToString_Medium)
@@ -1020,15 +1019,15 @@ void MsgCmdProcImpl::CheckIfSpam(const UIdArray& uids)
if ( SpamFilter::CheckIfSpam(*msg, wxEmptyString, &result) )
{
wxLogWarning(str + _("seems to be a spam (%s)."),
- msg->Subject().c_str(),
- msg->From().c_str(),
- result.c_str());
+ msg->Subject(),
+ msg->From(),
+ result);
}
else // !spam
{
wxLogMessage(str + _("doesn't seem to be a spam."),
- msg->Subject().c_str(),
- msg->From().c_str());
+ msg->Subject(),
+ msg->From());
}
}
@@ -1372,7 +1371,7 @@ MsgCmdProcImpl::SaveMessagesToFolder(const UIdArray& selections,
new AsyncStatusHandler(this, wxString::Format
(
_("Saving %lu message(s) to '%s'..."),
- count, folder->GetFullName().c_str()
+ count, folder->GetFullName()
));
Ticket t = m_asmf->
@@ -1381,7 +1380,7 @@ MsgCmdProcImpl::SaveMessagesToFolder(const UIdArray& selections,
status->Monitor(t, wxString::Format
(
_("Failed to save messages to the folder '%s'."),
- folder->GetFullName().c_str()
+ folder->GetFullName()
));
folder->DecRef();
@@ -1501,7 +1500,7 @@ MsgCmdProcImpl::DropMessagesToFolder(const UIdArray& selections,
{
wxLogTrace(M_TRACE_DND, _T("Saving %lu message(s) to folder '%s'"),
(unsigned long)selections.GetCount(),
- folder->GetFullName().c_str());
+ folder->GetFullName());
Ticket t = SaveMessagesToFolder(selections, folder);
diff --git a/src/gui/wxOptionsDlg.cpp b/src/gui/wxOptionsDlg.cpp
index cf48ecc1..1eff6af7 100644
--- a/src/gui/wxOptionsDlg.cpp
+++ b/src/gui/wxOptionsDlg.cpp
@@ -834,7 +834,7 @@ public:
CreatePagesDesc();
SetPagesDesc(m_nPages, m_aPages);
- SetTitle(wxString::Format(_("Settings for identity '%s'"), m_identity.c_str()));
+ SetTitle(wxString::Format(_("Settings for identity '%s'"), m_identity));
CreateAllControls();
Layout();
@@ -3383,7 +3383,7 @@ bool wxOptionsPage::OnListBoxAdd(wxListBox *lbox, const LboxData& lboxData)
if ( lbox->FindString(str) != -1 ) {
// it is, don't add it twice
wxLogError(_("String '%s' is already present in the list, not added."),
- str.c_str());
+ str);
return FALSE;
}
@@ -4467,10 +4467,10 @@ bool wxOptionsPageSync::DoTransferOptionsFromWindow()
{
if ( usingConfigFile )
wxLogError(_("Failed to export settings to the file \"%s\"."),
- filenameConfig.c_str());
+ filenameConfig);
else
wxLogError(_("Failed to import settings from the file \"%s\"."),
- filenameConfig.c_str());
+ filenameConfig);
}
}
}
@@ -4513,12 +4513,12 @@ void wxOptionsPageSync::OnButton(wxCommandEvent& event)
if ( save )
{
wxLogError(_("Failed to save remote configuration to '%s'"),
- foldername.c_str());
+ foldername);
}
else // restoring
{
wxLogError(_("Failed to retrieve remote configuration from '%s'"),
- foldername.c_str());
+ foldername);
}
}
else // ok
@@ -4526,12 +4526,12 @@ void wxOptionsPageSync::OnButton(wxCommandEvent& event)
if ( save )
{
wxLogMessage(_("Successfully saved remote configuration to '%s'."),
- foldername.c_str());
+ foldername);
}
else // restoring
{
wxLogMessage(_("Successfully restored remote configuration from '%s'."),
- foldername.c_str());
+ foldername);
}
}
@@ -5304,7 +5304,7 @@ bool wxConfigSourcesDialog::TransferDataFromWindow()
if ( names.Index(s) != wxNOT_FOUND )
{
- wxLogError(_("Name \"%s\" is not unique."), s.c_str());
+ wxLogError(_("Name \"%s\" is not unique."), s);
return false;
}
diff --git a/src/gui/wxRenameDialog.cpp b/src/gui/wxRenameDialog.cpp
index b5b5750b..3d49019b 100644
--- a/src/gui/wxRenameDialog.cpp
+++ b/src/gui/wxRenameDialog.cpp
@@ -42,9 +42,7 @@
static String GetRenameDialogTitle(const MFolder *folder)
{
- wxString title;
- title.Printf(_("Rename folder '%s'"), folder->GetFullName().c_str());
- return title;
+ return wxString::Format(_("Rename folder '%s'"), folder->GetFullName());
}
// ----------------------------------------------------------------------------
diff --git a/src/gui/wxSubfoldersDialog.cpp b/src/gui/wxSubfoldersDialog.cpp
index 0142b64b..383dfea6 100644
--- a/src/gui/wxSubfoldersDialog.cpp
+++ b/src/gui/wxSubfoldersDialog.cpp
@@ -555,7 +555,7 @@ wxSubfoldersTree::OnListFolder(const String& path, wxChar delim, long attr)
wxString name;
if ( !StringStartsWith(path, m_reference, Case_Ignore, &name) )
{
- wxLogDebug(_T("Folder specification '%s' unexpected."), path.c_str());
+ wxLogDebug(_T("Folder specification '%s' unexpected."), path);
return;
}
@@ -963,7 +963,7 @@ void wxSubscriptionDialog::OnTreeExpanded(wxTreeEvent& event)
wxTreeItemId id = event.GetItem();
size_t nFolders = m_treectrl->GetChildrenCount(id);
m_box->SetLabel(wxString::Format(_("%u subfolders under %s"),
- nFolders, m_treectrl->GetItemText(id).c_str()));
+ nFolders, m_treectrl->GetItemText(id)));
event.Skip();
}
@@ -1087,8 +1087,7 @@ bool wxSubscriptionDialog::TransferDataFromWindow()
folderNew = parent->CreateSubfolder(name, m_folderType, false);
if ( !folderNew )
{
- wxLogError(_("Failed to create folder '%s'."),
- (fullpath + name).c_str());
+ wxLogError(_("Failed to create folder '%s'."), fullpath + name);
// can't create children if parent creation failed...
break;
@@ -1247,7 +1246,7 @@ ListFolderEventReceiver::OnListFolder(const String& path,
if ( name.empty() )
{
- wxLogDebug(_T("Folder specification '%s' unexpected."), path.c_str());
+ wxLogDebug(_T("Folder specification '%s' unexpected."), path);
return;
}
@@ -1315,7 +1314,7 @@ ListFolderEventReceiver::OnListFolder(const String& path,
}
else
{
- wxLogError(_("Failed to create the folder '%s'"), name.c_str());
+ wxLogError(_("Failed to create the folder '%s'"), name);
}
}
@@ -1330,8 +1329,7 @@ bool ShowFolderSubfoldersDialog(MFolder *folder, wxWindow *parent)
if ( !CanHaveSubfolders(folder->GetType(), folder->GetFlags()) )
{
// how did we get here at all?
- wxLogMessage(_("The folder '%s' has no subfolders."),
- folder->GetPath().c_str());
+ wxLogMessage(_("The folder '%s' has no subfolders."), folder->GetPath());
return FALSE;
}
@@ -1353,7 +1351,7 @@ bool ShowFolderSubfoldersDialog(MFolder *folder, wxWindow *parent)
wxLogError(_("Impossible to browse subfolders of folder '%s' because "
"the folder cannot be opened."),
- folderPath.c_str());
+ folderPath);
}
//else: the user didn't want to open the folder (for example because it
// requires going online and he didn't want it)
@@ -1367,7 +1365,7 @@ bool ShowFolderSubfoldersDialog(MFolder *folder, wxWindow *parent)
"to the folder tree (or select the individual folders\n"
"manually)?"),
parent,
- wxString::Format(_("Subfolders of '%s'"), folder->GetPath().c_str()),
+ wxString::Format(_("Subfolders of '%s'"), folder->GetPath()),
M_DLG_YES_DEFAULT,
M_MSGBOX_ADD_ALL_SUBFOLDERS
)
diff --git a/src/gui/wxTemplateDialog.cpp b/src/gui/wxTemplateDialog.cpp
index 9e2531be..662c2895 100644
--- a/src/gui/wxTemplateDialog.cpp
+++ b/src/gui/wxTemplateDialog.cpp
@@ -699,7 +699,7 @@ void wxTemplatesDialogBase::CheckForChanges()
String msg;
msg.Printf(_("You have modified the template '%s', "
"would you like to save it?"),
- m_name.c_str());
+ m_name);
if ( MDialog_YesNoDialog(msg, this,
MDIALOG_YESNOTITLE,
M_DLG_YES_DEFAULT,
@@ -829,7 +829,7 @@ wxChooseTemplateDialog::GetTemplateTitle(MessageTemplateKind kind) const
FAIL_MSG(_T("unknown template kind"));
}
- title.Printf(_("Please choose template for %s"), what.c_str());
+ title.Printf(_("Please choose template for %s"), what);
return title;
}
@@ -995,7 +995,7 @@ wxString wxAllTemplatesDialog::GetTemplateTitle(MessageTemplateKind kind) const
FAIL_MSG(_T("unknown template kind"));
}
- title.Printf(_("Configure templates for %s"), what.c_str());
+ title.Printf(_("Configure templates for %s"), what);
return title;
}
@@ -1040,8 +1040,7 @@ void wxAllTemplatesDialog::OnDeleteTemplate(wxCommandEvent& /* event */)
wxASSERT_MSG( !!m_name, _T("shouldn't try to delete") );
String msg;
- msg.Printf(_("Do you really want to delete the template '%s'?"),
- m_name.c_str());
+ msg.Printf(_("Do you really want to delete the template '%s'?"), m_name);
if ( MDialog_YesNoDialog(msg, this,
MDIALOG_YESNOTITLE,
M_DLG_NO_DEFAULT,
diff --git a/src/gui/wxTextDialog.cpp b/src/gui/wxTextDialog.cpp
index 42cc7ddc..0f758700 100644
--- a/src/gui/wxTextDialog.cpp
+++ b/src/gui/wxTextDialog.cpp
@@ -309,8 +309,7 @@ void MTextDialog::OnFindDialogNext(wxFindDialogEvent& event)
if ( !m_regexFind.Compile(strFind, flagsRE) )
{
- wxLogError(_("Invalid regular expression \"%s\"."),
- strFind.c_str());
+ wxLogError(_("Invalid regular expression \"%s\"."), strFind);
return;
}
diff --git a/src/gui/wxllist.cpp b/src/gui/wxllist.cpp
index 8e724385..73fd1031 100644
--- a/src/gui/wxllist.cpp
+++ b/src/gui/wxllist.cpp
@@ -382,7 +382,7 @@ wxLayoutObjectText::DebugDump(void) const
wxString str;
str = wxLayoutObject::DebugDump();
wxString str2;
- str2.Printf(" `%s`", m_Text.c_str());
+ str2.Printf(" `%s`", m_Text);
return str+str2;
}
#endif
commit 466ad2c0277a25d730c524e8554d558557f374d1
Author: Vadim Zeitlin <[email protected]>
Date: Wed Aug 23 15:38:22 2023 +0200
Fix wrong encoding conversion code in composer code
Passing "text" to cMB2WC() didn't make sense because this converted the
already Unicode string to multibyte using the current locale encoding,
which could fail and, in any case, seems completely useless.
Just ask the string itself for its multibyte representation in the
desired encoding instead.
This code is still overly complicated and the branches converting to the
part encoding and UTF-8 should be merged, but at least it works now.
diff --git a/src/gui/wxComposeView.cpp b/src/gui/wxComposeView.cpp
index 9c78482b..06b730c3 100644
--- a/src/gui/wxComposeView.cpp
+++ b/src/gui/wxComposeView.cpp
@@ -4818,21 +4818,14 @@ wxComposeView::EncodeText(const wxString& text,
encodingPart != m_encoding )
{
// try converting this part to the message encoding
- wxCSConv convPart(encodingPart);
- wxWCharBuffer wtext(convPart.cMB2WC(text));
-
- bool ok = wtext.length() != 0;
-
- if ( ok )
+ textBuf = text.mb_str(wxCSConv(m_encoding));
+ if ( !textBuf )
{
- wxCSConv convMsg(m_encoding);
- textBuf = wxCharBuffer(convMsg.cWC2MB(wtext));
- ok = textBuf.length() != 0;
- }
+ // Before asking whether to convert to the part encoding, check if it
+ // can be converted.
+ textBuf = text.mb_str(wxCSConv(encodingPart));
- if ( !ok )
- {
- if ( (flags & Interactive) && !m_okToConvertOnSend )
+ if ( textBuf.length() && (flags & Interactive) && !m_okToConvertOnSend )
{
if ( !MDialog_YesNoDialog
(
-----------------------------------------------------------------------
Summary of changes:
.mailmap | 2 +
doc/tech/config.txt | 2 -
include/Moptions.h | 2 -
src/classes/Moptions.cpp | 4 --
src/gui/ClickURL.cpp | 19 ++++-----
src/gui/CreateFolderWizard.cpp | 6 +--
src/gui/MImport.cpp | 5 +--
src/gui/wxAttachDialog.cpp | 2 +-
src/gui/wxColumnsDlg.cpp | 2 +-
src/gui/wxComposeView.cpp | 95 ++++++++++++++++++------------------------
src/gui/wxFiltersDialog.cpp | 14 +++----
src/gui/wxFolderTree.cpp | 56 ++++++++++++-------------
src/gui/wxFolderView.cpp | 28 ++++++-------
src/gui/wxHeadersDialogs.cpp | 8 ++--
src/gui/wxIconManager.cpp | 17 ++++----
src/gui/wxMApp.cpp | 14 +++----
src/gui/wxMDialogs.cpp | 14 +++----
src/gui/wxMFolderDialogs.cpp | 9 ++--
src/gui/wxMFrame.cpp | 14 +++----
src/gui/wxMIMETreeDialog.cpp | 2 +-
src/gui/wxMainFrame.cpp | 18 ++++----
src/gui/wxMenuDefs.cpp | 8 ++--
src/gui/wxMimeDialog.cpp | 2 +-
src/gui/wxMsgCmdProc.cpp | 25 ++++++-----
src/gui/wxOptionsDlg.cpp | 42 +++++--------------
src/gui/wxRenameDialog.cpp | 4 +-
src/gui/wxSubfoldersDialog.cpp | 18 ++++----
src/gui/wxTemplateDialog.cpp | 9 ++--
src/gui/wxTextDialog.cpp | 6 +--
src/gui/wxllist.cpp | 2 +-
src/mail/HeaderInfoImpl.cpp | 44 ++++++++-----------
src/mail/HeaderIterator.cpp | 2 +-
src/mail/MessageCC.cpp | 14 ++++++-
src/mail/SendMessageCC.cpp | 52 +++++++++++++++++++++++
34 files changed, 281 insertions(+), 280 deletions(-)
create mode 100644 .mailmap
hooks/post-receive
--
Mahogany sources repository.
--===============2193924283070179240==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--===============2193924283070179240==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates
--===============2193924283070179240==--