vcl/unx/kde5/KDE5FilePicker.hxx  |    4 ----
 vcl/unx/kde5/KDE5FilePicker2.cxx |   11 ++++-------
 2 files changed, 4 insertions(+), 11 deletions(-)

New commits:
commit 5fe230552f276b429178f1d183abc134452b0150
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Feb 6 17:12:32 2019 +0100
Commit:     Katarina Behrens <katarina.behr...@cib.de>
CommitDate: Tue May 21 21:42:53 2019 +0200

    kde5 fpicker: Reuse parent class member to store custom widgets
    
    Directly access member 'm_pExtraControls' from parent class
    Qt5FilePicker for managing custom widgets, rather than maintaining
    an own one.
    
    This is meant as an intermediate step, further refactoring will
    follow.
    
    Change-Id: I0568d3db68dc24042e198d36f4b5e49608f93a0e
    Reviewed-on: https://gerrit.libreoffice.org/68055
    Tested-by: Jenkins
    Reviewed-by: Katarina Behrens <katarina.behr...@cib.de>
    (cherry picked from commit 2bd0400a49ad2dfeb1c3848a84f8e512433b5411)
    Reviewed-on: https://gerrit.libreoffice.org/72652

diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx
index 3d3a428cd5a0..044a921eeb72 100644
--- a/vcl/unx/kde5/KDE5FilePicker.hxx
+++ b/vcl/unx/kde5/KDE5FilePicker.hxx
@@ -54,9 +54,6 @@ protected:
     QHash<sal_Int16, QWidget*> _customWidgets;
     QHash<sal_Int16, QWidget*> _customListboxes;
 
-    //widget to contain extra custom controls
-    QWidget* _extraControls;
-
     //layout for extra custom controls
     QGridLayout* _layout;
 
@@ -64,7 +61,6 @@ protected:
 
 public:
     explicit KDE5FilePicker(QFileDialog::FileMode);
-    virtual ~KDE5FilePicker() override;
 
     // XExecutableDialog functions
     virtual sal_Int16 SAL_CALL execute() override;
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index 7e683a59884f..aabd344b1547 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -82,8 +82,7 @@ uno::Sequence<OUString> FilePicker_getSupportedServiceNames()
 KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode)
     // Native kde5 filepicker does not add file extension automatically
     : Qt5FilePicker(eMode, true)
-    , _extraControls(new QWidget)
-    , _layout(new QGridLayout(_extraControls))
+    , _layout(new QGridLayout(m_pExtraControls))
     , allowRemoteUrls(false)
 {
     // use native dialog
@@ -118,8 +117,6 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode)
     qApp->installEventFilter(this);
 }
 
-KDE5FilePicker::~KDE5FilePicker() { delete _extraControls; }
-
 sal_Int16 SAL_CALL KDE5FilePicker::execute()
 {
     if (qApp->thread() != QThread::currentThread())
@@ -326,7 +323,7 @@ void KDE5FilePicker::addCustomControl(sal_Int16 controlId)
             // code, but the checkbox is hidden and ignored
             bool hidden = controlId == CHECKBOX_AUTOEXTENSION;
 
-            auto widget = new QCheckBox(resString, _extraControls);
+            auto widget = new QCheckBox(resString, m_pExtraControls);
             widget->setHidden(hidden);
             if (!hidden)
             {
@@ -349,7 +346,7 @@ void KDE5FilePicker::addCustomControl(sal_Int16 controlId)
         case LISTBOX_TEMPLATE:
         case LISTBOX_VERSION:
         {
-            auto widget = new QComboBox(_extraControls);
+            auto widget = new QComboBox(m_pExtraControls);
             QLabel* label = new QLabel(resString);
             label->setBuddy(widget);
 
@@ -508,7 +505,7 @@ bool KDE5FilePicker::eventFilter(QObject* o, QEvent* e)
         {
             if (auto* fileWidget = w->findChild<KFileWidget*>({}, 
Qt::FindDirectChildrenOnly))
             {
-                fileWidget->setCustomWidget(_extraControls);
+                fileWidget->setCustomWidget(m_pExtraControls);
                 // remove event filter again; the only purpose was to set the 
custom widget here
                 qApp->removeEventFilter(this);
             }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to