summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mailit/emailhandler.cpp
Unidiff
Diffstat (limited to 'noncore/unsupported/mailit/emailhandler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/mailit/emailhandler.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/unsupported/mailit/emailhandler.cpp b/noncore/unsupported/mailit/emailhandler.cpp
index fbbada7..c7b27a0 100644
--- a/noncore/unsupported/mailit/emailhandler.cpp
+++ b/noncore/unsupported/mailit/emailhandler.cpp
@@ -30,24 +30,26 @@ QCollection::Item EnclosureList::newItem(QCollection::Item d)
30{ 30{
31 return dupl( (Enclosure *) d); 31 return dupl( (Enclosure *) d);
32} 32}
33 33
34Enclosure* EnclosureList::dupl(Enclosure *in) 34Enclosure* EnclosureList::dupl(Enclosure *in)
35{ 35{
36 ac = new Enclosure(*in); 36 ac = new Enclosure(*in);
37 return ac; 37 return ac;
38} 38}
39 39
40EmailHandler::EmailHandler() 40EmailHandler::EmailHandler()
41{ 41{
42 qDebug("EMailHandler::EmailHandler");
43
42 smtpClient = new SmtpClient(); 44 smtpClient = new SmtpClient();
43 popClient = new PopClient(); 45 popClient = new PopClient();
44 46
45 connect(smtpClient, SIGNAL(errorOccurred(int)), this, 47 connect(smtpClient, SIGNAL(errorOccurred(int)), this,
46 SIGNAL(smtpError(int)) ); 48 SIGNAL(smtpError(int)) );
47 connect(smtpClient, SIGNAL(mailSent()), this, SIGNAL(mailSent()) ); 49 connect(smtpClient, SIGNAL(mailSent()), this, SIGNAL(mailSent()) );
48 connect(smtpClient, SIGNAL(updateStatus(const QString &)), this, 50 connect(smtpClient, SIGNAL(updateStatus(const QString &)), this,
49 SIGNAL(updateSmtpStatus(const QString &)) ); 51 SIGNAL(updateSmtpStatus(const QString &)) );
50 52
51 connect(popClient, SIGNAL(errorOccurred(int)), this, 53 connect(popClient, SIGNAL(errorOccurred(int)), this,
52 SIGNAL(popError(int)) ); 54 SIGNAL(popError(int)) );
53 connect(popClient, SIGNAL(newMessage(const QString &, int, uint, bool)), 55 connect(popClient, SIGNAL(newMessage(const QString &, int, uint, bool)),
@@ -106,24 +108,25 @@ void EmailHandler::getMail()
106 headers = FALSE; 108 headers = FALSE;
107 //popClient->headersOnly(headers, 0); 109 //popClient->headersOnly(headers, 0);
108 popClient->newConnection(mailAccount.popServer, 110); 110 popClient->newConnection(mailAccount.popServer, 110);
109} 111}
110 112
111void EmailHandler::getMailHeaders() 113void EmailHandler::getMailHeaders()
112{ 114{
113 popClient->setAccount(mailAccount.popUserName, mailAccount.popPasswd); 115 popClient->setAccount(mailAccount.popUserName, mailAccount.popPasswd);
114 mailAccount.synchronize ? popClient->setSynchronize(mailAccount.lastServerMailCount): popClient->removeSynchronize(); 116 mailAccount.synchronize ? popClient->setSynchronize(mailAccount.lastServerMailCount): popClient->removeSynchronize();
115 117
116 headers = TRUE; 118 headers = TRUE;
117 popClient->headersOnly(headers, mailAccount.syncLimit); //less than requested syncLimit, download all 119 popClient->headersOnly(headers, mailAccount.syncLimit); //less than requested syncLimit, download all
120 qDebug("Initiating connection");
118 popClient->newConnection(mailAccount.popServer, 110); 121 popClient->newConnection(mailAccount.popServer, 110);
119} 122}
120 123
121void EmailHandler::getMailByList(MailList *mailList) 124void EmailHandler::getMailByList(MailList *mailList)
122{ 125{
123 if (mailList->count() == 0) { //should not occur though 126 if (mailList->count() == 0) { //should not occur though
124 emit mailTransfered(0); 127 emit mailTransfered(0);
125 return; 128 return;
126 } 129 }
127 130
128 headers = FALSE; 131 headers = FALSE;
129 popClient->headersOnly(FALSE, 0); 132 popClient->headersOnly(FALSE, 0);
@@ -617,12 +620,13 @@ void EmailHandler::encode64base(char *src, QString *dest, int len)
617 else if (bufOut[x] == 64) 620 else if (bufOut[x] == 64)
618 bufOut[x] = '='; 621 bufOut[x] = '=';
619 622
620 dest->append(bufOut[x]); 623 dest->append(bufOut[x]);
621 } 624 }
622} 625}
623 626
624void EmailHandler::cancel() 627void EmailHandler::cancel()
625{ 628{
626 popClient->errorHandling(ErrCancel); 629 popClient->errorHandling(ErrCancel);
627 smtpClient->errorHandling(ErrCancel); 630 smtpClient->errorHandling(ErrCancel);
628} 631}
632