if (authenticatingStarted)
return;
- authenticatingStarted = true;
+ if (authCommand.user().isEmpty() || authCommand.pass().isEmpty())
+ {
+ m_error = AuthenticationError;
+ m_errorString = tr("You have to set your AniDB user and password in order to connect.");
+ emit connectionError();
+ return;
+ }
if (m_sessionId.isEmpty())
{
+ authenticatingStarted = true;
if (authReply != 0) authReply->deleteLater();
authReply = createReply(authCommand);
QObject::connect(authReply, SIGNAL(replyReady(bool)), this, SLOT(doAuthenticate(bool)));
enqueueControlCommand(authReply, true);
return;
}
- authenticatingStarted = false;
emit authenticated();
}
if (encryptionStarted)
return;
- encryptionStarted = true;
+ if (apiKey().isEmpty())
+ {
+ m_error = EncryptionError;
+ m_errorString = tr("You have to set your API Key in order to use encryption.");
+ emit connectionError();
+ return;
+ }
if (m_enableEncryption && !usingEncryption)
{
+ encryptionStarted = true;
if (encryptReply != 0) encryptReply->deleteLater();
encryptReply = createReply(encryptCommand);
QObject::connect(encryptReply, SIGNAL(replyReady(bool)), this, SLOT(doEncrypt(bool)));
enqueueControlCommand(encryptReply, true);
return;
}
- encryptionStarted = false;
emit encryptionEstablished();
}