summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper
Side-by-side diff
Diffstat (limited to 'kmicromail/libmailwrapper') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/abstractmail.cpp22
-rw-r--r--kmicromail/libmailwrapper/imapwrapper.cpp58
-rw-r--r--kmicromail/libmailwrapper/mboxwrapper.cpp29
-rw-r--r--kmicromail/libmailwrapper/pop3wrapper.cpp21
-rw-r--r--kmicromail/libmailwrapper/smtpwrapper.cpp59
5 files changed, 96 insertions, 93 deletions
diff --git a/kmicromail/libmailwrapper/abstractmail.cpp b/kmicromail/libmailwrapper/abstractmail.cpp
index 2d7533c..8ee112c 100644
--- a/kmicromail/libmailwrapper/abstractmail.cpp
+++ b/kmicromail/libmailwrapper/abstractmail.cpp
@@ -11,7 +11,7 @@
#include <qprogressbar.h>
#include <qapplication.h>
#include <qmessagebox.h>
-
+#include <klocale.h>
#include <kdecore/kstandarddirs.h>
#include <qfile.h>
#include <qtextstream.h>
@@ -147,10 +147,10 @@ void AbstractMail::deleteMailList(const QValueList<RecMailP>&target)
int iii = 0;
int count = target.count();
QProgressBar wid ( count );
- wid.setCaption( tr("Deleting ..."));
+ wid.setCaption( i18n("Deleting ..."));
wid.show();
while (iii < count ) {
- Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count));
+ Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count));
wid.setProgress( iii );
wid.raise();
qApp->processEvents();
@@ -172,15 +172,15 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe
// create local folder
if ( !targetMail->createMbox(lfName))
{
- QMessageBox::critical(0,tr("Error creating new Folder"),
- tr("Error while creating new folder\n%1\n\nCancelling action.").arg(lfName));
+ QMessageBox::critical(0,i18n("Error creating new Folder"),
+ i18n("Error while creating new folder\n%1\n\nCancelling action.").arg(lfName));
return;
}
QValueList<RecMailP> t;
listMessages(fromFolder->getName(),t,acc->getMaxMailSize() );
if ( t.count() == 0 ) {
qDebug("There are no new messages %s", fromFolder->getName().latin1());
- Global::statusMessage(tr("There are no new messages"));
+ Global::statusMessage(i18n("There are no new messages"));
return;
}
QValueList<RecMailP> e;
@@ -210,11 +210,11 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe
}
qDebug("Downloaded %d messages ",n.count() );
if ( n.count() == 0 ) {
- Global::statusMessage(tr("There are no new messages"));
+ Global::statusMessage(i18n("There are no new messages"));
return;
}
mvcpMailList( n,lfName,targetMail,!acc->getLeaveOnServer());
- Global::statusMessage(tr("Downloaded %1 messages").arg(n.count()));
+ Global::statusMessage(i18n("Downloaded %1 messages").arg(n.count()));
#if 0
QValueList<RecMailP> t;
@@ -240,13 +240,13 @@ void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t,
if ( count == 0 )
return;
// wel, processevents is qite strange, we need a widget for getting
- // Global::statusMessage(tr("Copy2 message %1").arg(iii)); displaye
+ // Global::statusMessage(i18n("Copy2 message %1").arg(iii)); displaye
QProgressBar wid ( count );
- wid.setCaption( tr("Copying ..."));
+ wid.setCaption( i18n("Copying..."));
wid.show();
while (iii < count ) {
- Global::statusMessage(tr("Copy message %1 of %2").arg(iii).arg(count));
+ Global::statusMessage(i18n("Copy message %1 of %2").arg(iii).arg(count));
wid.setProgress( iii );
wid.raise();
qApp->processEvents();
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp
index 8150453..3aec13d 100644
--- a/kmicromail/libmailwrapper/imapwrapper.cpp
+++ b/kmicromail/libmailwrapper/imapwrapper.cpp
@@ -48,7 +48,7 @@ int IMAPwrapper::selectMbox(const QString&mbox)
void IMAPwrapper::imap_progress( size_t current, size_t maximum )
{
//qDebug("imap progress %d of %d ",current,maximum );
- //Global::statusMessage(tr("Downloading message %1 of %2").arg( current).arg(maximum));
+ //Global::statusMessage(i18n("Downloading message %1 of %2").arg( current).arg(maximum));
//qApp->processEvents()
static int last = 0;
if ( last != current )
@@ -66,8 +66,8 @@ void IMAPwrapper::progress( QString m )
}
QString mess;
//qDebug("progress ");
- if ( mMax ) mess = mProgrMess +tr(" message %1 of %2").arg( mCurrent++).arg(mMax);
- else mess = mProgrMess +tr(" message %1").arg( mCurrent++);
+ if ( mMax ) mess = mProgrMess +i18n(" message %1 of %2").arg( mCurrent++).arg(mMax);
+ else mess = mProgrMess +i18n(" message %1").arg( mCurrent++);
Global::statusMessage(mess);
//qDebug("Progress %s %s", mess.latin1(), m.latin1());
qApp->processEvents();
@@ -100,7 +100,7 @@ bool IMAPwrapper::start_tls(bool force_tls)
if (try_tls) {
err = mailimap_starttls(m_imap);
if (err != MAILIMAP_NO_ERROR && force_tls) {
- Global::statusMessage(tr("Server has no TLS support!"));
+ Global::statusMessage(i18n("Server has no TLS support!"));
try_tls = false;
} else {
mailstream_low * low;
@@ -188,7 +188,7 @@ void IMAPwrapper::login()
} else {
failure="Unknown failure";
}
- Global::statusMessage(tr("error connecting imap server: %1").arg(failure));
+ Global::statusMessage(i18n("error connecting imap server: %1").arg(failure));
mailimap_free( m_imap );
m_imap = 0;
return;
@@ -200,7 +200,7 @@ void IMAPwrapper::login()
bool ok = true;
if (force_tls && !try_tls) {
- Global::statusMessage(tr("Server has no TLS support!"));
+ Global::statusMessage(i18n("Server has no TLS support!"));
ok = false;
}
@@ -210,7 +210,7 @@ void IMAPwrapper::login()
if (ok) {
err = mailimap_login_simple( m_imap, (char*)user.latin1(), (char*)pass.latin1() );
if ( err != MAILIMAP_NO_ERROR ) {
- Global::statusMessage(tr("error logging in imap server: %1").arg(m_imap->imap_response));
+ Global::statusMessage(i18n("error logging in imap server: %1").arg(m_imap->imap_response));
ok = false;
}
}
@@ -256,14 +256,14 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSma
int last = m_imap->imap_selection_info->sel_exists;
if (last == 0) {
- Global::statusMessage(tr("Mailbox has no mails"));
+ Global::statusMessage(i18n("Mailbox has no mails"));
return;
} else {
}
- progress( tr("Fetch "));
+ progress( i18n("Fetch "));
mMax = last;
//qDebug("last %d ", last);
- Global::statusMessage(tr("Fetching header list"));
+ Global::statusMessage(i18n("Fetching header list"));
qApp->processEvents();
/* the range has to start at 1!!! not with 0!!!! */
//LR the access to web.de imap server is no working with value 1
@@ -299,12 +299,12 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSma
}
}
}
- Global::statusMessage(tr("Mailbox has %1 mails").arg(target.count()));
+ Global::statusMessage(i18n("Mailbox has %1 mails").arg(target.count()));
} else {
--tryAgain;
--tryAgain;//disabled tryagain by adding this line
if ( tryAgain < 0 )
- Global::statusMessage(tr("Error fetching headers: %1").arg(m_imap->imap_response));
+ Global::statusMessage(i18n("Error fetching headers: %1").arg(m_imap->imap_response));
else
qDebug("try again... ");
}
@@ -333,7 +333,7 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders()
* We must not forget to filter them out in next loop!
* it seems like ugly code. and yes - it is ugly code. but the best way.
*/
- Global::statusMessage(tr("Fetching folder list"));
+ Global::statusMessage(i18n("Fetching folder list"));
qApp->processEvents();
QString temp;
mask = "INBOX" ;
@@ -969,13 +969,13 @@ void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target)
mMax = count;
- progress( tr("Delete"));
+ progress( i18n("Delete"));
QProgressBar wid ( count );
- wid.setCaption( tr("Deleting ..."));
+ wid.setCaption( i18n("Deleting ..."));
wid.show();
while (iii < count ) {
- Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count));
+ Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count));
wid.setProgress( iii );
wid.raise();
qApp->processEvents();
@@ -1003,7 +1003,7 @@ void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target)
// err = mailimap_expunge(m_imap);
//if (err != MAILIMAP_NO_ERROR) {
- // Global::statusMessage(tr("Error deleting mails: %s").arg(m_imap->imap_response));
+ // Global::statusMessage(i18n("Error deleting mails: %s").arg(m_imap->imap_response));
// }
//#endif
//deleteMail( mail);
@@ -1012,7 +1012,7 @@ void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target)
//qDebug("Deleting imap mails... ");
err = mailimap_expunge(m_imap);
if (err != MAILIMAP_NO_ERROR) {
- Global::statusMessage(tr("Error deleting mails: %s").arg(m_imap->imap_response));
+ Global::statusMessage(i18n("Error deleting mails: %s").arg(m_imap->imap_response));
}
}
void IMAPwrapper::deleteMail(const RecMailP&mail)
@@ -1046,7 +1046,7 @@ void IMAPwrapper::deleteMail(const RecMailP&mail)
err = mailimap_expunge(m_imap);
if (err != MAILIMAP_NO_ERROR) {
- Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response));
+ Global::statusMessage(i18n("error deleting mail: %s").arg(m_imap->imap_response));
}
//qDebug("IMAPwrapper::deleteMail 2");
@@ -1129,7 +1129,7 @@ int IMAPwrapper::deleteAllMail(const FolderP&folder)
int last = m_imap->imap_selection_info->sel_exists;
if (last == 0) {
- Global::statusMessage(tr("Mailbox has no mails!"));
+ Global::statusMessage(i18n("Mailbox has no mails!"));
return 0;
}
flist = mailimap_flag_list_new_empty();
@@ -1140,14 +1140,14 @@ int IMAPwrapper::deleteAllMail(const FolderP&folder)
mailimap_set_free( set );
mailimap_store_att_flags_free(store_flags);
if (err != MAILIMAP_NO_ERROR) {
- Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response));
+ Global::statusMessage(i18n("error deleting mail: %s").arg(m_imap->imap_response));
return 0;
}
// odebug << "deleting mail: " << m_imap->imap_response << "" << oendl;
/* should we realy do that at this moment? */
err = mailimap_expunge(m_imap);
if (err != MAILIMAP_NO_ERROR) {
- Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response));
+ Global::statusMessage(i18n("error deleting mail: %s").arg(m_imap->imap_response));
return 0;
}
// odebug << "Delete successfull " << m_imap->imap_response << "" << oendl;
@@ -1171,14 +1171,14 @@ int IMAPwrapper::createMbox(const QString&folder,const FolderP&parentfolder,cons
if (delemiter.length()>0) {
pre+=delemiter;
} else {
- Global::statusMessage(tr("Cannot create folder %1 for holding subfolders").arg(pre));
+ Global::statusMessage(i18n("Cannot create folder %1 for holding subfolders").arg(pre));
return 0;
}
}
// odebug << "Creating " << pre.latin1() << "" << oendl;
int res = mailimap_create(m_imap,pre.latin1());
if (res != MAILIMAP_NO_ERROR) {
- Global::statusMessage(tr("%1").arg(m_imap->imap_response));
+ Global::statusMessage(i18n("%1").arg(m_imap->imap_response));
return 0;
}
return 1;
@@ -1191,7 +1191,7 @@ int IMAPwrapper::deleteMbox(const FolderP&folder)
if (!m_imap) {return 0;}
int res = mailimap_delete(m_imap,folder->getName());
if (res != MAILIMAP_NO_ERROR) {
- Global::statusMessage(tr("%1").arg(m_imap->imap_response));
+ Global::statusMessage(i18n("%1").arg(m_imap->imap_response));
return 0;
}
return 1;
@@ -1274,7 +1274,7 @@ void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder,
{
if (targetWrapper != this || maxSizeInKb > 0 ) {
mMax = 0;
- progress( tr("Copy"));
+ progress( i18n("Copy"));
AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit, maxSizeInKb);
//qDebug("IMAPwrapper::mvcpAllMails::Using generic");
// odebug << "Using generic" << oendl;
@@ -1289,13 +1289,13 @@ void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder,
if ( err != MAILIMAP_NO_ERROR ) {
return;
}
- Global::statusMessage( tr("Copying mails on server...") );
+ Global::statusMessage( i18n("Copying mails on server...") );
int last = m_imap->imap_selection_info->sel_exists;
set = mailimap_set_new_interval( 1, last );
err = mailimap_copy(m_imap,set,targetFolder.latin1());
mailimap_set_free( set );
if ( err != MAILIMAP_NO_ERROR ) {
- QString error_msg = tr("Error copy mails: %1").arg(m_imap->imap_response);
+ QString error_msg = i18n("Error copy mails: %1").arg(m_imap->imap_response);
Global::statusMessage(error_msg);
// odebug << error_msg << oendl;
return;
@@ -1325,7 +1325,7 @@ void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,Abstra
err = mailimap_copy(m_imap,set,targetFolder.latin1());
mailimap_set_free( set );
if ( err != MAILIMAP_NO_ERROR ) {
- QString error_msg = tr("error copy mail: %1").arg(m_imap->imap_response);
+ QString error_msg = i18n("error copy mail: %1").arg(m_imap->imap_response);
Global::statusMessage(error_msg);
// odebug << error_msg << oendl;
return;
diff --git a/kmicromail/libmailwrapper/mboxwrapper.cpp b/kmicromail/libmailwrapper/mboxwrapper.cpp
index 39dd156..0cdbae4 100644
--- a/kmicromail/libmailwrapper/mboxwrapper.cpp
+++ b/kmicromail/libmailwrapper/mboxwrapper.cpp
@@ -4,6 +4,7 @@
#include <libetpan/libetpan.h>
#include <qdir.h>
#include <stdlib.h>
+#include <klocale.h>
#include <qpe/global.h>
@@ -44,7 +45,7 @@ void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &ta
mailfolder_disconnect(folder);
mailfolder_free(folder);
mailstorage_free(storage);
- Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count()));
+ Global::statusMessage(i18n("Mailbox has %1 mail(s)").arg(target.count()));
}
QValueList<Opie::Core::OSmartPointer<Folder> >* MBOXwrapper::listFolders()
@@ -143,12 +144,12 @@ int MBOXwrapper::createMbox(const QString&folder,const FolderP&,const QString&,b
p+=folder;
QFileInfo fi(p);
if (fi.exists()) {
- Global::statusMessage(tr("Mailbox exists."));
+ Global::statusMessage(i18n("Mailbox exists."));
return 0;
}
mailmbox_folder*f = 0;
if (mailmbox_init(p.latin1(),0,1,0,&f) != MAIL_NO_ERROR) {
- Global::statusMessage(tr("Error init folder"));
+ Global::statusMessage(i18n("Error init folder"));
return 0;
}
if (f) mailmbox_done(f);
@@ -162,12 +163,12 @@ void MBOXwrapper::storeMessage(const char*msg,size_t length, const QString&folde
mailmbox_folder*f = 0;
int r = mailmbox_init(p.latin1(),0,1,0,&f);
if (r != MAIL_NO_ERROR) {
- Global::statusMessage(tr("Error init folder"));
+ Global::statusMessage(i18n("Error init folder"));
return;
}
r = mailmbox_append_message(f,msg,length);
if (r != MAIL_NO_ERROR) {
- Global::statusMessage(tr("Error writing to message folder"));
+ Global::statusMessage(i18n("Error writing to message folder"));
}
mailmbox_done(f);
}
@@ -187,21 +188,21 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMailP&mail)
folder = mailfolder_new( storage,(char*)p.latin1(),NULL);
r = mailfolder_connect(folder);
if (r != MAIL_NO_ERROR) {
- Global::statusMessage(tr("Error initializing mbox"));
+ Global::statusMessage(i18n("Error initializing mbox"));
mailfolder_free(folder);
mailstorage_free(storage);
return 0;
}
r = mailsession_get_message(folder->fld_session, mail->getNumber(), &msg);
if (r != MAIL_NO_ERROR) {
- Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber()));
+ Global::statusMessage(i18n("Error fetching mail %i").arg(mail->getNumber()));
mailfolder_free(folder);
mailstorage_free(storage);
return 0;
}
r = mailmessage_fetch(msg,&data,&size);
if (r != MAIL_NO_ERROR) {
- Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber()));
+ Global::statusMessage(i18n("Error fetching mail %i").arg(mail->getNumber()));
mailfolder_free(folder);
mailstorage_free(storage);
mailmessage_free(msg);
@@ -257,14 +258,14 @@ int MBOXwrapper::deleteAllMail(const FolderP&tfolder)
mailstorage*storage = mailstorage_new(NULL);
int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0);
if (r != MAIL_NO_ERROR) {
- Global::statusMessage(tr("Error initializing mbox"));
+ Global::statusMessage(i18n("Error initializing mbox"));
res = 0;
}
if (res) {
folder = mailfolder_new( storage,(char*)p.latin1(),NULL);
r = mailfolder_connect(folder);
if (r != MAIL_NO_ERROR) {
- Global::statusMessage(tr("Error initializing mbox"));
+ Global::statusMessage(i18n("Error initializing mbox"));
res = 0;
}
}
@@ -278,7 +279,7 @@ int MBOXwrapper::deleteAllMail(const FolderP&tfolder)
for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) {
r = mailsession_remove_message(folder->fld_session,i+1);
if (r != MAIL_NO_ERROR) {
- Global::statusMessage(tr("Error deleting mail %1").arg(i+1));
+ Global::statusMessage(i18n("Error deleting mail %1").arg(i+1));
res = 0;
break;
}
@@ -295,11 +296,11 @@ int MBOXwrapper::deleteMbox(const FolderP&tfolder)
QString p = MBOXPath+"/"+tfolder->getDisplayName();
QFile fi(p);
if (!fi.exists()) {
- Global::statusMessage(tr("Mailbox doesn't exist."));
+ Global::statusMessage(i18n("Mailbox doesn't exist."));
return 0;
}
if (!fi.remove()) {
- Global::statusMessage(tr("Error deleting Mailbox."));
+ Global::statusMessage(i18n("Error deleting Mailbox."));
return 0;
}
return 1;
@@ -315,7 +316,7 @@ void MBOXwrapper::statusFolder(folderStat&target_stat,const QString & mailbox)
QString p = MBOXPath+"/"+mailbox;
QFile fi(p);
if (!fi.exists()) {
- Global::statusMessage(tr("Mailbox doesn't exist."));
+ Global::statusMessage(i18n("Mailbox doesn't exist."));
return;
}
int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0);
diff --git a/kmicromail/libmailwrapper/pop3wrapper.cpp b/kmicromail/libmailwrapper/pop3wrapper.cpp
index 9d52f52..2888f7c 100644
--- a/kmicromail/libmailwrapper/pop3wrapper.cpp
+++ b/kmicromail/libmailwrapper/pop3wrapper.cpp
@@ -5,6 +5,7 @@
#include "logindialog.h"
#include <libetpan/libetpan.h>
+#include <klocale.h>
#include <qpe/global.h>
#include <qfile.h>
@@ -107,7 +108,7 @@ void POP3wrapper::listMessages(const QString &, QValueList<Opie::Core::OSmartPoi
uint32_t res_messages,res_recent,res_unseen;
mailsession_status_folder(m_pop3->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen);
parseList(target,m_pop3->sto_session,"INBOX", false, maxSizeInKb);
- Global::statusMessage( tr("Mailbox contains %1 mail(s)").arg(res_messages));
+ Global::statusMessage( i18n("Mailbox contains %1 mail(s)").arg(res_messages));
}
void POP3wrapper::login()
@@ -165,7 +166,7 @@ void POP3wrapper::login()
err = mailstorage_connect(m_pop3);
if (err != MAIL_NO_ERROR) {
; // odebug << QString( "FEHLERNUMMER %1" ).arg( err ) << oendl;
- Global::statusMessage(tr("Error %1 initializing folder").arg( err ));
+ Global::statusMessage(i18n("Error %1 initializing folder").arg( err ));
mailstorage_free(m_pop3);
m_pop3 = 0;
} else {
@@ -202,10 +203,10 @@ void POP3wrapper::deleteMailList(const QValueList<RecMailP>&target)
int count = target.count();
QProgressBar wid ( count );
- wid.setCaption( tr("Deleting ..."));
+ wid.setCaption( i18n("Deleting ..."));
wid.show();
while (iii < count ) {
- Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count));
+ Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count));
wid.setProgress( iii );
wid.raise();
qApp->processEvents();
@@ -213,7 +214,7 @@ void POP3wrapper::deleteMailList(const QValueList<RecMailP>&target)
RecMailP mail = (*target.at( iii ));
int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber());
if (err != MAIL_NO_ERROR) {
- Global::statusMessage(tr("Error deleting mail"));
+ Global::statusMessage(i18n("Error deleting mail"));
}
++iii;
}
@@ -224,7 +225,7 @@ void POP3wrapper::deleteMail(const RecMailP&mail) {
return;
int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber());
if (err != MAIL_NO_ERROR) {
- Global::statusMessage(tr("error deleting mail"));
+ Global::statusMessage(i18n("error deleting mail"));
}
}
@@ -239,24 +240,24 @@ int POP3wrapper::deleteAllMail(const FolderP&) {
uint32_t result = 0;
int err = mailsession_messages_number(m_pop3->sto_session,NULL,&result);
if (err != MAIL_NO_ERROR) {
- Global::statusMessage(tr("Error getting folder info"));
+ Global::statusMessage(i18n("Error getting folder info"));
return 0;
}
QProgressBar wid ( result );
- wid.setCaption( tr("Deleting ..."));
+ wid.setCaption( i18n("Deleting ..."));
wid.show();
for (unsigned int i = 0; i < result; ++i) {
- Global::statusMessage(tr("Delete message %1 of %2").arg(i).arg(result));
+ Global::statusMessage(i18n("Delete message %1 of %2").arg(i).arg(result));
wid.setProgress( i );
wid.raise();
qApp->processEvents();
err = mailsession_remove_message(m_pop3->sto_session,i+1);
if (err != MAIL_NO_ERROR) {
- Global::statusMessage(tr("Error deleting mail %1").arg(i+1));
+ Global::statusMessage(i18n("Error deleting mail %1").arg(i+1));
res=0;
}
break;
diff --git a/kmicromail/libmailwrapper/smtpwrapper.cpp b/kmicromail/libmailwrapper/smtpwrapper.cpp
index d5a528c..dee1477 100644
--- a/kmicromail/libmailwrapper/smtpwrapper.cpp
+++ b/kmicromail/libmailwrapper/smtpwrapper.cpp
@@ -14,6 +14,7 @@
#include <qpe/qcopenvelope_qws.h>
#include <libetpan/libetpan.h>
+#include <klocale.h>
using namespace Opie::Core;
@@ -44,43 +45,43 @@ void SMTPwrapper::emitQCop( int queued ) {
QString SMTPwrapper::mailsmtpError( int errnum ) {
switch ( errnum ) {
case MAILSMTP_NO_ERROR:
- return tr( "No error" );
+ return i18n( "No error" );
case MAILSMTP_ERROR_UNEXPECTED_CODE:
- return tr( "Unexpected error code" );
+ return i18n( "Unexpected error code" );
case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE:
- return tr( "Service not available" );
+ return i18n( "Service not available" );
case MAILSMTP_ERROR_STREAM:
- return tr( "Stream error" );
+ return i18n( "Stream error" );
case MAILSMTP_ERROR_HOSTNAME:
- return tr( "gethostname() failed" );
+ return i18n( "gethostname() failed" );
case MAILSMTP_ERROR_NOT_IMPLEMENTED:
- return tr( "Not implemented" );
+ return i18n( "Not implemented" );
case MAILSMTP_ERROR_ACTION_NOT_TAKEN:
- return tr( "Error, action not taken" );
+ return i18n( "Error, action not taken" );
case MAILSMTP_ERROR_EXCEED_STORAGE_ALLOCATION:
- return tr( "Data exceeds storage allocation" );
+ return i18n( "Data exceeds storage allocation" );
case MAILSMTP_ERROR_IN_PROCESSING:
- return tr( "Error in processing" );
+ return i18n( "Error in processing" );
case MAILSMTP_ERROR_STARTTLS_NOT_SUPPORTED:
- return tr( "Starttls not supported" );
+ return i18n( "Starttls not supported" );
// case MAILSMTP_ERROR_INSUFFISANT_SYSTEM_STORAGE:
- // return tr( "Insufficient system storage" );
+ // return i18n( "Insufficient system storage" );
case MAILSMTP_ERROR_MAILBOX_UNAVAILABLE:
- return tr( "Mailbox unavailable" );
+ return i18n( "Mailbox unavailable" );
case MAILSMTP_ERROR_MAILBOX_NAME_NOT_ALLOWED:
- return tr( "Mailbox name not allowed" );
+ return i18n( "Mailbox name not allowed" );
case MAILSMTP_ERROR_BAD_SEQUENCE_OF_COMMAND:
- return tr( "Bad command sequence" );
+ return i18n( "Bad command sequence" );
case MAILSMTP_ERROR_USER_NOT_LOCAL:
- return tr( "User not local" );
+ return i18n( "User not local" );
case MAILSMTP_ERROR_TRANSACTION_FAILED:
- return tr( "Transaction failed" );
+ return i18n( "Transaction failed" );
case MAILSMTP_ERROR_MEMORY:
- return tr( "Memory error" );
+ return i18n( "Memory error" );
case MAILSMTP_ERROR_CONNECTION_REFUSED:
- return tr( "Connection refused" );
+ return i18n( "Connection refused" );
default:
- return tr( "Unknown error code" );
+ return i18n( "Unknown error code" );
}
}
@@ -152,8 +153,8 @@ void SMTPwrapper::storeFailedMail(const char*data,unsigned int size, const char*
storeMail(data,size,"Sendfailed");
}
if (failuremessage) {
- QMessageBox::critical(0,tr("Error sending mail"),
- tr("<center>%1</center>").arg(failuremessage));
+ QMessageBox::critical(0,i18n("Error sending mail"),
+ i18n("<center>%1</center>").arg(failuremessage));
}
}
@@ -221,7 +222,7 @@ void SMTPwrapper::connect_server()
}
if ( err != MAILSMTP_NO_ERROR ) {
; // odebug << "Error init connection" << oendl;
- failuretext = tr("Error init SMTP connection: %1").arg(mailsmtpError(err));
+ failuretext = i18n("Error init SMTP connection: %1").arg(mailsmtpError(err));
result = 0;
}
@@ -230,7 +231,7 @@ void SMTPwrapper::connect_server()
err = mailsmtp_init( m_smtp );
if (err != MAILSMTP_NO_ERROR) {
result = 0;
- failuretext = tr("Error init SMTP connection: %1").arg(mailsmtpError(err));
+ failuretext = i18n("Error init SMTP connection: %1").arg(mailsmtpError(err));
}
}
@@ -245,7 +246,7 @@ void SMTPwrapper::connect_server()
if (!try_tls && force_tls) {
result = 0;
- failuretext = tr("Error init SMTP tls: %1").arg(mailsmtpError(err));
+ failuretext = i18n("Error init SMTP tls: %1").arg(mailsmtpError(err));
}
if (result==1 && m_SmtpAccount->getLogin() ) {
@@ -261,7 +262,7 @@ void SMTPwrapper::connect_server()
pass = login.getPassword();
} else {
result = 0;
- failuretext=tr("Login aborted - storing mail to localfolder");
+ failuretext=i18n("Login aborted - storing mail to localfolder");
}
} else {
user = m_SmtpAccount->getUser();
@@ -273,7 +274,7 @@ void SMTPwrapper::connect_server()
if ( err == MAILSMTP_NO_ERROR ) {
; // odebug << "auth ok" << oendl;
} else {
- failuretext = tr("Authentification failed");
+ failuretext = i18n("Authentification failed");
result = 0;
}
}
@@ -300,7 +301,7 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size )
if (m_smtp) {
err = mailsmtp_send( m_smtp, from, rcpts, data, size );
if ( err != MAILSMTP_NO_ERROR ) {
- failuretext=tr("Error sending mail: %1").arg(mailsmtpError(err));
+ failuretext=i18n("Error sending mail: %1").arg(mailsmtpError(err));
result = 0;
}
} else {
@@ -433,8 +434,8 @@ bool SMTPwrapper::flushOutbox() {
while (mailsToSend.count()>0) {
if (sendQueuedMail(wrap, (*mailsToSend.begin()))==0) {
- QMessageBox::critical(0,tr("Error sending mail"),
- tr("Error sending queued mail - breaking"));
+ QMessageBox::critical(0,i18n("Error sending mail"),
+ i18n("Error sending queued mail - breaking"));
returnValue = false;
break;
}