mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Replace qDebug() by report_info in checkcloudconnection.cpp
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
b6439e0420
commit
d83da05f8d
1 changed files with 14 additions and 14 deletions
|
@ -73,10 +73,10 @@ bool CheckCloudConnection::checkServer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (verbose)
|
if (verbose)
|
||||||
qDebug() << "connection test to cloud server" << prefs.cloud_base_url << "failed" <<
|
report_info("connection test to cloud server %s failed %d %s %d %s", prefs.cloud_base_url,
|
||||||
reply->error() << reply->errorString() <<
|
static_cast<int>(reply->error()), qPrintable(reply->errorString()),
|
||||||
reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() <<
|
reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(),
|
||||||
reply->readAll();
|
qPrintable(reply->readAll()));
|
||||||
} while (nextServer());
|
} while (nextServer());
|
||||||
// if none of the servers was reachable, update the user and switch to git_local_only
|
// if none of the servers was reachable, update the user and switch to git_local_only
|
||||||
git_storage_update_progress(qPrintable(tr("Cloud connection failed")));
|
git_storage_update_progress(qPrintable(tr("Cloud connection failed")));
|
||||||
|
@ -90,9 +90,9 @@ bool CheckCloudConnection::checkServer()
|
||||||
|
|
||||||
void CheckCloudConnection::sslErrors(const QList<QSslError> &errorList)
|
void CheckCloudConnection::sslErrors(const QList<QSslError> &errorList)
|
||||||
{
|
{
|
||||||
qDebug() << "Received error response trying to set up https connection with cloud storage backend:";
|
report_info("Received error response trying to set up https connection with cloud storage backend:");
|
||||||
for (QSslError err: errorList)
|
for (QSslError err: errorList)
|
||||||
qDebug() << err.errorString();
|
report_info("%s", qPrintable(err.errorString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CheckCloudConnection::nextServer()
|
bool CheckCloudConnection::nextServer()
|
||||||
|
@ -120,12 +120,12 @@ bool CheckCloudConnection::nextServer()
|
||||||
strcpy(baseurl, "https://");
|
strcpy(baseurl, "https://");
|
||||||
strncat(baseurl, server, s);
|
strncat(baseurl, server, s);
|
||||||
strcat(baseurl, "/");
|
strcat(baseurl, "/");
|
||||||
qDebug() << "failed to connect to" << prefs.cloud_base_url << "next server to try: " << baseurl;
|
report_info("failed to connect to %s next server to try: %s", prefs.cloud_base_url, baseurl);
|
||||||
prefs.cloud_base_url = baseurl;
|
prefs.cloud_base_url = baseurl;
|
||||||
git_storage_update_progress(qPrintable(tr("Trying different cloud server...")));
|
git_storage_update_progress(qPrintable(tr("Trying different cloud server...")));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
qDebug() << "failed to connect to any of the Subsurface cloud servers, giving up";
|
report_info("failed to connect to any of the Subsurface cloud servers, giving up");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ void CheckCloudConnection::gotIP(QNetworkReply *reply)
|
||||||
if (reply->error() != QNetworkReply::NoError) {
|
if (reply->error() != QNetworkReply::NoError) {
|
||||||
// whatever, just use the default host
|
// whatever, just use the default host
|
||||||
if (verbose)
|
if (verbose)
|
||||||
qDebug() << __FUNCTION__ << "got error reply from ip webservice - not changing cloud host";
|
report_info("%s got error reply from ip webservice - not changing cloud host", __func__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QString addressString = reply->readAll();
|
QString addressString = reply->readAll();
|
||||||
|
@ -154,11 +154,11 @@ void CheckCloudConnection::gotIP(QNetworkReply *reply)
|
||||||
if (addr.isNull()) {
|
if (addr.isNull()) {
|
||||||
// this isn't an address, don't try to update the cloud host
|
// this isn't an address, don't try to update the cloud host
|
||||||
if (verbose)
|
if (verbose)
|
||||||
qDebug() << __FUNCTION__ << "returned address doesn't appear to be valid (" << addressString << ") - not changing cloud host";
|
report_info("%s returned address doesn't appear to be valid (%s) - not changing cloud host", __func__, qPrintable(addressString));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (verbose)
|
if (verbose)
|
||||||
qDebug() << "IP used for cloud server access" << addressString;
|
report_info("IP used for cloud server access %s", qPrintable(addressString));
|
||||||
// now figure out which continent we are on
|
// now figure out which continent we are on
|
||||||
QNetworkRequest request(QString(GET_CONTINENT_API).arg(addressString));
|
QNetworkRequest request(QString(GET_CONTINENT_API).arg(addressString));
|
||||||
request.setRawHeader("Accept", "text/plain");
|
request.setRawHeader("Accept", "text/plain");
|
||||||
|
@ -173,7 +173,7 @@ void CheckCloudConnection::gotContinent(QNetworkReply *reply)
|
||||||
if (reply->error() != QNetworkReply::NoError) {
|
if (reply->error() != QNetworkReply::NoError) {
|
||||||
// whatever, just use the default host
|
// whatever, just use the default host
|
||||||
if (verbose)
|
if (verbose)
|
||||||
qDebug() << __FUNCTION__ << "got error reply from ip location webservice - not changing cloud host";
|
report_info("%s got error reply from ip location webservice - not changing cloud host", __func__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QString continentString = reply->readAll();
|
QString continentString = reply->readAll();
|
||||||
|
@ -194,7 +194,7 @@ void CheckCloudConnection::gotContinent(QNetworkReply *reply)
|
||||||
base_url = "https://" CLOUD_HOST_EU "/";
|
base_url = "https://" CLOUD_HOST_EU "/";
|
||||||
if (!same_string(base_url, prefs.cloud_base_url)) {
|
if (!same_string(base_url, prefs.cloud_base_url)) {
|
||||||
if (verbose)
|
if (verbose)
|
||||||
qDebug() << "remember cloud server" << base_url << "based on IP location in " << continentString;
|
report_info("remember cloud server %s based on IP location in %s", base_url, qPrintable(continentString));
|
||||||
qPrefCloudStorage::instance()->store_cloud_base_url(base_url);
|
qPrefCloudStorage::instance()->store_cloud_base_url(base_url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -213,7 +213,7 @@ extern "C" bool canReachCloudServer(struct git_info *info)
|
||||||
if (pos != std::string::npos) {
|
if (pos != std::string::npos) {
|
||||||
info->url = format_string_std("%s%s", prefs.cloud_base_url, info->url.c_str() + pos + 4);
|
info->url = format_string_std("%s%s", prefs.cloud_base_url, info->url.c_str() + pos + 4);
|
||||||
if (verbose)
|
if (verbose)
|
||||||
qDebug() << "updating remote to: " << info->url.c_str();
|
report_info("updating remote to: %s", info->url.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return connection;
|
return connection;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue