Revert "QmlDesigner: Add setting to force download mirror"

This reverts commit 6a4313b7a8.

Reason for revert: does not compile on linux

and it is maybe not a good idea that utils static lib gets a
core plugin dependency

Change-Id: I2bf153f94aa922a82776b490238ba0ba774d26aa
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
(cherry picked from commit 57f7085d31dc4ed721632ca417760c80355ae80d)
This commit is contained in:
Tim Jenssen
2023-05-10 21:00:18 +00:00
parent 53cb1b4083
commit c644f78596

View File

@@ -2,8 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "filedownloader.h"
#include <coreplugin/icore.h>
#include <private/qqmldata_p.h>
#include <utils/networkaccessmanager.h>
#include <utils/filepath.h>
@@ -155,15 +154,6 @@ void FileDownloader::setUrl(const QUrl &url)
{
if (m_url != url) {
m_url = url;
const QString mirror = Core::ICore::settings()->value("QML/Designer/ForceDownloadMirror").toString();
if (!mirror.isEmpty()) {
qWarning() << Q_FUNC_INFO << "Alternative mirror is used:" << mirror;
QString replaced = url.toString();
replaced.replace("https://download.qt.io/", mirror);
m_url = QUrl::fromUserInput(replaced);
}
emit urlChanged();
}
@@ -272,6 +262,10 @@ void FileDownloader::doProbeUrl()
this,
[this](QNetworkReply::NetworkError code) {
if (QQmlData::wasDeleted(this)) {
qDebug() << Q_FUNC_INFO << "FileDownloader was deleted.";
return;
}
qDebug() << Q_FUNC_INFO << "Network error:" << code
<< qobject_cast<QNetworkReply *>(sender())->errorString();