[Libreoffice-commits] core.git: Changes to 'private/michaelweghorn/qt5_kde5_fpicker_deduplication'

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Feb 6 14:05:54 UTC 2019


New branch 'private/michaelweghorn/qt5_kde5_fpicker_deduplication' available with the following commits:
commit 7f3f094ea096e5802017b6faa156e9e8fff6135f
Author: Michael Weghorn <m.weghorn at posteo.de>
Date:   Wed Feb 6 14:58:32 2019 +0100

    Drop KDE5FilePicker::cancel
    
    Base class's 'Qt5FilePicker::cancel' already does nothing
    just the same way.
    
    Change-Id: Ie125d117f27849b29f082c72e320c1021e81163e

commit 6ce0b4ef01cee7255f639b9bda41d7f20f722180
Author: Michael Weghorn <m.weghorn at posteo.de>
Date:   Wed Feb 6 14:40:45 2019 +0100

    KDE5FilePicker: Reuse XFilter{,Group}Manager methods from qt5
    
    The non-native QFileDialog automatically adds the file extension
    for the selected filter in the listbox, therefore it was stripped
    from the filter title in 'Qt5FilePicker::appendFilter'.
    
    Since the native Plasma/kde5 file dialog does not add it automatically,
    introduce a new member 'm_bShowFileExtensionInFilterTitle' to specify
    whether or not to strip the extension and set it accordingly in
    KDE5FilePicker (so that it continues to show e.g.
    "ODF Text Document (.odt)" instead of just "ODF Text Document").
    
    This allows for KDE5FilePicker to reuse the base class implementation
    and thus to drop all related own members and methods.
    
    Change-Id: Icfb77d065160d3f655e3e89ad69de4195781373a

commit def75d10f04645323e9a818ddaa47f2d192000b9
Author: Michael Weghorn <m.weghorn at posteo.de>
Date:   Wed Feb 6 13:28:54 2019 +0100

    Drop KDE5FilePicker::setDescription
    
    Base class's 'Qt5FilePicker::setDescription'
    does the same, namely nothing.
    
    Change-Id: Ie89a1e1edaf20c49a1b16f43000a4a054b21f3b2

commit 1ee96b91c08cca6a375c854f572d033b90e62261
Author: Michael Weghorn <m.weghorn at posteo.de>
Date:   Wed Feb 6 12:37:39 2019 +0100

    Drop KDE5FilePicker::getDirectory
    
    Use base class's 'Qt5FilePicker::getDirectory' instead
    to reduce duplication.
    
    Strictly speaking, the 'KDE5FilePicker::implGetDirectory'
    implementation used by 'KDE5FilePicker::getDirectory'
    suggests that the display directory is returned
    rather than the selected directory, and the same
    method 'implGetDirectory()' was actually previously used
    by the 'KDE5FilePicker::getDisplayDirectory()' method
    as well (removed in a previous commit).
    
    The code worked fine inside KDE5FilePicker (where the
    native Plasma/kde5 file dialog is used) but would lead
    to incorrect results when used inside Qt5FilePicker, e.g.
    for the following scenario
    
    * open  folder picker displaying $HOME that contains
      a directory "bar"
    * do a single mouse click on the "bar" directory
    * click "OK"
    
    The call to 'toOUString(m_pFileDialog->directoryUrl().url())'
    inside 'getDirectory()' would return '$HOME/bar' for the native
    QFileDialog on KDE Plasma 5, but '$HOME' when
    used with the non-native QFileDialog
    
    Anyway, the implementation inside 'Qt5FilePicker::getDirectory'
    works fine for both cases, so just drop the KDE5FilePicker one.
    
    Change-Id: I86dcf98ed310636b899ad289d8a8a8fa263dd2e9

commit 84e54d7f89028e61d995e5528d7e4d4dcd29f0a8
Author: Michael Weghorn <m.weghorn at posteo.de>
Date:   Wed Feb 6 12:30:56 2019 +0100

    Drop KDE5Filepicker::getDisplayDirectory
    
    Base class's 'Qt5FilePicker::getDisplayDirectory'
    does the same.
    
    Change-Id: I835603848736a328d0cf63b0bdc87895761e229c

commit 262c9412d4d95e1c58a0eb0e84f24b992c4ac324
Author: Michael Weghorn <m.weghorn at posteo.de>
Date:   Wed Feb 6 09:16:53 2019 +0100

    Drop KDE5FilePicker::disposing
    
    Base class's 'Qt5FilePicker::disposing' is the same.
    
    Change-Id: I91069385541a519f006d10b0580104f14beb551e

commit 5982aa2e3b00765a8691fd458bf70d5b1c923dbc
Author: Michael Weghorn <m.weghorn at posteo.de>
Date:   Wed Feb 6 09:02:23 2019 +0100

    KDE5FilePicker: Drop (now) unused member '_helperMutex'
    
    Change-Id: I4680cc4a8507d0d2409301b62ab81165fcfcdba1

commit d7ca429a34bf9f6d39eef2d870c392bf0ada26f5
Author: Michael Weghorn <m.weghorn at posteo.de>
Date:   Wed Feb 6 08:55:59 2019 +0100

    kde5 fpicker: Drop 'getFiles' and 'getSelectedFiles'
    
    ... and related signals/slots.
    
    Those from the Qt5FilePicker base class do the same thing,
    except for one 'SolarMutexReleaser' that was commented out
    in 'KDE5FilePicker::getFiles' for no apparent reason since
    that line was added in commit 8fb0881a3e5b2.
    
    Take over the slightly nicer syntax for the range-based for loop
    from 'KDE5FilePicker::getSelectedFiles' to
    'Qt5FilePicker::getSelectedFiles'.
    
    Change-Id: I419f933d256f3b85eccaea85803b4890770efa24

commit 3cf16296814020f8a7a91b54ee9e137783a09e1b
Author: Michael Weghorn <m.weghorn at posteo.de>
Date:   Tue Feb 5 15:34:31 2019 +0100

    kde5 fpicker: Drop 'setDefaultName' and 'setDisplayDirectory'
    
    ... and related signals/slots.
    They are the same as in the Qt5FilePicker base class.
    
    Change-Id: I115d0daa6beace44b9c791fc892d7cf553c562bb

commit 0978e1fb35cef94de41d35f788ab8508c15218a2
Author: Michael Weghorn <m.weghorn at posteo.de>
Date:   Tue Feb 5 15:22:10 2019 +0100

    Drop KDE5FilePicker::setTitle and related signals/slots
    
    Base class's 'Qt5FilePicker::setTitle' is the same.
    
    Change-Id: I071bf5f962c2d8b0821d78e97793c8637f5c0a1b

commit 40c8ff518297fb059efd0a21adc25b9dfbd1f747
Author: Michael Weghorn <m.weghorn at posteo.de>
Date:   Tue Feb 5 15:09:44 2019 +0100

    KDE5FilePicker: Drop 'm_xListener' and related methods
    
    Drop the 'm_xListener' member and methods using it.
    The inherited Qt5FilePicker methods do the same thing.
    
    This also avoids that two methods are called when
    a file or filter is selected, since the
    'QFileDialog::filterSelected' and 'QFileDialog::fileSelected'
    signals had been connected to slots in both, the
    qt5 and kde5 fpicker constructors.
    
    Change-Id: I60e3eda29e6497f51165e87d0c4ab2e17f209a1c

commit 63267bd821e4ebe3f83a39c300cd4e89c21ace5e
Author: Michael Weghorn <m.weghorn at posteo.de>
Date:   Tue Feb 5 13:43:20 2019 +0100

    qt5/kde5: Reuse QFileDialog from Qt5Filepicker in kde5
    
    Drop the '_dialog' member from KDE5FileDialog and use
    the one from Qt5FileDialog instead.
    Move up 'm_bIsFolderPicker' to Qt5FilePicker.
    
    Also, move some of the related functionality from
    the kde5 file picker to the qt5 one, in particular
    take over missing parts from 'KDE5FilePicker::setMultiSelectionMode'
    to 'Qt5FilePicker::setMultiSelectionMode' and drop the
    former (now inherited from the base class).
    
    This e.g. also makes sure that only folders are available
    for selection when using a FolderPicker in qt5
    (e.g. in the dialog to add a JRE in "Tools" -> "Options"
     -> "Advanced"). The functionality had only been implemented
    for kde5 beforehand.
    
    Since the QFileDialog is set to non-native mode in
    Qt5FilePicker constructor, native mode needs to be
    excplicitly enabled again for kde5.
    
    Since Qt's signal/slot mechanism is used to connect
    signals on the object in both constructors
    (Qt5FilePicker/KDE5FilePicker), some events will
    trigger multiple actions. This will be taken care
    of in subsequent commits, along with further
    refactoring.
    
    Change-Id: I245d46c12945acb91c9b52dcff5c83248ac087dd

commit 11ba877a7f486a8ddf7159d3c293fd9631606b90
Author: Michael Weghorn <m.weghorn at posteo.de>
Date:   Tue Feb 5 12:38:18 2019 +0100

    Make KDE5FilePicker a subclass of Qt5FilePicker
    
    While this does not make much sense by itself as of now,
    it will allow to reduce code duplication in follow-up commits.
    
    Change-Id: Ie1a9bf3e516044ad5e56c526d1cf49cf1cb76f8a



More information about the Libreoffice-commits mailing list