Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJocelyn Turcotte <jturcotte@woboq.com>2015-09-05 16:39:22 +0300
committerJocelyn Turcotte <jturcotte@woboq.com>2015-09-05 17:00:45 +0300
commit6d027ebd40c85f5732eba74583a9eace08842524 (patch)
tree37d3953dde05a8a9ed00d8a13b5886b20ef78195 /src/gui/accountstate.h
parent89f69209dde7b5f859073cc9f7401aae2a847b07 (diff)
Separate the credential dialog from their fetch #3350
This moves the responsibility of asking the user or not for credentials from the Credentials classes back to the AccountState. fetch() now only extract credentials from the keychain, reports the result to the AccountState which then decides if askFromUser() should be called or not. The result is once more reported to the AccounState. This also replaces the HttpCredentials::queryPassword virtual which now lets HttpCredentialsGui and HttpCredentialsText do it the way that they prefer.
Diffstat (limited to 'src/gui/accountstate.h')
-rw-r--r--src/gui/accountstate.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/accountstate.h b/src/gui/accountstate.h
index 7280334d1..be1423950 100644
--- a/src/gui/accountstate.h
+++ b/src/gui/accountstate.h
@@ -19,6 +19,7 @@
#include <QPointer>
#include "utility.h"
#include "connectionvalidator.h"
+#include "creds/abstractcredentials.h"
#include <memory>
class QSettings;
@@ -27,7 +28,6 @@ namespace OCC {
class AccountState;
class Account;
-class AbstractCredentials;
/**
* @brief Extra info about an ownCloud server account.
@@ -59,6 +59,7 @@ public:
/// An error like invalid credentials where retrying won't help.
ConfigurationError
};
+ enum CredentialFetchMode { Interactive, NonInteractive };
/// The actual current connectivity status.
typedef ConnectionValidator::Status ConnectionStatus;
@@ -84,7 +85,7 @@ public:
/// Triggers a ping to the server to update state and
/// connection status and errors.
- void checkConnectivity(AbstractCredentials::FetchMode credentialsFetchMode);
+ void checkConnectivity(CredentialFetchMode credentialsFetchMode);
/** Returns a new settings object for this account, already in the right groups. */
std::unique_ptr<QSettings> settings();
@@ -104,6 +105,7 @@ protected Q_SLOTS:
void slotConnectionValidatorResult(ConnectionValidator::Status status, const QStringList& errors);
void slotInvalidCredentials();
void slotCredentialsFetched(AbstractCredentials* creds);
+ void slotCredentialsAsked(AbstractCredentials* creds);
private:
AccountPtr _account;
@@ -111,6 +113,7 @@ private:
ConnectionStatus _connectionStatus;
QStringList _connectionErrors;
bool _waitingForNewCredentials;
+ CredentialFetchMode _credentialsFetchMode;
QPointer<ConnectionValidator> _connectionValidator;
};