summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mailit/popclient.cpp
Side-by-side diff
Diffstat (limited to 'noncore/unsupported/mailit/popclient.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/mailit/popclient.cpp57
1 files changed, 29 insertions, 28 deletions
diff --git a/noncore/unsupported/mailit/popclient.cpp b/noncore/unsupported/mailit/popclient.cpp
index 5da3bcb..1df6b2b 100644
--- a/noncore/unsupported/mailit/popclient.cpp
+++ b/noncore/unsupported/mailit/popclient.cpp
@@ -31,3 +31,3 @@ PopClient::PopClient()
{
-
+
socket = new QSocket(this, "popClient");
@@ -36,5 +36,5 @@ PopClient::PopClient()
connect(socket, SIGNAL(readyRead()), this, SLOT(incomingData()));
-
+
stream = new QTextStream(socket);
-
+
receiving = FALSE;
@@ -43,2 +43,3 @@ PopClient::PopClient()
headerLimit = 0;
+ mailList = 0;
preview = FALSE;
@@ -58,5 +59,5 @@ void PopClient::newConnection(const QString &target, int port)
}
-
+
status = Init;
-
+
socket->connectToHost(target, port);
@@ -64,3 +65,3 @@ void PopClient::newConnection(const QString &target, int port)
//selected = FALSE;
-
+
emit updateStatus(tr("DNS lookup"));
@@ -72,3 +73,3 @@ void PopClient::setAccount(const QString &popUser, const QString &popPasswd)
popPassword = popPasswd;
-}
+}
@@ -125,5 +126,5 @@ void PopClient::incomingData()
-
+
response = socket->readLine();
-
+
switch(status) {
@@ -138,3 +139,3 @@ void PopClient::incomingData()
md5Source = timeStamp + popPassword;
-
+
md5_buffer( (char const *)md5Source, md5Source.length(),&md5Digest[0]);
@@ -145,3 +146,3 @@ void PopClient::incomingData()
}
- printf("\n");
+ printf("\n");
// qDebug(md5Digest);
@@ -158,6 +159,6 @@ void PopClient::incomingData()
}
-
+
break;
}
-
+
case Pass: {
@@ -165,3 +166,3 @@ void PopClient::incomingData()
status = Stat;
-
+
break;
@@ -172,3 +173,3 @@ void PopClient::incomingData()
*stream << "STAT" << "\r\n";
- status = Mcnt;
+ status = Mcnt;
} else errorHandlingWithMsg(ErrLoginFailed, response);
@@ -185,3 +186,3 @@ void PopClient::incomingData()
status = List;
-
+
if (synchronize) {
@@ -192,4 +193,4 @@ void PopClient::incomingData()
}
-
- if (selected) {
+
+ if (selected && mailList ) {
int *ptr = mailList->first();
@@ -198,3 +199,3 @@ void PopClient::incomingData()
messageCount = *ptr;
- } else newMessages = 0;
+ } else newMessages = 0;
}
@@ -226,3 +227,3 @@ void PopClient::incomingData()
}
- }
+ }
//get size of message, eg "500 characters in message.." -> int 500
@@ -236,3 +237,3 @@ void PopClient::incomingData()
emit currentMailSize(mailSize);
-
+
status = Retr;
@@ -243,3 +244,3 @@ void PopClient::incomingData()
}
- }
+ }
//Read message number x, count upwards to messageCount
@@ -247,3 +248,3 @@ void PopClient::incomingData()
if (status != Quit) {
- if ((selected)||(mailSize <= headerLimit))
+ if ((selected)||(mailSize <= headerLimit))
{
@@ -256,3 +257,3 @@ void PopClient::incomingData()
break;
- } }
+ } }
case Ignore: {
@@ -288,3 +289,3 @@ void PopClient::incomingData()
}
-
+
if ((messageCount > newMessages)||(selected)) //last message ?
@@ -297,3 +298,3 @@ void PopClient::incomingData()
}
- else
+ else
{
@@ -304,3 +305,3 @@ void PopClient::incomingData()
emit updateStatus(tr("Retrieving ") + temp + "/" + temp2);
-
+
break;
@@ -322,3 +323,3 @@ void PopClient::incomingData()
}
-
+
socket->close();