author | kergoth <kergoth> | 2003-08-09 17:00:23 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-08-09 17:00:23 (UTC) |
commit | c33d5ec60361238e50a4a9d6e0eec03e396dce60 (patch) (unidiff) | |
tree | 31c0c85dc4262044db90c7918014bc45265ef420 /noncore/net/mailit/popclient.cpp | |
parent | 78c296d534589835801fb6374ac9d43d44b2b1c9 (diff) | |
download | opie-c33d5ec60361238e50a4a9d6e0eec03e396dce60.zip opie-c33d5ec60361238e50a4a9d6e0eec03e396dce60.tar.gz opie-c33d5ec60361238e50a4a9d6e0eec03e396dce60.tar.bz2 |
Merge from BRANCH_1_0
Diffstat (limited to 'noncore/net/mailit/popclient.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mailit/popclient.cpp | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/noncore/net/mailit/popclient.cpp b/noncore/net/mailit/popclient.cpp index 5da3bcb..1df6b2b 100644 --- a/noncore/net/mailit/popclient.cpp +++ b/noncore/net/mailit/popclient.cpp | |||
@@ -31,3 +31,3 @@ PopClient::PopClient() | |||
31 | { | 31 | { |
32 | 32 | ||
33 | socket = new QSocket(this, "popClient"); | 33 | socket = new QSocket(this, "popClient"); |
@@ -36,5 +36,5 @@ PopClient::PopClient() | |||
36 | connect(socket, SIGNAL(readyRead()), this, SLOT(incomingData())); | 36 | connect(socket, SIGNAL(readyRead()), this, SLOT(incomingData())); |
37 | 37 | ||
38 | stream = new QTextStream(socket); | 38 | stream = new QTextStream(socket); |
39 | 39 | ||
40 | receiving = FALSE; | 40 | receiving = FALSE; |
@@ -43,2 +43,3 @@ PopClient::PopClient() | |||
43 | headerLimit = 0; | 43 | headerLimit = 0; |
44 | mailList = 0; | ||
44 | preview = FALSE; | 45 | preview = FALSE; |
@@ -58,5 +59,5 @@ void PopClient::newConnection(const QString &target, int port) | |||
58 | } | 59 | } |
59 | 60 | ||
60 | status = Init; | 61 | status = Init; |
61 | 62 | ||
62 | socket->connectToHost(target, port); | 63 | socket->connectToHost(target, port); |
@@ -64,3 +65,3 @@ void PopClient::newConnection(const QString &target, int port) | |||
64 | //selected = FALSE; | 65 | //selected = FALSE; |
65 | 66 | ||
66 | emit updateStatus(tr("DNS lookup")); | 67 | emit updateStatus(tr("DNS lookup")); |
@@ -72,3 +73,3 @@ void PopClient::setAccount(const QString &popUser, const QString &popPasswd) | |||
72 | popPassword = popPasswd; | 73 | popPassword = popPasswd; |
73 | } | 74 | } |
74 | 75 | ||
@@ -125,5 +126,5 @@ void PopClient::incomingData() | |||
125 | 126 | ||
126 | 127 | ||
127 | response = socket->readLine(); | 128 | response = socket->readLine(); |
128 | 129 | ||
129 | switch(status) { | 130 | switch(status) { |
@@ -138,3 +139,3 @@ void PopClient::incomingData() | |||
138 | md5Source = timeStamp + popPassword; | 139 | md5Source = timeStamp + popPassword; |
139 | 140 | ||
140 | md5_buffer( (char const *)md5Source, md5Source.length(),&md5Digest[0]); | 141 | md5_buffer( (char const *)md5Source, md5Source.length(),&md5Digest[0]); |
@@ -145,3 +146,3 @@ void PopClient::incomingData() | |||
145 | } | 146 | } |
146 | printf("\n"); | 147 | printf("\n"); |
147 | // qDebug(md5Digest); | 148 | // qDebug(md5Digest); |
@@ -158,6 +159,6 @@ void PopClient::incomingData() | |||
158 | } | 159 | } |
159 | 160 | ||
160 | break; | 161 | break; |
161 | } | 162 | } |
162 | 163 | ||
163 | case Pass: { | 164 | case Pass: { |
@@ -165,3 +166,3 @@ void PopClient::incomingData() | |||
165 | status = Stat; | 166 | status = Stat; |
166 | 167 | ||
167 | break; | 168 | break; |
@@ -172,3 +173,3 @@ void PopClient::incomingData() | |||
172 | *stream << "STAT" << "\r\n"; | 173 | *stream << "STAT" << "\r\n"; |
173 | status = Mcnt; | 174 | status = Mcnt; |
174 | } else errorHandlingWithMsg(ErrLoginFailed, response); | 175 | } else errorHandlingWithMsg(ErrLoginFailed, response); |
@@ -185,3 +186,3 @@ void PopClient::incomingData() | |||
185 | status = List; | 186 | status = List; |
186 | 187 | ||
187 | if (synchronize) { | 188 | if (synchronize) { |
@@ -192,4 +193,4 @@ void PopClient::incomingData() | |||
192 | } | 193 | } |
193 | 194 | ||
194 | if (selected) { | 195 | if (selected && mailList ) { |
195 | int *ptr = mailList->first(); | 196 | int *ptr = mailList->first(); |
@@ -198,3 +199,3 @@ void PopClient::incomingData() | |||
198 | messageCount = *ptr; | 199 | messageCount = *ptr; |
199 | } else newMessages = 0; | 200 | } else newMessages = 0; |
200 | } | 201 | } |
@@ -226,3 +227,3 @@ void PopClient::incomingData() | |||
226 | } | 227 | } |
227 | } | 228 | } |
228 | //get size of message, eg "500 characters in message.." -> int 500 | 229 | //get size of message, eg "500 characters in message.." -> int 500 |
@@ -236,3 +237,3 @@ void PopClient::incomingData() | |||
236 | emit currentMailSize(mailSize); | 237 | emit currentMailSize(mailSize); |
237 | 238 | ||
238 | status = Retr; | 239 | status = Retr; |
@@ -243,3 +244,3 @@ void PopClient::incomingData() | |||
243 | } | 244 | } |
244 | } | 245 | } |
245 | //Read message number x, count upwards to messageCount | 246 | //Read message number x, count upwards to messageCount |
@@ -247,3 +248,3 @@ void PopClient::incomingData() | |||
247 | if (status != Quit) { | 248 | if (status != Quit) { |
248 | if ((selected)||(mailSize <= headerLimit)) | 249 | if ((selected)||(mailSize <= headerLimit)) |
249 | { | 250 | { |
@@ -256,3 +257,3 @@ void PopClient::incomingData() | |||
256 | break; | 257 | break; |
257 | } } | 258 | } } |
258 | case Ignore: { | 259 | case Ignore: { |
@@ -288,3 +289,3 @@ void PopClient::incomingData() | |||
288 | } | 289 | } |
289 | 290 | ||
290 | if ((messageCount > newMessages)||(selected)) //last message ? | 291 | if ((messageCount > newMessages)||(selected)) //last message ? |
@@ -297,3 +298,3 @@ void PopClient::incomingData() | |||
297 | } | 298 | } |
298 | else | 299 | else |
299 | { | 300 | { |
@@ -304,3 +305,3 @@ void PopClient::incomingData() | |||
304 | emit updateStatus(tr("Retrieving ") + temp + "/" + temp2); | 305 | emit updateStatus(tr("Retrieving ") + temp + "/" + temp2); |
305 | 306 | ||
306 | break; | 307 | break; |
@@ -322,3 +323,3 @@ void PopClient::incomingData() | |||
322 | } | 323 | } |
323 | 324 | ||
324 | socket->close(); | 325 | socket->close(); |