[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - vcl/unx

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Jan 31 16:24:57 UTC 2019


 vcl/unx/kde5/KDE5FilePicker2.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit c7b13a768d5185ba7e57c73062d97d4bdbcaa3e5
Author:     Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Thu Jan 31 09:43:56 2019 +0100
Commit:     Katarina Behrens <Katarina.Behrens at cib.de>
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 <Katarina.Behrens at cib.de>
    (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);


More information about the Libreoffice-commits mailing list