Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 40afb829 authored by Elvis Angelaccio's avatar Elvis Angelaccio

Don't use exec() to open dialogs

Summary:
exec() is blocking and should not be used if possible.

Currently it makes impossible to interact with a 2nd okular window
if the first window has the Properties or Embedded Files dialog open.

It also causes a double delete crash when closing okular via dbus
while either of those dialogs is open.

We can use open() instead which does not block the event loop and fixes
both the problems.

Test Plan:
1. Open the Properties or Embedded Files dialog, then close okular via dbus.
2. Open two okular windows, then open the Properties or Embedded Files dialog in one of them and try to use the other window.

Reviewers: #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D8704
parent a2f5560c
......@@ -2663,16 +2663,16 @@ void Part::showMenu(const Okular::Page *page, const QPoint &point, const QString
void Part::slotShowProperties()
{
PropertiesDialog *d = new PropertiesDialog(widget(), m_document);
d->exec();
delete d;
connect(d, &QDialog::finished, d, &QObject::deleteLater);
d->open();
}
void Part::slotShowEmbeddedFiles()
{
EmbeddedFilesDialog *d = new EmbeddedFilesDialog(widget(), m_document);
d->exec();
delete d;
connect(d, &QDialog::finished, d, &QObject::deleteLater);
d->open();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment