void ConnectionValidator::slotCheckAuthentication() { // simply GET the webdav root, will fail if credentials are wrong. // continue in slotAuthCheck here :-) PropfindJob *job = new PropfindJob(_account, "/", this); job->setIgnoreCredentialFailure(true); job->setProperties(QList<QByteArray>() << "getlastmodified"); connect(job, SIGNAL(result(QVariantMap)), SLOT(slotAuthSuccess())); connect(job, SIGNAL(networkError(QNetworkReply*)), SLOT(slotAuthFailed(QNetworkReply*))); job->start(); qDebug() << "# checking for authentication settings."; }
void ConnectionValidator::checkAuthentication() { AbstractCredentials *creds = _account->credentials(); if (!creds->ready()) { // The user canceled reportResult(UserCanceledCredentials); } // simply GET the webdav root, will fail if credentials are wrong. // continue in slotAuthCheck here :-) qDebug() << "# Check whether authenticated propfind works."; PropfindJob *job = new PropfindJob(_account, "/", this); job->setProperties(QList<QByteArray>() << "getlastmodified"); connect(job, SIGNAL(result(QVariantMap)), SLOT(slotAuthSuccess())); connect(job, SIGNAL(networkError(QNetworkReply*)), SLOT(slotAuthFailed(QNetworkReply*))); job->start(); }