mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-29 12:45:40 +08:00
Check Qpointer "myself" in loop
This commit is contained in:
@@ -84,13 +84,18 @@ namespace BlackGui
|
|||||||
const CGlobalSetup setup = sApp->getGlobalSetup();
|
const CGlobalSetup setup = sApp->getGlobalSetup();
|
||||||
if (setup.wasLoadedFromWeb())
|
if (setup.wasLoadedFromWeb())
|
||||||
{
|
{
|
||||||
|
QPointer<CSetupLoadingDialog> myself(this);
|
||||||
QTimer::singleShot(250, this, [ = ]
|
QTimer::singleShot(250, this, [ = ]
|
||||||
{
|
{
|
||||||
|
if (!myself) { return; }
|
||||||
const CUrlList bootstrapUrls = setup.getSwiftBootstrapFileUrls();
|
const CUrlList bootstrapUrls = setup.getSwiftBootstrapFileUrls();
|
||||||
for (const CUrl &url : bootstrapUrls)
|
for (const CUrl &url : bootstrapUrls)
|
||||||
{
|
{
|
||||||
const CStatusMessage msg = CNetworkUtils::canConnect(url) ?
|
const bool cc = CNetworkUtils::canConnect(url);
|
||||||
CStatusMessage(this).info(u"Can connect to '%1'") << url.getFullUrl() : CStatusMessage(this).warning(u"Cannot connect to '%1'") << url.getFullUrl();
|
if (!myself) { return; } // because of CEventLoop::processEventsUntil
|
||||||
|
const CStatusMessage msg = cc ?
|
||||||
|
CStatusMessage(this).info(u"Can connect to '%1'") << url.getFullUrl() :
|
||||||
|
CStatusMessage(this).warning(u"Cannot connect to '%1'") << url.getFullUrl();
|
||||||
ui->comp_Messages->appendStatusMessageToList(msg);
|
ui->comp_Messages->appendStatusMessageToList(msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user