Diffstat (limited to 'noncore/net/mailit/emailhandler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mailit/emailhandler.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/noncore/net/mailit/emailhandler.cpp b/noncore/net/mailit/emailhandler.cpp index 62fa64f..59ccd90 100644 --- a/noncore/net/mailit/emailhandler.cpp +++ b/noncore/net/mailit/emailhandler.cpp @@ -36,13 +36,13 @@ Enclosure* EnclosureList::dupl(Enclosure *in) ac = new Enclosure(*in); return ac; } EmailHandler::EmailHandler() { - qDebug("EMailHandler::EmailHandler"); + qDebug("EMailHandler::EmailHandler"); smtpClient = new SmtpClient(); popClient = new PopClient(); connect(smtpClient, SIGNAL(errorOccurred(int)), this, SIGNAL(smtpError(int)) ); @@ -145,13 +145,13 @@ void EmailHandler::messageArrived(const QString &message, int id, uint size, boo mail.size = size; mail.downloaded = complete; emit mailArrived(mail, FALSE); } -bool EmailHandler::parse(QString in, QString lineShift, Email *mail) +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; @@ -201,27 +201,27 @@ bool EmailHandler::parse(QString in, QString lineShift, Email *mail) pos=0; //Search for To: after the FROM: attribute to prevent hitting the Delivered-To: while((pos = p.find("TO",':', pos+1, TRUE))!=-1) { - QString rec; - - if (p.separatorAt(pos-1)!='-') //The - separator means that this is a Delivered-To: or Reply-To: - { - pos++; - mail->recipients.append(p.getString(&pos, '\r', TRUE)); - } + QString rec; + + if (p.separatorAt(pos-1)!='-') //The - separator means that this is a Delivered-To: or Reply-To: + { + pos++; + mail->recipients.append(p.getString(&pos, '\r', TRUE)); + } } // //if (pos==-1) mail->recipients.append (tr("undisclosed recipients") ); if ((pos = p.find("CC",':', 0, TRUE)) != -1) { - pos++; - mail->carbonCopies.append (p.getString(&pos, 'z', TRUE) ); + pos++; + mail->carbonCopies.append (p.getString(&pos, 'z', TRUE) ); } if ((pos = p.find("SUBJECT",':', 0, TRUE)) != -1) { pos++; mail->subject = p.getString(&pos, 'z', TRUE); } @@ -437,14 +437,14 @@ int EmailHandler::encodeMime(Email *mail) { QString fileName, fileType, contentType, newBody, boundary; Enclosure *ePtr; QString userName = mailAccount.name; - if (userName.length()>0) //only embrace it if there is a user name - userName += " <" + mailAccount.emailAddress + ">"; + if (userName.length()>0) //only embrace it if there is a user name + userName += " <" + mailAccount.emailAddress + ">"; //add standard headers newBody = "From: " + userName + "\r\nTo: "; for (QStringList::Iterator it = mail->recipients.begin(); it != mail->recipients.end(); ++it ) { newBody += *it + " "; } @@ -507,13 +507,13 @@ int EmailHandler::encodeMime(Email *mail) newBody += "\r\n\r\n--" + boundary + "--"; mail->rawMail = newBody; return 0; } -int EmailHandler::encodeFile(QString fileName, QString *toBody) +int EmailHandler::encodeFile(const QString &fileName, QString *toBody) { char *fileData; char *dataPtr; QString temp; uint dataSize, count; QFile f(fileName); |