[libcalamaresui] Less mutex shenanigans

This commit is contained in:
Adriaan de Groot 2020-09-03 16:11:35 +02:00
parent 32649f78ea
commit d94b9caba5
2 changed files with 12 additions and 5 deletions

View File

@ -117,11 +117,8 @@ SlideshowQML::loadQmlV2Complete()
{ {
// We're alreay visible! Must have been slow QML loading, and we // We're alreay visible! Must have been slow QML loading, and we
// passed onActivate already. changeSlideShowState() locks // passed onActivate already. changeSlideShowState() locks
// the same mutex: we could set up a workaround to call // the same mutex: call changeSlideShowState() after l is dead.
// changeSlideShowState() later after destruction of l. QTimer::singleShot( 0, this, &SlideshowQML::startSlideShow );
//
l.unlock();
changeSlideShowState( Slideshow::Start );
} }
} }
} }
@ -142,6 +139,13 @@ SlideshowQML::loadQmlV2Complete()
} }
} }
void
SlideshowQML::startSlideShow()
{
changeSlideShowState( Slideshow::Start );
}
/* /*
* Applies V1 and V2 QML activation / deactivation: * Applies V1 and V2 QML activation / deactivation:
* - V1 loads the QML in @p widget on activation. Sets root object property * - V1 loads the QML in @p widget on activation. Sets root object property

View File

@ -100,6 +100,9 @@ public slots:
void loadQmlV2Complete(); void loadQmlV2Complete();
void loadQmlV2(); ///< Loads the slideshow QML (from branding) for API version 2 void loadQmlV2(); ///< Loads the slideshow QML (from branding) for API version 2
/// Implementation detail
void startSlideShow();
private: private:
QQuickWidget* m_qmlShow; QQuickWidget* m_qmlShow;
QQmlComponent* m_qmlComponent; QQmlComponent* m_qmlComponent;