mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
24eac8df87
commit
3d4412ad1a
1 changed files with 6 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue