crash:dont show settings dialog in early startup

--showing settings dialog too early before layout(s)
are loaded can possible create crashes. Settings dialog
is considering that everything is in place and ready
to be used.

BUG:440731
pull/23/head
Michail Vourlakos 4 years ago
parent 2f6808b626
commit f7032f7f19

@ -267,6 +267,8 @@ void Corona::load()
addOutput(screen);
}
m_inStartup = false;
connect(qGuiApp, &QGuiApplication::screenAdded, this, &Corona::addOutput, Qt::UniqueConnection);
connect(qGuiApp, &QGuiApplication::screenRemoved, this, &Corona::screenRemoved, Qt::UniqueConnection);
}
@ -1117,6 +1119,10 @@ void Corona::switchToLayout(QString layout)
void Corona::showSettingsWindow(int page)
{
if (m_inStartup) {
return;
}
Settings::Dialog::ConfigurationPage p = Settings::Dialog::LayoutPage;
if (page >= Settings::Dialog::LayoutPage && page <= Settings::Dialog::PreferencesPage) {

@ -211,6 +211,7 @@ private:
bool m_activitiesStarting{true};
bool m_defaultLayoutOnStartup{false}; //! this is used to enforce loading the default layout on startup
bool m_inStartup{true}; //! this is used in order to identify when application is still in startup phase
bool m_inQuit{false}; //! this is used in order to identify when application is in quit phase
bool m_quitTimedEnded{false}; //! this is used on destructor in order to delay it and slide-out the views

@ -300,9 +300,14 @@ CentralLayout *Synchronizer::centralLayout(QString layoutname) const
QList<CentralLayout *> Synchronizer::currentLayouts() const
{
QList<CentralLayout *> layouts;
layouts.clear();
if (m_centralLayouts.isEmpty()) {
return layouts;
}
if (m_manager->memoryUsage() == MemoryUsage::SingleLayout) {
layouts << m_centralLayouts.at(0);
layouts << m_centralLayouts[0];
} else {
for (auto layout : m_centralLayouts) {
if (layout->isOnAllActivities() || layout->appliedActivities().contains(m_manager->corona()->activitiesConsumer()->currentActivity())) {

Loading…
Cancel
Save