[M-git] Mahogany sources repository. branch master updated. v0.67-927-g14989495
vadz via Mahogany-cvsupdates <[email protected]> Sat, 02 May 2026 21:33:32 +0000
| Newsgroups | gmane.mail.mahogany.cvs |
|---|---|
| Message-ID | <[email protected]> |
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 14989495a71a9e63c8580a4fa0dd516d6292191c (commit)
via a5da612487f1213167b119d170282d03ff43f443 (commit)
via e7c3f33db45c3b1910c943f76ab5d9cdee916085 (commit)
via 3e0bf0ab9919ead59cd1f5d411faedef4be076c6 (commit)
via 0488a5ba7cb25f5f5f611648c807d185d20479dc (commit)
via f4070743be8a2440b6de2d4dedf214f4144eac99 (commit)
from af073d7646cb71eea10eeb649ffb0fa84858fb23 (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 14989495a71a9e63c8580a4fa0dd516d6292191c
Merge: af073d76 a5da6124
Author: Vadim Zeitlin <[email protected]>
Date: Sat May 2 23:32:33 2026 +0200
Merge branch 'c_str-simplify'
Simplify vararg formatting functions calls, notably by removing
unnecessary calls to wxString::c_str().
See #3.
commit a5da612487f1213167b119d170282d03ff43f443
Author: Vadim Zeitlin <[email protected]>
Date: Tue Jul 1 20:35:11 2025 +0200
Get rid of remaining casts to "unsigned long" by using "%zu"
Still no changes, just avoid ugly casts by using the correct formatting
string instead.
diff --git a/src/classes/MModule.cpp b/src/classes/MModule.cpp
index 3c5c3775..4c944fb0 100644
--- a/src/classes/MModule.cpp
+++ b/src/classes/MModule.cpp
@@ -733,8 +733,7 @@ MModule::ListAvailableModules(const String& interfaceName)
}
}
- wxLogTrace(M_TRACE_MODULES, _T("\t%lu modules found."),
- (unsigned long)count);
+ wxLogTrace(M_TRACE_MODULES, _T("\t%zu modules found."), count);
listing->SetCount(count);
diff --git a/src/classes/MObject.cpp b/src/classes/MObject.cpp
index 0aba6aa7..5a734b42 100644
--- a/src/classes/MObject.cpp
+++ b/src/classes/MObject.cpp
@@ -64,7 +64,7 @@ void MObjectRC::CheckLeaks()
size_t nCount = gs_aObjects.Count();
if ( nCount > 0 ) {
- wxLogDebug(_T("MEMORY LEAK: %lu object leaked:"), (unsigned long)nCount);
+ wxLogDebug(_T("MEMORY LEAK: %zu object leaked:"), nCount);
}
for ( size_t n = 0; n < nCount; n++ ) {
@@ -75,7 +75,7 @@ void MObjectRC::CheckLeaks()
String MObjectRC::DebugDump() const
{
- return MObject::DebugDump() + String::Format(_T(" m_nRef = %lu: "), (unsigned long)m_nRef);
+ return MObject::DebugDump() + String::Format(_T(" m_nRef = %zu: "), m_nRef);
}
void MObject::CheckLeaks()
@@ -112,8 +112,7 @@ void MObjectRC::IncRef()
if ( this == gs_traceObject )
{
wxLogTrace(TRACE_REFCOUNT,
- _T("Object %p: IncRef() called, m_nRef = %lu."),
- this, (unsigned long)m_nRef);
+ _T("Object %p: IncRef() called, m_nRef = %zu."), this, m_nRef);
}
}
@@ -127,8 +126,7 @@ bool MObjectRC::DecRef()
if ( this == gs_traceObject )
{
wxLogTrace(TRACE_REFCOUNT,
- _T("Object %p: DecRef() called, m_nRef = %lu."),
- this, (unsigned long)m_nRef);
+ _T("Object %p: DecRef() called, m_nRef = %zu."), this, m_nRef);
}
if ( m_nRef == 0 )
diff --git a/src/classes/MessageView.cpp b/src/classes/MessageView.cpp
index 47f5ee98..81bb8823 100644
--- a/src/classes/MessageView.cpp
+++ b/src/classes/MessageView.cpp
@@ -2140,14 +2140,14 @@ void MessageView::ShowImage(const MimePart *mimepart)
msg.Printf
(
_("An image embedded in this message is bigger "
- "than the currently configured limit of %luKb.\n"
+ "than the currently configured limit of %ldKb.\n"
"\n"
"Would you still like to see it?\n"
"\n"
"You can change this setting in the \"Message "
"View\" page of the preferences dialog to 0 if "
"you want to always show the images inline."),
- (unsigned long)m_ProfileValues.inlineGFX
+ m_ProfileValues.inlineGFX
);
if ( MDialog_YesNoDialog
diff --git a/src/classes/Profile.cpp b/src/classes/Profile.cpp
index 4c305d3d..d598cf26 100644
--- a/src/classes/Profile.cpp
+++ b/src/classes/Profile.cpp
@@ -1098,7 +1098,7 @@ void SaveArray(wxConfigBase *conf,
size_t nCount = astr.Count();
String strkey;
for ( size_t n = 0; n < nCount; n++ ) {
- strkey.Printf(_T("%lu"), (unsigned long)n);
+ strkey.Printf(_T("%zu"), n);
conf->Write(path + strkey, astr[n]);
}
}
@@ -1113,7 +1113,7 @@ void RestoreArray(wxConfigBase *conf, wxArrayString& astr, const String& key)
String strkey, strVal;
for ( size_t n = 0; ; n++ ) {
- strkey.Printf(_T("%lu"), (unsigned long)n);
+ strkey.Printf(_T("%zu"), n);
if ( !conf->HasEntry(path+strkey) )
break;
diff --git a/src/gui/Mdnd.cpp b/src/gui/Mdnd.cpp
index 83f183ff..22352214 100644
--- a/src/gui/Mdnd.cpp
+++ b/src/gui/Mdnd.cpp
@@ -178,8 +178,7 @@ wxDragResult MMessagesDropTarget::OnMsgDrop(wxCoord x, wxCoord y,
msgCmdProc->ProcessCommand(WXMENU_MSG_DROP_TO_FOLDER, messages, folder);
// it's ok even if m_frame is NULL
- const unsigned long count = messages.GetCount();
- wxLogStatus(GetFrame(), _("%lu message(s) dropped."), count);
+ wxLogStatus(GetFrame(), _("%zu message(s) dropped."), messages.GetCount());
m_where->Refresh();
return def;
diff --git a/src/gui/wxFolderView.cpp b/src/gui/wxFolderView.cpp
index 25286053..8e1d0975 100644
--- a/src/gui/wxFolderView.cpp
+++ b/src/gui/wxFolderView.cpp
@@ -2862,7 +2862,7 @@ void wxFolderListCtrl::UpdateStatusBar()
String msg;
if ( m_countSelected )
- msg.Printf(_("%lu messages selected"), (unsigned long)m_countSelected);
+ msg.Printf(_("%zu messages selected"), m_countSelected);
// determine where should this message go
wxFrame *frame = GetFrame(this);
@@ -3527,9 +3527,9 @@ void wxFolderView::MoveToNextSearchMatch(bool forward)
status = String(_T(" (")) + status + String(_T(')'));
}
- wxLogStatus(m_Frame, _("Search result %lu of %lu for \"%s\"%s"),
- (unsigned long)(m_searchData.idx + 1),
- (unsigned long)count,
+ wxLogStatus(m_Frame, _("Search result %zu of %zu for \"%s\"%s"),
+ (m_searchData.idx + 1),
+ count,
m_searchData.str,
status);
}
@@ -5083,8 +5083,8 @@ wxFolderView::OnFolderExpungeEvent(MEventFolderExpungeData& event)
size_t n,
count = event.GetCount();
- wxLogTrace(M_TRACE_FV_UPDATE, _T("wxFolderView::Expunge(%lu items), now %d"),
- (unsigned long)count, m_FolderCtrl->GetItemCount());
+ wxLogTrace(M_TRACE_FV_UPDATE, _T("wxFolderView::Expunge(%zu items), now %d"),
+ count, m_FolderCtrl->GetItemCount());
HeaderInfoList_obj hil(GetFolder()->GetHeaders());
diff --git a/src/gui/wxMApp.cpp b/src/gui/wxMApp.cpp
index 267110af..67ab732b 100644
--- a/src/gui/wxMApp.cpp
+++ b/src/gui/wxMApp.cpp
@@ -1967,9 +1967,7 @@ wxMApp::UpdateOutboxStatus(MailFolder *mf) const
if(nNNTP == 0 && nSMTP == 0)
msg = _("Outbox empty");
else
- msg.Printf(_("Outbox %lu, %lu"),
- (unsigned long) nSMTP,
- (unsigned long) nNNTP);
+ msg.Printf(_("Outbox %lu, %lu"), nSMTP, nNNTP);
wxStatusBar *sbar = m_topLevelFrame->GetStatusBar();
CHECK_RET( sbar, _T("no status bar in the main frame?") );
diff --git a/src/gui/wxMDialogs.cpp b/src/gui/wxMDialogs.cpp
index d69b0133..90d28249 100644
--- a/src/gui/wxMDialogs.cpp
+++ b/src/gui/wxMDialogs.cpp
@@ -2858,8 +2858,7 @@ void MProgressInfo::SetLabel(const wxString& label)
void MProgressInfo::SetValue(size_t numDone)
{
- SetLabel(wxString::Format(_("%lu done"),
- static_cast<unsigned long>(numDone)));
+ SetLabel(wxString::Format(_("%zu done"), numDone));
}
MProgressInfo::~MProgressInfo()
diff --git a/src/gui/wxMIMETreeDialog.cpp b/src/gui/wxMIMETreeDialog.cpp
index 85c119d9..296c52a2 100644
--- a/src/gui/wxMIMETreeDialog.cpp
+++ b/src/gui/wxMIMETreeDialog.cpp
@@ -225,8 +225,7 @@ wxMIMETreeDialog::wxMIMETreeDialog(const MimePart *partRoot,
m_treectrl->Expand(m_treectrl->GetRootItem());
- box->SetLabel(wxString::Format(_("%lu MIME parts"),
- static_cast<unsigned long>(m_countParts)));
+ box->SetLabel(wxString::Format(_("%zu MIME parts"), m_countParts));
SetSizer(sizerTop);
diff --git a/src/gui/wxMainFrame.cpp b/src/gui/wxMainFrame.cpp
index 7f8e1c77..3054ae68 100644
--- a/src/gui/wxMainFrame.cpp
+++ b/src/gui/wxMainFrame.cpp
@@ -512,9 +512,9 @@ public:
{
OpenFolderViewFrame(m_folderVirt, frame);
- wxLogStatus(frame, _("Found %lu messages in %lu folders."),
- (unsigned long)m_nMatchingMessages,
- (unsigned long)m_nMatchingFolders);
+ wxLogStatus(frame, _("Found %zu messages in %zu folders."),
+ m_nMatchingMessages,
+ m_nMatchingFolders);
}
else
diff --git a/src/gui/wxMsgCmdProc.cpp b/src/gui/wxMsgCmdProc.cpp
index 1bb986a4..f283b14a 100644
--- a/src/gui/wxMsgCmdProc.cpp
+++ b/src/gui/wxMsgCmdProc.cpp
@@ -981,9 +981,9 @@ void MsgCmdProcImpl::ReclassifyAsSpam(const UIdArray& uids, bool isSpam)
(
String::Format
(
- _("Do you want to permanently delete the %lu messages "
+ _("Do you want to permanently delete the %zu messages "
"marked as spam now?"),
- (unsigned long)uidsReclassified.size()
+ uidsReclassified.size()
),
GetFrame(),
MDIALOG_YESNOTITLE,
@@ -1099,7 +1099,7 @@ MsgCmdProcImpl::BounceMessages(const UIdArray& messages)
msg->DecRef();
}
- STATUSMESSAGE((_("Bounced %lu messages."), (unsigned long)countOk));
+ STATUSMESSAGE((_("Bounced %zu messages."), countOk));
}
void
@@ -1113,8 +1113,7 @@ MsgCmdProcImpl::ResendMessages(const UIdArray& messages)
(
String::Format
(
- _("Do you want to resend the %lu selected messages?"),
- (unsigned long)count
+ _("Do you want to resend the %zu selected messages?"), count
),
GetFrame(),
MDIALOG_YESNOTITLE,
@@ -1157,7 +1156,7 @@ MsgCmdProcImpl::ResendMessages(const UIdArray& messages)
if ( !sendMsg->SendOrQueue() )
{
- ERRORMESSAGE((_("Failed to resend the message %lu."), (unsigned long)n));
+ ERRORMESSAGE((_("Failed to resend the message %zu."), n));
}
else
{
@@ -1165,7 +1164,7 @@ MsgCmdProcImpl::ResendMessages(const UIdArray& messages)
}
}
- STATUSMESSAGE((_("Resent %lu messages."), (unsigned long)countOk));
+ STATUSMESSAGE((_("Resent %zu messages."), countOk));
}
void
@@ -1253,10 +1252,10 @@ MsgCmdProcImpl::DeleteAndExpungeMessages(const UIdArray& selections)
String::Format
(
_("Do you really want to permanently delete "
- "the %lu selected messages?\n"
+ "the %zu selected messages?\n"
"\n"
"Note that it will be impossible to restore them!"),
- (unsigned long)selections.Count()
+ selections.Count()
),
GetFrame(),
MDIALOG_YESNOTITLE,
@@ -1498,8 +1497,8 @@ void
MsgCmdProcImpl::DropMessagesToFolder(const UIdArray& selections,
MFolder *folder)
{
- wxLogTrace(M_TRACE_DND, _T("Saving %lu message(s) to folder '%s'"),
- (unsigned long)selections.GetCount(),
+ wxLogTrace(M_TRACE_DND, _T("Saving %zu message(s) to folder '%s'"),
+ selections.GetCount(),
folder->GetFullName());
Ticket t = SaveMessagesToFolder(selections, folder);
@@ -1625,12 +1624,12 @@ MsgCmdProcImpl::DragAndDropMessages(const UIdArray& selections)
void
MsgCmdProcImpl::ApplyFilters(const UIdArray& selections)
{
- const unsigned long count = selections.GetCount();
+ const auto count = selections.GetCount();
AsyncStatusHandler *status =
new AsyncStatusHandler(this, wxString::Format
(
- _("Applying filter rules to %lu message(s)..."),
+ _("Applying filter rules to %zu message(s)..."),
count
));
@@ -1639,7 +1638,7 @@ MsgCmdProcImpl::ApplyFilters(const UIdArray& selections)
{
status->SetSuccessMsg(wxString::Format
(
- _("Applied filters to %lu message(s), "
+ _("Applied filters to %zu message(s), "
"see log window for details."),
count
));
@@ -1753,7 +1752,7 @@ MsgCmdProcImpl::OnMEvent(MEventData& ev)
UIdArray *seq = result->GetSequence();
CHECK( seq, false, _T("invalid async event data") );
- unsigned long count = seq->Count();
+ const auto count = seq->Count();
if ( wasDropped )
{
@@ -1765,7 +1764,7 @@ MsgCmdProcImpl::OnMEvent(MEventData& ev)
}
//else: dropped and already marked for deletion, delete below
- msg.Printf(_("Dropped %lu message(s)."), count);
+ msg.Printf(_("Dropped %zu message(s)."), count);
}
//else: not dropped
@@ -1796,7 +1795,7 @@ MsgCmdProcImpl::OnMEvent(MEventData& ev)
if ( !wasDropped )
{
- msg.Printf(_("Moved %lu message(s)."), count);
+ msg.Printf(_("Moved %zu message(s)."), count);
}
//else: message already given above
}
@@ -1804,7 +1803,7 @@ MsgCmdProcImpl::OnMEvent(MEventData& ev)
{
if ( !hadStatusObject )
{
- msg.Printf(_("Copied %lu message(s)."), count);
+ msg.Printf(_("Copied %zu message(s)."), count);
}
//else: message already given
}
diff --git a/src/mail/MailFolderCmn.cpp b/src/mail/MailFolderCmn.cpp
index 0e79e943..b4a9b25e 100644
--- a/src/mail/MailFolderCmn.cpp
+++ b/src/mail/MailFolderCmn.cpp
@@ -355,9 +355,9 @@ void MailFolderKeepAliveTimer::Notify(void)
MfCloseEntry::MfCloseEntry(MailFolderCmn *mf, int secs)
{
wxLogTrace(TRACE_MF_CLOSE,
- _T("Delaying closing of '%s' (%lu refs) for %d seconds."),
+ _T("Delaying closing of '%s' (%zu refs) for %d seconds."),
mf->GetName(),
- (unsigned long)mf->GetNRef(),
+ mf->GetNRef(),
secs == NEVER_EXPIRES ? -1 : secs);
m_mf = mf;
@@ -374,8 +374,8 @@ MfCloseEntry::MfCloseEntry(MailFolderCmn *mf, int secs)
MfCloseEntry::~MfCloseEntry()
{
- wxLogTrace(TRACE_MF_CLOSE, _T("Destroying MfCloseEntry(%s) (%lu refs left)"),
- m_mf->GetName(), (unsigned long)m_mf->GetNRef());
+ wxLogTrace(TRACE_MF_CLOSE, _T("Destroying MfCloseEntry(%s) (%zu refs left)"),
+ m_mf->GetName(), m_mf->GetNRef());
m_mf->RealDecRef();
}
@@ -1884,9 +1884,9 @@ MailFolderCmn::DoProcessNewMail(const MFolder *folder,
bool MailFolderCmn::ProcessNewMail(UIdArray& uidsNew,
const MFolder *folderDst)
{
- wxLogTrace(TRACE_MF_NEWMAIL, "MF(%s)::ProcessNewMail(%lu msgs) for %s",
+ wxLogTrace(TRACE_MF_NEWMAIL, "MF(%s)::ProcessNewMail(%zu msgs) for %s",
GetName(),
- (unsigned long)uidsNew.GetCount(),
+ uidsNew.GetCount(),
folderDst ? folderDst->GetFullName() : wxString("ourselves"));
// use the settings for the folder where the new mail is!
diff --git a/src/mail/MimePartCCBase.cpp b/src/mail/MimePartCCBase.cpp
index 5aff0c7c..4cbf40c9 100644
--- a/src/mail/MimePartCCBase.cpp
+++ b/src/mail/MimePartCCBase.cpp
@@ -105,7 +105,7 @@ MimePartCCBase::Create(BODY *body, MimePartCCBase *parent, size_t nPart)
m_spec << specParent << '.';
}
- m_spec << wxString::Format(_T("%lu"), (unsigned long)nPart);
+ m_spec << wxString::Format(_T("%zu"), nPart);
}
MimePartCCBase::~MimePartCCBase()
diff --git a/src/modules/Filters.cpp b/src/modules/Filters.cpp
index c413b520..f647b080 100644
--- a/src/modules/Filters.cpp
+++ b/src/modules/Filters.cpp
@@ -2947,9 +2947,7 @@ String FilterRuleApply::CreditsCommon()
// don't append "1/1" as it carries no useful information
const size_t count = m_msgs.GetCount();
if ( count != 1 )
- common += String::Format(_T(" %lu/%lu"),
- (unsigned long)m_idx + 1,
- (unsigned long)count);
+ common += String::Format(_T(" %zu/%zu"), m_idx + 1, count);
return common;
}
diff --git a/src/modules/NetscapeImporter.cpp b/src/modules/NetscapeImporter.cpp
index 3b495d2d..136ac2dd 100644
--- a/src/modules/NetscapeImporter.cpp
+++ b/src/modules/NetscapeImporter.cpp
@@ -1083,9 +1083,9 @@ bool MNetscapeImporter::ImportSettingsFromFile(const wxString& filename)
// lines which do not contain a key-value pair will log a message
if ( nEq == wxNOT_FOUND )
{
- wxLogDebug(_T("%s(%lu): missing variable identifier ('%s')."),
+ wxLogDebug(_T("%s(%zu): missing variable identifier ('%s')."),
filename,
- (unsigned long)nLine + 1,
+ nLine + 1,
g_VarIdent);
// skip line
diff --git a/src/modules/PalmOS.cpp b/src/modules/PalmOS.cpp
index 528efceb..095df0ef 100644
--- a/src/modules/PalmOS.cpp
+++ b/src/modules/PalmOS.cpp
@@ -1735,9 +1735,8 @@ PalmOSModule::StoreEMails(void)
if((hi->GetStatus() & MailFolder::MSG_STAT_DELETED) != 0)
{
String tmpstr;
- tmpstr.Printf(_("Skipping deleted message %lu/%lu"),
- (unsigned long)(i+1),
- (unsigned long)(hil->Count()));
+ tmpstr.Printf(_("Skipping deleted message %zu/%zu"),
+ i+1, hil->Count());
StatusMessage(tmpstr);
}
else
@@ -1756,9 +1755,8 @@ PalmOSModule::StoreEMails(void)
msg = mf->GetMessage(hi->GetUId());
ASSERT(msg);
String tmpstr;
- tmpstr.Printf( _("Storing message %lu/%lu: %s"),
- (unsigned long)(i+1),
- (unsigned long)(hil->Count()),
+ tmpstr.Printf( _("Storing message %zu/%zu: %s"),
+ i+1, hil->Count(),
msg->Subject());
StatusMessage(tmpstr);
String content;
@@ -1802,9 +1800,8 @@ PalmOSModule::StoreEMails(void)
if(dlp_WriteRecord(m_PiSocket, m_MailDB, 0, 0, 0, buffer, len, 0) <= 0)
{
String tmpstr;
- tmpstr.Printf( _("Could not store message %lu/%lu: %s"),
- (unsigned long)(i+1),
- (unsigned long)(hil->Count()),
+ tmpstr.Printf( _("Could not store message %zu/%zu: %s"),
+ i+1, hil->Count(),
msg->Subject());
ErrorMessage(tmpstr);
count++;
@@ -1818,9 +1815,9 @@ PalmOSModule::StoreEMails(void)
if(count > 0)
{
String tmpstr;
- tmpstr.Printf(_("Stored %lu/%lu messages on PalmOS device."),
- (unsigned long) count,
- (unsigned long) hil->Count());
+ tmpstr.Printf(_("Stored %zu/%zu messages on PalmOS device."),
+ count,
+ hil->Count());
StatusMessage((tmpstr));
}
SafeDecRef(hil);
diff --git a/src/modules/PineImport.cpp b/src/modules/PineImport.cpp
index 01b994f1..3a5e9dc1 100644
--- a/src/modules/PineImport.cpp
+++ b/src/modules/PineImport.cpp
@@ -258,8 +258,8 @@ void MPineImporter::ImportSetting(const wxString& pinerc,
}
else
{
- wxLogDebug(_T(".pinerc(%lu): non numeric composer-wrap-column value."),
- (unsigned long)line);
+ wxLogDebug(_T(".pinerc(%zu): non numeric composer-wrap-column value."),
+ line);
}
}
else if ( var == _T("editor") )
@@ -284,8 +284,8 @@ void MPineImporter::ImportSetting(const wxString& pinerc,
}
else
{
- wxLogDebug(_T(".pinerc(%lu): non numeric mail-check-interval value."),
- (unsigned long)line);
+ wxLogDebug(_T(".pinerc(%zu): non numeric mail-check-interval value."),
+ line);
}
}
else if ( var == _T("nntp-server") )
diff --git a/src/modules/spam/DspamFilter.cpp b/src/modules/spam/DspamFilter.cpp
index 0dcff8b1..dbe3987d 100644
--- a/src/modules/spam/DspamFilter.cpp
+++ b/src/modules/spam/DspamFilter.cpp
@@ -518,12 +518,7 @@ void DspamFilter::Train(wxWindow *parent)
for ( size_t n = 0; n < count; n++ )
{
- if ( !pd.Update(n + 1, String::Format
- (
- _("Message %lu of %lu"),
- (unsigned long)n,
- (unsigned long)count
- )) )
+ if ( !pd.Update(n + 1, String::Format(_("Message %zu of %zu"), n, count)) )
{
// cancelled by user
break;
@@ -541,7 +536,7 @@ void DspamFilter::Train(wxWindow *parent)
}
}
- wxLogWarning(_("Failed to retrieve message #%lu."));
+ wxLogWarning(_("Failed to retrieve message #%zu."), n);
}
}
diff --git a/src/wx/generic/persctrl.cpp b/src/wx/generic/persctrl.cpp
index 608c247d..e931a068 100644
--- a/src/wx/generic/persctrl.cpp
+++ b/src/wx/generic/persctrl.cpp
@@ -360,7 +360,7 @@ void wxPTextEntry::SaveSettings()
for ( size_t n = 0; n < count; n++ ) {
value = GetString(n);
if ( value != text ) {
- key.Printf(_T("%lu"), (unsigned long)numKey++);
+ key.Printf(_T("%zu"), numKey++);
config->Write(key, value);
}
//else: don't store duplicates
@@ -381,7 +381,7 @@ void wxPTextEntry::RestoreStrings()
// read them all
wxString key, val;
for ( size_t n = 0; ; n++ ) {
- key.Printf(_T("%lu"), (unsigned long)n);
+ key.Printf(_T("%zu"), n);
if ( !config->HasEntry(key) )
break;
val = config->Read(key);
@@ -1244,8 +1244,7 @@ bool wxPTreeCtrl::GetExpandedBranches(const wxTreeItemId& id,
wxArrayString subbranches;
if ( GetExpandedBranches(idChild, subbranches) )
{
- wxString prefix = wxString::Format(_T("%lu,"),
- (unsigned long)nChild);
+ wxString prefix = wxString::Format(_T("%zu,"), nChild);
size_t count = subbranches.GetCount();
for ( size_t n = 0; n < count; n++ )
{
commit e7c3f33db45c3b1910c943f76ab5d9cdee916085
Author: Vadim Zeitlin <[email protected]>
Date: Tue Jul 1 20:23:16 2025 +0200
Get rid of unnecessary c_str() inside wx vararg functions
Pass wxStrings directly to Printf(), Format() and various wxLogXXX()
functions, without calling c_str() on them which is completely
unnecessary, wasteful and can result in data loss when not using UTF-8
locale.
Also remove a couple of casts to "unsigned long" by changing "%lu" in
the same code to "%zu" to take size_t values directly.
No real changes, this is just cleanup.
diff --git a/include/PGPClickInfo.h b/include/PGPClickInfo.h
index d03cef55..042c197a 100644
--- a/include/PGPClickInfo.h
+++ b/include/PGPClickInfo.h
@@ -98,7 +98,7 @@ protected:
{
String s;
if ( !from.empty() )
- s.Printf(_T(" from \"%s\"") , from.c_str());
+ s.Printf(_T(" from \"%s\"") , from);
return s;
}
@@ -115,7 +115,7 @@ public:
PGPInfoGoodSig(MessageView *msgView, const String& from)
: PGPSignatureInfo(msgView,
wxString::Format(_("Good PGP signature%s"),
- GetFromString(from).c_str()),
+ GetFromString(from)),
_T("pgpsig_good"),
*wxGREEN) { }
@@ -129,7 +129,7 @@ public:
PGPInfoExpiredSig(MessageView *msgView, const String& from)
: PGPSignatureInfo(msgView,
wxString::Format(_("Expired PGP signature%s"),
- GetFromString(from).c_str()),
+ GetFromString(from)),
_T("pgpsig_exp"),
wxColour(0, 255, 255)) { }
@@ -143,7 +143,7 @@ public:
PGPInfoUntrustedSig(MessageView *msgView, const String& from)
: PGPSignatureInfo(msgView,
wxString::Format(_("PGP Signature from untrusted key \"%s\""),
- from.c_str()),
+ from),
_T("pgpsig_untrust"),
wxColour(255, 128, 0)) { }
@@ -157,7 +157,7 @@ public:
PGPInfoBadSig(MessageView *msgView, const String& from)
: PGPSignatureInfo(msgView,
wxString::Format(_("Bad PGP signature%s"),
- GetFromString(from).c_str()),
+ GetFromString(from)),
_T("pgpsig_bad"),
*wxRED) { }
@@ -178,7 +178,7 @@ public:
(
_("PGP public key not found%s, click here to "
"try to retrieve it."),
- GetFromString(from).c_str()
+ GetFromString(from)
),
_T("pgpsig_bad"),
wxColour(145, 145, 145)),
diff --git a/include/mail/ServerInfo.h b/include/mail/ServerInfo.h
index 34b72958..5ac27b2c 100644
--- a/include/mail/ServerInfo.h
+++ b/include/mail/ServerInfo.h
@@ -74,7 +74,7 @@ public:
{
wxLogTrace(TRACE_SERVER_CACHE,
_T("Reusing existing server entry for %s(%s)."),
- folder->GetFullName().c_str(), i->m_login.c_str());
+ folder->GetFullName(), i->m_login);
// found
return *i;
@@ -84,7 +84,7 @@ public:
// not found
wxLogTrace(TRACE_SERVER_CACHE,
_T("No server entry for %s found."),
- folder->GetFullName().c_str());
+ folder->GetFullName());
return NULL;
}
@@ -106,7 +106,7 @@ public:
{
wxLogTrace(TRACE_SERVER_CACHE,
_T("Creating new server entry for %s(%s)."),
- folder->GetFullName().c_str(), folder->GetLogin().c_str());
+ folder->GetFullName(), folder->GetLogin());
serverInfo = mf->CreateServerInfo(folder);
@@ -206,7 +206,7 @@ protected:
wxLogTrace(TRACE_SERVER_CACHE,
_T("Created server entry for %s(%s)."),
- folder->GetFullName().c_str(), m_login.c_str());
+ folder->GetFullName(), m_login);
}
// login and password for this server if we need it and if we're allowed to
diff --git a/include/sysutil.h b/include/sysutil.h
index 4247f340..a5a2c050 100644
--- a/include/sysutil.h
+++ b/include/sysutil.h
@@ -84,7 +84,7 @@ public:
{
if ( wxRemove(m_name) != 0 )
{
- wxLogDebug(_T("Stale temp file '%s' left."), m_name.c_str());
+ wxLogDebug(_T("Stale temp file '%s' left."), m_name);
}
}
}
diff --git a/src/Python/InitPython.cpp b/src/Python/InitPython.cpp
index 874a9403..d39809ca 100644
--- a/src/Python/InitPython.cpp
+++ b/src/Python/InitPython.cpp
@@ -57,7 +57,7 @@ bool CheckPyError()
{
if ( PyErr_Occurred() )
{
- ERRORMESSAGE((_T("%s"), PythonGetErrorMessage().c_str()));
+ ERRORMESSAGE((PythonGetErrorMessage()));
return false;
}
@@ -166,7 +166,7 @@ InitPython(void)
if ( !CheckPyError() || !moduleInit )
{
ERRORMESSAGE(("Cannot load Python module \"%s\".",
- startScript.c_str()));
+ startScript));
rc = false;
}
diff --git a/src/Python/PythonHelp.cpp b/src/Python/PythonHelp.cpp
index 9d890375..534d7082 100644
--- a/src/Python/PythonHelp.cpp
+++ b/src/Python/PythonHelp.cpp
@@ -174,7 +174,7 @@ FindPythonFunction(const char *func, PyObject **module, PyObject **function)
if ( !*module )
{
ERRORMESSAGE(( _("Module \"%s\" couldn't be loaded."),
- modname.c_str() ));
+ modname ));
return false;
}
@@ -195,7 +195,7 @@ FindPythonFunction(const char *func, PyObject **module, PyObject **function)
Py_XDECREF(*module);
ERRORMESSAGE(( _("Function \"%s\" not found in module \"%s\"."),
- functionName.c_str(), modname.c_str() ));
+ functionName, modname ));
return false;
}
@@ -236,7 +236,7 @@ PythonFunction(const char *func,
String err = PythonGetErrorMessage();
if ( !err.empty() )
{
- ERRORMESSAGE((_T("%s"), err.c_str()));
+ ERRORMESSAGE((err));
}
}
@@ -290,7 +290,7 @@ PythonStringFunction(const String& func,
default:
ERRORMESSAGE((_("Too many arguments to Python function \"%s\"."),
- func.c_str()));
+ func));
rc = NULL;
}
@@ -314,11 +314,11 @@ PythonStringFunction(const String& func,
String err = PythonGetErrorMessage();
if ( !err.empty() )
{
- ERRORMESSAGE((_T("%s"), err.c_str()));
+ ERRORMESSAGE((err));
}
}
- ERRORMESSAGE((_("Calling Python function \"%s\" failed."), func.c_str()));
+ ERRORMESSAGE((_("Calling Python function \"%s\" failed."), func));
return false;
}
@@ -377,7 +377,7 @@ PythonRunScript(const char *filename)
String err = PythonGetErrorMessage();
if ( !err.empty() )
{
- ERRORMESSAGE((_T("%s"), err.c_str()));
+ ERRORMESSAGE((err));
}
ERRORMESSAGE((_("Execution of the Python script \"%s\" failed."),
diff --git a/src/adb/AdbDialogs.cpp b/src/adb/AdbDialogs.cpp
index 043bc9dc..1edb9a1b 100644
--- a/src/adb/AdbDialogs.cpp
+++ b/src/adb/AdbDialogs.cpp
@@ -579,7 +579,7 @@ bool AdbShowImportDialog(wxWindow *parent, String *nameOfNativeAdb)
wxLogWarning(_("Sorry, impossible to determine the location of "
"the default address book file for the format "
"'%s' - please specify the file manually in the "
- "next dialog."), importerDesc.c_str());
+ "next dialog."), importerDesc);
// make the message appear before the dialog box, otherwise it's
// really confusing - we say that we determine the file location
diff --git a/src/adb/AdbFrame.cpp b/src/adb/AdbFrame.cpp
index 4c453f69..7a4f2dad 100644
--- a/src/adb/AdbFrame.cpp
+++ b/src/adb/AdbFrame.cpp
@@ -1514,7 +1514,7 @@ void wxAdbEditFrame::RestoreSettings1()
else {
wxLogWarning(_("Address book '%s' couldn't be opened:\n"
"this format is not supported."),
- strFile.c_str());
+ strFile);
bAllAdbOk = FALSE;
}
}
@@ -1619,7 +1619,7 @@ bool wxAdbEditFrame::OpenAdb(const wxString& strPath,
{
// check that we don't already have it
if ( IsAdbOpened(strPath) ) {
- wxLogError(_("The address book '%s' is already opened."), strPath.c_str());
+ wxLogError(_("The address book '%s' is already opened."), strPath);
return FALSE;
}
@@ -1710,7 +1710,7 @@ ask_name:
wxASSERT( !m_strLastNewEntry.IsEmpty() ); // don't add empty entries
if ( group->FindChild(m_strLastNewEntry) ) {
wxLogError(_("%s '%s' already exists %s."),
- strWhat.c_str(), m_strLastNewEntry.c_str(), strWhere.c_str());
+ strWhat, m_strLastNewEntry, strWhere);
goto ask_name;
}
@@ -1719,7 +1719,7 @@ ask_name:
m_bLastNewWasGroup != 0);
if ( element == NULL ) {
wxLogError(_("Can't create %s named '%s' %s."),
- strWhat.c_str(), m_strLastNewEntry.c_str(), strWhere.c_str());
+ strWhat, m_strLastNewEntry, strWhere);
goto ask_name;
}
@@ -1730,7 +1730,7 @@ ask_name:
m_treeAdb->SelectItem(element->GetId());
wxLogStatus(this, _("Created new %s '%s' %s."),
- strWhat.c_str(), m_strLastNewEntry.c_str(), strWhere.c_str());
+ strWhat, m_strLastNewEntry, strWhere);
}
void wxAdbEditFrame::DoDeleteNode(bool bAskConfirmation)
@@ -1814,13 +1814,13 @@ void wxAdbEditFrame::DoDeleteNode(bool bAskConfirmation)
// construct the message
wxString msg;
msg.Printf(_("Really delete the %s '%s'?"),
- strWhat.c_str(), strName.c_str());
+ strWhat, strName);
if ( !MDialog_YesNoDialog(msg, this,
_("Address book editor"),
M_DLG_NO_DEFAULT,
msgbox) ) {
wxLogStatus(this, _("Cancelled: '%s' not deleted."),
- m_current->GetName().c_str());
+ m_current->GetName());
return;
}
}
@@ -1858,7 +1858,7 @@ void wxAdbEditFrame::DoDeleteNode(bool bAskConfirmation)
}
strWhat[0u] = (wxChar)toupper(strWhat[0u]);
- wxLogStatus(this, _("%s '%s' deleted."), strWhat.c_str(), strName.c_str());
+ wxLogStatus(this, _("%s '%s' deleted."), strWhat, strName);
}
void wxAdbEditFrame::DoRenameNode()
@@ -1870,13 +1870,13 @@ void wxAdbEditFrame::AdvanceToNextFound()
{
size_t nCount = m_aFindResults.Count();
if ( nCount == 0 )
- wxLogWarning(_("Cannot find any matches for '%s'."), m_strFind.c_str());
+ wxLogWarning(_("Cannot find any matches for '%s'."), m_strFind);
else {
if ( m_nFindIndex == -1 ) {
// called for the first time (for this search)
m_nFindIndex = 0;
wxLogStatus(this, _("Search for '%s' found %d entries."),
- m_strFind.c_str(), nCount);
+ m_strFind, nCount);
}
else if ( (size_t)++m_nFindIndex == nCount ) {
wxLogStatus(this, _("Search wrapped to the beginning."));
@@ -1899,7 +1899,7 @@ void wxAdbEditFrame::DoFind()
m_nFindIndex = -1;
m_strFind = m_textKey->GetValue();
- wxBusyInfo busy(wxString::Format("Searching for \"%s\"...", m_strFind.c_str()),
+ wxBusyInfo busy(wxString::Format("Searching for \"%s\"...", m_strFind),
this);
DoFind(m_strFind, m_root);
@@ -1949,7 +1949,7 @@ void wxAdbEditFrame::DoUndoChanges()
// the IncRef() done by GetData() compensated with DecRef() in SetData()
m_notebook->SetData(GetEntry());
- wxLogStatus(this, _("Changes to '%s' undone"), m_current->GetName().c_str());
+ wxLogStatus(this, _("Changes to '%s' undone"), m_current->GetName());
}
bool wxAdbEditFrame::OnMEvent(MEventData& d)
@@ -2093,9 +2093,9 @@ void wxAdbEditFrame::OnMenuCommand(wxCommandEvent& event)
AdbTreeBook *book = (AdbTreeBook *)m_current;
wxString name = book->GetName();
if ( !book->Flush() )
- wxLogError(_T("Couldn't flush book '%s'!"), name.c_str());
+ wxLogError(_T("Couldn't flush book '%s'!"), name);
else
- wxLogStatus(this, _T("Book '%s' flushed."), name.c_str());
+ wxLogStatus(this, _T("Book '%s' flushed."), name);
}
else {
wxLogError(_T("Select a book to flush"));
@@ -2234,7 +2234,7 @@ bool wxAdbEditFrame::CreateOrOpenAdb(bool bDoCreate)
if ( !book->Flush() ) {
wxLogWarning(_("Address book '%s' was created, but could not "
"be flushed. It might be unaccessible until "
- "the program is restarted."), strAdbName.c_str());
+ "the program is restarted."), strAdbName);
}
book->DecRef();
@@ -2271,7 +2271,7 @@ bool wxAdbEditFrame::ImportAdb()
if ( ok )
{
wxLogStatus(this, _("Address book successfully imported into book '%s'."),
- adbname.c_str());
+ adbname);
}
else
{
@@ -2310,7 +2310,7 @@ void wxAdbEditFrame::ExportVCardEntry()
if ( exporter->Export(*entry, filename) )
{
wxLogStatus(this, _("Successfully exported address book data to the file '%s'."),
- filename.c_str());
+ filename);
}
else
{
@@ -2424,7 +2424,7 @@ void wxAdbEditFrame::DoPaste()
if ( group->FindChild(m_clipboard->GetName()) ) {
wxLogError(_("Cannot paste entry '%s' %s: an entry with\n"
"the same name already exists."),
- m_clipboard->GetName().c_str(), group->GetWhere().c_str());
+ m_clipboard->GetName(), group->GetWhere());
return;
}
@@ -2475,7 +2475,7 @@ void wxAdbEditFrame::OnTreeSelect(wxTreeEvent& event)
}
else {
wxString str;
- str.Printf(_("Editing entry '%s' %s"), m_current->GetName().c_str(), m_current->GetParent()->GetWhere().c_str());
+ str.Printf(_("Editing entry '%s' %s"), m_current->GetName(), m_current->GetParent()->GetWhere());
SetStatusText(str, 1);
}
@@ -2658,15 +2658,15 @@ AdbTreeElement *wxAdbEditFrame::ExpandBranch(const wxString& strEntry)
current = curGroup->FindChild(aComponents[n]);
if ( current == NULL ) {
wxLogError(_("No entry '%s':\n'%s' has no entry/subgroup '%s'."),
- strEntry.c_str(),
- curGroup->GetName().c_str(),
- aComponents[n].c_str());
+ strEntry,
+ curGroup->GetName(),
+ aComponents[n]);
return NULL;
}
}
else { // current item is an entry
wxLogError(_("Entry '%s' cannot have subgroup/entry '%s'!"),
- current->GetName().c_str(), aComponents[n].c_str());
+ current->GetName(), aComponents[n]);
return NULL;
}
@@ -3097,7 +3097,7 @@ wxADBPropertiesDialog::wxADBPropertiesDialog(wxWindow *parent, AdbTreeBook *book
// set label and position
// ----------------------
wxString strTitle;
- strTitle.Printf(_("Properties for '%s'"), book->GetName().c_str());
+ strTitle.Printf(_("Properties for '%s'"), book->GetName());
SetTitle(strTitle);
Centre(wxCENTER_FRAME | wxBOTH);
@@ -3317,7 +3317,7 @@ void wxAdbNotebook::SaveChanges()
m_pAdbEntry->GetField(AdbField_NickName, &str);
if ( m_bDirty ) {
wxLogStatus((wxFrame *)this->GetGrandParent(),
- _("Entry '%s' saved."), str.c_str());
+ _("Entry '%s' saved."), str);
}
}
}
@@ -4080,7 +4080,7 @@ AdbTreeElement *AdbTreeNode::CreateChild(const wxString& name, bool bGroup)
// first check that it doesn't already exist
if ( m_pGroup->Exists(name) ) {
wxLogError(_("%s '%s' already exists in this group."),
- strWhat.c_str(), name.c_str());
+ strWhat, name);
return NULL;
}
diff --git a/src/adb/AdbImport.cpp b/src/adb/AdbImport.cpp
index 50706183..fe99bb10 100644
--- a/src/adb/AdbImport.cpp
+++ b/src/adb/AdbImport.cpp
@@ -89,8 +89,8 @@ static bool AdbImportGroup(AdbImporter *importer, // from
if ( !entryName )
{
- wxLogDebug(_T("Autogenerating nickname for nameless address entry %lu in '%s'"),
- (unsigned long)nEntry, path.c_str());
+ wxLogDebug(_T("Autogenerating nickname for nameless address entry %zu in '%s'"),
+ nEntry, path);
entryName.Printf(_("Nameless entry %d"), ++nAnonIndex);
}
@@ -99,7 +99,7 @@ static bool AdbImportGroup(AdbImporter *importer, // from
if ( !entry )
{
wxLogError(_("Import error: cannot create entry '%s/%s'."),
- path.c_str(), entryName.c_str());
+ path, entryName);
return FALSE;
}
@@ -125,7 +125,7 @@ static bool AdbImportGroup(AdbImporter *importer, // from
if ( !subgroup )
{
wxLogError(_("Import error: cannot create group '%s/%s'."),
- path.c_str(), groupName.c_str());
+ path, groupName);
return FALSE;
}
@@ -178,7 +178,7 @@ AdbImporter *FindImporter(const String& filename, AdbImporter *importer)
wxString msg;
msg.Printf(_("It seems that the file '%s' is not in the format '%s',\n"
"do you still want to try to import it?"),
- filename.c_str(), importer->GetFormatDesc());
+ filename, importer->GetFormatDesc());
if ( !MDialog_YesNoDialog(msg, NULL, _("Address book import"),
M_DLG_NO_DEFAULT,
@@ -209,7 +209,7 @@ bool DoAdbImport(const String& filename,
if ( errMsg )
{
errMsg->Printf(_("couldn't start importing from file '%s'."),
- filename.c_str());
+ filename);
}
}
else
@@ -264,7 +264,7 @@ bool AdbImport(const String& filename,
if ( !adbBook )
{
errMsg.Printf(_("cannot create native address book '%s'."),
- adbname.c_str());
+ adbname);
goto exit;
}
@@ -302,7 +302,7 @@ exit:
wxLogMessage(_("Successfully imported address book from file '%s' "
"(format '%s')"),
- adbname.c_str(),
+ adbname,
importer->GetFormatDesc());
}
else // an error occured
@@ -317,14 +317,14 @@ exit:
// nothing else...
errImport += _T('.');
- wxLogError(errImport, adbname.c_str());
+ wxLogError(errImport, adbname);
}
else
{
// add the detailed error message
errImport += _T(": %s");
- wxLogError(errImport, adbname.c_str(), errMsg.c_str());
+ wxLogError(errImport, adbname, errMsg);
}
}
}
@@ -350,7 +350,7 @@ bool AdbImport(const String& filename,
wxString errImport = _("Import of address book from file '%s' failed");
errImport += _T(": %s");
- wxLogError(errImport, filename.c_str(), _("unsupported format."));
+ wxLogError(errImport, filename, _("unsupported format."));
return false;
}
diff --git a/src/adb/AdbManager.cpp b/src/adb/AdbManager.cpp
index fccbc882..43a2029d 100644
--- a/src/adb/AdbManager.cpp
+++ b/src/adb/AdbManager.cpp
@@ -286,7 +286,7 @@ AdbExpand(wxArrayString& results, const String& what, int how, wxFrame *frame)
{
wxLogStatus(frame,
_("Looking for matches for '%s' in the address books..."),
- what.c_str());
+ what);
}
MBusyCursor bc;
@@ -351,7 +351,7 @@ AdbExpand(wxArrayString& results, const String& what, int how, wxFrame *frame)
if ( frame ) {
wxLogStatus(frame, _("Expanded '%s' using entries from group '%s'"),
- what.c_str(), group->GetDescription().c_str());
+ what, group->GetDescription());
}
}
else {
@@ -365,7 +365,7 @@ AdbExpand(wxArrayString& results, const String& what, int how, wxFrame *frame)
String name;
entry->GetField(AdbField_FullName, &name);
wxLogStatus(frame, _("Expanded '%s' using entry '%s'"),
- what.c_str(), name.c_str());
+ what, name);
}
}
}
@@ -378,7 +378,7 @@ AdbExpand(wxArrayString& results, const String& what, int how, wxFrame *frame)
else {
if ( frame )
{
- wxLogStatus(frame, _("No matches for '%s'."), what.c_str());
+ wxLogStatus(frame, _("No matches for '%s'."), what);
}
}
@@ -475,7 +475,7 @@ AdbExpandSingleAddress(String *address,
// at least cc, bcc and body are also possible but we don't
// handle them now
wxLogDebug("Ignoring unknown mailto: URL parameter %s=\"%s\"",
- param.c_str(), value.c_str());
+ param, value);
}
posParamStart = posParamEnd;
@@ -753,7 +753,7 @@ AdbBook *AdbManager::CreateBook(const String& name,
}
if ( book == NULL ) {
- wxLogError(_("Can't open the address book '%s'."), name.c_str());
+ wxLogError(_("Can't open the address book '%s'."), name);
}
else {
book->IncRef();
diff --git a/src/adb/AdbModule.cpp b/src/adb/AdbModule.cpp
index 6edf0b36..62a98464 100644
--- a/src/adb/AdbModule.cpp
+++ b/src/adb/AdbModule.cpp
@@ -65,7 +65,7 @@ size_t AdbModule::EnumModules(const char *kind,
}
else
{
- wxLogDebug(_T("Failed to load ADB importer '%s'."), info->name.c_str());
+ wxLogDebug(_T("Failed to load ADB importer '%s'."), info->name);
}
info = info->next;
@@ -93,7 +93,7 @@ AdbModule *AdbModule::GetModuleByName(const char *kind, const String& name)
}
else
{
- wxLogDebug(_T("Failed to load ADB importer '%s'."), info->name.c_str());
+ wxLogDebug(_T("Failed to load ADB importer '%s'."), info->name);
}
importer = NULL;
diff --git a/src/adb/Collect.cpp b/src/adb/Collect.cpp
index 21feabb8..298d1f6f 100644
--- a/src/adb/Collect.cpp
+++ b/src/adb/Collect.cpp
@@ -156,7 +156,7 @@ void AutoCollectAddress(const String& email,
{
wxLogError(_("Failed to create the address book '%s' "
"for autocollected e-mail addresses."),
- bookName.c_str());
+ bookName);
// TODO ask the user if he wants to disable autocollect?
return;
@@ -229,8 +229,8 @@ void AutoCollectAddress(const String& email,
String::Format
(
_("Add new e-mail entry '%s' for '%s' to the database?"),
- email.c_str(),
- name.c_str()
+ email,
+ name
),
frame
)
@@ -242,7 +242,7 @@ void AutoCollectAddress(const String& email,
{
wxLogError(_("Couldn't create an entry in the address "
"book '%s' for autocollected address."),
- bookName.c_str());
+ bookName);
// TODO ask the user if he wants to disable autocollect?
}
@@ -274,9 +274,9 @@ void AutoCollectAddress(const String& email,
wxLogStatus(frame,
_("Auto collected e-mail address '%s' "
"(created new entry '%s' in group '%s')."),
- email.c_str(),
- name.c_str(),
- group->GetName().c_str());
+ email,
+ name,
+ group->GetName());
}
}
}
@@ -334,7 +334,7 @@ void AutoCollectAddress(const String& email,
{
wxLogStatus(frame,
_("'%s': the name is missing, address was not "
- "autocollected."), email.c_str());
+ "autocollected."), email);
}
}
}
@@ -393,7 +393,7 @@ int InteractivelyCollectAddresses(const wxArrayString& addresses,
{
wxLogError(_("Failed to create the address book '%s' "
"for autocollected e-mail addresses."),
- bookName.c_str());
+ bookName);
// TODO ask the user for another book name
return -1;
@@ -404,7 +404,7 @@ int InteractivelyCollectAddresses(const wxArrayString& addresses,
{
wxLogError(_("Failed to create group '%s' in the address "
"book '%s'."),
- groupName.c_str(), bookName.c_str());
+ groupName, bookName);
return -1;
}
diff --git a/src/adb/ExportText.cpp b/src/adb/ExportText.cpp
index a2766d9b..89d4ad05 100644
--- a/src/adb/ExportText.cpp
+++ b/src/adb/ExportText.cpp
@@ -268,7 +268,7 @@ bool AdbTextExporter::Export(AdbEntryGroup& group, const String& dest)
if ( DoExportGroup(group, file, dialog.GetDelimiter()) )
{
wxLogMessage(_("Successfully exported address book data to "
- "file '%s'"), filename.c_str());
+ "file '%s'"), filename);
return TRUE;
}
diff --git a/src/adb/ExportVCard.cpp b/src/adb/ExportVCard.cpp
index d0f24599..99de3700 100644
--- a/src/adb/ExportVCard.cpp
+++ b/src/adb/ExportVCard.cpp
@@ -221,7 +221,7 @@ bool AdbVCardExporter::DoExportEntry(const AdbEntry& entry,
// write vCard to the file
if ( !vcard.Write(filename) )
{
- wxLogError(_("Failed to write vCard to the file '%s'."), filename.c_str());
+ wxLogError(_("Failed to write vCard to the file '%s'."), filename);
return FALSE;
}
@@ -238,7 +238,7 @@ bool AdbVCardExporter::DoExportGroup(AdbEntryGroup& group,
if ( !wxMkdir(dirname, 0755) )
{
wxLogError(_("Failed to export address book to '%s'."),
- dirname.c_str());
+ dirname);
return FALSE;
}
@@ -305,7 +305,7 @@ bool AdbVCardExporter::Export(AdbEntryGroup& group, const String& dest)
if ( DoExportGroup(group, dirname) )
{
wxLogMessage(_("Successfully exported address book data to "
- "directory '%s'"), dirname.c_str());
+ "directory '%s'"), dirname);
return TRUE;
}
diff --git a/src/adb/ImportEudora.cpp b/src/adb/ImportEudora.cpp
index 5ce6df8e..83161627 100644
--- a/src/adb/ImportEudora.cpp
+++ b/src/adb/ImportEudora.cpp
@@ -179,7 +179,7 @@ bool AdbEudoraImporter::ParseTagValue(const char **ppc,
else
{
wxLogWarning(_("Unknown tag '%s' in Eudora address book file ignored."),
- tag.c_str());
+ tag);
}
*ppc = pc;
diff --git a/src/adb/ImportMailrc.cpp b/src/adb/ImportMailrc.cpp
index 1d20062d..c0e796f1 100644
--- a/src/adb/ImportMailrc.cpp
+++ b/src/adb/ImportMailrc.cpp
@@ -194,7 +194,7 @@ bool AdbMailrcImporter::ParseMailrcAliasLine(const wxString& line,
if ( addresses->GetCount() == 0 )
{
wxLogWarning(_("Mailrc entry '%s' doesn't have any addresses and "
- "will be ignored."), line.c_str());
+ "will be ignored."), line);
return FALSE;
}
@@ -219,7 +219,7 @@ String AdbMailrcImporter::GetDefaultFilename() const
{
// nice try, but it's not there - so we don't know
wxLogVerbose(_("Didn't find the mailrc address book in the default "
- "location (%s)."), location.c_str());
+ "location (%s)."), location);
location.Empty();
}
diff --git a/src/adb/ImportPine.cpp b/src/adb/ImportPine.cpp
index b7fadf22..d7602d87 100644
--- a/src/adb/ImportPine.cpp
+++ b/src/adb/ImportPine.cpp
@@ -174,7 +174,7 @@ wxString AdbPineImporter::ExtractField(size_t *index,
{
wxLogWarning(_("Unterminated mailing address list at line %d "
"in the PINE address book file '%s'."),
- *index, line->c_str());
+ *index, *line);
}
}
}
@@ -415,7 +415,7 @@ size_t AdbPineImporter::SplitMailingListAddresses(const wxString& addresses,
if ( !addresses || addresses[0u] != '(' || addresses.Last() != ')' )
{
wxLogWarning(_("Invalid format for list of addresses of PINE mailing "
- "list entry: '%s'."), addresses.c_str());
+ "list entry: '%s'."), addresses);
return 0;
}
@@ -452,7 +452,7 @@ size_t AdbPineImporter::SplitMailingListAddresses(const wxString& addresses,
if ( email.Last() != '>' )
{
wxLogWarning(_("No matching '>' in the address '%s'."),
- address.c_str());
+ address);
}
else
{
@@ -642,7 +642,7 @@ String AdbPineImporter::GetDefaultFilename() const
{
// nice try, but it's not there - so we don't know
wxLogVerbose(_("Didn't find the PINE address book in the default "
- "location (%s)."), location.c_str());
+ "location (%s)."), location);
location.Empty();
}
diff --git a/src/adb/ImportXFMail.cpp b/src/adb/ImportXFMail.cpp
index aeeee9e9..4ec8d626 100644
--- a/src/adb/ImportXFMail.cpp
+++ b/src/adb/ImportXFMail.cpp
@@ -93,7 +93,7 @@ String AdbXFMailImporter::GetDefaultFilename() const
{
// nice try, but it's not there - so we don't know
wxLogVerbose(_("Didn't find the XFMail address book in the default "
- "location (%s)."), location.c_str());
+ "location (%s)."), location);
location.Empty();
}
diff --git a/src/adb/ProvBbdb.cpp b/src/adb/ProvBbdb.cpp
index c0e5ba21..c5c0ced5 100644
--- a/src/adb/ProvBbdb.cpp
+++ b/src/adb/ProvBbdb.cpp
@@ -485,7 +485,7 @@ BbdbEntry::ReadListOfVectors(String *string)
if(! ReadToken(')', string))
{
- wxLogWarning(_("Bbdb::ReadListOfVectors expected ')', found '%s'"), string->c_str());
+ wxLogWarning(_("Bbdb::ReadListOfVectors expected ')', found '%s'"), *string);
}
return vlist;
@@ -684,13 +684,13 @@ BbdbEntryGroup::BbdbEntryGroup(BbdbEntryGroup *, const String& strName)
if(! BbdbEntry::ReadHeader(&version, &line))
{
wxLogError(_("BBDB: file has wrong header line: '%s'"),
- line.c_str());
+ line);
MEndBusyCursor();
return;
}
else
{
- LOGMESSAGE((M_LOG_WINONLY, _("BBDB: file format version '%s'"), version.c_str()));
+ LOGMESSAGE((M_LOG_WINONLY, _("BBDB: file format version '%s'"), version));
}
MProgressDialog status_frame
@@ -751,7 +751,7 @@ BbdbEntryGroup::~BbdbEntryGroup()
String str;
str.Printf(_("Save BBDB address book '%s'?\n"
"This might lead to loss of some of the original data."),
- m_strName.c_str());
+ m_strName);
save = MDialog_YesNoDialog(str,NULL,_("BBDB"),
M_DLG_YES_DEFAULT,
M_MSGBOX_BBDB_SAVE_DIALOG);
@@ -888,7 +888,7 @@ BbdbEntryGroup::GetEntry(const String& name)
BbdbEntryList::iterator i;
-// wxLogDebug(_T("BbdbEntryGroup::GetEntry() called with: %s"), name.c_str());
+// wxLogDebug(_T("BbdbEntryGroup::GetEntry() called with: %s"), name);
for(i = m_entries->begin(); i != m_entries->end(); i++)
{
(**i).MOcheck();
@@ -911,7 +911,7 @@ BbdbEntryGroup::Exists(const String& path)
AdbEntryGroup *BbdbEntryGroup::GetGroup(const String& name) const
{
MOcheck();
-// wxLogDebug(_T("BbdbEntryGroup::GetGroup() called with: %s"), name.c_str());
+// wxLogDebug(_T("BbdbEntryGroup::GetGroup() called with: %s"), name);
return NULL;
}
diff --git a/src/adb/ProvDummy.cpp b/src/adb/ProvDummy.cpp
index 84f69573..dbf02039 100644
--- a/src/adb/ProvDummy.cpp
+++ b/src/adb/ProvDummy.cpp
@@ -418,7 +418,7 @@ bool DummyDataProvider::TestBookAccess(const String& name, AdbTests test)
String str;
str.Printf("Return TRUE from DummyDataProvider::TestBookAccess(%d) "
" for '%s'?",
- test, name.c_str());
+ test, name);
return MDialog_YesNoDialog(str);
}
diff --git a/src/adb/ProvFC.cpp b/src/adb/ProvFC.cpp
index c4ad76ec..a567ccc9 100644
--- a/src/adb/ProvFC.cpp
+++ b/src/adb/ProvFC.cpp
@@ -759,7 +759,7 @@ bool FCBook::Flush()
if ( !m_pConfig->Flush() )
{
wxLogError(_("Couldn't create or write address book file '%s'."),
- m_strFile.c_str());
+ m_strFile);
return false;
}
diff --git a/src/adb/ProvLine.cpp b/src/adb/ProvLine.cpp
index 32e238fc..4e301d36 100644
--- a/src/adb/ProvLine.cpp
+++ b/src/adb/ProvLine.cpp
@@ -269,7 +269,7 @@ LineBook::LineBook(const String& file)
return;
FileError:
- wxLogError(_("Cannot open file %s."), m_file.c_str());
+ wxLogError(_("Cannot open file %s."), m_file);
m_bad = true;
}
@@ -395,7 +395,7 @@ bool LineBook::Flush()
return true;
FileError:
- wxLogError(_("Cannot write to file %s."), m_file.c_str());
+ wxLogError(_("Cannot write to file %s."), m_file);
return false;
}
diff --git a/src/classes/CacheFile.cpp b/src/classes/CacheFile.cpp
index d04f1964..78e4d495 100644
--- a/src/classes/CacheFile.cpp
+++ b/src/classes/CacheFile.cpp
@@ -85,7 +85,7 @@ int CacheFile::CheckFormatVersion(const String& header, int *version) const
wxLogWarning(_("Your mail folder status cache file (%s) was "
"created by a newer version of Mahogany but "
"will be overwritten when the program exits "
- "in older format."), GetFileName().c_str());
+ "in older format."), GetFileName());
// don't try to read it
return -1;
@@ -218,7 +218,7 @@ bool CacheFile::Load()
if ( !ok )
{
wxLogWarning(_("Failed to load cache file '%s'."),
- GetFileName().c_str());
+ GetFileName());
}
}
diff --git a/src/classes/ComposeTemplate.cpp b/src/classes/ComposeTemplate.cpp
index d7acbb6f..d26fe962 100644
--- a/src/classes/ComposeTemplate.cpp
+++ b/src/classes/ComposeTemplate.cpp
@@ -1100,7 +1100,7 @@ VarExpander::ExpandFile(const String& name,
if ( !SlurpFile(filename, value) )
{
wxLogError(_("Failed to insert file '%s' into the message."),
- name.c_str());
+ name);
return FALSE;
}
@@ -1155,7 +1155,7 @@ VarExpander::ExpandAttach(const String& name,
if ( !SlurpFile(filename, value) )
{
wxLogError(_("Failed to attach file '%s' to the message."),
- name.c_str());
+ name);
return FALSE;
}
@@ -1213,7 +1213,7 @@ VarExpander::ExpandCommand(const String& name,
if ( !ok )
{
- wxLogSysError(_("Failed to execute the command '%s'"), name.c_str());
+ wxLogSysError(_("Failed to execute the command '%s'"), name);
// make sure the value isn't empty to avoid message about unknown
// variable from the parser
@@ -1233,7 +1233,7 @@ VarExpander::SetHeaderValue(const String& name,
if ( arguments.GetCount() != 1 )
{
wxLogError(_("${header:%s} requires exactly one argument."),
- name.c_str());
+ name);
*value = _T('?');
@@ -1485,7 +1485,7 @@ String VarExpander::GetSignature() const
if ( !hasSign )
{
wxLogError(_("Failed to read signature file \"%s\""),
- path.c_str());
+ path);
}
}
@@ -1506,7 +1506,7 @@ String VarExpander::GetSignature() const
log->Flush();
msg.Printf(_("Signature file '%s' couldn't be opened."),
- strSignFile.c_str());
+ strSignFile);
}
msg += _("\n\nWould you like to choose your signature "
diff --git a/src/classes/ConfigSource.cpp b/src/classes/ConfigSource.cpp
index a7425167..78c56aa1 100644
--- a/src/classes/ConfigSource.cpp
+++ b/src/classes/ConfigSource.cpp
@@ -119,7 +119,7 @@ ConfigSource::Create(const ConfigSource& config, const String& name)
String type;
if ( !config.Read(path, &type) )
{
- wxLogError(_("Invalid config source \"%s\" without type."), name.c_str());
+ wxLogError(_("Invalid config source \"%s\" without type."), name);
return NULL;
}
@@ -129,7 +129,7 @@ ConfigSource::Create(const ConfigSource& config, const String& name)
if ( !factory )
{
wxLogError(_("Unknown type \"%s\" for config source \"%s\"."),
- type.c_str(), name.c_str());
+ type, name);
return NULL;
}
@@ -349,12 +349,12 @@ bool ConfigSourceLocal::InitDefault(const String& filename)
if ( !wxMkdir(localFilePath, 0700) )
{
wxLogError(_("Cannot create the directory for configuration "
- "files '%s'."), localFilePath.c_str());
+ "files '%s'."), localFilePath);
return false;
}
wxLogInfo(_("Created directory '%s' for configuration files."),
- localFilePath.c_str());
+ localFilePath);
// also create an empty config file with the right permissions:
String filename;
@@ -384,7 +384,7 @@ bool ConfigSourceLocal::InitDefault(const String& filename)
"The programs settings might have been changed without "
"your knowledge and the passwords stored in your config\n"
"file (if any) could have been compromised!\n\n"),
- localFilePath.c_str());
+ localFilePath);
if ( chmod(localFilePath.fn_str(), st.st_mode & ~(S_IWGRP | S_IWOTH)) == 0 )
{
@@ -405,7 +405,7 @@ bool ConfigSourceLocal::InitDefault(const String& filename)
{
wxLogSysError(_("Failed to access the directory '%s' containing "
"the configuration files."),
- localFilePath.c_str());
+ localFilePath);
}
localFilePath << DIR_SEPARATOR << _T("config");
@@ -425,7 +425,7 @@ bool ConfigSourceLocal::InitDefault(const String& filename)
"The program settings could have been changed without\n"
"your knowledge, please consider reinstalling the "
"program!"),
- localFilePath.c_str());
+ localFilePath);
}
if ( st.st_mode & (S_IRGRP | S_IROTH) )
@@ -438,7 +438,7 @@ bool ConfigSourceLocal::InitDefault(const String& filename)
_("Configuration file '%s' was readable for other users.\n"
"Passwords may have been compromised, please "
"consider changing them!"),
- localFilePath.c_str()
+ localFilePath
);
}
@@ -810,7 +810,7 @@ ConfigSourceLocalFactory::Create(const ConfigSource& config, const String& name)
if ( !config.Read(name + FileNamePath(), &filename) )
{
wxLogError(_("No filename for local config source \"%s\"."),
- name.c_str());
+ name);
return NULL;
}
diff --git a/src/classes/ConfigSourcesAll.cpp b/src/classes/ConfigSourcesAll.cpp
index e62a97e2..e940c182 100644
--- a/src/classes/ConfigSourcesAll.cpp
+++ b/src/classes/ConfigSourcesAll.cpp
@@ -746,7 +746,7 @@ AllConfigSources::SetSources(const wxArrayString& names,
if ( !factory )
{
wxLogError(_("Unknown configuration source type \"%s\"."),
- type.c_str());
+ type);
}
// restore old config sources
diff --git a/src/classes/FolderMonitor.cpp b/src/classes/FolderMonitor.cpp
index af69ecda..97719208 100644
--- a/src/classes/FolderMonitor.cpp
+++ b/src/classes/FolderMonitor.cpp
@@ -157,7 +157,7 @@ public:
m_timeNext = time(NULL) + (time_t)GetPollInterval();
wxLogTrace(TRACE_MONITOR, _T("Next check for %s scheduled for %s"),
- m_folder->GetFullName().c_str(),
+ m_folder->GetFullName(),
ctime(&m_timeNext));
}
@@ -206,7 +206,7 @@ public:
if ( folder->GetFlags() & MF_FLAGS_MONITOR )
{
wxLogTrace(TRACE_MONITOR, _T("Found folder to monitor: %s"),
- folderName.c_str());
+ folderName);
m_list.push_back(new FolderMonitorFolderEntry(folder));
}
@@ -542,7 +542,7 @@ FolderMonitorImpl::CheckOneFolder(FolderMonitorFolderEntry *i,
if ( !mf )
{
wxLogTrace(TRACE_MONITOR, _T("Skipping not opened folder %s"),
- folder->GetFullName().c_str());
+ folder->GetFullName());
return true;
}
@@ -557,20 +557,20 @@ FolderMonitorImpl::CheckOneFolder(FolderMonitorFolderEntry *i,
"If you believe this message to be wrong, please "
"set the flag allowing to access the folder\n"
"without network in its \"Access\" properties page."),
- i->GetName().c_str()));
+ i->GetName()));
i->SetState(Folder_TempUnavailable);
}
#endif // USE_DIALUP
wxLogTrace(TRACE_MONITOR, _T("Checking for new mail in '%s'."),
- i->GetName().c_str());
+ i->GetName());
if ( progInfo )
{
// show to the user that we're doing something
progInfo->SetLabel(String::Format(_("Checking folder %s..."),
- folder->GetFullName().c_str()));
+ folder->GetFullName()));
}
// don't show the dialogs in non-interactive mode
@@ -582,7 +582,7 @@ FolderMonitorImpl::CheckOneFolder(FolderMonitorFolderEntry *i,
wxString msg;
msg.Printf(_("Checking for new mail in the folder '%s' failed.\n"
"Do you want to stop checking it during this session?"),
- i->GetName().c_str());
+ i->GetName());
if ( MDialog_YesNoDialog
(
diff --git a/src/classes/MApplication.cpp b/src/classes/MApplication.cpp
index b9121f63..24db496d 100644
--- a/src/classes/MApplication.cpp
+++ b/src/classes/MApplication.cpp
@@ -282,7 +282,7 @@ MAppBase::ContinueStartup()
else // invalid folder name
{
wxLogWarning(_("Failed to open folder '%s' in the main window."),
- foldername.c_str());
+ foldername);
}
}
@@ -328,7 +328,7 @@ MAppBase::ContinueStartup()
else
{
wxLogWarning(_("Failed to reopen folder '%s', it doesn't seem "
- "to exist any more."), name.c_str());
+ "to exist any more."), name);
ok = false;
}
@@ -387,7 +387,7 @@ MAppBase::OnStartup()
if ( !ConfigSource::Copy(*configDst, *configSrc) )
{
wxLogError(_("Failed to import Mahogany settings from \"%s\"."),
- m_cmdLineOptions->configImport.c_str());
+ m_cmdLineOptions->configImport);
// continue nevertheless
}
@@ -397,7 +397,7 @@ MAppBase::OnStartup()
// anything at all (this shouldn't be annoying as import is not
// supposed to be used often)
wxLogMessage(_("Successfully imported Mahogany settings from \"%s\"."),
- m_cmdLineOptions->configImport.c_str());
+ m_cmdLineOptions->configImport);
}
}
@@ -811,7 +811,7 @@ MAppBase::CanClose() const
(
_("Would you like to purge all messages from "
"the trash mailbox (%s)?"),
- trashName.c_str()
+ trashName
),
NULL,
_("Empty trash?"),
@@ -1136,14 +1136,14 @@ bool MAppBase::CheckOutbox(UIdType *nSMTP, UIdType *nNNTP, MailFolder *mfi) cons
if(mf == NULL)
{
String msg;
- msg.Printf(_("Cannot open outbox '%s'"), outbox.c_str());
+ msg.Printf(_("Cannot open outbox '%s'"), outbox);
ERRORMESSAGE((msg));
return FALSE;
}
}
else
{
- ERRORMESSAGE((_("Outbox folder '%s' doesn't exist"), outbox.c_str()));
+ ERRORMESSAGE((_("Outbox folder '%s' doesn't exist"), outbox));
return FALSE;
}
}
@@ -1193,7 +1193,7 @@ MAppBase::SendOutbox(const String & outbox, bool
MFolder_obj folderOutbox(outbox);
if ( !folderOutbox )
{
- ERRORMESSAGE((_("Outbox folder '%s' doesn't exist"), outbox.c_str()));
+ ERRORMESSAGE((_("Outbox folder '%s' doesn't exist"), outbox));
return;
}
@@ -1201,7 +1201,7 @@ MAppBase::SendOutbox(const String & outbox, bool
if(! mf)
{
String msg;
- msg.Printf(_("Cannot open outbox '%s'"), outbox.c_str());
+ msg.Printf(_("Cannot open outbox '%s'"), outbox);
ERRORMESSAGE((msg));
return;
}
@@ -1256,8 +1256,8 @@ MAppBase::SendOutbox(const String & outbox, bool
const HeaderInfo *hi = hil[i];
if ( !hi )
{
- ERRORMESSAGE(( _("Failed to access message #%lu in the outbox."),
- (unsigned long)nbOfMsgTried ));
+ ERRORMESSAGE(( _("Failed to access message #%zu in the outbox."),
+ nbOfMsgTried ));
++i;
continue;
@@ -1266,18 +1266,18 @@ MAppBase::SendOutbox(const String & outbox, bool
Message_obj msg(mf->GetMessage(hi->GetUId()));
if ( !msg )
{
- ERRORMESSAGE(( _("Failed to recreate message #%lu from the outbox."),
- (unsigned long)nbOfMsgTried ));
+ ERRORMESSAGE(( _("Failed to recreate message #%zu from the outbox."),
+ nbOfMsgTried ));
++i;
continue;
}
const String subject = msg->Subject();
- STATUSMESSAGE(( _("Sending message %lu/%lu: %s"),
- (unsigned long)nbOfMsgTried,
- (unsigned long)totalNb,
- subject.c_str()));
+ STATUSMESSAGE(( _("Sending message %zu/%zu: %s"),
+ nbOfMsgTried,
+ totalNb,
+ subject));
wxYield();
SendMessage_obj
sendMsg(SendMessage::CreateFromMsg(mf->GetProfile(), msg.Get()));
@@ -1289,7 +1289,7 @@ MAppBase::SendOutbox(const String & outbox, bool
}
else
{
- ERRORMESSAGE((_("Cannot send message '%s'."), subject.c_str()));
+ ERRORMESSAGE((_("Cannot send message '%s'."), subject));
++i;
}
@@ -1299,8 +1299,8 @@ MAppBase::SendOutbox(const String & outbox, bool
if(count > 0)
{
String msg;
- msg.Printf(_("Sent %lu messages from outbox \"%s\"."),
- (unsigned long) count, mf->GetName().c_str());
+ msg.Printf(_("Sent %zu messages from outbox \"%s\"."),
+ count, mf->GetName());
STATUSMESSAGE((msg));
}
}
diff --git a/src/classes/MFilter.cpp b/src/classes/MFilter.cpp
index 8887d9f9..41c0e74f 100644
--- a/src/classes/MFilter.cpp
+++ b/src/classes/MFilter.cpp
@@ -154,7 +154,7 @@ MFDialogComponent::WriteSettings(void)
(int) m_Logical,
(int) m_Inverted,
(int) m_Test,
- strutil_escapeString(m_Argument).c_str(),
+ strutil_escapeString(m_Argument),
(int) m_Target);
if ( m_Target == ORC_W_Header )
s << " \"" << strutil_escapeString(m_TargetArgument) << '"';
@@ -779,7 +779,7 @@ MFDialogSettingsImpl::WriteActionSettings(void) const
{
return String::Format(_T("%d \"%s\""),
(int) m_Action,
- strutil_escapeString(m_ActionArgument).c_str());
+ strutil_escapeString(m_ActionArgument));
}
String
@@ -1165,7 +1165,7 @@ GetFilterForFolder(const MFolder *folder)
if ( !filterRule )
{
wxLogError(_("Error parsing filter '%s' for folder '%s'"),
- filterString.c_str(), folder->GetFullName().c_str());
+ filterString, folder->GetFullName());
}
// cache the newly created rule and make sure it doesn't go away
diff --git a/src/classes/MFolder.cpp b/src/classes/MFolder.cpp
index af3ae081..2810c482 100644
--- a/src/classes/MFolder.cpp
+++ b/src/classes/MFolder.cpp
@@ -562,7 +562,7 @@ MFolder::Create(const String& fullname, MFolderType type, bool tryCreateLater)
if ( folder )
{
wxLogError(_("Cannot create a folder '%s' which already exists."),
- fullname.c_str());
+ fullname);
folder->DecRef();
@@ -1027,7 +1027,7 @@ MFolder *MFolderFromProfile::CreateSubfolder(const String& name,
if ( folder )
{
wxLogError(_("Cannot create subfolder '%s': folder with this name "
- "already exists."), name.c_str());
+ "already exists."), name);
folder->DecRef();
@@ -1108,7 +1108,7 @@ bool MFolderFromProfile::Rename(const String& newName)
{
wxLogError(_("Cannot rename folder '%s' to '%s': the folder with "
"the new name already exists."),
- m_folderName.c_str(), newName.c_str());
+ m_folderName, newName);
return false;
}
@@ -1120,7 +1120,7 @@ bool MFolderFromProfile::Rename(const String& newName)
{
wxLogError(_("Cannot rename folder '%s' to '%s': the folder with "
"the new name already exists."),
- m_folderName.c_str(), newName.c_str());
+ m_folderName, newName);
return false;
}
@@ -1185,7 +1185,7 @@ bool MFolderFromProfile::Move(MFolder *newParent)
if ( !newSubfolder )
{
wxLogError(_("Could not create subfolder '%s' in '%s'."),
- name.c_str(), path.c_str());
+ name, path);
return false;
}
@@ -1229,7 +1229,7 @@ bool MFolderFromProfile::Move(MFolder *newParent)
dialogSettings->SetAction(dialogSettings->GetAction(), argument);
filterDesc.Set(dialogSettings);
filter->Set(filterDesc);
- wxLogStatus(_("Filter '%s' has been updated."), filterName.c_str());
+ wxLogStatus(_("Filter '%s' has been updated."), filterName);
}
else
{
@@ -1239,7 +1239,7 @@ bool MFolderFromProfile::Move(MFolder *newParent)
else
{
// XNOTODO: Find out how to update this filter anyway
- wxLogError(_("Filter '%s' is not \"simple\" and has not been updated."), filterName.c_str());
+ wxLogError(_("Filter '%s' is not \"simple\" and has not been updated."), filterName);
}
filter->DecRef();
}
@@ -1413,7 +1413,7 @@ extern MFolder *CreateFolderTreeEntry(MFolder *parent,
{
wxLogError(_("Cannot create a folder '%s'.\n"
"Maybe a folder of this name already exists?"),
- fullname.c_str());
+ fullname);
return NULL;
}
@@ -1502,7 +1502,7 @@ bool CreateMboxSubtreeHelper(MFolder *parent,
}
else
{
- wxLogWarning(_("Failed to create folder '%s'"), fullname.c_str());
+ wxLogWarning(_("Failed to create folder '%s'"), fullname);
}
cont = dir.GetNext(&filename);
@@ -1533,7 +1533,7 @@ bool CreateMboxSubtreeHelper(MFolder *parent,
}
else
{
- wxLogWarning(_("Failed to create folder group '%s'"), dirname.c_str());
+ wxLogWarning(_("Failed to create folder group '%s'"), dirname);
}
cont = dir.GetNext(&dirname);
diff --git a/src/classes/MModule.cpp b/src/classes/MModule.cpp
index 8525ffb5..3c5c3775 100644
--- a/src/classes/MModule.cpp
+++ b/src/classes/MModule.cpp
@@ -269,13 +269,13 @@ MModule *LoadModuleInternal(const String & name, const String &pathname)
if ( !dll )
{
wxLogTrace(M_TRACE_MODULES, _T("Failed to load module '%s' from '%s'."),
- name.c_str(), pathname.c_str());
+ name, pathname);
return NULL;
}
wxLogTrace(M_TRACE_MODULES, _T("Successfully loaded module '%s' from '%s'."),
- name.c_str(), pathname.c_str());
+ name, pathname);
MModule_InitModuleFuncType initFunc =
(MModule_InitModuleFuncType)dll->GetSymbol(MMODULE_INITMODULE_FUNCTION);
@@ -321,7 +321,7 @@ MModule *LoadModuleInternal(const String & name, const String &pathname)
String msg;
msg.Printf(_("Cannot initialise module '%s', error code %d."),
- pathname.c_str(), errorCode);
+ pathname, errorCode);
MDialog_ErrorMessage(msg);
}
@@ -357,7 +357,7 @@ MModule::LoadModule(const String & name)
}
wxLogTrace(M_TRACE_MODULES, _T("Looking for module '%s' in the path '%s'."),
- name.c_str(), path.c_str());
+ name, path);
#endif // DEBUG
const wxString moduleExt = DLL_EXTENSION;
@@ -384,7 +384,7 @@ MModule::GetProvider(const wxString &interfaceName)
if ( !listing )
{
wxLogWarning(_("No modules implementing \"%s\" interface found."),
- interfaceName.c_str());
+ interfaceName);
return NULL;
}
@@ -393,7 +393,7 @@ MModule::GetProvider(const wxString &interfaceName)
wxLogWarning(_("Several modules implement \"%s\" interface, you "
"should probably disable all but one of them using the "
"\"Edit|Modules...\" menu command."),
- interfaceName.c_str());
+ interfaceName);
// still return something
}
@@ -623,7 +623,7 @@ MModule::ListAvailableModules(const String& interfaceName)
wxLogTrace(M_TRACE_MODULES,
_T("Looking for modules of type \"%s\" in the path '%s'."),
- interfaceName.c_str(), path.c_str());
+ interfaceName, path);
#endif // DEBUG
// First, build list of all .dll/.so files in module directories
@@ -679,7 +679,7 @@ MModule::ListAvailableModules(const String& interfaceName)
{
// this is not our module
wxLogWarning(_("Shared library '%s' is not a Mahogany module."),
- filename.c_str());
+ filename);
continue;
}
@@ -729,7 +729,7 @@ MModule::ListAvailableModules(const String& interfaceName)
else // no properties in this module??
{
wxLogWarning(_("Mahogany module '%s' is probably corrupted"),
- filename.c_str());
+ filename);
}
}
diff --git a/src/classes/MObject.cpp b/src/classes/MObject.cpp
index 5655430b..0aba6aa7 100644
--- a/src/classes/MObject.cpp
+++ b/src/classes/MObject.cpp
@@ -68,8 +68,8 @@ void MObjectRC::CheckLeaks()
}
for ( size_t n = 0; n < nCount; n++ ) {
- wxLogDebug(_T("Object %lu: %s"),
- (unsigned long)n, gs_aObjects[n]->DebugDump().c_str());
+ wxLogDebug(_T("Object %zu: %s"),
+ n, gs_aObjects[n]->DebugDump());
}
}
diff --git a/src/classes/MessageTemplate.cpp b/src/classes/MessageTemplate.cpp
index b2dddd87..8062f16d 100644
--- a/src/classes/MessageTemplate.cpp
+++ b/src/classes/MessageTemplate.cpp
@@ -130,7 +130,7 @@ MessageTemplateParser::ExpandTemplate(const wxChar **ppc, String *value) const
return TRUE;
case '\0':
- wxLogWarning(_("Unexpected end of file '%s'."), m_filename.c_str());
+ wxLogWarning(_("Unexpected end of file '%s'."), m_filename);
return FALSE;
default:
@@ -146,7 +146,7 @@ MessageTemplateParser::ExpandTemplate(const wxChar **ppc, String *value) const
"%d in the file '%s'."),
pc - m_pStartOfLine + 1,
m_nLine,
- m_filename.c_str());
+ m_filename);
return FALSE;
}
@@ -196,7 +196,7 @@ MessageTemplateParser::ExpandTemplate(const wxChar **ppc, String *value) const
"%d, position %d in the file '%s'"),
m_nLine,
pc - m_pStartOfLine,
- m_filename.c_str());
+ m_filename);
return FALSE;
}
@@ -259,7 +259,7 @@ MessageTemplateParser::ExpandTemplate(const wxChar **ppc, String *value) const
"%d, position %d in the file '%s'"),
m_nLine,
pc - m_pStartOfLine,
- m_filename.c_str());
+ m_filename);
}
arguments.Add(arg);
@@ -305,7 +305,7 @@ MessageTemplateParser::ExpandTemplate(const wxChar **ppc, String *value) const
"%d, position %d in the file '%s'."),
m_nLine,
pc - m_pStartOfLine,
- m_filename.c_str());
+ m_filename);
return FALSE;
}
@@ -347,7 +347,7 @@ MessageTemplateParser::ExpandTemplate(const wxChar **ppc, String *value) const
*pc,
m_nLine,
pc - m_pStartOfLine,
- m_filename.c_str(),
+ m_filename,
bracketClose);
return FALSE;
@@ -369,10 +369,10 @@ MessageTemplateParser::ExpandTemplate(const wxChar **ppc, String *value) const
{
wxLogWarning(_("Unknown variable '%s' at line %zu, position %zu "
"in the file '%s'."),
- name.c_str(),
+ name,
m_nLine,
pc - m_pStartOfLine - name.length(),
- m_filename.c_str());
+ m_filename);
}
//else: message should have been already given
diff --git a/src/classes/MessageView.cpp b/src/classes/MessageView.cpp
index b9619bbb..47f5ee98 100644
--- a/src/classes/MessageView.cpp
+++ b/src/classes/MessageView.cpp
@@ -809,7 +809,7 @@ MessageView::CreateViewer()
wxLogWarning(_("Failed to load the configured message viewer '%s'.\n"
"\n"
"Reverting to the available message viewer '%s'."),
- name.c_str(), nameAlt.c_str());
+ name, nameAlt);
viewer = LoadViewer(name = nameAlt);
}
@@ -875,7 +875,7 @@ MessageView::InitializeViewFilters()
{
ERRORMESSAGE(( _("Incorrect message view filter priority %d "
"for the filter \"%s\""),
- (int)prio, name.c_str() ));
+ (int)prio, name ));
prio = ViewFilter::Priority_Lowest;
}
@@ -1792,7 +1792,7 @@ MessageView::ShowFace(const wxString& faceString)
if ( faceString.length() > 966 )
{
wxLogDebug("Message \"%s\" Face header is too long, ignored.",
- m_mailMessage->Subject().c_str());
+ m_mailMessage->Subject());
return;
}
@@ -1814,7 +1814,7 @@ MessageView::ShowFace(const wxString& faceString)
if ( !faceData )
{
wxLogDebug("Message \"%s\" Face header is not valid base64, ignored.",
- m_mailMessage->Subject().c_str());
+ m_mailMessage->Subject());
return;
}
@@ -1825,14 +1825,14 @@ MessageView::ShowFace(const wxString& faceString)
if ( !face.LoadFile(is, wxBITMAP_TYPE_PNG) )
{
wxLogDebug("Message \"%s\" Face header is corrupted, ignored.",
- m_mailMessage->Subject().c_str());
+ m_mailMessage->Subject());
return;
}
if ( face.GetWidth() != 48 || face.GetHeight() != 48 )
{
wxLogDebug("Message \"%s\" Face header has non-standard size.",
- m_mailMessage->Subject().c_str());
+ m_mailMessage->Subject());
}
m_viewer->ShowXFace(face);
@@ -2250,7 +2250,7 @@ MessageView::ShowPart(const MimePart *mimepart)
// ignore empty parts but warn user as it might indicate a problem
wxLogStatus(GetParentFrame(),
_("Skipping the empty MIME part #%s."),
- mimepart->GetPartSpec().c_str());
+ mimepart->GetPartSpec());
return;
}
@@ -2279,7 +2279,7 @@ MessageView::ShowPart(const MimePart *mimepart)
}
else
{
- wxLogDebug("Invalid MIME type '%s'!", typeName.c_str());
+ wxLogDebug("Invalid MIME type '%s'!", typeName);
}
}
@@ -3014,7 +3014,7 @@ bool MessageView::ChangeViewerWithoutUpdate(const String& viewerName)
MessageViewer *viewer = LoadViewer(viewerName);
if ( !viewer )
{
- wxLogWarning(_("Viewer \"%s\" couldn't be set."), viewerName.c_str());
+ wxLogWarning(_("Viewer \"%s\" couldn't be set."), viewerName);
return false;
}
@@ -3254,7 +3254,7 @@ void MessageView::MimeOpenAsMessage(const MimePart *mimepart)
{
wxString name;
name.Printf(_("Attached message '%s'"),
- mimepart->GetFilename().c_str());
+ mimepart->GetFilename());
MFolder_obj mfolder(MFolder::CreateTempFile(name, filename));
@@ -3292,13 +3292,13 @@ void MessageView::MimeDoOpen(const String& command, const String& filename)
{
if ( command.empty() )
{
- wxLogWarning(_("No command to open file \"%s\"."), filename.c_str());
+ wxLogWarning(_("No command to open file \"%s\"."), filename);
return;
}
// see HandleProcessTermination() for the explanation of "possibly"
wxString errmsg;
- errmsg.Printf(_("External viewer \"%s\" possibly failed"), command.c_str());
+ errmsg.Printf(_("External viewer \"%s\" possibly failed"), command);
(void)LaunchProcess(command, errmsg, filename);
}
@@ -3380,7 +3380,7 @@ MessageView::MimeHandle(const MimePart *mimepart)
if ( !wxRemoveFile(filename) )
{
wxLogDebug("Warning: stale temp file '%s' will be left.",
- filename.c_str());
+ filename);
}
filename = path + wxFILE_SEP_PATH + name;
@@ -3437,7 +3437,7 @@ MessageView::MimeHandle(const MimePart *mimepart)
String filenamePS = filename.BeforeLast('.') + ".ps";
String command;
command.Printf(READ_CONFIG_TEXT(profile,MP_TIFF2PS),
- filename.c_str(), filenamePS.c_str());
+ filename, filenamePS);
// we ignore the return code, because next viewer will fail
// or succeed depending on this:
//system(command); // this produces a postscript file on success
@@ -3445,7 +3445,7 @@ MessageView::MimeHandle(const MimePart *mimepart)
// We cannot use launch process, as it doesn't wait for the
// program to finish.
//wxString msg;
- //msg.Printf(_("Running '%s' to create Postscript file failed."), command.c_str());
+ //msg.Printf(_("Running '%s' to create Postscript file failed."), command);
//(void)LaunchProcess(command, msg );
wxRemoveFile(filename);
@@ -3528,7 +3528,7 @@ MessageView::MimeOpenWith(const MimePart *mimepart)
if ( !wxRemoveFile(filename) )
{
wxLogDebug("Warning: stale temp file '%s' will be left.",
- filename.c_str());
+ filename);
}
filename = path + wxFILE_SEP_PATH + name;
@@ -3644,7 +3644,7 @@ MessageView::MimeSave(const MimePart *mimepart,const wxChar *ifilename)
if ( strutil_isempty(ifilename) )
{
wxLogStatus(GetParentFrame(), _("Wrote %lu bytes to file '%s'"),
- len, filename.c_str());
+ len, filename);
}
return true;
@@ -3715,7 +3715,7 @@ MessageView::DoMenuCommand(int id)
{
wxLogStatus(GetParentFrame(),
_("'%s' not found"),
- text.c_str());
+ text);
}
}
}
@@ -4030,7 +4030,7 @@ MessageView::RunProcess(const String& command)
{
wxLogStatus(GetParentFrame(),
_("Calling external viewer '%s'"),
- command.c_str());
+ command);
return wxExecute(command, true) == 0;
}
@@ -4052,7 +4052,7 @@ MessageView::LaunchProcess(const String& command,
{
wxLogStatus(GetParentFrame(),
_("Calling external viewer '%s'"),
- command.c_str());
+ command);
// If we pass a (temporary) file as parameter to the command, we want to
// monitor the child process termination to be able to remove the file as
@@ -4069,7 +4069,7 @@ MessageView::LaunchProcess(const String& command,
if ( !errormsg.empty() )
{
- wxLogError("%s.", errormsg.c_str());
+ wxLogError("%s.", errormsg);
}
return false;
@@ -4108,7 +4108,7 @@ MessageView::HandleProcessTermination(int pid, int exitcode)
// so just warn the user about it...
wxLogStatus(GetParentFrame(),
_("%s (non null exit code %d)"),
- info->GetErrorMsg().c_str(),
+ info->GetErrorMsg(),
exitcode);
}
diff --git a/src/classes/Mpers.cpp b/src/classes/Mpers.cpp
index a3823e03..07c0dedf 100644
--- a/src/classes/Mpers.cpp
+++ b/src/classes/Mpers.cpp
@@ -226,7 +226,7 @@ extern String GetPersMsgBoxHelp(const String& name)
if ( !s )
{
- s.Printf(_("unknown (%s)"), name.c_str());
+ s.Printf(_("unknown (%s)"), name);
}
return s;
diff --git a/src/classes/Profile.cpp b/src/classes/Profile.cpp
index 1cd26033..4c305d3d 100644
--- a/src/classes/Profile.cpp
+++ b/src/classes/Profile.cpp
@@ -1074,7 +1074,7 @@ ProfileImpl::DebugDump() const
PCHECK();
return String::Format(_T("%s; name = \"%s\""),
- MObjectRC::DebugDump().c_str(), m_ProfileName.c_str());
+ MObjectRC::DebugDump(), m_ProfileName);
}
#endif // DEBUG
diff --git a/src/classes/XFace.cpp b/src/classes/XFace.cpp
index 1a8c5d2a..ed564d72 100644
--- a/src/classes/XFace.cpp
+++ b/src/classes/XFace.cpp
@@ -180,7 +180,7 @@ XFace::GetXFaceImg(const String& filename,
{
String msg;
msg.Printf(_("Could not load XFace file '%s'."),
- filename.c_str());
+ filename);
}
}
if(success)
diff --git a/src/gui/wxTemplateDialog.cpp b/src/gui/wxTemplateDialog.cpp
index 662c2895..670f2e46 100644
--- a/src/gui/wxTemplateDialog.cpp
+++ b/src/gui/wxTemplateDialog.cpp
@@ -405,7 +405,7 @@ void TemplateEditor::OnMenu(wxCommandEvent& event)
ASSERT_MSG( strutil_extract_formatspec(menuitem->format) == _T("s"),
_T("incorrect format string") );
- value = String::Format(menuitem->format, value.c_str());
+ value = String::Format(menuitem->format, value);
break;
}
diff --git a/src/mail/ASMailFolder.cpp b/src/mail/ASMailFolder.cpp
index 92ee2f19..cbc8d64b 100644
--- a/src/mail/ASMailFolder.cpp
+++ b/src/mail/ASMailFolder.cpp
@@ -1215,7 +1215,7 @@ char ASMailFolder::GetFolderDelimiter() const
String ASMailFolderImpl::DebugDump() const
{
String s1 = MObjectRC::DebugDump(), s2;
- s2.Printf(_T("name '%s'"), GetName().c_str());
+ s2.Printf(_T("name '%s'"), GetName());
return s1 + s2;
}
@@ -1223,7 +1223,7 @@ String ASMailFolderImpl::DebugDump() const
String ASMailFolder::ResultImpl::DebugDump() const
{
String s1 = MObjectRC::DebugDump(), s2;
- s2.Printf(_T("operation id = %d, folder '%s'"), m_Id, m_Mf->GetName().c_str());
+ s2.Printf(_T("operation id = %d, folder '%s'"), m_Id, m_Mf->GetName());
return s1 + s2;
}
diff --git a/src/mail/Address.cpp b/src/mail/Address.cpp
index 04d01f68..8cf033a0 100644
--- a/src/mail/Address.cpp
+++ b/src/mail/Address.cpp
@@ -75,7 +75,7 @@ static const AddressHash& GetAddressHash()
if ( equiv.size() != 2 )
{
wxLogWarning(_("Invalid address equivalence option \"%s\""),
- equivPairs[n].c_str());
+ equivPairs[n]);
continue;
}
diff --git a/src/mail/AddressCC.cpp b/src/mail/AddressCC.cpp
index 577b412c..ce69fca9 100644
--- a/src/mail/AddressCC.cpp
+++ b/src/mail/AddressCC.cpp
@@ -254,7 +254,7 @@ AddressList::Create(const String& address,
if ( !adr || adr->error )
{
- DBGMESSAGE((_T("Invalid RFC822 address '%s'."), address.c_str()));
+ DBGMESSAGE((_T("Invalid RFC822 address '%s'."), address));
}
}
diff --git a/src/mail/HeaderIterator.cpp b/src/mail/HeaderIterator.cpp
index 9bf9ba9f..502590f0 100644
--- a/src/mail/HeaderIterator.cpp
+++ b/src/mail/HeaderIterator.cpp
@@ -88,7 +88,7 @@ bool HeaderIterator::GetNext(String *name, String *value, int flags)
{
// but have seen something -- this is not normal
wxLogDebug(_T("Header line '%s' is malformed; ignored."),
- m_str.c_str());
+ m_str);
}
else // no name neither
{
diff --git a/src/mail/LogCircle.cpp b/src/mail/LogCircle.cpp
index c393733f..8375ed0c 100644
--- a/src/mail/LogCircle.cpp
+++ b/src/mail/LogCircle.cpp
@@ -50,7 +50,7 @@ MLogCircle:: Find(const String needle, String *store) const
if(m_Next > 0)
for(int i = m_Next-1; i >= 0 ; i--)
{
- wxLogTrace(_T("logcircle"), _T("checking msg %d, %s"), i, m_Messages[i].c_str());
+ wxLogTrace(_T("logcircle"), _T("checking msg %d, %s"), i, m_Messages[i]);
if(m_Messages[i].Contains(needle))
{
if(store)
@@ -61,7 +61,7 @@ MLogCircle:: Find(const String needle, String *store) const
// search from m_N-1 down to m_Next:
for(int i = m_N-1; i >= m_Next; i--)
{
- wxLogTrace(_T("logcircle"), _T("checking msg %d, %s"), i, m_Messages[i].c_str());
+ wxLogTrace(_T("logcircle"), _T("checking msg %d, %s"), i, m_Messages[i]);
if(m_Messages[i].Contains(needle))
{
if(store)
diff --git a/src/mail/MFCache.cpp b/src/mail/MFCache.cpp
index 57034ccb..6e9717e6 100644
--- a/src/mail/MFCache.cpp
+++ b/src/mail/MFCache.cpp
@@ -166,7 +166,7 @@ void MfStatusCache::UpdateStatus(const String& folderName,
{
wxLogTrace(M_TRACE_MFSTATUS,
_T("Added status for '%s' (%lu total, %lu unread)"),
- folderName.c_str(), status.total, status.unread);
+ folderName, status.total, status.unread);
// add it
n = m_folderNames.Add(folderName);
@@ -183,7 +183,7 @@ void MfStatusCache::UpdateStatus(const String& folderName,
wxLogTrace(M_TRACE_MFSTATUS,
_T("Changed status for '%s' (%lu total, %lu unread)"),
- folderName.c_str(), status.total, status.unread);
+ folderName, status.total, status.unread);
}
// update
@@ -197,7 +197,7 @@ void MfStatusCache::UpdateStatus(const String& folderName,
void MfStatusCache::InvalidateStatus(const String& folderName)
{
wxLogTrace(M_TRACE_MFSTATUS, _T("Invalidated status for '%s'"),
- folderName.c_str());
+ folderName);
int n = m_folderNames.Index(folderName);
if ( n != wxNOT_FOUND )
@@ -345,7 +345,7 @@ bool MfStatusCache::DoLoad(const wxTextFile& file, int version)
else
{
wxLogDebug(_T("Removing deleted folder '%s' from status cache."),
- name.c_str());
+ name);
}
}
@@ -407,7 +407,7 @@ bool MfStatusCache::DoSave(wxTempFile& file)
_T("%lu") CACHE_DELIMITER
_T("%lu") CACHE_DELIMITER
_T("%lu\n"),
- name.c_str(),
+ name,
status->total,
status->newmsgs,
status->unread,
diff --git a/src/mail/MFPool.cpp b/src/mail/MFPool.cpp
index dc80a340..7f534ed8 100644
--- a/src/mail/MFPool.cpp
+++ b/src/mail/MFPool.cpp
@@ -246,7 +246,7 @@ MFPool::Add(MFDriver *driver,
pool->connections.push_back(new MFConnection(mf, spec, folder));
- wxLogTrace(TRACE_MFPOOL, _T("Added '%s' to the pool."), mf->GetName().c_str());
+ wxLogTrace(TRACE_MFPOOL, _T("Added '%s' to the pool."), mf->GetName());
}
/* static */
@@ -291,7 +291,7 @@ bool MFPool::Remove(MailFolder *mf)
if ( i->mf == mf )
{
wxLogTrace(TRACE_MFPOOL, _T("Removing '%s' from the pool."),
- mf->GetName().c_str());
+ mf->GetName());
pool->connections.erase(i);
diff --git a/src/mail/MailFolder.cpp b/src/mail/MailFolder.cpp
index 5e0f3f3f..fcb6eabd 100644
--- a/src/mail/MailFolder.cpp
+++ b/src/mail/MailFolder.cpp
@@ -180,7 +180,7 @@ static MFDriver *GetFolderDriver(const MFolder *folder)
MFDriver *driver = MFDriver::Get(kind.ToAscii());
if ( !driver )
{
- ERRORMESSAGE((_("Unknown folder kind '%s'"), kind.c_str()));
+ ERRORMESSAGE((_("Unknown folder kind '%s'"), kind));
}
return driver;
@@ -259,7 +259,7 @@ bool MailFolder::CheckNetwork(const MFolder *
msg.Printf(_("To open the folder '%s', network access is required "
"but it is currently not available.\n"
"Would you like to connect to the network now?"),
- folder->GetFullName().c_str());
+ folder->GetFullName());
if ( MDialog_YesNoDialog(msg,
frame,
@@ -498,7 +498,7 @@ ExtractListPostAddress(const String& listPostHeader)
wxStrncmp(p, _T("https:"), 6) != 0 )
{
wxLogDebug(_T("Unknown URL scheme in List-Post (%s)"),
- listPostHeader.c_str());
+ listPostHeader);
}
p = wxStrchr(p, _T('>'));
@@ -571,7 +571,7 @@ ExtractListPostAddress(const String& listPostHeader)
// this is just for me, so that I could check for possible bugs in
// this code
wxLogDebug(_T("Malformed List-Post header '%s'!"),
- listPostHeader.c_str());
+ listPostHeader);
return wxEmptyString;
}
}
@@ -1086,9 +1086,9 @@ MailFolder::ReplyMessage(Message *msg,
{
replyLevel++;
newSubject.Printf(_T("%s[%d]: %s"),
- replyPrefixWithoutColon.c_str(),
+ replyPrefixWithoutColon,
replyLevel,
- subject.c_str());
+ subject);
}
}
@@ -1382,7 +1382,7 @@ MailFolder::ProposeSavePassword(MailFolder *mf,
_("Would you like to permanently remember the password "
"for the folder '%s'?\n"
"(WARNING: don't do it if you are concerned about security)"),
- mf->GetName().c_str()
+ mf->GetName()
),
NULL,
MDIALOG_YESNOTITLE,
diff --git a/src/mail/MailFolderCC.cpp b/src/mail/MailFolderCC.cpp
index 2a883e89..a4304c5f 100644
--- a/src/mail/MailFolderCC.cpp
+++ b/src/mail/MailFolderCC.cpp
@@ -447,7 +447,7 @@ static void CloseOrKeepStream(MAILSTREAM *stream,
else
{
wxLogTrace(TRACE_MF_CALLS, _T("Closing connection to '%s'"),
- folder->GetFullName().c_str());
+ folder->GetFullName());
mail_close(stream);
}
@@ -1174,7 +1174,7 @@ private:
0,
MessageSize_AutoBytes,
SizeToString_Verbose
- ).c_str()
+ )
);
m_dlgProgress = new MProgressDialog
@@ -1293,7 +1293,7 @@ String MailFolder::GetImapSpec(const MFolder *folder, const String& login_)
if ( ssl != SSLSupport_TLSIfAvailable )
{
wxLogWarning(_("Ignoring SSL authentication for folder '%s'"),
- name.c_str());
+ name);
}
// and reset it to nothing in any case
@@ -1426,7 +1426,7 @@ String MailFolder::GetImapSpec(const MFolder *folder, const String& login_)
{
wxLogError(_("Invalid MH folder name '%s' not under the "
"root MH directory '%s'."),
- p, mhRoot.c_str());
+ p, mhRoot);
return wxEmptyString;
}
@@ -1773,7 +1773,7 @@ MailFolderCC::CreateIfNeeded(const MFolder *folder,
// exist
{
wxLogTrace(TRACE_MF_CALLS, _T("Trying to open MailFolderCC '%s' first."),
- imapspec.c_str());
+ imapspec);
CCErrorDisabler noErrs;
stream = MailOpen(NULL, imapspec);
@@ -1793,7 +1793,7 @@ MailFolderCC::CreateIfNeeded(const MFolder *folder,
if ( !stream || stream->halfopen )
{
wxLogTrace(TRACE_MF_CALLS, _T("Creating MailFolderCC '%s'."),
- imapspec.c_str());
+ imapspec);
// stream may be NIL or not here
MailCreate(stream, imapspec);
@@ -1806,7 +1806,7 @@ MailFolderCC::CreateIfNeeded(const MFolder *folder,
// and try to open it again now
wxLogTrace(TRACE_MF_CALLS, _T("Opening MailFolderCC '%s' after creating it."),
- imapspec.c_str());
+ imapspec);
stream = MailOpen(stream, imapspec);
}
@@ -1930,7 +1930,7 @@ void MailFolderCC::CreateFileFolder()
tmp << _T("#driver.") << cclient_drivers[format] << _T('/');
wxLogDebug(_T("Trying to create folder \"%s\" in %s format."),
- m_ImapSpec.c_str(), cclient_drivers[format]);
+ m_ImapSpec, cclient_drivers[format]);
}
else // MF_MH folder
{
@@ -2017,7 +2017,7 @@ MailFolderCC::CheckForFileLock()
"\n"
"Some other process may be using the folder.\n"
"Shall I forcefully override the lock?"),
- lockfile.c_str(), file.c_str()
+ lockfile, file
),
NULL,
MDIALOG_YESNOTITLE,
@@ -2036,7 +2036,7 @@ MailFolderCC::CheckForFileLock()
String::Format
(
_("The file '%s' is not empty, still remove it?"),
- lockfile.c_str()
+ lockfile
),
NULL,
MDIALOG_YESNOTITLE,
@@ -2073,13 +2073,13 @@ bool
MailFolderCC::Open(OpenMode openmode)
{
wxLogTrace(TRACE_MF_CALLS, _T("%s \"'%s'\""),
- GetOperationName(openmode).c_str(), GetName().c_str());
+ GetOperationName(openmode), GetName());
wxFrame *frame = GetInteractiveFrame();
if ( frame )
{
STATUSMESSAGE((frame, _("%s mailbox \"%s\"..."),
- GetOperationName(openmode).c_str(), GetName().c_str()));
+ GetOperationName(openmode), GetName()));
}
// Now, we apply the very latest c-client timeout values, in case they have
@@ -2196,7 +2196,7 @@ MailFolderCC::Open(OpenMode openmode)
}
wxLogTrace(TRACE_MF_CALLS, _T("Opening MailFolderCC '%s'."),
- m_ImapSpec.c_str());
+ m_ImapSpec);
m_MailStream = MailOpen(stream, m_ImapSpec, ccOptions);
}
@@ -2222,7 +2222,7 @@ MailFolderCC::Open(OpenMode openmode)
}
wxLogTrace(TRACE_MF_CALLS, _T("Half opening MailFolderCC '%s'."),
- m_ImapSpec.c_str());
+ m_ImapSpec);
// redirect all notifications to us again
CCDefaultFolder def(this);
@@ -2249,7 +2249,7 @@ MailFolderCC::Open(OpenMode openmode)
// give the general error message anyhow
String err;
- err.Printf(_("Could not open mailbox '%s'."), GetName().c_str());
+ err.Printf(_("Could not open mailbox '%s'."), GetName());
// and then try to give more details about what happened
if ( !explanation.empty() )
@@ -2257,7 +2257,7 @@ MailFolderCC::Open(OpenMode openmode)
err << _T("\n\n") << explanation;
}
- wxLogError(_T("%s"), err.c_str());
+ wxLogError(_T("%s"), err);
return false;
}
@@ -2312,7 +2312,7 @@ MailFolderCC::Open(OpenMode openmode)
if ( !msg.empty() )
{
- STATUSMESSAGE((frame, msg, GetName().c_str()));
+ STATUSMESSAGE((frame, msg, GetName()));
}
}
@@ -2328,7 +2328,7 @@ MailFolderCC::Open(OpenMode openmode)
void
MailFolderCC::Close(bool mayLinger)
{
- wxLogTrace(TRACE_MF_CALLS, _T("Closing folder '%s'"), GetName().c_str());
+ wxLogTrace(TRACE_MF_CALLS, _T("Closing folder '%s'"), GetName());
MailFolderCmn::Close(mayLinger);
@@ -2613,7 +2613,7 @@ MailFolderCC::Checkpoint(void)
if ( NeedsNetwork() && ! mApplication->IsOnline() )
{
ERRORMESSAGE((_("System is offline, cannot access mailbox '%s'"),
- GetName().c_str()));
+ GetName()));
return;
}
#endif // USE_DIALUP
@@ -2622,7 +2622,7 @@ MailFolderCC::Checkpoint(void)
if ( lock )
{
wxLogTrace(TRACE_MF_CALLS, _T("MailFolderCC::Checkpoint() on %s."),
- GetName().c_str());
+ GetName());
mail_check(m_MailStream); // update flags, etc, .newsrc
}
@@ -2665,7 +2665,7 @@ MailFolderCC::Ping(void)
(
_("Dial-Up network is down.\n"
"Do you want to try to check folder '%s' anyway?"),
- GetName().c_str()
+ GetName()
),
NULL,
MDIALOG_YESNOTITLE,
@@ -2703,7 +2703,7 @@ MailFolderCC::PingOpenedFolder()
// caller must check for this
CHECK( m_MailStream, false, _T("PingOpenedFolder() called for closed folder") );
- wxLogTrace(TRACE_MF_CALLS, _T("MailFolderCC::Ping(%s)"), GetName().c_str());
+ wxLogTrace(TRACE_MF_CALLS, _T("MailFolderCC::Ping(%s)"), GetName());
return mail_ping(m_MailStream) != NIL;
}
@@ -2791,7 +2791,7 @@ MailFolderCC::DoCheckStatus(const MFolder *folder, MAILSTATUS *mailstatus)
MMStatusRedirector statusRedir(spec, mailstatus);
wxLogTrace(TRACE_MF_CALLS, _T("MailFolderCC::CheckStatus() on %s."),
- spec.c_str());
+ spec);
mail_status(stream, spec.char_str(), STATUS_FLAGS);
@@ -2849,7 +2849,7 @@ bool MailFolderCC::CheckStatus(const MFolder *folder)
if ( !DoCheckStatus(folder, &mailstatus) )
{
ERRORMESSAGE(( _("Failed to check status of the folder '%s'"),
- folder->GetFullName().c_str() ));
+ folder->GetFullName() ));
return false;
}
@@ -2940,7 +2940,7 @@ bool
MailFolderCC::AppendMessage(const String& msg)
{
wxLogTrace(TRACE_MF_CALLS, _T("MailFolderCC(%s)::AppendMessage(string)"),
- GetName().c_str());
+ GetName());
if ( CheckConnection() )
{
@@ -2959,7 +2959,7 @@ MailFolderCC::AppendMessage(const String& msg)
}
wxLogError(_("Failed to save message to the folder '%s'"),
- GetName().c_str());
+ GetName());
return false;
}
@@ -2973,7 +2973,7 @@ MailFolderCC::AppendMessage(const Message& msg)
// mail_append() here!
wxLogTrace(TRACE_MF_CALLS, _T("MailFolderCC(%s)::AppendMessage(Message)"),
- GetName().c_str());
+ GetName());
String date;
msg.GetHeaderLine(_T("Date"), date);
@@ -3021,10 +3021,10 @@ MailFolderCC::AppendMessage(const Message& msg)
// useful to know which message exactly we failed to copy
wxLogError(_("Message details: subject '%s', from '%s'"),
- msg.Subject().c_str(), msg.From().c_str());
+ msg.Subject(), msg.From());
wxLogError(_("Failed to save message to the folder '%s'"),
- GetName().c_str());
+ GetName());
return false;
}
@@ -3038,7 +3038,7 @@ MailFolderCC::SaveMessages(const UIdArray *selections, MFolder *folder)
CHECK( count, true, _T("SaveMessages(): nothing to save") );
wxLogTrace(TRACE_MF_CALLS, _T("MailFolderCC(%s)::SaveMessages(%s)"),
- GetName().c_str(), folder->GetFullName().c_str());
+ GetName(), folder->GetFullName());
/*
This is an optimisation: if both mailfolders are IMAP and on the same
@@ -3231,7 +3231,7 @@ void
MailFolderCC::ExpungeMessages(void)
{
wxLogTrace(TRACE_MF_CALLS, _T("MailFolderCC(%s)::ExpungeMessages()"),
- GetName().c_str());
+ GetName());
if ( !PY_CALLBACK(MCB_FOLDEREXPUNGE,1,GetProfile()) )
{
@@ -3314,7 +3314,7 @@ bool MailFolderCC::DoCountMessages(MailFolderStatus *status) const
CHECK( m_MailStream, false, _T("DoCountMessages: folder is closed") );
wxLogTrace(TRACE_MF_CALLS, _T("MailFolderCC(%s)::DoCountMessages()"),
- GetName().c_str());
+ GetName());
*status = MailFolderStatus(m_MailStream->nmsgs);
@@ -3677,7 +3677,7 @@ MailFolderCC::SetSequenceFlag(SequenceKind kind,
if ( !CanSetFlag(flag) )
{
ERRORMESSAGE((_("Impossible to set this flag for the folder '%s'."),
- GetName().c_str()));
+ GetName()));
return false;
}
@@ -3687,13 +3687,13 @@ MailFolderCC::SetSequenceFlag(SequenceKind kind,
const String sequence = seq.GetString();
wxLogTrace(TRACE_MF_CALLS, _T("MailFolderCC(%s)::SetFlags(%s) = %s"),
- GetName().c_str(), sequence.c_str(), flags.c_str());
+ GetName(), sequence, flags);
// let a Python callback veto the flag change
#if 0
if(PY_CALLBACKVA((set ? MCB_FOLDERSETMSGFLAG : MCB_FOLDERCLEARMSGFLAG,
1, this, this->GetClassName(),
- GetProfile(), "ss", sequence.c_str(), flags.c_str()),1) )
+ GetProfile(), "ss", sequence, flags),1) )
#endif
{
MBusyCursor busyCursor;
@@ -4032,7 +4032,7 @@ MailFolderCC::SortMessages(MsgnoType *msgnos, const SortParams& sortParams)
if ( pgmSort )
{
wxLogTrace(TRACE_MF_CALLS, _T("MailFolderCC(%s)::SortMessages()"),
- GetName().c_str());
+ GetName());
// if any new messages appear in the folder during sorting, nmsgs is
// going to change but we only have enough place for the current value
@@ -4213,7 +4213,7 @@ bool MailFolderCC::ThreadMessages(const ThreadParams& thrParams,
// do server side threading
wxLogTrace(TRACE_MF_CALLS, _T("MailFolderCC(%s)::ThreadMessages()"),
- GetName().c_str());
+ GetName());
ASSERT_MSG( !thrData->m_root, _T("will leak THREADNODE tree!") );
@@ -4267,7 +4267,7 @@ MsgnoType MailFolderCC::GetHeaderInfo(ArrayHeaderInfo& headers,
String sequence = seq.GetString();
wxLogTrace(TRACE_MF_CALLS, _T("Retrieving headers %s for '%s'..."),
- sequence.c_str(), GetName().c_str());
+ sequence, GetName());
// prepare overviewData to be used by OverviewHeaderEntry()
// --------------------------------------------------------
@@ -4342,7 +4342,7 @@ MsgnoType MailFolderCC::GetHeaderInfo(ArrayHeaderInfo& headers,
if ( !m_MailStream )
{
ERRORMESSAGE((_("Error retrieving the message headers from folder '%s'"),
- GetName().c_str()));
+ GetName()));
}
return overviewData.GetRetrievedCount();
@@ -4482,7 +4482,7 @@ MailFolderCC::HandleMailExists(struct mail_stream *stream, MsgnoType msgnoMax)
{
// this is strange...
wxLogDebug(_T("mm_exists() for not opened folder '%s' ignored."),
- GetName().c_str());
+ GetName());
}
#endif // DEBUG
@@ -4630,7 +4630,7 @@ void MailFolderCC::OnNewMail()
CHECK_RET( !m_MailStream->lock, _T("OnNewMail: folder is locked") );
wxLogTrace(TRACE_MF_EVENTS, _T("Got new mail notification for '%s'"),
- GetName().c_str());
+ GetName());
// the number of unread/marked/... messages may have changed (there
// could be some more of them among the new ones), so forget the
@@ -4690,7 +4690,7 @@ void MailFolderCC::OnNewMail()
// use "%ld" to print UID_ILLEGAL as -1 although it's really
// unsigned
wxLogTrace(TRACE_MF_NEWMAIL, _T("Folder %s: last new UID %ld -> %ld"),
- GetName().c_str(), m_uidLastNew, uidsNew->Last());
+ GetName(), m_uidLastNew, uidsNew->Last());
// update m_uidLastNew to avoid finding the same messages again the
// next time
@@ -5045,7 +5045,7 @@ MailFolderCC::mm_status(MAILSTREAM *stream,
CHECK_RET(mf, _T("mm_status for non existent folder"));
wxLogTrace(TRACE_MF_CALLBACK, _T("mm_status: folder '%s', %lu messages"),
- mf->m_ImapSpec.c_str(), status->messages);
+ mf->m_ImapSpec, status->messages);
// do nothing here for now
}
@@ -5066,7 +5066,7 @@ MailFolderCC::mm_notify(MAILSTREAM * stream, const String& str, long errflg)
mf->ForceClose();
wxLogWarning(_("Connection to the folder '%s' lost unexpectedly."),
- mf->GetName().c_str());
+ mf->GetName());
}
mm_log(str, errflg, mf);
@@ -5181,7 +5181,7 @@ MailFolderCC::mm_dlog(const String& str)
GetLogCircle().Add(str);
// send it to the window
- wxLogGeneric(M_LOG_WINONLY, _("Mail log: %s"), str.c_str());
+ wxLogGeneric(M_LOG_WINONLY, _("Mail log: %s"), str);
}
/** get user name and password
@@ -5486,7 +5486,7 @@ bool
MailFolderCC::Rename(const MFolder *mfolder, const String& name)
{
wxLogTrace(TRACE_MF_CALLS, _T("MailFolderCC::Rename(): %s -> %s"),
- mfolder->GetPath().c_str(), name.c_str());
+ mfolder->GetPath(), name);
// I'm unsure if this is needed but I suppose we're going to have problems
// if we rename the folder being used - or maybe not?
@@ -5514,9 +5514,9 @@ MailFolderCC::Rename(const MFolder *mfolder, const String& name)
{
wxLogError(_("Failed to rename the mailbox for folder '%s' "
"from '%s' to '%s'."),
- mfolder->GetFullName().c_str(),
- mfolder->GetPath().c_str(),
- name.c_str());
+ mfolder->GetFullName(),
+ mfolder->GetPath(),
+ name);
return false;
}
@@ -5535,7 +5535,7 @@ MailFolderCC::ClearFolder(const MFolder *mfolder)
String fullname = mfolder->GetFullName();
String mboxpath = MailFolder::GetImapSpec(mfolder);
- wxLogTrace(TRACE_MF_CALLS, _T("Clearing folder '%s'"), fullname.c_str());
+ wxLogTrace(TRACE_MF_CALLS, _T("Clearing folder '%s'"), fullname);
// if this folder is opened, use its stream - and also notify about message
// deletion
@@ -5577,7 +5577,7 @@ MailFolderCC::ClearFolder(const MFolder *mfolder)
if ( !stream )
{
- wxLogError(_("Impossible to open folder '%s'"), fullname.c_str());
+ wxLogError(_("Impossible to open folder '%s'"), fullname);
delete noCCC;
@@ -5657,7 +5657,7 @@ MailFolderCC::DeleteFolder(const MFolder *mfolder)
String mboxpath = MailFolder::GetImapSpec(mfolder, login);
wxLogTrace(TRACE_MF_CALLS,
- _T("MailFolderCC::DeleteFolder(%s)"), mboxpath.c_str());
+ _T("MailFolderCC::DeleteFolder(%s)"), mboxpath);
return mail_delete(NIL, mboxpath.char_str()) != NIL;
}
diff --git a/src/mail/MailFolderCmn.cpp b/src/mail/MailFolderCmn.cpp
index ccda227d..0e79e943 100644
--- a/src/mail/MailFolderCmn.cpp
+++ b/src/mail/MailFolderCmn.cpp
@@ -161,9 +161,9 @@ public:
#if 0
wxLogTrace(TRACE_MF_CLOSE,
_T("Checking if '%s' expired: exp time: %s, now: %s"),
- m_mf->GetName().c_str(),
- m_dt.FormatTime().c_str(),
- wxDateTime::Now().FormatTime().c_str());
+ m_mf->GetName(),
+ m_dt.FormatTime(),
+ wxDateTime::Now().FormatTime());
#endif // 0
return m_expires && (m_dt <= wxDateTime::Now());
@@ -356,7 +356,7 @@ MfCloseEntry::MfCloseEntry(MailFolderCmn *mf, int secs)
{
wxLogTrace(TRACE_MF_CLOSE,
_T("Delaying closing of '%s' (%lu refs) for %d seconds."),
- mf->GetName().c_str(),
+ mf->GetName(),
(unsigned long)mf->GetNRef(),
secs == NEVER_EXPIRES ? -1 : secs);
@@ -375,7 +375,7 @@ MfCloseEntry::MfCloseEntry(MailFolderCmn *mf, int secs)
MfCloseEntry::~MfCloseEntry()
{
wxLogTrace(TRACE_MF_CLOSE, _T("Destroying MfCloseEntry(%s) (%lu refs left)"),
- m_mf->GetName().c_str(), (unsigned long)m_mf->GetNRef());
+ m_mf->GetName(), (unsigned long)m_mf->GetNRef());
m_mf->RealDecRef();
}
@@ -417,7 +417,7 @@ void MfCloser::Add(MailFolderCmn *mf, int delay)
CHECK_RET( delay > 0, _T("folder close timeout must be positive") );
wxLogTrace(TRACE_MF_REF, _T("Adding '%s' to gs_MailFolderCloser"),
- mf->GetName().c_str());
+ mf->GetName());
m_MfList.push_back(new MfCloseEntry(mf, delay));
@@ -439,7 +439,7 @@ void MfCloser::OnTimer(void)
{
#ifdef DEBUG
wxLogTrace(TRACE_MF_CLOSE, _T("Going to remove '%s' from m_MfList"),
- i->GetName().c_str());
+ i->GetName());
#endif // DEBUG
i = m_MfList.erase(i);
@@ -462,7 +462,7 @@ void MfCloser::Remove(MfCloseEntry *entry)
#ifdef DEBUG
wxLogTrace(TRACE_MF_REF, _T("Removing '%s' from gs_MailFolderCloser"),
- entry->GetName().c_str());
+ entry->GetName());
#endif // DEBUG
for ( MfList::iterator i = m_MfList.begin(); i != m_MfList.end(); i++ )
@@ -609,10 +609,10 @@ MailFolderCmn::DecRef()
void
MailFolderCmn::IncRef()
{
- wxLogTrace(TRACE_MF_REF, _T("MF(%s)::IncRef(): %lu -> %lu"),
- GetName().c_str(),
- (unsigned long)GetNRef(),
- (unsigned long)GetNRef() + 1);
+ wxLogTrace(TRACE_MF_REF, _T("MF(%s)::IncRef(): %zu -> %zu"),
+ GetName(),
+ GetNRef(),
+ GetNRef() + 1);
MObjectRC::IncRef();
}
@@ -620,10 +620,10 @@ MailFolderCmn::IncRef()
bool
MailFolderCmn::RealDecRef()
{
- wxLogTrace(TRACE_MF_REF, _T("MF(%s)::DecRef(): %lu -> %lu"),
- GetName().c_str(),
- (unsigned long)GetNRef(),
- (unsigned long)GetNRef() - 1);
+ wxLogTrace(TRACE_MF_REF, _T("MF(%s)::DecRef(): %zu -> %zu"),
+ GetName(),
+ GetNRef(),
+ GetNRef() - 1);
#ifdef DEBUG_FOLDER_CLOSE
// check that the folder is not in the mail folder closer list any more if
@@ -783,7 +783,7 @@ MailFolderCmn::SaveMessagesToFile(const UIdArray *selections,
{
wxString msg;
msg.Printf(_("Saving %d messages to the file '%s'..."),
- n, fileName0.empty() ? fileName.c_str() : fileName0.c_str());
+ n, fileName0.empty() ? fileName : fileName0);
pd.reset(new MProgressDialog(GetName(), msg, 2*n));
}
@@ -829,7 +829,7 @@ MailFolderCmn::SaveMessages(const UIdArray *selections,
// detect it here
wxLogError(_("Impossible to copy messages in the folder '%s'.\n"
"You can't create messages in the folders of this type."),
- folder->GetFullName().c_str());
+ folder->GetFullName());
return false;
}
@@ -841,7 +841,7 @@ MailFolderCmn::SaveMessages(const UIdArray *selections,
{
String msg;
msg.Printf(_("Cannot save messages to folder '%s'."),
- folder->GetFullName().c_str());
+ folder->GetFullName());
ERRORMESSAGE((msg));
return false;
}
@@ -860,7 +860,7 @@ MailFolderCmn::SaveMessages(const UIdArray *selections,
// open a progress window:
wxString msg;
msg.Printf(_("Saving %d messages to the folder '%s'..."),
- n, folder->GetName().c_str());
+ n, folder->GetName());
pd.reset(new MProgressDialog
(
@@ -911,7 +911,7 @@ MailFolderCmn::SaveMessages(const UIdArray *selections,
if ( !folder.IsOk() )
{
wxLogError(_("Impossible to save messages to not existing folder '%s'."),
- folderName.c_str());
+ folderName);
return false;
}
@@ -1381,7 +1381,7 @@ MailFolderCmn::RequestUpdate()
return;
wxLogTrace(TRACE_MF_EVENTS, _T("Sending FolderUpdate event for folder '%s'"),
- GetName().c_str());
+ GetName());
// remember that the GUI is going to know about that many messages
m_msgnoLastNotified = GetMessageCount();
@@ -1663,8 +1663,8 @@ MailFolderCmn::FilterNewMail(FilterRule *filterRule, UIdArray& uidsNew)
{
CHECK( filterRule, false, _T("FilterNewMail: NULL filter") );
- wxLogTrace(TRACE_MF_NEWMAIL, _T("MF(%s)::FilterNewMail(%lu msgs)"),
- GetName().c_str(), (unsigned long)uidsNew.GetCount());
+ wxLogTrace(TRACE_MF_NEWMAIL, _T("MF(%s)::FilterNewMail(%zu msgs)"),
+ GetName(), uidsNew.GetCount());
// we're almost surely going to look at all new messages, so pre-cache them
// all at once
@@ -1704,8 +1704,8 @@ MailFolderCmn::FilterNewMail(FilterRule *filterRule, UIdArray& uidsNew)
}
// some messages could have been deleted by filters
- wxLogTrace(TRACE_MF_NEWMAIL, _T("MF(%s)::FilterNewMail(): %lu msgs left"),
- GetName().c_str(), (unsigned long)uidsNew.GetCount());
+ wxLogTrace(TRACE_MF_NEWMAIL, _T("MF(%s)::FilterNewMail(): %zu msgs left"),
+ GetName(), uidsNew.GetCount());
return true;
}
@@ -1834,7 +1834,7 @@ MailFolderCmn::DoProcessNewMail(const MFolder *folder,
"please modify the properties for this folder.\n"
"\n"
"Disabling automatic mail collection for now."),
- newMailFolder.c_str()));
+ newMailFolder));
((MFolder *)folder)->ResetFlags(MF_FLAGS_INCOMING); // const_cast
@@ -1937,9 +1937,9 @@ MailFolderCmn::CollectNewMail(UIdArray& uidsNew, const String& newMailFolder)
bool move = READ_CONFIG_BOOL(GetProfile(), MP_MOVE_NEWMAIL);
- wxLogTrace(TRACE_MF_NEWMAIL, _T("MF(%s)::CollectNewMail(%lu msgs) (%s)"),
- GetName().c_str(),
- (unsigned long)uidsNew.GetCount(),
+ wxLogTrace(TRACE_MF_NEWMAIL, _T("MF(%s)::CollectNewMail(%zu msgs) (%s)"),
+ GetName(),
+ uidsNew.GetCount(),
move ? "moving" : "copying");
if ( !SaveMessages(&uidsNew, newMailFolder) )
@@ -1947,8 +1947,8 @@ MailFolderCmn::CollectNewMail(UIdArray& uidsNew, const String& newMailFolder)
// don't delete them if we failed to save them
ERRORMESSAGE((_("Cannot %s new mail from folder '%s' to '%s'."),
move ? _("move") : _("copy"),
- GetName().c_str(),
- newMailFolder.c_str()));
+ GetName(),
+ newMailFolder));
return false;
}
@@ -1994,9 +1994,9 @@ MailFolderCmn::ReportNewMail(const MFolder *folder,
if ( uidsNew )
countNew = uidsNew->GetCount();
- wxLogTrace(TRACE_MF_NEWMAIL, _T("MF(%s)::ReportNewMail(%u msgs) (folder is %s)"),
- folder->GetFullName().c_str(),
- (unsigned int)countNew,
+ wxLogTrace(TRACE_MF_NEWMAIL, _T("MF(%s)::ReportNewMail(%lu msgs) (folder is %s)"),
+ folder->GetFullName(),
+ countNew,
mf ? "opened" : "closed");
// step 1: execute external command if it's configured
@@ -2007,13 +2007,13 @@ MailFolderCmn::ReportNewMail(const MFolder *folder,
if ( !command.empty() )
{
wxLogTrace(TRACE_MF_NEWMAIL, _T("MF(%s)::ReportNewMail(): running '%s'"),
- folder->GetFullName().c_str(), command.c_str());
+ folder->GetFullName(), command);
if ( !wxExecute(command, false /* async */) )
{
// TODO ask whether the user wants to disable it
wxLogError(_("Command '%s' (to execute on new mail reception)"
- " failed."), command.c_str());
+ " failed."), command);
}
}
}
@@ -2048,7 +2048,7 @@ MailFolderCmn::ReportNewMail(const MFolder *folder,
String command = wxFileType::ExpandCommand(soundCmd, params);
wxLogTrace(TRACE_MF_NEWMAIL, _T("MF(%s)::ReportNewMail(): playing '%s'"),
- folder->GetFullName().c_str(), command.c_str());
+ folder->GetFullName(), command);
if ( !wxExecute(command, false /* async */) )
#elif defined(__MINGW32__) || defined(__WINE__)
@@ -2121,7 +2121,7 @@ MailFolderCmn::ReportNewMail(const MFolder *folder,
// this may happen if another session deleted it
wxLogDebug(_T("New message %lu disappeared from folder '%s'"),
uidsNew->Item(i),
- folder->GetFullName().c_str());
+ folder->GetFullName());
}
}
}
@@ -2138,7 +2138,7 @@ MailFolderCmn::ReportNewMail(const MFolder *folder,
String message;
message.Printf(_("You have received %lu new messages "
"in the folder '%s'"),
- countNew, folder->GetFullName().c_str());
+ countNew, folder->GetFullName());
if ( !infos.empty() )
{
@@ -2349,9 +2349,9 @@ MailFolderCmn::SendMsgStatusChangeEvent()
// next notify everyone else about the status change
wxLogTrace(TRACE_MF_EVENTS,
- _T("Sending MsgStatus event for %lu msgs in folder '%s'"),
- (unsigned long)m_statusChangeData->msgnos.GetCount(),
- GetName().c_str());
+ _T("Sending MsgStatus event for %zu msgs in folder '%s'"),
+ m_statusChangeData->msgnos.GetCount(),
+ GetName());
MEventManager::Send(new MEventMsgStatusData(this, m_statusChangeData));
@@ -2403,7 +2403,7 @@ void MailFolderCmn::RequestUpdateAfterExpunge()
// tell GUI to update
wxLogTrace(TRACE_MF_EVENTS, _T("Sending FolderExpunged event for folder '%s'"),
- GetName().c_str());
+ GetName());
MEventManager::Send(new MEventFolderExpungeData(this, m_expungeData));
diff --git a/src/mail/MailMH.cpp b/src/mail/MailMH.cpp
index b983512c..efc531ba 100644
--- a/src/mail/MailMH.cpp
+++ b/src/mail/MailMH.cpp
@@ -163,7 +163,7 @@ bool MHFoldersImporter::OnMEvent(MEventData& event)
}
else
{
- wxLogDebug(_T("Folder specification '%s' unexpected."), spec.c_str());
+ wxLogDebug(_T("Folder specification '%s' unexpected."), spec);
}
}
@@ -173,7 +173,7 @@ bool MHFoldersImporter::OnMEvent(MEventData& event)
void MHFoldersImporter::OnNewFolder(String& name)
{
- wxLogMessage(_T("Found MH folder %s"), name.c_str());
+ wxLogMessage(_T("Found MH folder %s"), name);
}
// ----------------------------------------------------------------------------
@@ -265,8 +265,8 @@ MailFolder::GetMHFolderName(String *path)
{
wxLogError(_("Invalid MH folder name '%s' - all MH folders should "
"be under '%s' directory."),
- name.c_str(),
- gs_MHRootDir.c_str());
+ name,
+ gs_MHRootDir);
return FALSE;
}
@@ -320,7 +320,7 @@ bool MailFolder::ImportFoldersMH(const String& root, bool allUnder)
if ( !folderMH )
{
wxLogError(_("Failed to create root MH folder at '%s'."),
- root.c_str());
+ root);
ok = FALSE;
}
@@ -346,7 +346,7 @@ bool MailFolder::ImportFoldersMH(const String& root, bool allUnder)
if ( !ok )
{
wxLogError(_("Failed to import MH subfolders under '%s'."),
- root.c_str());
+ root);
}
}
diff --git a/src/mail/MessageCC.cpp b/src/mail/MessageCC.cpp
index 6e9ecc62..e032180f 100644
--- a/src/mail/MessageCC.cpp
+++ b/src/mail/MessageCC.cpp
@@ -48,7 +48,7 @@
if ( !m_folder->IsOpened() ) \
{ \
ERRORMESSAGE((_("Cannot access closed folder '%s'."), \
- m_folder->GetName().c_str())); \
+ m_folder->GetName())); \
return; \
}
@@ -57,7 +57,7 @@
if ( !m_folder->IsOpened() ) \
{ \
ERRORMESSAGE((_("Cannot access closed folder '%s'."), \
- m_folder->GetName().c_str())); \
+ m_folder->GetName())); \
return rc; \
}
@@ -637,7 +637,7 @@ MessageCC::DoGetPartAny(const MimePart& mimepart,
{
ERRORMESSAGE((_("Impossible to retrieve message text: "
"folder '%s' is closed."),
- m_folder->GetName().c_str()));
+ m_folder->GetName()));
return NULL;
}
@@ -645,7 +645,7 @@ MessageCC::DoGetPartAny(const MimePart& mimepart,
{
ERRORMESSAGE((_("Impossible to retrieve message text: "
"failed to lock folder '%s'."),
- m_folder->GetName().c_str()));
+ m_folder->GetName()));
return NULL;
}
@@ -710,7 +710,7 @@ MessageCC::GetEnvelope()
{
ERRORMESSAGE((_("Impossible to retrieve message headers: "
"failed to lock folder '%s'."),
- m_folder->GetName().c_str()));
+ m_folder->GetName()));
}
m_Envelope = mail_fetch_structure(m_folder->Stream(),
@@ -738,7 +738,7 @@ MessageCC::GetBody(void)
{
ERRORMESSAGE((_("Impossible to retrieve message body: "
"failed to lock folder '%s'."),
- m_folder->GetName().c_str()));
+ m_folder->GetName()));
}
m_Envelope = mail_fetchstructure_full(m_folder->Stream(),
diff --git a/src/mail/MimeDecode.cpp b/src/mail/MimeDecode.cpp
index 749882aa..244521e0 100644
--- a/src/mail/MimeDecode.cpp
+++ b/src/mail/MimeDecode.cpp
@@ -202,7 +202,7 @@ String DecodeHeaderOnce(const String& in, wxFontEncoding *pEncoding)
if ( p == end )
{
wxLogDebug(_T("Invalid encoded word syntax in '%s': missing charset."),
- in.c_str());
+ in);
out += wxString(encWordStart, end);
break;
@@ -268,15 +268,14 @@ String DecodeHeaderOnce(const String& in, wxFontEncoding *pEncoding)
if ( enc2047 == MIME::Encoding_Unknown )
{
- wxLogDebug(_T("Unrecognized header encoding in '%s'."), in.c_str());
+ wxLogDebug(_T("Unrecognized header encoding in '%s'."), in);
// scan until the end of the encoded word
const size_t posEncWordStart = p - in.begin();
const size_t posEncWordEnd = in.find("?=", p - in.begin());
if ( posEncWordEnd == wxString::npos )
{
- wxLogDebug(_T("Missing encoded word end marker in '%s'."),
- in.c_str());
+ wxLogDebug(_T("Missing encoded word end marker in '%s'."), in);
out += wxString(encWordStart, end);
break;
@@ -310,8 +309,7 @@ String DecodeHeaderOnce(const String& in, wxFontEncoding *pEncoding)
if ( p == last )
{
- wxLogDebug(_T("Missing encoded word end marker in '%s'."),
- in.c_str());
+ wxLogDebug(_T("Missing encoded word end marker in '%s'."), in);
out += wxString(encWordStart, end);
break;
diff --git a/src/mail/Pop3.cpp b/src/mail/Pop3.cpp
index 5e22aad1..5eec7e8b 100644
--- a/src/mail/Pop3.cpp
+++ b/src/mail/Pop3.cpp
@@ -117,7 +117,7 @@ void PopFlagsCacheFile::SaveFlags()
if ( !Save() )
{
wxLogWarning(_("Failed to save flags for POP3 folder '%s'"),
- m_folderName.c_str());
+ m_folderName);
}
}
@@ -208,7 +208,7 @@ bool PopFlagsCacheFile::DoSave(wxTempFile& file)
flags = 0;
}
- str.Printf(_T("%s %d\n"), m_uidls->Item(msgno - 1).c_str(), flags);
+ str.Printf(_T("%s %d\n"), m_uidls->Item(msgno - 1), flags);
if ( !file.Write(str) )
{
@@ -324,7 +324,7 @@ extern void Pop3_SaveFlags(const String& folderName, MAILSTREAM *stream)
{
if ( !wxRemoveFile(filename) )
{
- wxLogWarning(_("Stale cache file '%s' left."), filename.c_str());
+ wxLogWarning(_("Stale cache file '%s' left."), filename);
}
}
diff --git a/src/mail/SendMessageCC.cpp b/src/mail/SendMessageCC.cpp
index 4a10c2c2..8bc8666b 100644
--- a/src/mail/SendMessageCC.cpp
+++ b/src/mail/SendMessageCC.cpp
@@ -291,8 +291,7 @@ bool SendMessage::Bounce(const String& address,
if ( !sendMsg->SendOrQueue() )
{
- ERRORMESSAGE((_("Failed to bounce the message to \"%s\"."),
- address.c_str()));
+ ERRORMESSAGE((_("Failed to bounce the message to \"%s\"."), address));
return false;
}
@@ -898,7 +897,7 @@ void SendMessageCC::CheckAddressFieldForErrors(ADDRESS *adrStart)
adrPrev->next = adr->next;
DBGMESSAGE(("Invalid recipient address '%s' ignored.",
- AddressCC(adr).GetAddress().c_str()));
+ AddressCC(adr).GetAddress()));
// prevent mail_free_address() from freeing the entire list tail
adr->next = NULL;
@@ -975,7 +974,7 @@ SendMessageCC::SetFcc(const String& fcc)
// not folder names as the file names? this would allow saving
// outgoing messages to files very easily...
ERRORMESSAGE((_("The folder '%s' specified in the FCC list "
- "doesn't exist."), folderName.c_str()));
+ "doesn't exist."), folderName));
return false;
}
@@ -1052,7 +1051,7 @@ SendMessageCC::AddHeaderEntry(const String& nameIn, const String& value)
else if ( !HeaderName(name).CanBeSetByUser() )
{
ERRORMESSAGE((_("The value of the header '%s' cannot be modified."),
- nameIn.c_str()));
+ nameIn));
}
else if ( name == "SUBJECT" )
{
@@ -1117,7 +1116,7 @@ String BuildMessageId(const char *hostname)
return String::Format("<Mahogany-%s-%lu-%s.%02u@%s>",
M_VERSION,
s_pid,
- dt.Format("%Y%m%d-%H%M%S").c_str(),
+ dt.Format("%Y%m%d-%H%M%S"),
s_numInSec,
hostname);
}
@@ -1177,7 +1176,7 @@ SendMessageCC::Sign()
String err = n == 0 ? String(_("no error information available"))
: log.GetMessage(n - 1);
- ERRORMESSAGE((_("Signing the message failed: %s"), err.c_str()));
+ ERRORMESSAGE((_("Signing the message failed: %s"), err));
return false;
}
@@ -1325,7 +1324,7 @@ SendMessageCC::Build(bool forStorage)
if ( value.empty() )
{
wxLogError(_("Invalid value \"%s\" for the custom header \"%s\""),
- header.m_value.c_str(), header.m_name.c_str());
+ header.m_value, header.m_name);
return false;
}
@@ -1863,7 +1862,7 @@ SendMessageCC::SendNow(String *errGeneral, String *errDetailed)
{
wxLogTrace(TRACE_SEND,
"Trying to open connection to SMTP server \"%s\"",
- m_ServerHost.c_str());
+ m_ServerHost);
if ( READ_CONFIG(m_profile, MP_SMTP_USE_8BIT) )
{
@@ -1897,7 +1896,7 @@ SendMessageCC::SendNow(String *errGeneral, String *errDetailed)
case Prot_NNTP:
wxLogTrace(TRACE_SEND,
"Trying to open connection to NNTP server \"%s\"",
- m_ServerHost.c_str());
+ m_ServerHost);
stream = nntp_open_full(NIL, hostlist, CONST_CCAST("nntp"), NIL, options);
break;
@@ -1932,7 +1931,7 @@ SendMessageCC::SendNow(String *errGeneral, String *errDetailed)
if ( WEXITSTATUS(rc) != 0 )
{
errDetailed->Printf(_("Failed to execute local MTA \"%s\""),
- m_SendmailCmd.c_str());
+ m_SendmailCmd);
}
else
{
@@ -1942,7 +1941,7 @@ SendMessageCC::SendNow(String *errGeneral, String *errDetailed)
else
{
errDetailed->Printf(_("Failed to write to temporary file \"%s\""),
- filename.c_str());
+ filename);
}
}
else
@@ -2032,7 +2031,7 @@ SendMessageCC::AfterSending()
i != m_FccList.end();
i++ )
{
- wxLogTrace(TRACE_SEND, "FCCing message to %s", (*i)->c_str());
+ wxLogTrace(TRACE_SEND, "FCCing message to %s", **i);
WriteToFolder(**i);
}
@@ -2103,7 +2102,7 @@ SendMessageCC::WriteToFile(const String &filename, bool append)
if ( !ok )
{
ERRORMESSAGE((_("Failed to write message to file '%s'."),
- filename.c_str()));
+ filename));
}
return ok;
@@ -2116,7 +2115,7 @@ SendMessageCC::WriteToFolder(String const &name)
if ( !folder )
{
ERRORMESSAGE((_("Can't save sent message in the folder '%s' "
- "which doesn't exist."), name.c_str()));
+ "which doesn't exist."), name));
return false;
}
@@ -2124,7 +2123,7 @@ SendMessageCC::WriteToFolder(String const &name)
if ( !mf )
{
ERRORMESSAGE((_("Can't open folder '%s' to save the message to."),
- name.c_str()));
+ name));
return false;
}
diff --git a/src/mail/SpamFilter.cpp b/src/mail/SpamFilter.cpp
index a7540076..2c7859d0 100644
--- a/src/mail/SpamFilter.cpp
+++ b/src/mail/SpamFilter.cpp
@@ -422,7 +422,7 @@ SpamFilter::CheckIfSpam(const Message& msg,
if ( result )
{
*result = String::Format("recognized as spam by %s filter: %s",
- name.c_str(), result->c_str());
+ name, *result);
}
return true;
@@ -430,7 +430,7 @@ SpamFilter::CheckIfSpam(const Message& msg,
if ( result )
{
*result = String::Format("recognized as non-spam by %s filter: %s",
- name.c_str(), result->c_str());
+ name, *result);
}
return false;
@@ -519,15 +519,13 @@ bool SpamFilter::EditParameters(wxFrame *parent, String *params)
SpamFilter *filter = FindByName(name);
if ( !filter )
{
- wxLogDebug(_T("invalid filter name \"%s\" in isspam()"),
- name.c_str());
+ wxLogDebug(_T("invalid filter name \"%s\" in isspam()"), name);
continue;
}
if ( filters.Index(filter->GetLongName()) != wxNOT_FOUND )
{
- wxLogDebug(_T("duplicate filter name \"%s\" in isspam()"),
- name.c_str());
+ wxLogDebug(_T("duplicate filter name \"%s\" in isspam()"), name);
continue;
}
@@ -619,7 +617,7 @@ void SpamFilter::DoLoadAll()
MModule * const module = MModule::LoadModule(name);
if ( !module )
{
- wxLogError(_("Failed to load spam filter \"%s\"."), name.c_str());
+ wxLogError(_("Failed to load spam filter \"%s\"."), name);
continue;
}
diff --git a/src/modules/Calendar.cpp b/src/modules/Calendar.cpp
index d1b7c81e..fe987464 100644
--- a/src/modules/Calendar.cpp
+++ b/src/modules/Calendar.cpp
@@ -313,7 +313,7 @@ public:
{
wxString tmp = m_TextCtrl->GetValue();
long l = 1;
- sscanf(tmp.c_str(),"%ld", &l);
+ sscanf(tmp,"%ld", &l);
l += delta;
if(l < 1)
l = 1;
@@ -752,7 +752,7 @@ CalendarFrame::GetConfig(void)
{
wxString msg;
msg.Printf(_("Cannot create calendar module folder '%s'."),
- m_FolderName.c_str());
+ m_FolderName);
m_Module->ErrorMessage(msg);
}
}
@@ -788,7 +788,7 @@ CalendarFrame::ParseDateLine(const wxString &line)
wxDateTimeWithRepeat dt;
long year, month, day;
long yr, mr, dr, yre, mre, dre;
- if(sscanf(line.c_str(),"%ld %ld %ld %ld %ld %ld %ld %ld %ld",
+ if(sscanf(line,"%ld %ld %ld %ld %ld %ld %ld %ld %ld",
&year, &month, &day,
&yr, &mr, &dr,
&yre, &mre, &dre) != 9)
@@ -990,8 +990,8 @@ CalendarFrame::CheckUpdate(MailFolder *eventFolder)
{
wxString txt;
txt.Printf(_("Stored reminder `%s' in mailbox `%s'."),
- m_Alarms[count]->GetSubject().c_str(),
- m_NewMailFolder.c_str());
+ m_Alarms[count]->GetSubject(),
+ m_NewMailFolder);
GetStatusBar()->SetStatusText(txt);
DeleteOrRewrite(mf, msg,
@@ -1012,7 +1012,7 @@ CalendarFrame::CheckUpdate(MailFolder *eventFolder)
{
wxString txt;
txt.Printf(_("Sent or queued message `%s'."),
- m_Alarms[count]->GetSubject().c_str());
+ m_Alarms[count]->GetSubject());
GetStatusBar()->SetStatusText(txt);
DeleteOrRewrite(mf, msg,
m_Alarms[count]->GetDate(), action);
@@ -1067,7 +1067,7 @@ CalendarFrame::AddReminder(const wxString &itext,
<< "\015\012"
<< tmp
<< "\015\012";
- text.Printf(fmt, timeStr.c_str(), MakeDateLine(when).c_str());
+ text.Printf(fmt, timeStr, MakeDateLine(when));
}
class Message * msg = m_MInterface->CreateMessage(text,UID_ILLEGAL,m_Profile);
(void) m_Folder->AppendMessage(msg);
diff --git a/src/modules/Filters.cpp b/src/modules/Filters.cpp
index 2e0ec850..c413b520 100644
--- a/src/modules/Filters.cpp
+++ b/src/modules/Filters.cpp
@@ -1067,7 +1067,7 @@ FilterRuleImpl::Error(const String &error)
unsigned long pos = GetPos();
String tmp;
tmp.Printf(_("Parse error at input position %lu:\n %s\n%s<error> %s"),
- pos, error.c_str(), CharLeft().c_str(), CharMid().c_str());
+ pos, error, CharLeft(), CharMid());
// FIXME: this should be wxLogError() call as otherwise we get several
// message boxes for each error instead of only one combining all
@@ -1813,7 +1813,7 @@ FilterRuleImpl::ParseFunctionCall(Token id)
{
String err;
err.Printf(_("Functioncall expected '(' after '%s'."),
- id.GetIdentifier().c_str());
+ id.GetIdentifier());
Error(err);
return NULL;
}
@@ -1853,7 +1853,7 @@ FilterRuleImpl::ParseFunctionCall(Token id)
{
String err;
err.Printf(_("Attempt to call undefined function '%s'."),
- id.GetIdentifier().c_str());
+ id.GetIdentifier());
Error(err);
delete args;
return NULL;
@@ -2803,9 +2803,9 @@ FilterRuleApply::CreateProgressDialog()
(
wxString::Format
(
- _("Filtering %lu messages in folder \"%s\":"),
- static_cast<unsigned long>(m_msgs.GetCount()),
- m_parent->m_MailFolder->GetName().c_str()
+ _("Filtering %zu messages in folder \"%s\":"),
+ m_msgs.GetCount(),
+ m_parent->m_MailFolder->GetName()
),
// make the message wide enough to show filtering messages
// and tall enough for 4 lines that we use for them
@@ -2846,7 +2846,7 @@ FilterRuleApply::GetMessage()
wxLogDebug(
_T("Filter error: message with UID %ld in folder '%s' doesn't exist any more."),
m_parent->m_MessageUId,
- m_parent->m_MailFolder->GetName().c_str());
+ m_parent->m_MailFolder->GetName());
return false;
}
@@ -3079,12 +3079,12 @@ FilterRuleApply::UpdateProgressDialog()
//
// NB: textLog may contain '%'s itself, so don't let it be
// interpreted as a format string
- wxLogGeneric(M_LOG_WINONLY, _T("%s"), textLog.c_str());
+ wxLogGeneric(M_LOG_WINONLY, _T("%s"), textLog);
}
else // no progress dialog
{
// see comment above
- wxLogStatus(_T("%s"), textLog.c_str());
+ wxLogStatus(_T("%s"), textLog);
}
// We don't need this anymore
@@ -3106,7 +3106,7 @@ FilterRuleApply::ProgressCopy()
if( !m_pd->Update(m_msgs.GetCount() + m_idx,
GetExecuteProgressString(
wxString::Format(_("Copying messages to '%s'..."),
- m_destinations[m_idx].c_str()))) )
+ m_destinations[m_idx]))) )
{
return false;
}
diff --git a/src/modules/HtmlViewer.cpp b/src/modules/HtmlViewer.cpp
index 1e683bfa..9881ea1c 100644
--- a/src/modules/HtmlViewer.cpp
+++ b/src/modules/HtmlViewer.cpp
@@ -853,7 +853,7 @@ void HtmlViewer::AddColourAttr(const wxChar *attr, const wxColour& col)
if ( col.Ok() )
{
m_htmlText += wxString::Format(_T(" %s=\"#%s\""),
- attr, Col2Html(col).c_str());
+ attr, Col2Html(col));
}
}
@@ -1183,7 +1183,7 @@ void HtmlViewer::EndBody()
m_htmlText += _T("</body></html>");
// makes cut-&-pasting into Netscape easier
- //wxLogTrace(_T("html"), _T("Generated HTML output:\n%s\n"), m_htmlText.c_str());
+ //wxLogTrace(_T("html"), _T("Generated HTML output:\n%s\n"), m_htmlText);
m_window->SetPage(m_htmlText);
diff --git a/src/modules/Migrate.cpp b/src/modules/Migrate.cpp
index 76fb4770..f7e7af87 100644
--- a/src/modules/Migrate.cpp
+++ b/src/modules/Migrate.cpp
@@ -429,7 +429,7 @@ public:
_("Failed to access the IMAP server %s,\n"
"please return to the previous page and\n"
"check its parameters."),
- parent->Data().source.server.c_str()
+ parent->Data().source.server
)
)
{
@@ -458,7 +458,7 @@ public:
"\n"
"You may want to return to the previous page\n"
"and change the server parameters there."),
- parent->Data().source.server.c_str()
+ parent->Data().source.server
)
)
{
@@ -812,7 +812,7 @@ bool IMAPServerPanel::TransferDataFromWindow()
unsigned long l;
if ( !port.ToULong(&l) || l > INT_MAX )
{
- wxLogError(_("Invalid port specification: %s"), port.c_str());
+ wxLogError(_("Invalid port specification: %s"), port);
return false;
}
@@ -1188,7 +1188,7 @@ MigrateWizardConfirmPage::BuildMsg(MigrateWizard *parent) const
msg.Printf(_("About to start copying %d folders from the\n"
"server %s"),
- data.countFolders, data.source.server.c_str());
+ data.countFolders, data.source.server);
const String& rootSrc = data.source.root;
if ( !rootSrc.empty() )
@@ -1201,7 +1201,7 @@ MigrateWizardConfirmPage::BuildMsg(MigrateWizard *parent) const
msg += String::Format
(
_("to the IMAP server\n%s"),
- data.dstIMAP.server.c_str()
+ data.dstIMAP.server
);
const String& rootDst = data.dstIMAP.root;
@@ -1217,7 +1217,7 @@ MigrateWizardConfirmPage::BuildMsg(MigrateWizard *parent) const
_("to the files in %s format under the\n"
"directory \"%s\""),
LocalPanel::GetFormatName(data.dstLocal.format),
- data.dstLocal.root.c_str()
+ data.dstLocal.root
);
}
@@ -1335,7 +1335,7 @@ bool MigrateWizardProgressPage::UpdateFolderProgress()
_("Folder: %d/%d (%s)"),
m_nFolder + 1,
Data().countFolders,
- fullname.c_str()
+ fullname
)
);
@@ -1491,7 +1491,7 @@ MigrateWizardProgressPage::GetDstFolder(const String& name, int flags)
if ( !wxDirExists(path) && !wxMkdir(path) )
{
wxLogWarning(_("Failed to create directory \"%s\" for folder \"%s\""),
- path.c_str(), name.c_str());
+ path, name);
}
// and modify the name for the file itself
@@ -1566,7 +1566,7 @@ MigrateWizardProgressPage::CopyMessages(MailFolder *mfSrc, MFolder *folderDst)
{
wxLogError(_("Failed to copy the message %d from folder \"%s\""),
m_nMessage,
- Data().folderNames[m_nFolder].c_str());
+ Data().folderNames[m_nFolder]);
return false;
}
@@ -1598,7 +1598,7 @@ bool MigrateWizardProgressPage::ProcessOneFolder(const String& name, int flags)
MailFolder_obj mf(OpenSource(Data().source, name));
if ( !mf )
{
- wxLogError(_("Failed to open source folder \"%s\""), name.c_str());
+ wxLogError(_("Failed to open source folder \"%s\""), name);
return false;
}
@@ -1618,7 +1618,7 @@ bool MigrateWizardProgressPage::ProcessOneFolder(const String& name, int flags)
MailFolder_obj mfDst(MailFolder::OpenFolder(folderDst));
if ( !mfDst )
{
- wxLogError(_("Failed to create the target folder \"%s\""), name.c_str());
+ wxLogError(_("Failed to create the target folder \"%s\""), name);
return false;
}
@@ -1666,7 +1666,7 @@ bool MigrateWizardProgressPage::ProcessAllFolders()
{
// it's not a fatal error (no messages lost...) but still worth
// noting
- wxLogWarning(_("Failed to copy the folder \"%s\""), name.c_str());
+ wxLogWarning(_("Failed to copy the folder \"%s\""), name);
}
}
else // a "file"-like folder, copy the messages from it
@@ -1674,7 +1674,7 @@ bool MigrateWizardProgressPage::ProcessAllFolders()
if ( !ProcessOneFolder(name, Data().folderFlags[m_nFolder]) )
{
wxLogError(_("Failed to copy messages from folder \"%s\""),
- name.c_str());
+ name);
m_nErrors++;
}
diff --git a/src/modules/NetscapeImporter.cpp b/src/modules/NetscapeImporter.cpp
index 47b40c7d..3b495d2d 100644
--- a/src/modules/NetscapeImporter.cpp
+++ b/src/modules/NetscapeImporter.cpp
@@ -679,7 +679,7 @@ int MNetscapeImporter::GetFeatures() const
bool MNetscapeImporter::Applies() const
{
// just check for ~/.netscape directory
- bool b = wxDir::Exists(m_PrefDir.c_str());
+ bool b = wxDir::Exists(m_PrefDir);
return b;
}
@@ -701,7 +701,7 @@ bool MNetscapeImporter::ImportADB()
wxString filename = importer->GetDefaultFilename();
wxLogMessage(_("Starting importing %s address book '%s'..."),
- "Netscape", filename.c_str());
+ "Netscape", filename);
bool ok = AdbImport(filename, "Netscape.adb", "Netscape Address Book", importer);
importer->DecRef();
@@ -728,13 +728,13 @@ bool MNetscapeImporter::ImportFolders(MFolder *folderParent, int flags)
// if the mail dir was found in the preferences, it will be used
// otherwise the default ($HOME/nsmail) will have to do.
- if (! wxDir::Exists(m_MailDir.c_str()) )
+ if (! wxDir::Exists(m_MailDir) )
{
// TODO
// - ask the user for his Netscape mail dir
// On the other hand it should ahve been read in prefs
wxLogMessage(_("Cannot import folders, directory '%s' doesn't exist"),
- m_MailDir.c_str());
+ m_MailDir);
return FALSE;
}
@@ -811,7 +811,7 @@ bool MNetscapeImporter::CreateFolders(MFolder *parent,
if ( !fileList.GetCount() && !dirList.GetCount() )
{
- wxLogMessage(_("No folders found in '%s'."), dir.c_str());
+ wxLogMessage(_("No folders found in '%s'."), dir);
// we can consider the operation successful
return TRUE;
@@ -891,13 +891,13 @@ bool MNetscapeImporter::CreateFolders(MFolder *parent,
if ( folder )
{
folderList.Add(folder);
- wxLogMessage(_("Imported group folder: %s."),dirFldName.c_str());
+ wxLogMessage(_("Imported group folder: %s."),dirFldName);
}
else
return FALSE;
// check if there is a file matching (without .sbd)
- int i = fileList.Index( dirFldName.c_str() );
+ int i = fileList.Index( dirFldName );
if ( i != wxNOT_FOUND)
{
// TODO
@@ -920,7 +920,7 @@ bool MNetscapeImporter::CreateFolders(MFolder *parent,
folderList.Add(subFolder);
fileList.RemoveAt(i); // this one has been created, remove from filelist
wxLogMessage(_("NOTE: >>>>>> Created 'AAA Misc' folder to contain the msgs currently in group folder %s."),
- dirFldName.c_str());
+ dirFldName);
}
else
return FALSE;
@@ -980,7 +980,7 @@ bool MNetscapeImporter::CreateFolders(MFolder *parent,
if ( folder )
{
folderList.Add(folder);
- wxLogMessage(_("Imported mail folder: %s "), name.c_str());
+ wxLogMessage(_("Imported mail folder: %s "), name);
}
else
return FALSE;
@@ -1006,7 +1006,7 @@ bool MNetscapeImporter::ImportSettings()
if ( ! ImportSettingsFromFileIfExists(filename) )
{
wxLogMessage(_("Couldn't import the global preferences file: %s."),
- filename.c_str());
+ filename);
}
// user own preference files
@@ -1023,7 +1023,7 @@ bool MNetscapeImporter::ImportSettings()
// 'preferences.js' is the main one
// if it doesn't exist, bail out
filename = m_PrefDir + DIR_SEPARATOR + g_PrefFile;
- if (! wxFile::Exists(filename.c_str()) )
+ if (! wxFile::Exists(filename) )
{
// TODO
// - ask user if he knows where the prefs file is
@@ -1034,7 +1034,7 @@ bool MNetscapeImporter::ImportSettings()
if ( !status )
{
wxLogMessage(_("Couldn't import the user preferences file: %s."),
- filename.c_str());
+ filename);
}
return status;
@@ -1084,9 +1084,9 @@ bool MNetscapeImporter::ImportSettingsFromFile(const wxString& filename)
if ( nEq == wxNOT_FOUND )
{
wxLogDebug(_T("%s(%lu): missing variable identifier ('%s')."),
- filename.c_str(),
+ filename,
(unsigned long)nLine + 1,
- g_VarIdent.c_str());
+ g_VarIdent);
// skip line
continue;
@@ -1303,7 +1303,7 @@ bool MNetscapeImporter::ImportSettingList( PrefMap* map, const MyHashTable& tbl)
else if (map[i].mpKey == _T("Not mapped"))
{
- wxLogMessage(_("Key '%s' hasn't been mapped yet"), map[i].npKey.c_str());
+ wxLogMessage(_("Key '%s' hasn't been mapped yet"), map[i].npKey);
map[i].procd = TRUE; // mark to find out which ones in the file are also in the maps
continue;
}
@@ -1327,7 +1327,7 @@ bool MNetscapeImporter::ImportSettingList( PrefMap* map, const MyHashTable& tbl)
}
else
wxLogMessage(_("Parsing error for key '%s'"),
- map[i].npKey.c_str());
+ map[i].npKey);
break;
}
case NM_IS_STRING:
@@ -1338,14 +1338,14 @@ bool MNetscapeImporter::ImportSettingList( PrefMap* map, const MyHashTable& tbl)
if ((map[i].type == NM_IS_STRING) && value.empty() )
{
wxLogMessage(_("Bad value for key '%s': cannot be empty"),
- map[i].npKey.c_str());
+ map[i].npKey);
break;
}
map[i].procd = WriteProfileEntry(map[i].mpKey, value, map[i].desc);
}
else
wxLogMessage(_("Parsing error for key '%s'"),
- map[i].npKey.c_str());
+ map[i].npKey);
break;
}
case NM_IS_INT:
@@ -1356,11 +1356,11 @@ bool MNetscapeImporter::ImportSettingList( PrefMap* map, const MyHashTable& tbl)
}
else
wxLogMessage(_("Type mismatch for key '%s' ulong expected.'"),
- map[i].npKey.c_str());
+ map[i].npKey);
break;
}
default:
- wxLogMessage(_("Bad type key '%s'"), map[i].npKey.c_str());
+ wxLogMessage(_("Bad type key '%s'"), map[i].npKey);
}
if ( ! map[i].procd )
return FALSE;
@@ -1383,9 +1383,9 @@ bool MNetscapeImporter::WriteProfileEntry(const wxString& key, const wxString& v
if ( (status = l_Profile->writeEntry( key, tmpVal)) == true )
wxLogMessage(_("Imported '%s' setting from %s: %s."),
- desc.c_str(),"Netscape",tmpVal.c_str());
+ desc,"Netscape",tmpVal);
else
- wxLogWarning(_("Failed to write '%s' entry to profile"), desc.c_str());
+ wxLogWarning(_("Failed to write '%s' entry to profile"), desc);
return status;
}
@@ -1398,9 +1398,9 @@ bool MNetscapeImporter::WriteProfileEntry(const wxString& key, const int val, co
if ( (status = l_Profile->writeEntry(key, val)) == true )
wxLogMessage(_("Imported '%s' setting from %s: %u."),
- desc.c_str(),"Netscape",val);
+ desc,"Netscape",val);
else
- wxLogWarning(_("Failed to write '%s' entry to profile"), desc.c_str());
+ wxLogWarning(_("Failed to write '%s' entry to profile"), desc);
return status;
}
@@ -1412,14 +1412,14 @@ bool MNetscapeImporter::WriteProfileEntry(const wxString& key, const bool val, c
Profile* l_Profile = mApplication->GetProfile();
if ( val )
- status = l_Profile->writeEntry( key.c_str(), 1L);
+ status = l_Profile->writeEntry( key, 1L);
else
- status = l_Profile->writeEntry( key.c_str(), 0L);
+ status = l_Profile->writeEntry( key, 0L);
if ( status )
- wxLogMessage(_("Imported '%s' setting from %s: %u."), desc.c_str(),"Netscape",val);
+ wxLogMessage(_("Imported '%s' setting from %s: %u."), desc,"Netscape",val);
else
- wxLogWarning(_("Failed to write '%s' entry to profile"), desc.c_str());
+ wxLogWarning(_("Failed to write '%s' entry to profile"), desc);
return status;
}
diff --git a/src/modules/PalmOS.cpp b/src/modules/PalmOS.cpp
index 3da45d1a..528efceb 100644
--- a/src/modules/PalmOS.cpp
+++ b/src/modules/PalmOS.cpp
@@ -247,14 +247,14 @@ public:
m_Locked = TRUE;
wxString pidstr;
pidstr.Printf("%lu", (unsigned long) getpid());
- write(fd, (char *)pidstr.c_str(),pidstr.Length());
+ write(fd, (char *)pidstr,pidstr.Length());
close(fd);
}
else
{
wxString msg;
msg.Printf(_("Could not obtain lock for '/dev/%s'"),
- m_Device.c_str());
+ m_Device);
wxLogSysError(msg);
}
return m_Locked;
@@ -605,8 +605,8 @@ PalmOSModule::GetConfig(void)
String dev;
dev = m_PilotDev;
- if(strncmp(m_PilotDev,"/dev/",5)==0)
- dev = m_PilotDev.c_str()+5;
+ if(strncmp(m_PilotDev.c_str(),"/dev/",5)==0)
+ dev = m_PilotDev+5;
if(m_Lock) delete m_Lock;
m_Lock = new wxDeviceLock(dev);
}
@@ -738,7 +738,7 @@ PalmOSModule::Connect(void)
{
String msg;
msg.Printf(_("Executing command '%s' returned an error code (%d)."),
- m_Script1.c_str(), rc);
+ m_Script1, rc);
ErrorMessage(msg);
}
}
@@ -853,7 +853,7 @@ PalmOSModule::Disconnect(void)
{
String msg;
msg.Printf(_("Executing command '%s' returned an error code (%d)."),
- m_Script2.c_str(), rc);
+ m_Script2, rc);
ErrorMessage(msg);
}
}
@@ -966,7 +966,7 @@ PalmOSModule::CreateFileList(wxArrayString &list, const wxString& directory)
{
wxString msg;
msg.Printf(_("Ignoring file '%s' with unknown extension."),
- name.c_str());
+ name);
StatusMessage(_(msg));
continue;
}
@@ -976,7 +976,7 @@ PalmOSModule::CreateFileList(wxArrayString &list, const wxString& directory)
// now we open the file and see whether it is really a file for
// the Palm. If yes, then we remember the filename.
- struct pi_file *f = pi_file_open((char*)name.c_str());
+ struct pi_file *f = pi_file_open((char*)name);
if (f > 0)
{
pi_file_close(f);
@@ -1050,7 +1050,7 @@ PalmOSModule::Backup(void)
{
String msg;
msg.Printf(_("Could not access backup directory '%s'."),
- m_BackupDir.c_str());
+ m_BackupDir);
ErrorMessage(msg);
}
@@ -1107,7 +1107,7 @@ PalmOSModule::Backup(void)
else
fname.Append(".pdb");
- name.Printf("%s%s", m_BackupDir.c_str(), fname.c_str());
+ name.Printf("%s%s", m_BackupDir, fname);
// update progress dialog, exit on "cancel"
if( ! pd->Update(max++, name) )
@@ -1118,7 +1118,7 @@ PalmOSModule::Backup(void)
// check whether this might be a database we have to ignore
if (m_IncrBackup)
- if (stat(name.c_str(), &statb) == 0)
+ if (stat(name, &statb) == 0)
if (info.modifyDate == statb.st_mtime) {
RemoveFromList(orig_files, name);
continue;
@@ -1132,7 +1132,7 @@ PalmOSModule::Backup(void)
// check exclude list
int pos;
- pos = m_BackupExcludeList.find(fname.c_str(), 0);
+ pos = m_BackupExcludeList.find(fname, 0);
if (pos >= 0) {
// the found string is only valid, if it is either surrounded by commata or
// with string start or end
@@ -1163,12 +1163,12 @@ PalmOSModule::Backup(void)
}
// create file
- f = pi_file_create((char*)name.c_str(), &info);
+ f = pi_file_create((char*)name, &info);
if (f == 0) {
wxString msg;
msg.Printf(_("Unable to create file %s!"),
- (char*)name.c_str());
+ (char*)name);
ErrorMessage(_(msg));
continue;
}
@@ -1176,7 +1176,7 @@ PalmOSModule::Backup(void)
if (pi_file_retrieve(f, m_PiSocket, 0) < 0) {
wxString msg;
msg.Printf(_("Unable to backup database %s!"),
- name.c_str());
+ name);
ErrorMessage(_(msg));
}
@@ -1198,7 +1198,7 @@ PalmOSModule::Backup(void)
// Remaining files are outdated
if (m_BackupSync) {
for (unsigned int j = 0; j < orig_files.GetCount(); j++)
- unlink(orig_files.Item(j).c_str()); // delete
+ unlink(orig_files.Item(j)); // delete
}
// All files are backed up now.
@@ -1250,7 +1250,7 @@ PalmOSModule::InstallFiles(wxArrayString &fnames, bool delFile)
db[dbcount] = (struct db*)malloc(sizeof(struct db));
// remember filename
- sprintf(db[dbcount]->name, "%s", fnames.Item(j).c_str());
+ sprintf(db[dbcount]->name, "%s", fnames.Item(j));
f = pi_file_open(db[dbcount]->name);
@@ -1364,7 +1364,7 @@ PalmOSModule::InstallFromDir(wxString directory, bool delFiles)
{
wxString msg;
msg.Printf(_("Could not access directory %s!"),
- directory.c_str());
+ directory);
ErrorMessage(_(msg));
return;
}
@@ -1680,7 +1680,7 @@ PalmOSModule::SendEMails(void)
String tmpstr;
tmpstr.Printf(_("Transferred %d/%d messages."),
numMessagesTransferred, numMessages);
- dlp_AddSyncLogEntry(m_PiSocket, (char *)tmpstr.c_str());
+ dlp_AddSyncLogEntry(m_PiSocket, (char *)tmpstr);
StatusMessage(tmpstr);
}
if(! numMessages)
@@ -1709,7 +1709,7 @@ PalmOSModule::StoreEMails(void)
if(! mf)
{
String tmpstr;
- tmpstr.Printf(_("Cannot open PalmOS synchronisation mailbox '%s'"), m_PalmBox.c_str());
+ tmpstr.Printf(_("Cannot open PalmOS synchronisation mailbox '%s'"), m_PalmBox);
ErrorMessage((tmpstr));
return;
}
@@ -1759,7 +1759,7 @@ PalmOSModule::StoreEMails(void)
tmpstr.Printf( _("Storing message %lu/%lu: %s"),
(unsigned long)(i+1),
(unsigned long)(hil->Count()),
- msg->Subject().c_str());
+ msg->Subject());
StatusMessage(tmpstr);
String content;
msg->GetHeaderLine("From",content);
@@ -1787,7 +1787,7 @@ PalmOSModule::StoreEMails(void)
}
// msg->WriteToString(content, false /* headers */);
String content2;
- const char *cptr = content.c_str();
+ const char *cptr = content;
while(*cptr)
{
if(*cptr != '\r')
@@ -1805,7 +1805,7 @@ PalmOSModule::StoreEMails(void)
tmpstr.Printf( _("Could not store message %lu/%lu: %s"),
(unsigned long)(i+1),
(unsigned long)(hil->Count()),
- msg->Subject().c_str());
+ msg->Subject());
ErrorMessage(tmpstr);
count++;
}
@@ -1846,17 +1846,17 @@ PalmOSModule::SyncMAL(void)
if(m_MALUseProxy)
{
StatusMessage(_("Setting up MAL proxy..."));
- setHttpProxy ((char *) m_MALProxyHost.c_str());
+ setHttpProxy ((char *) m_MALProxyHost);
setHttpProxyPort ( m_MALProxyPort);
- setProxyUsername ((char *) m_MALProxyLogin.c_str());
- setProxyPassword ((char *) m_MALProxyPassword.c_str());
+ setProxyUsername ((char *) m_MALProxyLogin);
+ setProxyPassword ((char *) m_MALProxyPassword);
}
/* are we using a SOCKS proxy? */
if(m_MALUseSocks)
{
StatusMessage(_("Setting up SOCKS proxy..."));
- setSocksProxy ((char *) m_MALSocksHost.c_str());
+ setSocksProxy ((char *) m_MALSocksHost);
setSocksProxyPort ( m_MALSocksPort );
}
StatusMessage(_("Synchronising MAL server/AvantGo..."));
diff --git a/src/modules/PineImport.cpp b/src/modules/PineImport.cpp
index 081b9514..01b994f1 100644
--- a/src/modules/PineImport.cpp
+++ b/src/modules/PineImport.cpp
@@ -119,7 +119,7 @@ bool MPineImporter::ImportADB()
wxString filename = importer->GetDefaultFilename();
wxLogMessage(_("Starting importing %s address book '%s'..."),
- "PINE", filename.c_str());
+ "PINE", filename);
bool ok = AdbImport(filename, _T("pine.adb"), _T("PINE Address Book"), importer);
importer->DecRef();
@@ -189,7 +189,7 @@ bool MPineImporter::ImportFolders(MFolder *folderParent, int flags)
);
if ( folder )
{
- wxLogMessage(_("Imported folder '%s'."), path.c_str());
+ wxLogMessage(_("Imported folder '%s'."), path);
nImported++;
@@ -197,7 +197,7 @@ bool MPineImporter::ImportFolders(MFolder *folderParent, int flags)
}
else
{
- wxLogError(_("Error importing folder '%s'."), path.c_str());
+ wxLogError(_("Error importing folder '%s'."), path);
}
}
@@ -270,7 +270,7 @@ void MPineImporter::ImportSetting(const wxString& pinerc,
mApplication->GetProfile()->writeEntry(MP_EXTERNALEDITOR, editor);
wxLogMessage(_("Imported external editor setting from %s: %s."),
- "PINE", editor.c_str());
+ "PINE", editor);
}
else if ( var == _T("mail-check-interval") )
{
@@ -292,32 +292,32 @@ void MPineImporter::ImportSetting(const wxString& pinerc,
{
mApplication->GetProfile()->writeEntry(MP_NNTPHOST, value);
wxLogMessage(_("Imported NNTP host setting from %s: %s."),
- "PINE", value.c_str());
+ "PINE", value);
}
else if ( var == _T("personal-name") )
{
mApplication->GetProfile()->writeEntry(MP_PERSONALNAME, value);
wxLogMessage(_("Imported personal name setting from %s: %s."),
- "PINE", value.c_str());
+ "PINE", value);
}
else if ( var == _T("reply-indent-string") )
{
mApplication->GetProfile()->writeEntry(MP_REPLY_PREFIX, value);
wxLogMessage(_("Imported reply prefix setting from %s: %s."),
- "PINE", value.c_str());
+ "PINE", value);
}
else if ( var == _T("signature-file") )
{
mApplication->GetProfile()->writeEntry(MP_COMPOSE_SIGNATURE, value);
wxLogMessage(_("Imported signature location from %s: %s."),
- "PINE", value.c_str());
+ "PINE", value);
}
else if ( var == _T("smtp-server") )
{
// FIXME this is a list and the entries may contain port numbers too!
mApplication->GetProfile()->writeEntry(MP_SMTPHOST, value);
wxLogMessage(_("Imported SMTP server setting from %s: %s."),
- "PINE", value.c_str());
+ "PINE", value);
}
}
@@ -343,7 +343,7 @@ bool MPineImporter::ImportSettingsFromFile(const wxString& filename)
if ( !file.Open() )
{
wxLogError(_("Couldn't open %s configuration file '%s'."),
- "PINE", filename.c_str());
+ "PINE", filename);
return FALSE;
}
@@ -363,9 +363,9 @@ bool MPineImporter::ImportSettingsFromFile(const wxString& filename)
int nEq = line.Find('=');
if ( nEq == wxNOT_FOUND )
{
- wxLogDebug(_T("%s(%lu): missing '=' sign."),
- filename.c_str(),
- (unsigned long)nLine + 1);
+ wxLogDebug(_T("%s(%zu): missing '=' sign."),
+ filename,
+ nLine + 1);
// skip line
continue;
diff --git a/src/modules/XFMailImport.cpp b/src/modules/XFMailImport.cpp
index 46d8926e..fb0832b6 100644
--- a/src/modules/XFMailImport.cpp
+++ b/src/modules/XFMailImport.cpp
@@ -119,7 +119,7 @@ void MXFMailImporter::ImportSetting(const wxString& xfmailrc,
{
profile->writeEntry(MP_NNTPHOST, value);
wxLogMessage(_("Imported NNTP host setting from %s: %s."),
- "XFMail", value.c_str());
+ "XFMail", value);
}
else if ( var == _T("nntpuser") )
{
@@ -136,7 +136,7 @@ void MXFMailImporter::ImportSetting(const wxString& xfmailrc,
{
profile->writeEntry(MP_PERSONALNAME, personalName);
wxLogMessage(_("Imported name setting from %s: %s."),
- "XFMail", personalName.c_str());
+ "XFMail", personalName);
}
}
}
@@ -144,7 +144,7 @@ void MXFMailImporter::ImportSetting(const wxString& xfmailrc,
{
profile->writeEntry(MP_FROM_ADDRESS, value);
wxLogMessage(_("Imported return address setting from %s: %s."),
- "XFMail", value.c_str());
+ "XFMail", value);
}
else if ( var == _T("myface") )
{
@@ -164,7 +164,7 @@ bool MXFMailImporter::ImportSettings()
if ( !file.Open() )
{
wxLogError(_("Failed to open %s configuration file '%s'."),
- "XFMail",filename.c_str());
+ "XFMail",filename);
return FALSE;
}
@@ -178,8 +178,8 @@ bool MXFMailImporter::ImportSettings()
if ( nEq == wxNOT_FOUND )
{
wxLogTrace(_T("importxfmail"),
- _T("%s(%lu): missing '=' sign."),
- filename.c_str(), (unsigned long)nLine + 1);
+ _T("%s(%zu): missing '=' sign."),
+ filename, nLine + 1);
// skip line
continue;
@@ -225,8 +225,8 @@ bool MXFMailImporter::ImportFolders(MFolder *folderParent, int flagsImport)
if ( nEq == wxNOT_FOUND )
{
wxLogTrace(_T("importxfmail"),
- _T("%s(%lu): missing '=' sign."),
- filenamerc.c_str(), (unsigned long)nLine + 1);
+ _T("%s(%zu): missing '=' sign."),
+ filenamerc, nLine + 1);
// skip line
continue;
@@ -269,8 +269,8 @@ bool MXFMailImporter::ImportFolders(MFolder *folderParent, int flagsImport)
if ( !folderName )
{
wxLogTrace(_T("importxfmail"),
- _T("%s(%lu): empty folder name, skipping."),
- foldersfilename.c_str(), (unsigned long)nLine + 1);
+ _T("%s(%zu): empty folder name, skipping."),
+ foldersfilename, nLine + 1);
continue;
}
@@ -288,9 +288,9 @@ bool MXFMailImporter::ImportFolders(MFolder *folderParent, int flagsImport)
if ( folderName[0u] == '/' )
{
wxLogTrace(_T("importxfmail"),
- _T("%s(%lu): folder '%s' assumed to be a spool, skipping."),
- foldersfilename.c_str(), (unsigned long)nLine + 1,
- folderName.c_str());
+ _T("%s(%zu): folder '%s' assumed to be a spool, skipping."),
+ foldersfilename, nLine + 1,
+ folderName);
continue;
}
@@ -313,9 +313,9 @@ bool MXFMailImporter::ImportFolders(MFolder *folderParent, int flagsImport)
if ( !typeString.ToULong(&nType) || (nType != 1 && nType != 8) )
{
wxLogTrace(_T("importxfmail"),
- _T("%s(%lu): unrecognized folder type %s, skipping."),
- foldersfilename.c_str(), (unsigned long)nLine + 1,
- typeString.c_str());
+ _T("%s(%zu): unrecognized folder type %s, skipping."),
+ foldersfilename, nLine + 1,
+ typeString);
continue;
}
@@ -357,9 +357,9 @@ bool MXFMailImporter::ImportFolders(MFolder *folderParent, int flagsImport)
if ( !flagsString.ToULong(&flags) )
{
wxLogTrace(_T("importxfmail"),
- _T("%s(%lu): not numeric folder flags %s, skipping."),
- foldersfilename.c_str(), (unsigned long)nLine + 1,
- flagsString.c_str());
+ _T("%s(%zu): not numeric folder flags %s, skipping."),
+ foldersfilename, nLine + 1,
+ flagsString);
continue;
}
@@ -374,9 +374,9 @@ bool MXFMailImporter::ImportFolders(MFolder *folderParent, int flagsImport)
folderName == _T("template") )
{
wxLogTrace(_T("importxfmail"),
- _T("%s(%lu): folder %s is a system folder."),
- foldersfilename.c_str(), (unsigned long)nLine + 1,
- folderName.c_str());
+ _T("%s(%zu): folder %s is a system folder."),
+ foldersfilename, nLine + 1,
+ folderName);
// do we import system folders at all?
if ( !(flagsImport & ImportFolder_SystemImport) )
@@ -412,7 +412,7 @@ bool MXFMailImporter::ImportFolders(MFolder *folderParent, int flagsImport)
);
if ( folder )
{
- wxLogMessage(_("Imported folder '%s'."), folderName.c_str());
+ wxLogMessage(_("Imported folder '%s'."), folderName);
nImported++;
@@ -422,7 +422,7 @@ bool MXFMailImporter::ImportFolders(MFolder *folderParent, int flagsImport)
{
// set the error flag, but continue with the other folders
error = TRUE;
- wxLogError(_("Error importing folder '%s'."), folderName.c_str());
+ wxLogError(_("Error importing folder '%s'."), folderName);
}
}
@@ -431,7 +431,7 @@ bool MXFMailImporter::ImportFolders(MFolder *folderParent, int flagsImport)
if ( error )
{
wxLogError(_("%s folder import from '%s' failed."), "XFMail",
- m_mailDir.BeforeLast('/').c_str());
+ m_mailDir.BeforeLast('/'));
return FALSE;
}
@@ -492,7 +492,7 @@ bool MXFMailImporter::ImportADB()
if ( !count )
{
wxLogError(_("Couldn't find any %s address books in '%s'."),
- "XFMail", dirname.c_str());
+ "XFMail", dirname);
return FALSE;
}
@@ -596,8 +596,8 @@ typedef struct _xf_rule {
if ( *p++ != '@' )
{
wxLogTrace(_T("importxfmail"),
- _T("%s(%lu): rule line doesn't start with '@', skipping."),
- filename.c_str(), (unsigned long)nLine + 1);
+ _T("%s(%zu): rule line doesn't start with '@', skipping."),
+ filename, nLine + 1);
continue;
}
@@ -607,8 +607,8 @@ typedef struct _xf_rule {
if ( tk.CountTokens() != 5 )
{
wxLogTrace(_T("importxfmail"),
- _T("%s(%lu): rule line doesn't contain exactly 5 tokens, skipping."),
- filename.c_str(), (unsigned long)nLine + 1);
+ _T("%s(%zu): rule line doesn't contain exactly 5 tokens, skipping."),
+ filename, nLine + 1);
continue;
}
@@ -619,8 +619,8 @@ typedef struct _xf_rule {
!tk.GetNextToken().ToULong(&flags) )
{
wxLogTrace(_T("importxfmail"),
- _T("%s(%lu): non numeric rule action or flags, skipping."),
- filename.c_str(), (unsigned long)nLine + 1);
+ _T("%s(%zu): non numeric rule action or flags, skipping."),
+ filename, nLine + 1);
continue;
}
@@ -658,9 +658,9 @@ typedef struct _xf_rule {
if ( where == ORC_W_Illegal )
{
wxLogTrace(_T("importxfmail"),
- _T("%s(%lu): unrecognized rule header '%s', skipping."),
- filename.c_str(), (unsigned long)nLine + 1,
- fmatch.c_str());
+ _T("%s(%zu): unrecognized rule header '%s', skipping."),
+ filename, nLine + 1,
+ fmatch);
continue;
}
@@ -697,7 +697,7 @@ typedef struct _xf_rule {
nFilter++;
- wxLogVerbose(_("Imported %s filter rule '%s'."), "XFMail", name.c_str());
+ wxLogVerbose(_("Imported %s filter rule '%s'."), "XFMail", name);
}
if ( !nFilter )
diff --git a/src/modules/crypt/PGPEngine.cpp b/src/modules/crypt/PGPEngine.cpp
index 29af1211..5e7b39d2 100644
--- a/src/modules/crypt/PGPEngine.cpp
+++ b/src/modules/crypt/PGPEngine.cpp
@@ -245,7 +245,7 @@ PGPEngine::ExecCommand(const String& options,
);
if ( log )
- log->AddMessage(String::Format(_("Executing \"%s\""), command.c_str()));
+ log->AddMessage(String::Format(_("Executing \"%s\""), command));
pid = wxExecute(command, wxEXEC_ASYNC, &process);
}
@@ -260,7 +260,7 @@ PGPEngine::ExecCommand(const String& options,
}
else // have command but executing it failed
{
- msg = String::Format(_("Failed to execute \"%s\"."), pgp.c_str());
+ msg = String::Format(_("Failed to execute \"%s\"."), pgp);
}
msg += "\n";
@@ -440,7 +440,7 @@ PGPEngine::ExecCommand(const String& options,
if ( status != SIGNATURE_EXPIRED_ERROR )
{
wxLogStatus(_("Valid signature from \"%s\""),
- log->GetUserID().c_str());
+ log->GetUserID());
status = OK;
}
}
@@ -480,7 +480,7 @@ PGPEngine::ExecCommand(const String& options,
{
status = SIGNATURE_UNTRUSTED_WARNING;
wxLogStatus(_("Valid signature from (invalid) \"%s\""),
- log->GetUserID().c_str());
+ log->GetUserID());
}
// else: "_MARGINAL, _FULLY and _ULTIMATE" do not trigger a warning
}
@@ -522,7 +522,7 @@ PGPEngine::ExecCommand(const String& options,
else if ( code == _T("MISSING_PASSPHRASE") )
{
wxLogError(_("Passphrase for the user \"%s\" unavailable."),
- user.c_str());
+ user);
}
else if ( code == _T("DECRYPTION_FAILED") )
{
@@ -639,7 +639,7 @@ PGPEngine::ExecCommand(const String& options,
if ( !pkalg.ToULong(&n) )
{
errmsg.Printf(_("unexpected public key algorithm \"%s\""),
- pkalg.c_str());
+ pkalg);
}
else
{
@@ -649,7 +649,7 @@ PGPEngine::ExecCommand(const String& options,
if ( !micalg.ToULong(&n) )
{
errmsg.Printf(_("unexpected hash algorithm \"%s\""),
- micalg.c_str());
+ micalg);
}
else
{
@@ -672,7 +672,7 @@ PGPEngine::ExecCommand(const String& options,
errmsg.Printf(_("unsupported hash algorithm \"%s\", "
"please configure GPG to use a hash "
"algorithm compatible with RFC 3156"),
- micalg.c_str());
+ micalg);
status = SIGN_UNKNOWN_MICALG;
}
@@ -711,7 +711,7 @@ PGPEngine::ExecCommand(const String& options,
keys += keysEnc[keysNoPrivate - 1];
wxLogWarning(_("No secret key which can decrypt this message "
- "(%s) is available."), keys.c_str());
+ "(%s) is available."), keys);
}
}
else if ( code == "NOTATION_NAME" )
@@ -940,8 +940,8 @@ PGPEngine::GetPublicKey(const String& pk,
wxString::Format
(
"--keyserver %s --recv-keys %s",
- keyserver.c_str(),
- pk.c_str()
+ keyserver,
+ pk
),
wxEmptyString,
dummyOut,
@@ -956,12 +956,12 @@ PGPEngine::GetPublicKey(const String& pk,
case NO_DATA_ERROR:
wxLogWarning(_("Public key not found on the key server \"%s\"."),
- keyserver.c_str());
+ keyserver);
break;
case OK:
wxLogMessage(_("Successfully imported public key \"%s\"."),
- pk.c_str());
+ pk);
break;
}
@@ -996,7 +996,7 @@ PassphraseManager::Get(const String& user, String& passphrase)
(
_("Passphrase is required to unlock the "
"secret key for \n"
- "user \"%s\":"), user.c_str()
+ "user \"%s\":"), user
),
_("Mahogany: Please enter the passphrase"),
wxEmptyString,
@@ -1029,7 +1029,7 @@ PassphraseManager::Unget(const String& user, String& passphrase)
wxString::Format
(
_("Would you like to keep the passphrase for the "
- "user \"%s\" in memory?"), user.c_str()
+ "user \"%s\" in memory?"), user
),
NULL,
_("Mahogany: Remember the passphrase?"),
diff --git a/src/modules/spam/DspamFilter.cpp b/src/modules/spam/DspamFilter.cpp
index 041e0d0f..0dcff8b1 100644
--- a/src/modules/spam/DspamFilter.cpp
+++ b/src/modules/spam/DspamFilter.cpp
@@ -466,8 +466,7 @@ void DspamFilter::Train(wxWindow *parent)
(
wxString::Format
(
- _("Does the folder \"%s\" contain spam?"),
- name.c_str()
+ _("Does the folder \"%s\" contain spam?"), name
),
parent,
_("Choose DSPAM training mode")
@@ -493,7 +492,7 @@ void DspamFilter::Train(wxWindow *parent)
if ( !mf )
{
wxLogError(_("Failed to open folder \"%s\" with training messages."),
- name.c_str());
+ name);
return;
}
diff --git a/src/modules/spam/HeadersFilter.cpp b/src/modules/spam/HeadersFilter.cpp
index 28ec4579..edc5ba5c 100644
--- a/src/modules/spam/HeadersFilter.cpp
+++ b/src/modules/spam/HeadersFilter.cpp
@@ -801,7 +801,7 @@ static bool CheckReceivedHeaders(const String& value)
return false;
// it should be in the beginning of the header line
- if ( pc != value.c_str() && *(pc - 1) != '\n' )
+ if ( pc != value && *(pc - 1) != '\n' )
return false;
// and it should be the last Received: header -- unfortunately there are
@@ -1001,7 +1001,7 @@ bool CheckRBL( int a, int b, int c, int d, const String & rblDomain)
int len;
String domain;
- domain.Printf(_T("%d.%d.%d.%d.%s"), d, c, b, a, rblDomain.c_str() );
+ domain.Printf(_T("%d.%d.%d.%d.%s"), d, c, b, a, rblDomain );
res_init();
len = res_query( domain.ToAscii(), C_IN, T_A,
@@ -1043,7 +1043,7 @@ static bool findIP(String &header,
if (closePos == wxNOT_FOUND)
// no second bracket found
break;
- if (wxSscanf(ip.c_str(), _T("%d.%d.%d.%d"), a,b,c,d) != 4)
+ if (wxSscanf(ip, _T("%d.%d.%d.%d"), a,b,c,d) != 4)
{
// no valid IP number behind open bracket, continue
// search:
@@ -1095,7 +1095,7 @@ HeadersFilter::DoCheckIfSpam(const Profile *profile,
if ( CheckWhiteList(msg, &match) )
{
if ( result )
- result->Printf("\"%s\" is in the white list", match.c_str());
+ result->Printf("\"%s\" is in the white list", match);
// this is definitely not a spam
return -1;
diff --git a/src/modules/spam/ServerSideFilter.cpp b/src/modules/spam/ServerSideFilter.cpp
index f7137e16..01391372 100644
--- a/src/modules/spam/ServerSideFilter.cpp
+++ b/src/modules/spam/ServerSideFilter.cpp
@@ -135,7 +135,7 @@ ServerSideFilter::DoReclassify(const Profile *profile,
if ( !reason.empty() )
{
wxLogError(_("Error while reclassifying the message: %s."),
- reason.c_str());
+ reason);
return false;
}
}
@@ -191,7 +191,7 @@ ServerSideFilter::DoCheckIfSpam(const Profile *profile,
return false;
if ( result )
- result->Printf("%s: %s", headerName.c_str(), headerValue.c_str());
+ result->Printf("%s: %s", headerName, headerValue);
return true;
}
diff --git a/src/util/ColourNames.cpp b/src/util/ColourNames.cpp
index 94ab9e8d..a88efeee 100644
--- a/src/util/ColourNames.cpp
+++ b/src/util/ColourNames.cpp
@@ -104,7 +104,7 @@ void ReadColour(wxColour *col, Profile *profile, const MOption& opt)
{
wxLogError(_("Cannot find a colour named \"%s\", using default instead "
"(please check the value of option \"%s\")"),
- value.c_str(),
+ value,
GetOptionName(opt));
}
}
diff --git a/src/util/upgrade.cpp b/src/util/upgrade.cpp
index f77f3ba9..70a1019e 100644
--- a/src/util/upgrade.cpp
+++ b/src/util/upgrade.cpp
@@ -1075,28 +1075,28 @@ bool InstallWizardServersPage::TransferDataFromWindow()
{
failed++;
tmp.Printf(_("POP3 server '%s'.\n"),
- gs_installWizardData.pop.c_str());
+ gs_installWizardData.pop);
check += tmp;
}
if( !CheckHostName(gs_installWizardData.smtp) )
{
failed++;
tmp.Printf(_("SMTP server '%s'.\n"),
- gs_installWizardData.smtp.c_str());
+ gs_installWizardData.smtp);
check += tmp;
}
if( !CheckHostName(gs_installWizardData.imap) )
{
failed++;
tmp.Printf(_("IMAP server '%s'.\n"),
- gs_installWizardData.imap.c_str());
+ gs_installWizardData.imap);
check += tmp;
}
if( !CheckHostName(gs_installWizardData.nntp) )
{
failed++;
tmp.Printf(_("NNTP server '%s'.\n"),
- gs_installWizardData.nntp.c_str());
+ gs_installWizardData.nntp);
check += tmp;
}
if(failed)
@@ -1133,7 +1133,7 @@ InstallWizardServersPage::AddDomain(wxString& server, const wxString& domain)
wxString msg;
msg.Printf(_("You have no domain specified for the server '%s'.\n"
"Do you want to add the domain '%s'?"),
- server.c_str(), domain.c_str());
+ server, domain);
if(MDialog_YesNoDialog(msg,this, MDIALOG_YESNOTITLE, true))
#endif // 0
@@ -1518,7 +1518,7 @@ static wxString GetRFC822Time(void)
}
timeStr.Printf(_T("%02d %s %d %02d:%02d:%02d"),
ourtime->tm_mday,
- timeStr.c_str(),
+ timeStr,
ourtime->tm_year+1900,
ourtime->tm_hour,
ourtime->tm_min,
@@ -1778,7 +1778,7 @@ bool RunInstallWizard(
);
String timeStr = GetRFC822Time();
- String msgString = wxString::Format(msgFmt, timeStr.c_str());
+ String msgString = wxString::Format(msgFmt, timeStr);
msgString = strutil_enforceCRLF(msgString);
mf->AppendMessage(msgString);
@@ -2182,7 +2182,7 @@ public:
config->DeleteEntry(MP_OLD_FOLDER_HOST);
wxLogTrace(_T("Successfully converted folder '%s'"),
- folderName.c_str());
+ folderName);
}
else
{
@@ -2247,7 +2247,7 @@ public:
};
wxLogTrace(_T("Updating templates for the folder '%s'..."),
- folderName.c_str());
+ folderName);
for ( size_t n = 0; n < WXSIZEOF(templateKinds); n++ )
{
@@ -2266,20 +2266,20 @@ public:
wxLogWarning(_("A profile entry '%s' already exists, "
"impossible to upgrade the existing template "
"in '%s/%s/%s'"),
- entryNew.c_str(),
- folderName.c_str(),
- group.c_str(),
- entry.c_str());
+ entryNew,
+ folderName,
+ group,
+ entry);
m_ok = false;
}
else
{
wxLogTrace(_T("\t%s/%s/%s upgraded to %s"),
- folderName.c_str(),
- group.c_str(),
- entry.c_str(),
- entryNew.c_str());
+ folderName,
+ group,
+ entry,
+ entryNew);
profileApp->writeEntry(entryNew, templateValue);
profile->writeEntry(entry, entryNew);
@@ -2511,7 +2511,7 @@ UpdateNonFolderProfiles(wxConfigBase *config)
if ( deleteGroup )
{
wxLogWarning(_("Removing invalid config settings group '%s'."),
- name.c_str());
+ name);
}
}
@@ -2928,7 +2928,7 @@ Upgrade(const String& fromVersion)
if ( success && UpgradeFrom066() )
wxLogMessage(_("Configuration information and program files were "
"successfully upgraded from the version '%s'."),
- fromVersion.c_str());
+ fromVersion);
else
wxLogError(_("Configuration information and program files "
"could not be upgraded from version '%s', some "
@@ -2936,7 +2936,7 @@ Upgrade(const String& fromVersion)
"\n"
"It is recommended that you uninstall and reinstall "
"the program before using it."),
- fromVersion.c_str());
+ fromVersion);
// fall through
case Version_Last:
@@ -2950,7 +2950,7 @@ Upgrade(const String& fromVersion)
case Version_Unknown:
wxLogError(_("The previously installed version of Mahogany (%s) was "
"probably newer than this one. Cannot upgrade."),
- fromVersion.c_str());
+ fromVersion);
return false;
}
@@ -2977,8 +2977,8 @@ public:
"Found additional folder '%s'\n"
"marked as central new mail folder. Ignoring it.\n"
"New Mail folder used is '%s'."),
- f->GetFullName().c_str(),
- m_NewMailFolder.c_str()));
+ f->GetFullName(),
+ m_NewMailFolder));
// f->SetFlags(f->GetFlags() & !MF_FLAGS_NEWMAILFOLDER);
Profile *p = Profile::CreateProfile(f->GetFullName());
if(p)
@@ -3000,7 +3000,7 @@ public:
ERRORMESSAGE((_("Cannot auto-collect mail from the new mail folder\n"
"'%s'\n"
"Corrected configuration data."),
- f->GetFullName().c_str()));
+ f->GetFullName()));
f->SetFlags(f->GetFlags() & ~MF_FLAGS_INCOMING);
}
}
@@ -3048,7 +3048,7 @@ VerifyStdFolder(const MOption& optName,
if ( !folder )
{
- wxLogError(_("Failed to create system folder '%s'"), name.c_str());
+ wxLogError(_("Failed to create system folder '%s'"), name);
return 0;
}
@@ -3625,7 +3625,7 @@ bool RetrieveRemoteConfigSettings(bool confirm)
if ( !folder )
{
wxLogError(_("Folder '%s' for storing remote configuration "
- "doesn't exist."), foldername.c_str());
+ "doesn't exist."), foldername);
return false;
}
@@ -3634,7 +3634,7 @@ bool RetrieveRemoteConfigSettings(bool confirm)
if(! mf)
{
wxLogError(_("Please check that the folder '%s' where the remote "
- "configuration is stored exists."), foldername.c_str());
+ "configuration is stored exists."), foldername);
return false;
}
@@ -3644,13 +3644,13 @@ bool RetrieveRemoteConfigSettings(bool confirm)
{
if ( nMessages == 0 )
wxLogError(_("Configuration mailbox '%s' does not contain any "
- "information."), mf->GetName().c_str());
+ "information."), mf->GetName());
else
wxLogError(
_("Configuration mailbox '%s' contains more than\n"
"one message. Possibly wrong mailbox specified?\n"
"If this mailbox is the correct one, please remove\n"
- "the extra messages and try again."), mf->GetName().c_str());
+ "the extra messages and try again."), mf->GetName());
mf->DecRef();
return false;
}
@@ -3663,7 +3663,7 @@ bool RetrieveRemoteConfigSettings(bool confirm)
wxLogError(
_("The message in the configuration mailbox '%s' does not\n"
"contain configuration settings. Please remove it."),
- mf->GetName().c_str());
+ mf->GetName());
mf->DecRef();
msg->DecRef();
hil->DecRef();
@@ -3794,7 +3794,7 @@ bool SaveRemoteConfigSettings(bool confirm)
_("Configuration mailbox '%s' contains more than\n"
"one message. Possibly wrong mailbox specified?\n"
"If this mailbox is the correct one, please remove\n"
- "the extra messages and try again."), mf->GetName().c_str());
+ "the extra messages and try again."), mf->GetName());
mf->DecRef();
return false;
}
@@ -3812,7 +3812,7 @@ bool SaveRemoteConfigSettings(bool confirm)
wxLogError(
_("The message in the configuration mailbox '%s' does not\n"
"contain configuration settings. Please remove it."),
- mf->GetName().c_str());
+ mf->GetName());
mf->DecRef();
msg->DecRef();
return false;
@@ -3840,7 +3840,7 @@ bool SaveRemoteConfigSettings(bool confirm)
{
wxLogError(
_("Cannot remove old configuration information from\n"
- "mailbox '%s'."), mf->GetName().c_str());
+ "mailbox '%s'."), mf->GetName());
mf->DecRef();
msg->DecRef();
return false;
@@ -3902,7 +3902,7 @@ bool SaveRemoteConfigSettings(bool confirm)
tmpfile.Read(buffer, lenTmp) != lenTmp)
{
wxLogError(_("Cannot read configuration info from temporary file\n"
- "'%s'."), filename.c_str());
+ "'%s'."), filename);
tmpfile.Close();
delete [] buffer;
mf->DecRef();
@@ -3922,7 +3922,7 @@ bool SaveRemoteConfigSettings(bool confirm)
if( ! mf->AppendMessage(msgText) )
{
wxLogError(_("Storing configuration information in mailbox\n"
- "'%s' failed."), mf->GetName().c_str());
+ "'%s' failed."), mf->GetName());
rc = false;
}
mf->DecRef();
@@ -3933,7 +3933,7 @@ bool SaveRemoteConfigSettings(bool confirm)
wxString msg;
msg.Printf(
_("Successfully stored shared configuration info in folder '%s'."),
- mf->GetName().c_str());
+ mf->GetName());
MDialog_Message(msg, NULL, _("Saved settings"),
GetPersMsgBoxName(M_MSGBOX_CONFIG_SAVED_REMOTELY));
}
diff --git a/src/wx/common/vcard.cpp b/src/wx/common/vcard.cpp
index 0c2be159..8ff6e9c8 100644
--- a/src/wx/common/vcard.cpp
+++ b/src/wx/common/vcard.cpp
@@ -120,7 +120,7 @@ wxVCard::~wxVCard()
if ( !vObj )
{
wxLogError(_("The file '%s' doesn't contain any vCard objects."),
- filename.c_str());
+ filename);
}
else
{
diff --git a/src/wx/generic/persctrl.cpp b/src/wx/generic/persctrl.cpp
index d5cbd766..608c247d 100644
--- a/src/wx/generic/persctrl.cpp
+++ b/src/wx/generic/persctrl.cpp
@@ -1319,7 +1319,7 @@ void wxPTreeCtrl::RestoreExpandedBranches(const wxTreeItemId& itemRoot,
if ( !node.ToULong(&index) )
{
wxLogDebug(_T("Corrupted config data: '%s'."),
- node.c_str());
+ node);
break;
}
diff --git a/src/wx/generic/vcarddlg.cpp b/src/wx/generic/vcarddlg.cpp
index 2c5ed31b..49616b18 100644
--- a/src/wx/generic/vcarddlg.cpp
+++ b/src/wx/generic/vcarddlg.cpp
@@ -501,7 +501,7 @@ bool wxVCardDialog::TransferDataFromWindow()
if ( !!birthday && !dt.ParseDate(birthday) )
{
wxLogError(_("Invalid birthday date: '%s'"),
- m_birthday->GetValue().c_str());
+ m_birthday->GetValue());
return FALSE;
}
diff --git a/tests/layout/wxLayout.cpp b/tests/layout/wxLayout.cpp
index 82740a8d..ad2d1c70 100644
--- a/tests/layout/wxLayout.cpp
+++ b/tests/layout/wxLayout.cpp
@@ -248,7 +248,7 @@ void MyFrame::AddSampleText(wxLayoutList *llist)
for ( wxString s = file.GetFirstLine(); !file.Eof(); s = file.GetNextLine() )
{
wxString line;
- llist->Insert(line.Format(_T("%6u: %s"),file.GetCurrentLine()+1,s.c_str()));
+ llist->Insert(line.Format(_T("%6u: %s"),file.GetCurrentLine()+1,s));
llist->LineBreak();
}
}
commit 3e0bf0ab9919ead59cd1f5d411faedef4be076c6
Author: Vadim Zeitlin <[email protected]>
Date: Tue Jul 1 19:59:52 2025 +0200
Simplify strutil_isempty() to always use empty()
diff --git a/include/strutil.h b/include/strutil.h
index 78a80020..5a6b26aa 100644
--- a/include/strutil.h
+++ b/include/strutil.h
@@ -25,11 +25,7 @@ class wxRegEx;
//@{
-#ifdef USE_WXSTRING // use std::string
- inline bool strutil_isempty(const String &s) { return IsEmpty(s); }
-#else
- inline bool strutil_isempty(const String &s) { return *s.c_str() == _T('\0'); }
-#endif
+inline bool strutil_isempty(const String &s) { return s.empty(); }
/// return true if string is empty
inline bool strutil_isempty(const wxChar *s) { return s == NULL || *s == _T('\0'); }
commit 0488a5ba7cb25f5f5f611648c807d185d20479dc
Author: Vadim Zeitlin <[email protected]>
Date: Tue Jul 1 19:57:29 2025 +0200
Don't call wxStrlen(s.c_str()), just use s.length() directly
diff --git a/include/gui/wxllist.h b/include/gui/wxllist.h
index 0439aaa4..e1a26ce7 100644
--- a/include/gui/wxllist.h
+++ b/include/gui/wxllist.h
@@ -288,7 +288,7 @@ public:
virtual wxString DebugDump(void) const;
#endif
- virtual CoordType GetLength(void) const { return wxStrlen(m_Text.c_str()); }
+ virtual CoordType GetLength(void) const { return m_Text.length(); }
// for editing:
wxString & GetText(void) { return m_Text; }
commit f4070743be8a2440b6de2d4dedf214f4144eac99
Author: Vadim Zeitlin <[email protected]>
Date: Tue Jul 1 19:56:59 2025 +0200
Remove unused Str() macro
This doesn't seem to have been ever used anywhere, so just remove it.
diff --git a/include/Mconfig.h b/include/Mconfig.h
index 041b9c82..a532fd67 100644
--- a/include/Mconfig.h
+++ b/include/Mconfig.h
@@ -162,11 +162,9 @@
#ifdef USE_STD_STRING
# include <string>
typedef std::string String;
-# define Str(str)((str).c_str())
#else
# include <wx/string.h>
typedef wxString String;
-# define Str(str) str
#endif
// set the proper STL class names
-----------------------------------------------------------------------
Summary of changes:
include/Mconfig.h | 2 -
include/PGPClickInfo.h | 12 ++--
include/gui/wxllist.h | 2 +-
include/mail/ServerInfo.h | 8 +--
include/strutil.h | 6 +-
include/sysutil.h | 2 +-
src/Python/InitPython.cpp | 4 +-
src/Python/PythonHelp.cpp | 14 ++---
src/adb/AdbDialogs.cpp | 2 +-
src/adb/AdbFrame.cpp | 52 ++++++++---------
src/adb/AdbImport.cpp | 22 +++----
src/adb/AdbManager.cpp | 12 ++--
src/adb/AdbModule.cpp | 4 +-
src/adb/Collect.cpp | 20 +++----
src/adb/ExportText.cpp | 2 +-
src/adb/ExportVCard.cpp | 6 +-
src/adb/ImportEudora.cpp | 2 +-
src/adb/ImportMailrc.cpp | 4 +-
src/adb/ImportPine.cpp | 8 +--
src/adb/ImportXFMail.cpp | 2 +-
src/adb/ProvBbdb.cpp | 12 ++--
src/adb/ProvDummy.cpp | 2 +-
src/adb/ProvFC.cpp | 2 +-
src/adb/ProvLine.cpp | 4 +-
src/classes/CacheFile.cpp | 4 +-
src/classes/ComposeTemplate.cpp | 12 ++--
src/classes/ConfigSource.cpp | 18 +++---
src/classes/ConfigSourcesAll.cpp | 2 +-
src/classes/FolderMonitor.cpp | 14 ++---
src/classes/MApplication.cpp | 40 ++++++-------
src/classes/MFilter.cpp | 6 +-
src/classes/MFolder.cpp | 20 +++----
src/classes/MModule.cpp | 21 ++++---
src/classes/MObject.cpp | 14 ++---
src/classes/MessageTemplate.cpp | 16 +++---
src/classes/MessageView.cpp | 48 ++++++++--------
src/classes/Mpers.cpp | 2 +-
src/classes/Profile.cpp | 6 +-
src/classes/XFace.cpp | 2 +-
src/gui/Mdnd.cpp | 3 +-
src/gui/wxFolderView.cpp | 12 ++--
src/gui/wxMApp.cpp | 4 +-
src/gui/wxMDialogs.cpp | 3 +-
src/gui/wxMIMETreeDialog.cpp | 3 +-
src/gui/wxMainFrame.cpp | 6 +-
src/gui/wxMsgCmdProc.cpp | 35 ++++++------
src/gui/wxTemplateDialog.cpp | 2 +-
src/mail/ASMailFolder.cpp | 4 +-
src/mail/Address.cpp | 2 +-
src/mail/AddressCC.cpp | 2 +-
src/mail/HeaderIterator.cpp | 2 +-
src/mail/LogCircle.cpp | 4 +-
src/mail/MFCache.cpp | 10 ++--
src/mail/MFPool.cpp | 4 +-
src/mail/MailFolder.cpp | 14 ++---
src/mail/MailFolderCC.cpp | 104 +++++++++++++++++-----------------
src/mail/MailFolderCmn.cpp | 98 ++++++++++++++++----------------
src/mail/MailMH.cpp | 12 ++--
src/mail/MessageCC.cpp | 12 ++--
src/mail/MimeDecode.cpp | 10 ++--
src/mail/MimePartCCBase.cpp | 2 +-
src/mail/Pop3.cpp | 6 +-
src/mail/SendMessageCC.cpp | 31 +++++-----
src/mail/SpamFilter.cpp | 12 ++--
src/modules/Calendar.cpp | 14 ++---
src/modules/Filters.cpp | 24 ++++----
src/modules/HtmlViewer.cpp | 4 +-
src/modules/Migrate.cpp | 26 ++++-----
src/modules/NetscapeImporter.cpp | 60 ++++++++++----------
src/modules/PalmOS.cpp | 75 ++++++++++++------------
src/modules/PineImport.cpp | 34 +++++------
src/modules/XFMailImport.cpp | 72 +++++++++++------------
src/modules/crypt/PGPEngine.cpp | 30 +++++-----
src/modules/spam/DspamFilter.cpp | 14 ++---
src/modules/spam/HeadersFilter.cpp | 8 +--
src/modules/spam/ServerSideFilter.cpp | 4 +-
src/util/ColourNames.cpp | 2 +-
src/util/upgrade.cpp | 72 +++++++++++------------
src/wx/common/vcard.cpp | 2 +-
src/wx/generic/persctrl.cpp | 9 ++-
src/wx/generic/vcarddlg.cpp | 2 +-
tests/layout/wxLayout.cpp | 2 +-
82 files changed, 625 insertions(+), 657 deletions(-)
hooks/post-receive
--
Mahogany sources repository.