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
@@ -62,9 +62,9 @@ void PopClient::newConnection(const QString &target, int port)
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)
{
@@ -102,10 +102,14 @@ void PopClient::connectionEstablished()
}
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;
}
@@ -166,9 +170,9 @@ void PopClient::incomingData()
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: {
@@ -194,9 +198,9 @@ void PopClient::incomingData()
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) {
@@ -233,9 +237,9 @@ void PopClient::incomingData()
status = Retr;
} else {
//qWarning(response);
- errorHandling(ErrUnknownResponse);
+ errorHandlingWithMsg(ErrUnknownResponse, response);
}
}
}
//Read message number x, count upwards to messageCount
@@ -258,9 +262,9 @@ void PopClient::incomingData()
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