diff options
author | Daniel Molkentin <danimo@owncloud.com> | 2014-04-14 17:08:43 +0400 |
---|---|---|
committer | Daniel Molkentin <danimo@owncloud.com> | 2014-04-14 17:08:43 +0400 |
commit | ef9a318cd9967c19919e55152782579fbc17e608 (patch) | |
tree | 096ee5b0f110613a784bb52c76f168a981f5e2f8 /src/creds | |
parent | 9f4ffd44d60c92275602b43c39732300af8af9cb (diff) |
AbstractNetworkJob Allow finished() to defer Job deletion
This allows to reuse the Job
Diffstat (limited to 'src/creds')
-rw-r--r-- | src/creds/shibboleth/shibbolethuserjob.cpp | 5 | ||||
-rw-r--r-- | src/creds/shibboleth/shibbolethuserjob.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/creds/shibboleth/shibbolethuserjob.cpp b/src/creds/shibboleth/shibbolethuserjob.cpp index d64fd26ec..2db343edf 100644 --- a/src/creds/shibboleth/shibbolethuserjob.cpp +++ b/src/creds/shibboleth/shibbolethuserjob.cpp @@ -35,7 +35,7 @@ void ShibbolethUserJob::start() AbstractNetworkJob::start(); } -void ShibbolethUserJob::finished() +bool ShibbolethUserJob::finished() { bool success = false; QVariantMap json = QtJson::parse(QString::fromUtf8(reply()->readAll()), success).toMap(); @@ -43,12 +43,13 @@ void ShibbolethUserJob::finished() if (!success || json.isEmpty()) { qDebug() << "cloud/user: invalid JSON!"; emit userFetched(QString()); - return; + return true; } QString user = json.value("ocs").toMap().value("data").toMap().value("id").toString(); qDebug() << "cloud/user: " << json << "->" << user; emit userFetched(user); + return true; } diff --git a/src/creds/shibboleth/shibbolethuserjob.h b/src/creds/shibboleth/shibbolethuserjob.h index b6d44836f..f6427a45b 100644 --- a/src/creds/shibboleth/shibbolethuserjob.h +++ b/src/creds/shibboleth/shibbolethuserjob.h @@ -36,7 +36,7 @@ signals: void tryAgain(); private slots: - virtual void finished(); + virtual bool finished(); }; |