mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-03 16:25:54 +08:00
Tidying up around QPointer guards.
This commit is contained in:
committed by
Klaus Basan
parent
3d935485dd
commit
61d933be12
@@ -475,7 +475,7 @@ namespace BlackCore
|
|||||||
if (ms > 10)
|
if (ms > 10)
|
||||||
{
|
{
|
||||||
// As of https://dev.swift-project.org/T558 play additional notification
|
// As of https://dev.swift-project.org/T558 play additional notification
|
||||||
const QPointer<CContextAudio> myself(const_cast<CContextAudio *>(this)); //! \fixme KB 2019-03 add bit hacky as I need non-const and do not want to change all signatures
|
const QPointer<const CContextAudio> myself(this);
|
||||||
QTimer::singleShot(ms, this, [ = ]
|
QTimer::singleShot(ms, this, [ = ]
|
||||||
{
|
{
|
||||||
if (!sApp || sApp->isShuttingDown() || !myself) { return; }
|
if (!sApp || sApp->isShuttingDown() || !myself) { return; }
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ 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, [ = ]
|
||||||
{
|
{
|
||||||
const CUrlList bootstrapUrls = setup.getSwiftBootstrapFileUrls();
|
const CUrlList bootstrapUrls = setup.getSwiftBootstrapFileUrls();
|
||||||
|
|||||||
@@ -200,16 +200,12 @@ namespace BlackMisc
|
|||||||
if (!CThreadUtils::isCurrentThreadObjectThread(this))
|
if (!CThreadUtils::isCurrentThreadObjectThread(this))
|
||||||
{
|
{
|
||||||
// shift in correct thread
|
// shift in correct thread
|
||||||
if (!this->isFinished())
|
QPointer<CContinuousWorker> myself(this);
|
||||||
|
QTimer::singleShot(0, this, [ = ]
|
||||||
{
|
{
|
||||||
QPointer<CContinuousWorker> myself(this);
|
if (!myself) { return; }
|
||||||
QTimer::singleShot(0, this, [ = ]
|
this->doIfNotFinished([ = ] { startUpdating(updateTimeSecs); });
|
||||||
{
|
});
|
||||||
if (!myself) { return; }
|
|
||||||
if (this->isFinished()) { return; }
|
|
||||||
this->startUpdating(updateTimeSecs);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user