QmlDesigner: Add private api to narrow down bug

This is only a temporary patch to narrow down a bug in QtDS.

Task-number: QDS-6239
Change-Id: Icf9cde008179174fd79fb92a92372fb2b541068b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Henning Gruendl
2022-02-16 12:39:46 +01:00
committed by Thomas Hartmann
parent 2cd7d89ec5
commit 4b7ab40ed0
2 changed files with 25 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
add_qtc_plugin(StudioWelcome
CONDITION TARGET Qt5::QuickWidgets AND TARGET QmlDesigner
DEPENDS Qt5::QuickWidgets
DEPENDS Qt5::QuickWidgets Qt5::QmlPrivate
PLUGIN_DEPENDS Core ProjectExplorer QtSupport QmlDesigner
DEFINES STUDIO_QML_PATH="${CMAKE_CURRENT_SOURCE_DIR}/qml/"
SOURCES

View File

@@ -31,6 +31,8 @@
#include <utils/networkaccessmanager.h>
#include <utils/qtcassert.h>
#include <private/qqmldata_p.h>
#include <QDialog>
#include <QFileDialog>
#include <QFileInfo>
@@ -247,6 +249,17 @@ void FileDownloader::probeUrl()
});
QNetworkReply::connect(reply, &QNetworkReply::finished, this, [this, reply]() {
QQmlData *data = QQmlData::get(this, false);
if (!data) {
qDebug() << Q_FUNC_INFO << "FileDownloader is nullptr.";
return;
}
if (QQmlData::wasDeleted(this)) {
qDebug() << Q_FUNC_INFO << "FileDownloader was deleted.";
return;
}
if (reply->error())
return;
@@ -261,8 +274,17 @@ void FileDownloader::probeUrl()
&QNetworkReply::errorOccurred,
this,
[this, reply](QNetworkReply::NetworkError code) {
// QNetworkReply::HostNotFoundError
// QNetworkReply::ContentNotFoundError
QQmlData *data = QQmlData::get(this, false);
if (!data) {
qDebug() << Q_FUNC_INFO << "FileDownloader is nullptr.";
return;
}
if (QQmlData::wasDeleted(this)) {
qDebug() << Q_FUNC_INFO << "FileDownloader was deleted.";
return;
}
m_available = false;
emit availableChanged();
});