aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Christopher Hockley <christopher@putcocoa.in>2015-02-17 14:46:47 +0100
committerGravatar Christopher Hockley <christopher@putcocoa.in>2015-02-17 14:46:47 +0100
commit9793fa6791cea4763f19af18d3291bb72f133500 (patch)
treefc498aee40939af4d57564f515f7cce6ca92a85d /src
parentfbd87ecf9b457d7bf4bbf062775ea03ffccb17aa (diff)
AccountValidator Fixes
Diffstat (limited to 'src')
-rw-r--r--src/core/provider/MCAccountValidator.cpp36
1 files changed, 17 insertions, 19 deletions
diff --git a/src/core/provider/MCAccountValidator.cpp b/src/core/provider/MCAccountValidator.cpp
index 3ca5bfbb..235c1704 100644
--- a/src/core/provider/MCAccountValidator.cpp
+++ b/src/core/provider/MCAccountValidator.cpp
@@ -228,7 +228,7 @@ void AccountValidator::checkNextHost()
mImapSession->setConnectionType(mImapServer->connectionType());
mOperation = (IMAPOperation *)mImapSession->checkAccountOperation();
- mOperation->setCallback((OperationCallback *)this);
+ mOperation->setCallback(this);
mOperation->start();
}
else {
@@ -239,17 +239,17 @@ void AccountValidator::checkNextHost()
}
else if (mCurrentServiceTested == SERVICE_POP){
if (mCurrentServiceIndex < mPopServices->count()) {
- POPAsyncSession *popSession = new POPAsyncSession();
- popSession->setUsername(mUsername);
- popSession->setPassword(mPassword);
+ mPopSession = new POPAsyncSession();
+ mPopSession->setUsername(mUsername);
+ mPopSession->setPassword(mPassword);
mPopServer = (NetService *) mPopServices->objectAtIndex(mCurrentServiceIndex);
- popSession->setHostname(mPopServer->hostname());
- popSession->setPort(mPopServer->port());
- popSession->setConnectionType(mPopServer->connectionType());
+ mPopSession->setHostname(mPopServer->hostname());
+ mPopSession->setPort(mPopServer->port());
+ mPopSession->setConnectionType(mPopServer->connectionType());
- mOperation = (POPOperation *)popSession->checkAccountOperation();
- mOperation->setCallback((OperationCallback *)this);
+ mOperation = mPopSession->checkAccountOperation();
+ mOperation->setCallback(this);
mOperation->start();
}
else {
@@ -260,17 +260,17 @@ void AccountValidator::checkNextHost()
}
else if (mCurrentServiceTested == SERVICE_SMTP){
if (mCurrentServiceIndex < mSmtpServices->count()) {
- SMTPAsyncSession *smtpSession = new SMTPAsyncSession();
- smtpSession->setUsername(mUsername);
- smtpSession->setPassword(mPassword);
+ mSmtpSession = new SMTPAsyncSession();
+ mSmtpSession->setUsername(mUsername);
+ mSmtpSession->setPassword(mPassword);
mSmtpServer = (NetService *) mSmtpServices->objectAtIndex(mCurrentServiceIndex);
- smtpSession->setHostname(mSmtpServer->hostname());
- smtpSession->setPort(mSmtpServer->port());
- smtpSession->setConnectionType(mSmtpServer->connectionType());
+ mSmtpSession->setHostname(mSmtpServer->hostname());
+ mSmtpSession->setPort(mSmtpServer->port());
+ mSmtpSession->setConnectionType(mSmtpServer->connectionType());
- mOperation = (SMTPOperation *)smtpSession->checkAccountOperation(Address::addressWithMailbox(mEmail));
- mOperation->setCallback((OperationCallback *)this);
+ mOperation = mSmtpSession->checkAccountOperation(Address::addressWithMailbox(mEmail));
+ mOperation->setCallback(this);
mOperation->start();
}
else {
@@ -304,8 +304,6 @@ void AccountValidator::checkNextHostDone()
MC_SAFE_RELEASE(mSmtpSession);
}
- MC_SAFE_RELEASE(mOperation);
-
if (error == ErrorNone) {
mCurrentServiceTested ++;
}