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.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/noncore/unsupported/mailit/popclient.cpp b/noncore/unsupported/mailit/popclient.cpp
index dc0116d..5da3bcb 100644
--- a/noncore/unsupported/mailit/popclient.cpp
+++ b/noncore/unsupported/mailit/popclient.cpp
@@ -60,13 +60,13 @@ void PopClient::newConnection(const QString &target, int port)
status = Init;
socket->connectToHost(target, port);
receiving = TRUE;
//selected = FALSE;
- emit updateStatus("DNS lookup");
+ emit updateStatus(tr("DNS lookup"));
}
void PopClient::setAccount(const QString &popUser, const QString &popPasswd)
{
popUserName = popUser;
popPassword = popPasswd;
@@ -100,14 +100,18 @@ void PopClient::connectionEstablished()
{
emit updateStatus(tr("Connection established"));
}
void PopClient::errorHandling(int status)
{
+ errorHandlingWithMsg( status, QString::null );
+}
+void PopClient::errorHandlingWithMsg(int status, const QString & Msg )
+{
emit updateStatus(tr("Error Occured"));
- emit errorOccurred(status);
+ emit errorOccurred(status, Msg);
socket->close();
receiving = FALSE;
}
void PopClient::incomingData()
{
@@ -164,13 +168,13 @@ void PopClient::incomingData()
}
//ask for number of messages
case Stat: {
if (response[0] == '+') {
*stream << "STAT" << "\r\n";
status = Mcnt;
- } else errorHandling(ErrLoginFailed);
+ } else errorHandlingWithMsg(ErrLoginFailed, response);
break;
}
//get count of messages, eg "+OK 4 900.." -> int 4
case Mcnt: {
if (response[0] == '+') {
temp = response.replace(0, 4, "");
@@ -192,13 +196,13 @@ void PopClient::incomingData()
if (ptr != 0) {
newMessages++; //to ensure no early jumpout
messageCount = *ptr;
} else newMessages = 0;
}
- } else errorHandling(ErrUnknownResponse);
+ } else errorHandlingWithMsg(ErrUnknownResponse, response);
}
//Read message number x, count upwards to messageCount
case List: {
if (messageCount <= newMessages) {
*stream << "LIST " << messageCount << "\r\n";
status = Size;
@@ -231,13 +235,13 @@ void PopClient::incomingData()
mailSize = temp.toInt();
emit currentMailSize(mailSize);
status = Retr;
} else {
//qWarning(response);
- errorHandling(ErrUnknownResponse);
+ errorHandlingWithMsg(ErrUnknownResponse, response);
}
}
}
//Read message number x, count upwards to messageCount
case Retr: {
if (status != Quit) {
@@ -256,13 +260,13 @@ void PopClient::incomingData()
if (response[0] == '+') {
message = "";
status = Read;
if (!socket->canReadLine()) //sync. problems
break;
response = socket->readLine();
- } else errorHandling(ErrUnknownResponse);
+ } else errorHandlingWithMsg(ErrUnknownResponse, response);
}
}
//add all incoming lines to body. When size is reached, send
//message, and go back to read new message
case Read: {
if (status != Quit) { //because of idiotic switch