summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mailit/addresslist.cpp2
-rw-r--r--noncore/net/mailit/emailclient.cpp8
-rw-r--r--noncore/net/mailit/emailhandler.cpp2
-rw-r--r--noncore/net/mailit/mailitwindow.cpp3
-rw-r--r--noncore/net/mailit/popclient.cpp10
-rw-r--r--noncore/net/mailit/readmail.cpp1
-rw-r--r--noncore/net/mailit/smtpclient.cpp20
-rw-r--r--noncore/unsupported/mailit/addresslist.cpp2
-rw-r--r--noncore/unsupported/mailit/emailclient.cpp8
-rw-r--r--noncore/unsupported/mailit/emailhandler.cpp2
-rw-r--r--noncore/unsupported/mailit/mailitwindow.cpp3
-rw-r--r--noncore/unsupported/mailit/popclient.cpp10
-rw-r--r--noncore/unsupported/mailit/readmail.cpp1
-rw-r--r--noncore/unsupported/mailit/smtpclient.cpp20
14 files changed, 42 insertions, 50 deletions
diff --git a/noncore/net/mailit/addresslist.cpp b/noncore/net/mailit/addresslist.cpp
index 9fe558a..8d9ab91 100644
--- a/noncore/net/mailit/addresslist.cpp
+++ b/noncore/net/mailit/addresslist.cpp
@@ -124,13 +124,13 @@ void AddressList::read()
124 //OContact* oc; 124 //OContact* oc;
125 125
126 for ( it = m_list.begin(); it != m_list.end(); ++it ) 126 for ( it = m_list.begin(); it != m_list.end(); ++it )
127 { 127 {
128 //oc=(OContact*) it; 128 //oc=(OContact*) it;
129 if ((*it).defaultEmail().length()!=0) 129 if ((*it).defaultEmail().length()!=0)
130 addContact((*it).defaultEmail(),(*it).fullName()); 130 addContact((*it).defaultEmail(),(*it).fileAs());
131 } 131 }
132 132
133 /*if (! f.open(IO_ReadOnly) ) 133 /*if (! f.open(IO_ReadOnly) )
134 return; 134 return;
135 135
136 QTextStream stream(&f); 136 QTextStream stream(&f);
diff --git a/noncore/net/mailit/emailclient.cpp b/noncore/net/mailit/emailclient.cpp
index 6612541..0d82a9a 100644
--- a/noncore/net/mailit/emailclient.cpp
+++ b/noncore/net/mailit/emailclient.cpp
@@ -529,13 +529,13 @@ void EmailClient::readMail()
529 Email mail; 529 Email mail;
530 int start, stop; 530 int start, stop;
531 QString s, del; 531 QString s, del;
532 532
533 QFile f(getPath(FALSE) + "inbox.txt"); 533 QFile f(getPath(FALSE) + "inbox.txt");
534// QFileInfo fi(f); 534// QFileInfo fi(f);
535 qDebug( f.name()); 535 //qDebug( f.name());
536 536
537 if ( f.open(IO_ReadOnly) ) { // file opened successfully 537 if ( f.open(IO_ReadOnly) ) { // file opened successfully
538 QTextStream t( &f ); // use a text stream 538 QTextStream t( &f ); // use a text stream
539 s = t.read(); 539 s = t.read();
540 f.close(); 540 f.close();
541 541
@@ -583,18 +583,18 @@ void EmailClient::saveMail(QString fileName, QListView *view)
583 583
584 if (! f.open(IO_WriteOnly) ) { 584 if (! f.open(IO_WriteOnly) ) {
585 qWarning("could not open file"); 585 qWarning("could not open file");
586 return; 586 return;
587 } 587 }
588 item = (EmailListItem *) view->firstChild(); 588 item = (EmailListItem *) view->firstChild();
589 qDebug (QString("Write : ") ); 589 //qDebug (QString("Write : ") );
590 QTextStream t(&f); 590 QTextStream t(&f);
591 while (item != NULL) { 591 while (item != NULL) {
592 mail = item->getMail(); 592 mail = item->getMail();
593 qDebug(mail->rawMail); 593 //qDebug(mail->rawMail);
594 qDebug(mail->recipients.first()); 594 //qDebug(mail->recipients.first());
595 t << mail->rawMail; 595 t << mail->rawMail;
596 596
597 mailconf->setGroup(mail->id); 597 mailconf->setGroup(mail->id);
598 mailconf->writeEntry("mailread", mail->read); 598 mailconf->writeEntry("mailread", mail->read);
599 599
600 item = (EmailListItem *) item->nextSibling(); 600 item = (EmailListItem *) item->nextSibling();
diff --git a/noncore/net/mailit/emailhandler.cpp b/noncore/net/mailit/emailhandler.cpp
index 9c1c814..03f8a28 100644
--- a/noncore/net/mailit/emailhandler.cpp
+++ b/noncore/net/mailit/emailhandler.cpp
@@ -160,14 +160,12 @@ bool EmailHandler::parse(QString in, QString lineShift, Email *mail)
160 mail->received = TRUE; 160 mail->received = TRUE;
161 mail->files.setAutoDelete(TRUE); 161 mail->files.setAutoDelete(TRUE);
162 162
163 temp = lineShift + "." + lineShift; 163 temp = lineShift + "." + lineShift;
164 164
165 if (in.right(temp.length()) != temp) { 165 if (in.right(temp.length()) != temp) {
166 qWarning(in.right(temp.length()));
167 qWarning(" . added at end of email as separator");
168 mail->rawMail += temp; 166 mail->rawMail += temp;
169 } 167 }
170 168
171 169
172 delimiter = lineShift + lineShift; // "\n\n" or "\r\n\r\n" 170 delimiter = lineShift + lineShift; // "\n\n" or "\r\n\r\n"
173 pos = in.find(delimiter, 0, FALSE); 171 pos = in.find(delimiter, 0, FALSE);
diff --git a/noncore/net/mailit/mailitwindow.cpp b/noncore/net/mailit/mailitwindow.cpp
index fd49c1f..2bf1dcb 100644
--- a/noncore/net/mailit/mailitwindow.cpp
+++ b/noncore/net/mailit/mailitwindow.cpp
@@ -24,17 +24,15 @@ MailItWindow::MailItWindow(QWidget *parent, const char *name, WFlags fl)
24{ 24{
25 currentCaption = "Mailit"; 25 currentCaption = "Mailit";
26 setCaption(tr(currentCaption)); 26 setCaption(tr(currentCaption));
27 views = new QWidgetStack(this); 27 views = new QWidgetStack(this);
28 setCentralWidget(views); 28 setCentralWidget(views);
29 29
30 qWarning("***Starting writeMail");
31 emailClient = new EmailClient(views, "client"); 30 emailClient = new EmailClient(views, "client");
32 writeMail = new WriteMail(views, "writing"); 31 writeMail = new WriteMail(views, "writing");
33 readMail = new ReadMail(views, "reading"); 32 readMail = new ReadMail(views, "reading");
34 qWarning("***Finished readMail");
35 33
36 views->raiseWidget(emailClient); 34 views->raiseWidget(emailClient);
37 35
38 connect(emailClient, SIGNAL(composeRequested()), 36 connect(emailClient, SIGNAL(composeRequested()),
39 this, SLOT(compose()) ); 37 this, SLOT(compose()) );
40 connect(emailClient, SIGNAL(viewEmail(QListView *, Email *)), this, 38 connect(emailClient, SIGNAL(viewEmail(QListView *, Email *)), this,
@@ -57,13 +55,12 @@ MailItWindow::MailItWindow(QWidget *parent, const char *name, WFlags fl)
57 SLOT(moveMailFront(Email *)) ); 55 SLOT(moveMailFront(Email *)) );
58 56
59 connect(emailClient, SIGNAL(newCaption(const QString &)), 57 connect(emailClient, SIGNAL(newCaption(const QString &)),
60 this, SLOT(updateCaption(const QString &)) ); 58 this, SLOT(updateCaption(const QString &)) );
61 viewingMail = FALSE; 59 viewingMail = FALSE;
62 60
63 qWarning("***Finished MailitWindow");
64} 61}
65 62
66MailItWindow::~MailItWindow() 63MailItWindow::~MailItWindow()
67{ 64{
68} 65}
69 66
diff --git a/noncore/net/mailit/popclient.cpp b/noncore/net/mailit/popclient.cpp
index 2f14ed2..f9cc337 100644
--- a/noncore/net/mailit/popclient.cpp
+++ b/noncore/net/mailit/popclient.cpp
@@ -116,25 +116,25 @@ void PopClient::incomingData()
116// char *md5Digest; 116// char *md5Digest;
117 char md5Digest[16]; 117 char md5Digest[16];
118// if ( !socket->canReadLine() ) 118// if ( !socket->canReadLine() )
119// return; 119// return;
120 120
121 response = socket->readLine(); 121 response = socket->readLine();
122 qDebug(response +" %d", status); 122 //qDebug(response +" %d", status);
123 123
124 switch(status) { 124 switch(status) {
125 //logging in 125 //logging in
126 case Init: { 126 case Init: {
127#ifdef APOP_TEST 127#ifdef APOP_TEST
128 start = response.find('<',0); 128 start = response.find('<',0);
129 end = response.find('>', start); 129 end = response.find('>', start);
130 if( start >= 0 && end > start ) 130 if( start >= 0 && end > start )
131 { 131 {
132 timeStamp = response.mid( start , end - start + 1); 132 timeStamp = response.mid( start , end - start + 1);
133 md5Source = timeStamp + popPassword; 133 md5Source = timeStamp + popPassword;
134 qDebug( md5Source); 134 //qDebug( md5Source);
135// for( int i = 0; i < md5Source.length(); i++) { 135// for( int i = 0; i < md5Source.length(); i++) {
136// buff[i] = (QChar)md5Source[i]; 136// buff[i] = (QChar)md5Source[i];
137// } 137// }
138 138
139 md5_buffer( (char const *)md5Source, md5Source.length(),&md5Digest[0]); 139 md5_buffer( (char const *)md5Source, md5Source.length(),&md5Digest[0]);
140// md5_buffer(char const *buffer, unsigned int len, char *digest); 140// md5_buffer(char const *buffer, unsigned int len, char *digest);
@@ -189,13 +189,13 @@ void PopClient::incomingData()
189 status = List; 189 status = List;
190 190
191 if (synchronize) { 191 if (synchronize) {
192 //messages deleted from server, reload all 192 //messages deleted from server, reload all
193 if (newMessages < lastSync) 193 if (newMessages < lastSync)
194 lastSync = 0; 194 lastSync = 0;
195 messageCount = lastSync + 1; 195 messageCount = 1;
196 } 196 }
197 197
198 if (selected) { 198 if (selected) {
199 int *ptr = mailList->first(); 199 int *ptr = mailList->first();
200 if (ptr != 0) { 200 if (ptr != 0) {
201 newMessages++; //to ensure no early jumpout 201 newMessages++; //to ensure no early jumpout
@@ -237,13 +237,13 @@ void PopClient::incomingData()
237 temp = temp.right(temp.length() - ((uint) x + 1) ); 237 temp = temp.right(temp.length() - ((uint) x + 1) );
238 mailSize = temp.toInt(); 238 mailSize = temp.toInt();
239 emit currentMailSize(mailSize); 239 emit currentMailSize(mailSize);
240 240
241 status = Retr; 241 status = Retr;
242 } else { 242 } else {
243 qWarning(response); 243 //qWarning(response);
244 errorHandling(ErrUnknownResponse); 244 errorHandling(ErrUnknownResponse);
245 } 245 }
246 } 246 }
247 } 247 }
248 //Read message number x, count upwards to messageCount 248 //Read message number x, count upwards to messageCount
249 case Retr: { 249 case Retr: {
@@ -283,13 +283,13 @@ void PopClient::incomingData()
283 break; 283 break;
284 } else { //message reach entire size 284 } else { //message reach entire size
285 //complete mail downloaded 285 //complete mail downloaded
286 if ( (!preview ) || ((preview) && (mailSize <= headerLimit)) ){ 286 if ( (!preview ) || ((preview) && (mailSize <= headerLimit)) ){
287 emit newMessage(message, messageCount-1, mailSize, TRUE); 287 emit newMessage(message, messageCount-1, mailSize, TRUE);
288 } else { //incomplete mail downloaded 288 } else { //incomplete mail downloaded
289 emit newMessage(message, messageCount-1, mailSize, FALSE); 289 emit newMessage(message, messageCount-1, mailSize, FALSE);
290 } 290 }
291 if (messageCount > newMessages) //that was the last message 291 if (messageCount > newMessages) //that was the last message
292 status = Quit; 292 status = Quit;
293 else { //ask for new message 293 else { //ask for new message
294 if (selected) { //grab next from queue 294 if (selected) { //grab next from queue
295 int *ptr = mailList->next(); 295 int *ptr = mailList->next();
diff --git a/noncore/net/mailit/readmail.cpp b/noncore/net/mailit/readmail.cpp
index a5e7147..7cd3e09 100644
--- a/noncore/net/mailit/readmail.cpp
+++ b/noncore/net/mailit/readmail.cpp
@@ -86,12 +86,13 @@ void ReadMail::init()
86 deleteButton->addTo(bar); 86 deleteButton->addTo(bar);
87 deleteButton->addTo(mailMenu); 87 deleteButton->addTo(mailMenu);
88 88
89 viewMenu->insertItem(Resource::loadPixmap("close"), "Close", this, SLOT(close())); 89 viewMenu->insertItem(Resource::loadPixmap("close"), "Close", this, SLOT(close()));
90 90
91 emailView = new QTextView( this, "emailView" ); 91 emailView = new QTextView( this, "emailView" );
92
92 setCentralWidget(emailView); 93 setCentralWidget(emailView);
93 94
94 mime = new QMimeSourceFactory(); 95 mime = new QMimeSourceFactory();
95 emailView->setMimeSourceFactory(mime); 96 emailView->setMimeSourceFactory(mime);
96} 97}
97 98
diff --git a/noncore/net/mailit/smtpclient.cpp b/noncore/net/mailit/smtpclient.cpp
index 6699a90..b2e38e5 100644
--- a/noncore/net/mailit/smtpclient.cpp
+++ b/noncore/net/mailit/smtpclient.cpp
@@ -84,60 +84,60 @@ void SmtpClient::incomingData()
84 QString response; 84 QString response;
85 85
86 if (!socket->canReadLine()) 86 if (!socket->canReadLine())
87 return; 87 return;
88 88
89 response = socket->readLine(); 89 response = socket->readLine();
90 qDebug(response); 90 //qDebug(response);
91 91
92 switch(status) { 92 switch(status) {
93 case Init: { 93 case Init: {
94 if (response[0] == '2') { 94 if (response[0] == '2') {
95 status = From; 95 status = From;
96 mailPtr = mailList.first(); 96 mailPtr = mailList.first();
97 *stream << "HELO there\r\n"; 97 *stream << "HELO there\r\n";
98 qDebug("HELO"); 98 //qDebug("HELO");
99 } else errorHandling(ErrUnknownResponse); 99 } else errorHandling(ErrUnknownResponse);
100 break; 100 break;
101 } 101 }
102 case From: { 102 case From: {
103 if (response[0] == '2') { 103 if (response[0] == '2') {
104 *stream << "MAIL FROM: <" << mailPtr->from << ">\r\n"; 104 *stream << "MAIL FROM: " << mailPtr->from << "\r\n";
105 status = Recv; 105 status = Recv;
106 qDebug("MAIL FROM: "+mailPtr->from); 106 //qDebug("MAIL FROM: "+mailPtr->from);
107 } else errorHandling(ErrUnknownResponse); 107 } else errorHandling(ErrUnknownResponse);
108 break; 108 break;
109 } 109 }
110 case Recv: { 110 case Recv: {
111 if (response[0] == '2') { 111 if (response[0] == '2') {
112 it = mailPtr->to.begin(); 112 it = mailPtr->to.begin();
113 if (it == NULL) 113 if (it == NULL)
114 errorHandling(ErrUnknownResponse); 114 errorHandling(ErrUnknownResponse);
115 *stream << "RCPT TO: <" << *it << ">\r\n"; 115 *stream << "RCPT TO: " << *it << ">\r\n";
116 qDebug("RCPT TO: "+ *it); 116 //qDebug("RCPT TO: "+ *it);
117 status = MRcv; 117 status = MRcv;
118 } else errorHandling(ErrUnknownResponse); 118 } else errorHandling(ErrUnknownResponse);
119 break; 119 break;
120 } 120 }
121 case MRcv: { 121 case MRcv: {
122 if (response[0] == '2') { 122 if (response[0] == '2') {
123 it++; 123 it++;
124 if ( it != mailPtr->to.end() ) { 124 if ( it != mailPtr->to.end() ) {
125 *stream << "RCPT TO: <" << *it << ">\r\n"; 125 *stream << "RCPT TO: <" << *it << ">\r\n";
126 qDebug("RCPT TO: "+ *it); 126 //qDebug("RCPT TO: "+ *it);
127 break; 127 break;
128 } else { 128 } else {
129 status = Data; 129 status = Data;
130 } 130 }
131 } else errorHandling(ErrUnknownResponse); 131 } else errorHandling(ErrUnknownResponse);
132 } 132 }
133 case Data: { 133 case Data: {
134 if (response[0] == '2') { 134 if (response[0] == '2') {
135 *stream << "DATA\r\n"; 135 *stream << "DATA\r\n";
136 status = Body; 136 status = Body;
137 qDebug("DATA"); 137 //qDebug("DATA");
138 emit updateStatus(tr("Sending: ") + mailPtr->subject); 138 emit updateStatus(tr("Sending: ") + mailPtr->subject);
139 } else errorHandling(ErrUnknownResponse); 139 } else errorHandling(ErrUnknownResponse);
140 break; 140 break;
141 } 141 }
142 case Body: { 142 case Body: {
143 if (response[0] == '3') { 143 if (response[0] == '3') {
@@ -145,13 +145,13 @@ void SmtpClient::incomingData()
145 mailPtr = mailList.next(); 145 mailPtr = mailList.next();
146 if (mailPtr != NULL) { 146 if (mailPtr != NULL) {
147 status = From; 147 status = From;
148 } else { 148 } else {
149 status = Quit; 149 status = Quit;
150 } 150 }
151 qDebug("BODY"); 151 //qDebug("BODY");
152 } else errorHandling(ErrUnknownResponse); 152 } else errorHandling(ErrUnknownResponse);
153 break; 153 break;
154 } 154 }
155 case Quit: { 155 case Quit: {
156 if (response[0] == '2') { 156 if (response[0] == '2') {
157 *stream << "QUIT\r\n"; 157 *stream << "QUIT\r\n";
@@ -160,12 +160,12 @@ void SmtpClient::incomingData()
160 temp.setNum(mailList.count()); 160 temp.setNum(mailList.count());
161 emit updateStatus(tr("Sent ") + temp + tr(" messages")); 161 emit updateStatus(tr("Sent ") + temp + tr(" messages"));
162 emit mailSent(); 162 emit mailSent();
163 mailList.clear(); 163 mailList.clear();
164 sending = FALSE; 164 sending = FALSE;
165 socket->close(); 165 socket->close();
166 qDebug("QUIT"); 166 //qDebug("QUIT");
167 } else errorHandling(ErrUnknownResponse); 167 } else errorHandling(ErrUnknownResponse);
168 break; 168 break;
169 } 169 }
170 } 170 }
171} 171}
diff --git a/noncore/unsupported/mailit/addresslist.cpp b/noncore/unsupported/mailit/addresslist.cpp
index 9fe558a..8d9ab91 100644
--- a/noncore/unsupported/mailit/addresslist.cpp
+++ b/noncore/unsupported/mailit/addresslist.cpp
@@ -124,13 +124,13 @@ void AddressList::read()
124 //OContact* oc; 124 //OContact* oc;
125 125
126 for ( it = m_list.begin(); it != m_list.end(); ++it ) 126 for ( it = m_list.begin(); it != m_list.end(); ++it )
127 { 127 {
128 //oc=(OContact*) it; 128 //oc=(OContact*) it;
129 if ((*it).defaultEmail().length()!=0) 129 if ((*it).defaultEmail().length()!=0)
130 addContact((*it).defaultEmail(),(*it).fullName()); 130 addContact((*it).defaultEmail(),(*it).fileAs());
131 } 131 }
132 132
133 /*if (! f.open(IO_ReadOnly) ) 133 /*if (! f.open(IO_ReadOnly) )
134 return; 134 return;
135 135
136 QTextStream stream(&f); 136 QTextStream stream(&f);
diff --git a/noncore/unsupported/mailit/emailclient.cpp b/noncore/unsupported/mailit/emailclient.cpp
index 6612541..0d82a9a 100644
--- a/noncore/unsupported/mailit/emailclient.cpp
+++ b/noncore/unsupported/mailit/emailclient.cpp
@@ -529,13 +529,13 @@ void EmailClient::readMail()
529 Email mail; 529 Email mail;
530 int start, stop; 530 int start, stop;
531 QString s, del; 531 QString s, del;
532 532
533 QFile f(getPath(FALSE) + "inbox.txt"); 533 QFile f(getPath(FALSE) + "inbox.txt");
534// QFileInfo fi(f); 534// QFileInfo fi(f);
535 qDebug( f.name()); 535 //qDebug( f.name());
536 536
537 if ( f.open(IO_ReadOnly) ) { // file opened successfully 537 if ( f.open(IO_ReadOnly) ) { // file opened successfully
538 QTextStream t( &f ); // use a text stream 538 QTextStream t( &f ); // use a text stream
539 s = t.read(); 539 s = t.read();
540 f.close(); 540 f.close();
541 541
@@ -583,18 +583,18 @@ void EmailClient::saveMail(QString fileName, QListView *view)
583 583
584 if (! f.open(IO_WriteOnly) ) { 584 if (! f.open(IO_WriteOnly) ) {
585 qWarning("could not open file"); 585 qWarning("could not open file");
586 return; 586 return;
587 } 587 }
588 item = (EmailListItem *) view->firstChild(); 588 item = (EmailListItem *) view->firstChild();
589 qDebug (QString("Write : ") ); 589 //qDebug (QString("Write : ") );
590 QTextStream t(&f); 590 QTextStream t(&f);
591 while (item != NULL) { 591 while (item != NULL) {
592 mail = item->getMail(); 592 mail = item->getMail();
593 qDebug(mail->rawMail); 593 //qDebug(mail->rawMail);
594 qDebug(mail->recipients.first()); 594 //qDebug(mail->recipients.first());
595 t << mail->rawMail; 595 t << mail->rawMail;
596 596
597 mailconf->setGroup(mail->id); 597 mailconf->setGroup(mail->id);
598 mailconf->writeEntry("mailread", mail->read); 598 mailconf->writeEntry("mailread", mail->read);
599 599
600 item = (EmailListItem *) item->nextSibling(); 600 item = (EmailListItem *) item->nextSibling();
diff --git a/noncore/unsupported/mailit/emailhandler.cpp b/noncore/unsupported/mailit/emailhandler.cpp
index 9c1c814..03f8a28 100644
--- a/noncore/unsupported/mailit/emailhandler.cpp
+++ b/noncore/unsupported/mailit/emailhandler.cpp
@@ -160,14 +160,12 @@ bool EmailHandler::parse(QString in, QString lineShift, Email *mail)
160 mail->received = TRUE; 160 mail->received = TRUE;
161 mail->files.setAutoDelete(TRUE); 161 mail->files.setAutoDelete(TRUE);
162 162
163 temp = lineShift + "." + lineShift; 163 temp = lineShift + "." + lineShift;
164 164
165 if (in.right(temp.length()) != temp) { 165 if (in.right(temp.length()) != temp) {
166 qWarning(in.right(temp.length()));
167 qWarning(" . added at end of email as separator");
168 mail->rawMail += temp; 166 mail->rawMail += temp;
169 } 167 }
170 168
171 169
172 delimiter = lineShift + lineShift; // "\n\n" or "\r\n\r\n" 170 delimiter = lineShift + lineShift; // "\n\n" or "\r\n\r\n"
173 pos = in.find(delimiter, 0, FALSE); 171 pos = in.find(delimiter, 0, FALSE);
diff --git a/noncore/unsupported/mailit/mailitwindow.cpp b/noncore/unsupported/mailit/mailitwindow.cpp
index fd49c1f..2bf1dcb 100644
--- a/noncore/unsupported/mailit/mailitwindow.cpp
+++ b/noncore/unsupported/mailit/mailitwindow.cpp
@@ -24,17 +24,15 @@ MailItWindow::MailItWindow(QWidget *parent, const char *name, WFlags fl)
24{ 24{
25 currentCaption = "Mailit"; 25 currentCaption = "Mailit";
26 setCaption(tr(currentCaption)); 26 setCaption(tr(currentCaption));
27 views = new QWidgetStack(this); 27 views = new QWidgetStack(this);
28 setCentralWidget(views); 28 setCentralWidget(views);
29 29
30 qWarning("***Starting writeMail");
31 emailClient = new EmailClient(views, "client"); 30 emailClient = new EmailClient(views, "client");
32 writeMail = new WriteMail(views, "writing"); 31 writeMail = new WriteMail(views, "writing");
33 readMail = new ReadMail(views, "reading"); 32 readMail = new ReadMail(views, "reading");
34 qWarning("***Finished readMail");
35 33
36 views->raiseWidget(emailClient); 34 views->raiseWidget(emailClient);
37 35
38 connect(emailClient, SIGNAL(composeRequested()), 36 connect(emailClient, SIGNAL(composeRequested()),
39 this, SLOT(compose()) ); 37 this, SLOT(compose()) );
40 connect(emailClient, SIGNAL(viewEmail(QListView *, Email *)), this, 38 connect(emailClient, SIGNAL(viewEmail(QListView *, Email *)), this,
@@ -57,13 +55,12 @@ MailItWindow::MailItWindow(QWidget *parent, const char *name, WFlags fl)
57 SLOT(moveMailFront(Email *)) ); 55 SLOT(moveMailFront(Email *)) );
58 56
59 connect(emailClient, SIGNAL(newCaption(const QString &)), 57 connect(emailClient, SIGNAL(newCaption(const QString &)),
60 this, SLOT(updateCaption(const QString &)) ); 58 this, SLOT(updateCaption(const QString &)) );
61 viewingMail = FALSE; 59 viewingMail = FALSE;
62 60
63 qWarning("***Finished MailitWindow");
64} 61}
65 62
66MailItWindow::~MailItWindow() 63MailItWindow::~MailItWindow()
67{ 64{
68} 65}
69 66
diff --git a/noncore/unsupported/mailit/popclient.cpp b/noncore/unsupported/mailit/popclient.cpp
index 2f14ed2..f9cc337 100644
--- a/noncore/unsupported/mailit/popclient.cpp
+++ b/noncore/unsupported/mailit/popclient.cpp
@@ -116,25 +116,25 @@ void PopClient::incomingData()
116// char *md5Digest; 116// char *md5Digest;
117 char md5Digest[16]; 117 char md5Digest[16];
118// if ( !socket->canReadLine() ) 118// if ( !socket->canReadLine() )
119// return; 119// return;
120 120
121 response = socket->readLine(); 121 response = socket->readLine();
122 qDebug(response +" %d", status); 122 //qDebug(response +" %d", status);
123 123
124 switch(status) { 124 switch(status) {
125 //logging in 125 //logging in
126 case Init: { 126 case Init: {
127#ifdef APOP_TEST 127#ifdef APOP_TEST
128 start = response.find('<',0); 128 start = response.find('<',0);
129 end = response.find('>', start); 129 end = response.find('>', start);
130 if( start >= 0 && end > start ) 130 if( start >= 0 && end > start )
131 { 131 {
132 timeStamp = response.mid( start , end - start + 1); 132 timeStamp = response.mid( start , end - start + 1);
133 md5Source = timeStamp + popPassword; 133 md5Source = timeStamp + popPassword;
134 qDebug( md5Source); 134 //qDebug( md5Source);
135// for( int i = 0; i < md5Source.length(); i++) { 135// for( int i = 0; i < md5Source.length(); i++) {
136// buff[i] = (QChar)md5Source[i]; 136// buff[i] = (QChar)md5Source[i];
137// } 137// }
138 138
139 md5_buffer( (char const *)md5Source, md5Source.length(),&md5Digest[0]); 139 md5_buffer( (char const *)md5Source, md5Source.length(),&md5Digest[0]);
140// md5_buffer(char const *buffer, unsigned int len, char *digest); 140// md5_buffer(char const *buffer, unsigned int len, char *digest);
@@ -189,13 +189,13 @@ void PopClient::incomingData()
189 status = List; 189 status = List;
190 190
191 if (synchronize) { 191 if (synchronize) {
192 //messages deleted from server, reload all 192 //messages deleted from server, reload all
193 if (newMessages < lastSync) 193 if (newMessages < lastSync)
194 lastSync = 0; 194 lastSync = 0;
195 messageCount = lastSync + 1; 195 messageCount = 1;
196 } 196 }
197 197
198 if (selected) { 198 if (selected) {
199 int *ptr = mailList->first(); 199 int *ptr = mailList->first();
200 if (ptr != 0) { 200 if (ptr != 0) {
201 newMessages++; //to ensure no early jumpout 201 newMessages++; //to ensure no early jumpout
@@ -237,13 +237,13 @@ void PopClient::incomingData()
237 temp = temp.right(temp.length() - ((uint) x + 1) ); 237 temp = temp.right(temp.length() - ((uint) x + 1) );
238 mailSize = temp.toInt(); 238 mailSize = temp.toInt();
239 emit currentMailSize(mailSize); 239 emit currentMailSize(mailSize);
240 240
241 status = Retr; 241 status = Retr;
242 } else { 242 } else {
243 qWarning(response); 243 //qWarning(response);
244 errorHandling(ErrUnknownResponse); 244 errorHandling(ErrUnknownResponse);
245 } 245 }
246 } 246 }
247 } 247 }
248 //Read message number x, count upwards to messageCount 248 //Read message number x, count upwards to messageCount
249 case Retr: { 249 case Retr: {
@@ -283,13 +283,13 @@ void PopClient::incomingData()
283 break; 283 break;
284 } else { //message reach entire size 284 } else { //message reach entire size
285 //complete mail downloaded 285 //complete mail downloaded
286 if ( (!preview ) || ((preview) && (mailSize <= headerLimit)) ){ 286 if ( (!preview ) || ((preview) && (mailSize <= headerLimit)) ){
287 emit newMessage(message, messageCount-1, mailSize, TRUE); 287 emit newMessage(message, messageCount-1, mailSize, TRUE);
288 } else { //incomplete mail downloaded 288 } else { //incomplete mail downloaded
289 emit newMessage(message, messageCount-1, mailSize, FALSE); 289 emit newMessage(message, messageCount-1, mailSize, FALSE);
290 } 290 }
291 if (messageCount > newMessages) //that was the last message 291 if (messageCount > newMessages) //that was the last message
292 status = Quit; 292 status = Quit;
293 else { //ask for new message 293 else { //ask for new message
294 if (selected) { //grab next from queue 294 if (selected) { //grab next from queue
295 int *ptr = mailList->next(); 295 int *ptr = mailList->next();
diff --git a/noncore/unsupported/mailit/readmail.cpp b/noncore/unsupported/mailit/readmail.cpp
index a5e7147..7cd3e09 100644
--- a/noncore/unsupported/mailit/readmail.cpp
+++ b/noncore/unsupported/mailit/readmail.cpp
@@ -86,12 +86,13 @@ void ReadMail::init()
86 deleteButton->addTo(bar); 86 deleteButton->addTo(bar);
87 deleteButton->addTo(mailMenu); 87 deleteButton->addTo(mailMenu);
88 88
89 viewMenu->insertItem(Resource::loadPixmap("close"), "Close", this, SLOT(close())); 89 viewMenu->insertItem(Resource::loadPixmap("close"), "Close", this, SLOT(close()));
90 90
91 emailView = new QTextView( this, "emailView" ); 91 emailView = new QTextView( this, "emailView" );
92
92 setCentralWidget(emailView); 93 setCentralWidget(emailView);
93 94
94 mime = new QMimeSourceFactory(); 95 mime = new QMimeSourceFactory();
95 emailView->setMimeSourceFactory(mime); 96 emailView->setMimeSourceFactory(mime);
96} 97}
97 98
diff --git a/noncore/unsupported/mailit/smtpclient.cpp b/noncore/unsupported/mailit/smtpclient.cpp
index 6699a90..b2e38e5 100644
--- a/noncore/unsupported/mailit/smtpclient.cpp
+++ b/noncore/unsupported/mailit/smtpclient.cpp
@@ -84,60 +84,60 @@ void SmtpClient::incomingData()
84 QString response; 84 QString response;
85 85
86 if (!socket->canReadLine()) 86 if (!socket->canReadLine())
87 return; 87 return;
88 88
89 response = socket->readLine(); 89 response = socket->readLine();
90 qDebug(response); 90 //qDebug(response);
91 91
92 switch(status) { 92 switch(status) {
93 case Init: { 93 case Init: {
94 if (response[0] == '2') { 94 if (response[0] == '2') {
95 status = From; 95 status = From;
96 mailPtr = mailList.first(); 96 mailPtr = mailList.first();
97 *stream << "HELO there\r\n"; 97 *stream << "HELO there\r\n";
98 qDebug("HELO"); 98 //qDebug("HELO");
99 } else errorHandling(ErrUnknownResponse); 99 } else errorHandling(ErrUnknownResponse);
100 break; 100 break;
101 } 101 }
102 case From: { 102 case From: {
103 if (response[0] == '2') { 103 if (response[0] == '2') {
104 *stream << "MAIL FROM: <" << mailPtr->from << ">\r\n"; 104 *stream << "MAIL FROM: " << mailPtr->from << "\r\n";
105 status = Recv; 105 status = Recv;
106 qDebug("MAIL FROM: "+mailPtr->from); 106 //qDebug("MAIL FROM: "+mailPtr->from);
107 } else errorHandling(ErrUnknownResponse); 107 } else errorHandling(ErrUnknownResponse);
108 break; 108 break;
109 } 109 }
110 case Recv: { 110 case Recv: {
111 if (response[0] == '2') { 111 if (response[0] == '2') {
112 it = mailPtr->to.begin(); 112 it = mailPtr->to.begin();
113 if (it == NULL) 113 if (it == NULL)
114 errorHandling(ErrUnknownResponse); 114 errorHandling(ErrUnknownResponse);
115 *stream << "RCPT TO: <" << *it << ">\r\n"; 115 *stream << "RCPT TO: " << *it << ">\r\n";
116 qDebug("RCPT TO: "+ *it); 116 //qDebug("RCPT TO: "+ *it);
117 status = MRcv; 117 status = MRcv;
118 } else errorHandling(ErrUnknownResponse); 118 } else errorHandling(ErrUnknownResponse);
119 break; 119 break;
120 } 120 }
121 case MRcv: { 121 case MRcv: {
122 if (response[0] == '2') { 122 if (response[0] == '2') {
123 it++; 123 it++;
124 if ( it != mailPtr->to.end() ) { 124 if ( it != mailPtr->to.end() ) {
125 *stream << "RCPT TO: <" << *it << ">\r\n"; 125 *stream << "RCPT TO: <" << *it << ">\r\n";
126 qDebug("RCPT TO: "+ *it); 126 //qDebug("RCPT TO: "+ *it);
127 break; 127 break;
128 } else { 128 } else {
129 status = Data; 129 status = Data;
130 } 130 }
131 } else errorHandling(ErrUnknownResponse); 131 } else errorHandling(ErrUnknownResponse);
132 } 132 }
133 case Data: { 133 case Data: {
134 if (response[0] == '2') { 134 if (response[0] == '2') {
135 *stream << "DATA\r\n"; 135 *stream << "DATA\r\n";
136 status = Body; 136 status = Body;
137 qDebug("DATA"); 137 //qDebug("DATA");
138 emit updateStatus(tr("Sending: ") + mailPtr->subject); 138 emit updateStatus(tr("Sending: ") + mailPtr->subject);
139 } else errorHandling(ErrUnknownResponse); 139 } else errorHandling(ErrUnknownResponse);
140 break; 140 break;
141 } 141 }
142 case Body: { 142 case Body: {
143 if (response[0] == '3') { 143 if (response[0] == '3') {
@@ -145,13 +145,13 @@ void SmtpClient::incomingData()
145 mailPtr = mailList.next(); 145 mailPtr = mailList.next();
146 if (mailPtr != NULL) { 146 if (mailPtr != NULL) {
147 status = From; 147 status = From;
148 } else { 148 } else {
149 status = Quit; 149 status = Quit;
150 } 150 }
151 qDebug("BODY"); 151 //qDebug("BODY");
152 } else errorHandling(ErrUnknownResponse); 152 } else errorHandling(ErrUnknownResponse);
153 break; 153 break;
154 } 154 }
155 case Quit: { 155 case Quit: {
156 if (response[0] == '2') { 156 if (response[0] == '2') {
157 *stream << "QUIT\r\n"; 157 *stream << "QUIT\r\n";
@@ -160,12 +160,12 @@ void SmtpClient::incomingData()
160 temp.setNum(mailList.count()); 160 temp.setNum(mailList.count());
161 emit updateStatus(tr("Sent ") + temp + tr(" messages")); 161 emit updateStatus(tr("Sent ") + temp + tr(" messages"));
162 emit mailSent(); 162 emit mailSent();
163 mailList.clear(); 163 mailList.clear();
164 sending = FALSE; 164 sending = FALSE;
165 socket->close(); 165 socket->close();
166 qDebug("QUIT"); 166 //qDebug("QUIT");
167 } else errorHandling(ErrUnknownResponse); 167 } else errorHandling(ErrUnknownResponse);
168 break; 168 break;
169 } 169 }
170 } 170 }
171} 171}