author | llornkcor <llornkcor> | 2003-05-24 01:20:33 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-05-24 01:20:33 (UTC) |
commit | 62d2ddfb5cd77e2637cdf7fe16d76aac04975984 (patch) (unidiff) | |
tree | 2157d57bab2d6e491226f5bc8468a4c2527e1456 /noncore/net/mailit/popclient.cpp | |
parent | 0c4b5288ccd4bcd1668816a0c4e12ce0a76b4e6e (diff) | |
download | opie-62d2ddfb5cd77e2637cdf7fe16d76aac04975984.zip opie-62d2ddfb5cd77e2637cdf7fe16d76aac04975984.tar.gz opie-62d2ddfb5cd77e2637cdf7fe16d76aac04975984.tar.bz2 |
QString to const QString
Diffstat (limited to 'noncore/net/mailit/popclient.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mailit/popclient.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/noncore/net/mailit/popclient.cpp b/noncore/net/mailit/popclient.cpp index fedc4e2..dc0116d 100644 --- a/noncore/net/mailit/popclient.cpp +++ b/noncore/net/mailit/popclient.cpp | |||
@@ -47,13 +47,13 @@ PopClient::PopClient() | |||
47 | PopClient::~PopClient() | 47 | PopClient::~PopClient() |
48 | { | 48 | { |
49 | delete socket; | 49 | delete socket; |
50 | delete stream; | 50 | delete stream; |
51 | } | 51 | } |
52 | 52 | ||
53 | void PopClient::newConnection(QString target, int port) | 53 | void PopClient::newConnection(const QString &target, int port) |
54 | { | 54 | { |
55 | if (receiving) { | 55 | if (receiving) { |
56 | qWarning("socket in use, connection refused"); | 56 | qWarning("socket in use, connection refused"); |
57 | return; | 57 | return; |
58 | } | 58 | } |
59 | 59 | ||
@@ -63,13 +63,13 @@ void PopClient::newConnection(QString target, int port) | |||
63 | receiving = TRUE; | 63 | receiving = TRUE; |
64 | //selected = FALSE; | 64 | //selected = FALSE; |
65 | 65 | ||
66 | emit updateStatus("DNS lookup"); | 66 | emit updateStatus("DNS lookup"); |
67 | } | 67 | } |
68 | 68 | ||
69 | void PopClient::setAccount(QString popUser, QString popPasswd) | 69 | void PopClient::setAccount(const QString &popUser, const QString &popPasswd) |
70 | { | 70 | { |
71 | popUserName = popUser; | 71 | popUserName = popUser; |
72 | popPassword = popPasswd; | 72 | popPassword = popPasswd; |
73 | } | 73 | } |
74 | 74 | ||
75 | void PopClient::setSynchronize(int lastCount) | 75 | void PopClient::setSynchronize(int lastCount) |
@@ -155,21 +155,21 @@ void PopClient::incomingData() | |||
155 | 155 | ||
156 | break; | 156 | break; |
157 | } | 157 | } |
158 | 158 | ||
159 | case Pass: { | 159 | case Pass: { |
160 | *stream << "PASS " << popPassword << "\r\n"; | 160 | *stream << "PASS " << popPassword << "\r\n"; |
161 | status = Stat; | 161 | status = Stat; |
162 | 162 | ||
163 | break; | 163 | break; |
164 | } | 164 | } |
165 | //ask for number of messages | 165 | //ask for number of messages |
166 | case Stat: { | 166 | case Stat: { |
167 | if (response[0] == '+') { | 167 | if (response[0] == '+') { |
168 | *stream << "STAT" << "\r\n"; | 168 | *stream << "STAT" << "\r\n"; |
169 | status = Mcnt; | 169 | status = Mcnt; |
170 | } else errorHandling(ErrLoginFailed); | 170 | } else errorHandling(ErrLoginFailed); |
171 | break; | 171 | break; |
172 | } | 172 | } |
173 | //get count of messages, eg "+OK 4 900.." -> int 4 | 173 | //get count of messages, eg "+OK 4 900.." -> int 4 |
174 | case Mcnt: { | 174 | case Mcnt: { |
175 | if (response[0] == '+') { | 175 | if (response[0] == '+') { |
@@ -179,24 +179,24 @@ void PopClient::incomingData() | |||
179 | newMessages = temp.toInt(); | 179 | newMessages = temp.toInt(); |
180 | messageCount = 1; | 180 | messageCount = 1; |
181 | status = List; | 181 | status = List; |
182 | 182 | ||
183 | if (synchronize) { | 183 | if (synchronize) { |
184 | //messages deleted from server, reload all | 184 | //messages deleted from server, reload all |
185 | if (newMessages < lastSync) | 185 | if (newMessages < lastSync) |
186 | lastSync = 0; | 186 | lastSync = 0; |
187 | messageCount = 1; | 187 | messageCount = 1; |
188 | } | 188 | } |
189 | 189 | ||
190 | if (selected) { | 190 | if (selected) { |
191 | int *ptr = mailList->first(); | 191 | int *ptr = mailList->first(); |
192 | if (ptr != 0) { | 192 | if (ptr != 0) { |
193 | newMessages++; //to ensure no early jumpout | 193 | newMessages++; //to ensure no early jumpout |
194 | messageCount = *ptr; | 194 | messageCount = *ptr; |
195 | } else newMessages = 0; | 195 | } else newMessages = 0; |
196 | } | 196 | } |
197 | 197 | ||
198 | } else errorHandling(ErrUnknownResponse); | 198 | } else errorHandling(ErrUnknownResponse); |
199 | } | 199 | } |
200 | //Read message number x, count upwards to messageCount | 200 | //Read message number x, count upwards to messageCount |
201 | case List: { | 201 | case List: { |
202 | if (messageCount <= newMessages) { | 202 | if (messageCount <= newMessages) { |
@@ -239,16 +239,16 @@ void PopClient::incomingData() | |||
239 | } | 239 | } |
240 | } | 240 | } |
241 | //Read message number x, count upwards to messageCount | 241 | //Read message number x, count upwards to messageCount |
242 | case Retr: { | 242 | case Retr: { |
243 | if (status != Quit) { | 243 | if (status != Quit) { |
244 | if ((selected)||(mailSize <= headerLimit)) | 244 | if ((selected)||(mailSize <= headerLimit)) |
245 | { | 245 | { |
246 | *stream << "RETR " << messageCount << "\r\n"; | 246 | *stream << "RETR " << messageCount << "\r\n"; |
247 | } else { //only header | 247 | } else { //only header |
248 | *stream << "TOP " << messageCount << " 0\r\n"; | 248 | *stream << "TOP " << messageCount << " 0\r\n"; |
249 | } | 249 | } |
250 | messageCount++; | 250 | messageCount++; |
251 | status = Ignore; | 251 | status = Ignore; |
252 | break; | 252 | break; |
253 | } } | 253 | } } |
254 | case Ignore: { | 254 | case Ignore: { |
@@ -273,29 +273,29 @@ void PopClient::incomingData() | |||
273 | } | 273 | } |
274 | emit downloadedSize(message.length()); | 274 | emit downloadedSize(message.length()); |
275 | int x = message.find("\r\n.\r\n",-5); | 275 | int x = message.find("\r\n.\r\n",-5); |
276 | if (x == -1) { | 276 | if (x == -1) { |
277 | break; | 277 | break; |
278 | } else { //message reach entire size | 278 | } else { //message reach entire size |
279 | if ( (selected)||(mailSize <= headerLimit)) //mail size limit is not used if late download is active | 279 | if ( (selected)||(mailSize <= headerLimit)) //mail size limit is not used if late download is active |
280 | { | 280 | { |
281 | emit newMessage(message, messageCount-1, mailSize, TRUE); | 281 | emit newMessage(message, messageCount-1, mailSize, TRUE); |
282 | } else { //incomplete mail downloaded | 282 | } else { //incomplete mail downloaded |
283 | emit newMessage(message, messageCount-1, mailSize, FALSE); | 283 | emit newMessage(message, messageCount-1, mailSize, FALSE); |
284 | } | 284 | } |
285 | 285 | ||
286 | if ((messageCount > newMessages)||(selected)) //last message ? | 286 | if ((messageCount > newMessages)||(selected)) //last message ? |
287 | { | 287 | { |
288 | status = Quit; | 288 | status = Quit; |
289 | if (selected) { //grab next from queue | 289 | if (selected) { //grab next from queue |
290 | newMessages--; | 290 | newMessages--; |
291 | status = Quit; | 291 | status = Quit; |
292 | } | 292 | } |
293 | } | 293 | } |
294 | else | 294 | else |
295 | { | 295 | { |
296 | *stream << "LIST " << messageCount << "\r\n"; | 296 | *stream << "LIST " << messageCount << "\r\n"; |
297 | status = Size; | 297 | status = Size; |
298 | temp2.setNum(newMessages - lastSync); | 298 | temp2.setNum(newMessages - lastSync); |
299 | temp.setNum(messageCount - lastSync); | 299 | temp.setNum(messageCount - lastSync); |
300 | emit updateStatus(tr("Retrieving ") + temp + "/" + temp2); | 300 | emit updateStatus(tr("Retrieving ") + temp + "/" + temp2); |
301 | 301 | ||