summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mailit/popclient.cpp
Unidiff
Diffstat (limited to 'noncore/unsupported/mailit/popclient.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/mailit/popclient.cpp3
1 files changed, 2 insertions, 1 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
@@ -32,24 +32,25 @@ PopClient::PopClient()
32 32
33 socket = new QSocket(this, "popClient"); 33 socket = new QSocket(this, "popClient");
34 connect(socket, SIGNAL(error(int)), this, SLOT(errorHandling(int))); 34 connect(socket, SIGNAL(error(int)), this, SLOT(errorHandling(int)));
35 connect(socket, SIGNAL(connected()), this, SLOT(connectionEstablished())); 35 connect(socket, SIGNAL(connected()), this, SLOT(connectionEstablished()));
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;
41 synchronize = FALSE; 41 synchronize = FALSE;
42 lastSync = 0; 42 lastSync = 0;
43 headerLimit = 0; 43 headerLimit = 0;
44 mailList = 0;
44 preview = FALSE; 45 preview = FALSE;
45} 46}
46 47
47PopClient::~PopClient() 48PopClient::~PopClient()
48{ 49{
49 delete socket; 50 delete socket;
50 delete stream; 51 delete stream;
51} 52}
52 53
53void PopClient::newConnection(const QString &target, int port) 54void PopClient::newConnection(const QString &target, int port)
54{ 55{
55 if (receiving) { 56 if (receiving) {
@@ -182,25 +183,25 @@ void PopClient::incomingData()
182 temp.truncate((uint) x); 183 temp.truncate((uint) x);
183 newMessages = temp.toInt(); 184 newMessages = temp.toInt();
184 messageCount = 1; 185 messageCount = 1;
185 status = List; 186 status = List;
186 187
187 if (synchronize) { 188 if (synchronize) {
188 //messages deleted from server, reload all 189 //messages deleted from server, reload all
189 if (newMessages < lastSync) 190 if (newMessages < lastSync)
190 lastSync = 0; 191 lastSync = 0;
191 messageCount = 1; 192 messageCount = 1;
192 } 193 }
193 194
194 if (selected) { 195 if (selected && mailList ) {
195 int *ptr = mailList->first(); 196 int *ptr = mailList->first();
196 if (ptr != 0) { 197 if (ptr != 0) {
197 newMessages++; //to ensure no early jumpout 198 newMessages++; //to ensure no early jumpout
198 messageCount = *ptr; 199 messageCount = *ptr;
199 } else newMessages = 0; 200 } else newMessages = 0;
200 } 201 }
201 202
202 } else errorHandlingWithMsg(ErrUnknownResponse, response); 203 } else errorHandlingWithMsg(ErrUnknownResponse, response);
203 } 204 }
204 //Read message number x, count upwards to messageCount 205 //Read message number x, count upwards to messageCount
205 case List: { 206 case List: {
206 if (messageCount <= newMessages) { 207 if (messageCount <= newMessages) {