diff options
author | Christian Stenger <christian.stenger@qt.io> | 2022-01-12 16:26:01 +0100 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2022-01-13 11:45:30 +0000 |
commit | 5ffad15367e2f5f4db5e36f8ded91e0701d71c40 (patch) | |
tree | f153fda8de7f960695aebc657da69bb52845271d | |
parent | 0b00c15d3681522b86822a74996d2ede46715b74 (diff) | |
download | qt-creator-5ffad15367e2f5f4db5e36f8ded91e0701d71c40.tar.gz |
CPaster: Do not fail to paste after connection check
dpaste allows one request per second, but we perform a connection
check before sending the paste request.
This happens too fast and lets the paste fail for the first time.
Skip the configuration check as the user gets an error message
if it fails.
Fixes: QTCREATORBUG-26717
Change-Id: I5661055c0d3ed0894db170c0570a7501af34214e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r-- | src/plugins/cpaster/dpastedotcomprotocol.cpp | 7 | ||||
-rw-r--r-- | src/plugins/cpaster/dpastedotcomprotocol.h | 2 |
2 files changed, 3 insertions, 6 deletions
diff --git a/src/plugins/cpaster/dpastedotcomprotocol.cpp b/src/plugins/cpaster/dpastedotcomprotocol.cpp index da9863bb4d..847ce8cdb1 100644 --- a/src/plugins/cpaster/dpastedotcomprotocol.cpp +++ b/src/plugins/cpaster/dpastedotcomprotocol.cpp @@ -140,11 +140,10 @@ void DPasteDotComProtocol::paste( }); } -bool DPasteDotComProtocol::checkConfiguration(QString *errorMessage) +bool DPasteDotComProtocol::checkConfiguration(QString * /*errorMessage*/) { - if (!m_hostKnownOk) - m_hostKnownOk = httpStatus(baseUrl(), errorMessage); - return m_hostKnownOk; + // we need a 1s gap between requests, so skip status check to avoid failing + return true; } void DPasteDotComProtocol::reportError(const QString &message) diff --git a/src/plugins/cpaster/dpastedotcomprotocol.h b/src/plugins/cpaster/dpastedotcomprotocol.h index 9b39052d8c..363c42153b 100644 --- a/src/plugins/cpaster/dpastedotcomprotocol.h +++ b/src/plugins/cpaster/dpastedotcomprotocol.h @@ -51,8 +51,6 @@ private: bool checkConfiguration(QString *errorMessage) override; static void reportError(const QString &message); - - bool m_hostKnownOk = false; }; } // namespace CodePaster |