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>
This commit is contained in:
Christian Stenger
2022-01-12 16:26:01 +01:00
parent 0b00c15d36
commit 5ffad15367
2 changed files with 3 additions and 6 deletions

View File

@@ -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)

View File

@@ -51,8 +51,6 @@ private:
bool checkConfiguration(QString *errorMessage) override;
static void reportError(const QString &message);
bool m_hostKnownOk = false;
};
} // namespace CodePaster