summaryrefslogtreecommitdiff
path: root/noncore/net/mailit/emailhandler.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/mailit/emailhandler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mailit/emailhandler.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/net/mailit/emailhandler.cpp b/noncore/net/mailit/emailhandler.cpp
index 39f693d..5b8bda1 100644
--- a/noncore/net/mailit/emailhandler.cpp
+++ b/noncore/net/mailit/emailhandler.cpp
@@ -23,56 +23,56 @@
#include <qmessagebox.h>
#include <qcstring.h>
#include "emailhandler.h"
#include <qpe/applnk.h>
#include <qpe/filemanager.h>
QCollection::Item EnclosureList::newItem(QCollection::Item d)
{
return dupl( (Enclosure *) d);
}
Enclosure* EnclosureList::dupl(Enclosure *in)
{
ac = new Enclosure(*in);
return ac;
}
EmailHandler::EmailHandler()
{
qDebug("EMailHandler::EmailHandler");
smtpClient = new SmtpClient();
popClient = new PopClient();
- connect(smtpClient, SIGNAL(errorOccurred(int)), this,
- SIGNAL(smtpError(int)) );
+ connect(smtpClient, SIGNAL(errorOccurred(int, const QString &)), this,
+ SIGNAL(smtpError(int, const QString &)) );
connect(smtpClient, SIGNAL(mailSent()), this, SIGNAL(mailSent()) );
connect(smtpClient, SIGNAL(updateStatus(const QString &)), this,
SIGNAL(updateSmtpStatus(const QString &)) );
- connect(popClient, SIGNAL(errorOccurred(int)), this,
- SIGNAL(popError(int)) );
+ connect(popClient, SIGNAL(errorOccurred(int, const QString &)), this,
+ SIGNAL(popError(int, const QString &)) );
connect(popClient, SIGNAL(newMessage(const QString &, int, uint, bool)),
this, SLOT(messageArrived(const QString &, int, uint, bool)) );
connect(popClient, SIGNAL(updateStatus(const QString &)), this,
SIGNAL(updatePopStatus(const QString &)) );
connect(popClient, SIGNAL(mailTransfered(int)), this,
SIGNAL(mailTransfered(int)) );
//relaying size information
connect(popClient, SIGNAL(currentMailSize(int)),
this, SIGNAL(currentMailSize(int)) );
connect(popClient, SIGNAL(downloadedSize(int)),
this, SIGNAL(downloadedSize(int)) );
}
void EmailHandler::sendMail(QList<Email> *mailList)
{
Email *currentMail;
QString temp;
QString userName = mailAccount.name;
userName += " <" + mailAccount.emailAddress + ">";
for (currentMail = mailList->first(); currentMail != 0;
currentMail = mailList->next()) {
@@ -141,49 +141,49 @@ void EmailHandler::messageArrived(const QString &message, int id, uint size, boo
Email mail;
mail.rawMail = message;
mail.serverId = id;
mail.size = size;
mail.downloaded = complete;
emit mailArrived(mail, FALSE);
}
bool EmailHandler::parse(const QString &in, const QString &lineShift, Email *mail)
{
QString temp, boundary;
int pos;
QString delimiter, header, body, mimeHeader, mimeBody;
QString content, contentType, contentAttribute, id, encoding;
QString fileName, storedName;
int enclosureId = 0;
mail->rawMail = in;
mail->received = TRUE;
mail->files.setAutoDelete(TRUE);
temp = lineShift + "." + lineShift;
-
+
if (in.right(temp.length()) != temp) {
mail->rawMail += temp;
}
delimiter = lineShift + lineShift; // "\n\n" or "\r\n\r\n"
pos = in.find(delimiter, 0, FALSE);
header = in.left(pos);
body = in.right(in.length() - pos - delimiter.length());
if ((body.at(body.length()-2) == '.') && (body.at(body.length()-3) == '\n'))
body.truncate(body.length()-2);
// TextParser p(header, lineShift);
TextParser * lp = new TextParser(header, lineShift);
#define p (*lp)
if ((pos = p.find("FROM",':', 0, TRUE)) != -1) {
pos++;
if (p.separatorAt(pos) == ' ') {
mail->from = p.getString(&pos, '<', false);
mail->from = mail->from.stripWhiteSpace();
if ( (mail->from.length() > 2) && (mail->from[0] == '"') ) {
mail->from = mail->from.left(mail->from.length() - 1);
mail->from = mail->from.right(mail->from.length() - 1);