forked from qt-creator/qt-creator
QmlDesigner: Add guard pointers to connect
Task-number: QDS-6239 Change-Id: I08a21a8c431046b846d0b41265d8665e93afa0a9 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
committed by
Henning Gründl
parent
45c018f560
commit
7dc82dace6
@@ -146,7 +146,7 @@ void FileDownloader::start()
|
|||||||
QNetworkRequest::UserVerifiedRedirectPolicy);
|
QNetworkRequest::UserVerifiedRedirectPolicy);
|
||||||
QNetworkReply *reply = Utils::NetworkAccessManager::instance()->get(request);
|
QNetworkReply *reply = Utils::NetworkAccessManager::instance()->get(request);
|
||||||
|
|
||||||
QNetworkReply::connect(reply, &QNetworkReply::readyRead, [this, reply]() {
|
QNetworkReply::connect(reply, &QNetworkReply::readyRead, this, [this, reply]() {
|
||||||
m_tempFile.write(reply->readAll());
|
m_tempFile.write(reply->readAll());
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -165,7 +165,7 @@ void FileDownloader::start()
|
|||||||
emit reply->redirectAllowed();
|
emit reply->redirectAllowed();
|
||||||
});
|
});
|
||||||
|
|
||||||
QNetworkReply::connect(reply, &QNetworkReply::finished, [this, reply]() {
|
QNetworkReply::connect(reply, &QNetworkReply::finished, this, [this, reply]() {
|
||||||
if (reply->error()) {
|
if (reply->error()) {
|
||||||
m_tempFile.remove();
|
m_tempFile.remove();
|
||||||
qDebug() << Q_FUNC_INFO << m_url << reply->errorString();
|
qDebug() << Q_FUNC_INFO << m_url << reply->errorString();
|
||||||
@@ -246,7 +246,7 @@ void FileDownloader::probeUrl()
|
|||||||
emit reply->redirectAllowed();
|
emit reply->redirectAllowed();
|
||||||
});
|
});
|
||||||
|
|
||||||
QNetworkReply::connect(reply, &QNetworkReply::finished, [this, reply]() {
|
QNetworkReply::connect(reply, &QNetworkReply::finished, this, [this, reply]() {
|
||||||
if (reply->error())
|
if (reply->error())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -259,6 +259,7 @@ void FileDownloader::probeUrl()
|
|||||||
|
|
||||||
QNetworkReply::connect(reply,
|
QNetworkReply::connect(reply,
|
||||||
&QNetworkReply::errorOccurred,
|
&QNetworkReply::errorOccurred,
|
||||||
|
this,
|
||||||
[this, reply](QNetworkReply::NetworkError code) {
|
[this, reply](QNetworkReply::NetworkError code) {
|
||||||
// QNetworkReply::HostNotFoundError
|
// QNetworkReply::HostNotFoundError
|
||||||
// QNetworkReply::ContentNotFoundError
|
// QNetworkReply::ContentNotFoundError
|
||||||
@@ -282,7 +283,7 @@ FileExtractor::FileExtractor(QObject *parent)
|
|||||||
m_timer.setInterval(100);
|
m_timer.setInterval(100);
|
||||||
m_timer.setSingleShot(false);
|
m_timer.setSingleShot(false);
|
||||||
|
|
||||||
QObject::connect(this, &FileExtractor::targetFolderExistsChanged, [this]() {
|
QObject::connect(this, &FileExtractor::targetFolderExistsChanged, this, [this]() {
|
||||||
if (targetFolderExists()) {
|
if (targetFolderExists()) {
|
||||||
m_birthTime = QFileInfo(m_targetPath.toString() + "/" + m_archiveName).birthTime();
|
m_birthTime = QFileInfo(m_targetPath.toString() + "/" + m_archiveName).birthTime();
|
||||||
} else
|
} else
|
||||||
@@ -389,7 +390,8 @@ void FileExtractor::extract()
|
|||||||
qint64 bytesBefore = QStorageInfo(m_targetPath.toFileInfo().dir()).bytesAvailable();
|
qint64 bytesBefore = QStorageInfo(m_targetPath.toFileInfo().dir()).bytesAvailable();
|
||||||
qint64 compressedSize = QFileInfo(m_sourceFile.toString()).size();
|
qint64 compressedSize = QFileInfo(m_sourceFile.toString()).size();
|
||||||
|
|
||||||
QTimer::connect(&m_timer, &QTimer::timeout, [this, bytesBefore, targetFolder, compressedSize]() {
|
QTimer::connect(
|
||||||
|
&m_timer, &QTimer::timeout, this, [this, bytesBefore, targetFolder, compressedSize]() {
|
||||||
static QHash<QString, int> hash;
|
static QHash<QString, int> hash;
|
||||||
QDirIterator it(targetFolder, {"*.*"}, QDir::Files, QDirIterator::Subdirectories);
|
QDirIterator it(targetFolder, {"*.*"}, QDir::Files, QDirIterator::Subdirectories);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user