vcl/unx/kde5/KDE5FilePicker2.cxx | 5 +++++ 1 file changed, 5 insertions(+)
New commits: commit c7b13a768d5185ba7e57c73062d97d4bdbcaa3e5 Author: Michael Weghorn <[email protected]> AuthorDate: Thu Jan 31 09:43:56 2019 +0100 Commit: Katarina Behrens <[email protected]> CommitDate: Thu Jan 31 17:24:27 2019 +0100 tdf#123077 kde5: Set KFileWidget's custom widget only once Since the event filter is only used to set the custom widget in the KFileWidget, it can be removed again once this has been done. Previously, events could cause 'fileWidget->setCustomWidget()' to be called multiple times, which resulted in a crash. (The fact that calling 'KfileWidget::setCustomWidget()' multiple times causes a crash could also be easily be reproduced by just duplicating the call.) Basically the same will be done for the gtk3_kde5 case, but in a separate commit to simplify backporting. Change-Id: Ic463c44d8a95f44ce09924893d682f402ad7ed3d Reviewed-on: https://gerrit.libreoffice.org/67185 Tested-by: Jenkins Reviewed-by: Katarina Behrens <[email protected]> (cherry picked from commit 68b15aee96abf5cd2179009424ab6a0229b67756) Reviewed-on: https://gerrit.libreoffice.org/67205 diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index 9968d1b4316d..5d40a7de39ab 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -153,6 +153,7 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) connect(this, &KDE5FilePicker::getFilesSignal, this, &KDE5FilePicker::getFiles, Qt::BlockingQueuedConnection); + // used to set the custom controls qApp->installEventFilter(this); } @@ -854,7 +855,11 @@ bool KDE5FilePicker::eventFilter(QObject* o, QEvent* e) if (!w->parentWidget() && w->isModal()) { if (auto* fileWidget = w->findChild<KFileWidget*>({}, Qt::FindDirectChildrenOnly)) + { fileWidget->setCustomWidget(_extraControls); + // remove event filter again; the only purpose was to set the custom widget here + qApp->removeEventFilter(this); + } } } return QObject::eventFilter(o, e); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
