mobile: don't call main loop for notifications once initialized

Calling qApp->processEvents() in QMLManager::setNotificationText()
caused crashes, because it could lead to the context-menu that
initialized the call being deleted. Something that QML apparently
doesn't like.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-04-13 11:21:25 +02:00 committed by Dirk Hohndel
parent 24eac8df87
commit 3d4412ad1a

View file

@ -1710,7 +1710,12 @@ void QMLManager::setNotificationText(QString text)
appendTextToLog(QStringLiteral("showProgress: ") + text);
m_notificationText = text;
emit notificationTextChanged();
qApp->processEvents();
// Once we're initialized, this may be called from signal context, notably when selecting an action from a context menu.
// Processing events may now cause the menu to be deleted. Deleting a QML object which sent a signal causes QML to quit the application.
// Therefore, don't process events once the application is started.
// During startup this is needed so that the notifications are shown.
if (!m_initialized)
qApp->processEvents();
}
qreal QMLManager::lastDevicePixelRatio()