forked from qt-creator/qt-creator
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:
committed by
Thomas Hartmann
parent
2cd7d89ec5
commit
4b7ab40ed0
@@ -1,6 +1,6 @@
|
|||||||
add_qtc_plugin(StudioWelcome
|
add_qtc_plugin(StudioWelcome
|
||||||
CONDITION TARGET Qt5::QuickWidgets AND TARGET QmlDesigner
|
CONDITION TARGET Qt5::QuickWidgets AND TARGET QmlDesigner
|
||||||
DEPENDS Qt5::QuickWidgets
|
DEPENDS Qt5::QuickWidgets Qt5::QmlPrivate
|
||||||
PLUGIN_DEPENDS Core ProjectExplorer QtSupport QmlDesigner
|
PLUGIN_DEPENDS Core ProjectExplorer QtSupport QmlDesigner
|
||||||
DEFINES STUDIO_QML_PATH="${CMAKE_CURRENT_SOURCE_DIR}/qml/"
|
DEFINES STUDIO_QML_PATH="${CMAKE_CURRENT_SOURCE_DIR}/qml/"
|
||||||
SOURCES
|
SOURCES
|
||||||
|
@@ -31,6 +31,8 @@
|
|||||||
#include <utils/networkaccessmanager.h>
|
#include <utils/networkaccessmanager.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
|
#include <private/qqmldata_p.h>
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
@@ -247,6 +249,17 @@ void FileDownloader::probeUrl()
|
|||||||
});
|
});
|
||||||
|
|
||||||
QNetworkReply::connect(reply, &QNetworkReply::finished, this, [this, reply]() {
|
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())
|
if (reply->error())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -261,8 +274,17 @@ void FileDownloader::probeUrl()
|
|||||||
&QNetworkReply::errorOccurred,
|
&QNetworkReply::errorOccurred,
|
||||||
this,
|
this,
|
||||||
[this, reply](QNetworkReply::NetworkError code) {
|
[this, reply](QNetworkReply::NetworkError code) {
|
||||||
// QNetworkReply::HostNotFoundError
|
QQmlData *data = QQmlData::get(this, false);
|
||||||
// QNetworkReply::ContentNotFoundError
|
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;
|
m_available = false;
|
||||||
emit availableChanged();
|
emit availableChanged();
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user