This avoids creating a QDateTime object with all the timezone processing that comes with it since we're only interested in the
relative order, not absolute precise date time values.
CHANGELOG: Sorting files by date is significantly faster now
Differential Revision: https://phabricator.kde.org/D14394
Summary: When DolphinContextMenu::baseFileItem is called a KFileItem is allocated and stored in DolphinContextMenu::m_baseFileItem, which is of type KFileItem*, but the destructor failed to delete this.
Test Plan: This leak was found using Address Sanitizer
Reviewers: broulik, elvisangelaccio
Reviewed By: broulik, elvisangelaccio
Subscribers: ngraham, kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D14178
Instead of using KIconLoader which currently doesn't support high dpi scaling, use QIcon::fromTheme which can.
Differential Revision: https://phabricator.kde.org/D14222
Instead of using KIconLoader which currently doesn't support high dpi scaling, use QIcon::fromTheme which can.
Differential Revision: https://phabricator.kde.org/D14222
Summary: When DolphinContextMenu::baseFileItem is called a KFileItem is allocated and stored in DolphinContextMenu::m_baseFileItem, which is of type KFileItem*, but the destructor failed to delete this.
Test Plan: This leak was found using Address Sanitizer
Reviewers: broulik, elvisangelaccio
Reviewed By: broulik, elvisangelaccio
Subscribers: ngraham, kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D14178
Summary: The KItemListViewAccessible class has a list of QAccessibleInterface pointers in a member variable m_cells. The problem is that when new entries are created, the newly allocated pointer is not stored in the list, only a nullptr is store, this renders the cleanup code in the destructor useless. This patch simply stores the pointer in the list, causing the destructor to correctly free the memory.
Test Plan: I found this issue using address sanitizer. Simply building Dolphin with -fsanitize=address and opening a window caused the memory leak.
Reviewers: #dolphin, jtamate, elvisangelaccio
Reviewed By: #dolphin, jtamate, elvisangelaccio
Subscribers: elvisangelaccio, kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D14168
Summary: The InformationPanel::m_pendingPreview and ApplyViewPropsJob::m_currentItem member variables are not used and can therefore be removed.
Reviewers: broulik, elvisangelaccio
Reviewed By: broulik, elvisangelaccio
Subscribers: kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D14180
Summary:
Like D12571, but for the {nav View Properties} Window. Also did a little bit of re-organization. This allows us to use a `QFormLayout` as the top-level layout and simplify the code a lot, including no longer using the now-unnecessary paradigm of putting a layout inside a `QWidget`, and ending the use of `QGridLayout` to make a fake and more complicated form-style layout.
Depends on D13749
Test Plan:
Window still resizes properly when the Additional Information content is shown or hidden.
Global view properties, additional information hidden:
{F6035943}
Global view properties, additional information shown:
{F6035945}
Per-folder view properties, additional information hidden:
{F6035869}
Per-folder view properties, additional information shown:
{F6035870}
Reviewers: #dolphin, elvisangelaccio, broulik, #vdg
Reviewed By: #dolphin, elvisangelaccio
Subscribers: abetts, kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D13768
Summary:
Uses a reference to the collator instead of copying and reinitializing it again and again. This is the reason for the speedup.
Changing the implementation from a Functor class to a Lambda removes some boilerplate code, but is not relevant for performance.
This requires a workaround for https://bugreports.qt.io/browse/QTBUG-69361
Just a single comparison to force the clean state of QCollator.
Test Plan:
Sorting in a directory with 82874 images:
[TIME] Sorting: 19883 (before)
[TIME] Sorting: 4198 (after)
kfileitemmodelbenchmark before: .............. Passed 29.36 sec
kfileitemmodelbenchmark after: .............. Passed 20.39 sec
Reviewers: #dolphin, #frameworks, markg, elvisangelaccio, bruns
Reviewed By: #dolphin, markg, elvisangelaccio
Subscribers: elvisangelaccio, apol, bruns, markg, kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D13814
Summary:
Use a lambda function to use only one QCollator initialized only once.
This requires a workaround for https://bugreports.qt.io/browse/QTBUG-69361
Just a single comparison to force the clean state of QCollator.
Test Plan:
Sorting in a directory with 82874 images:
[TIME] Sorting: 19883 (before)
[TIME] Sorting: 4198 (after)
kfileitemmodelbenchmark before: .............. Passed 29.36 sec
kfileitemmodelbenchmark after: .............. Passed 20.39 sec
Reviewers: #dolphin, #frameworks, markg, elvisangelaccio, bruns
Reviewed By: #dolphin, markg, elvisangelaccio
Subscribers: elvisangelaccio, apol, bruns, markg, kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D13814
I prefer to wait until QQCollator is thread safe or
someone discovers why this is happening now and not before.
Summary: This reverts commit 63825de82f.
Test Plan: revert-hammer
Reviewers:
Subscribers:
Summary:
Use a lambda function instead of a class.
This way the member QCollator is not copied and initialized several times.
Test Plan:
Sorting in a directory with 82874 images:
[TIME] Sorting: 19883 (before)
[TIME] Sorting: 4198 (after)
kfileitemmodelbenchmark before: .............. Passed 29.36 sec
kfileitemmodelbenchmark after: .............. Passed 20.39 sec
Reviewers: #dolphin, #frameworks, markg, elvisangelaccio
Reviewed By: #dolphin, markg, elvisangelaccio
Subscribers: elvisangelaccio, apol, bruns, markg, kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D13814
Summary: This patch modernizes the appearance of Dolphin's configuration window by following the KDE HIG as much as possible and following design cues from Plasma and System Settings.
Test Plan:
Tested all settings to make sure they still work; they do.
Startup page, before:
{F5825313}
Startup page, after:
{F5918574}
View page (Icons), before:
{F5825319}
View page (Icons) after:
{F5918575}
View page (Compact), before:
{F5825321}
View page (Compact) after:
{F5918700}
View page (Detailed), before:
{F5825323}
View page: (Detailed), after:
{F5918701}
Navigation page: no change
Trash page, before:
{F5858748}
Trash page, after:
{F5866656}
(Provided by {D12986})
General page (behavior), before:
{F5825316}
General page (behavior) after:
{F5918572}
General page (confirmations), before:
{F5866885}
General page (confirmations), after:
{F5918702}
General page (status bar): no change
Reviewers: #dolphin, #vdg, broulik, elvisangelaccio
Reviewed By: #dolphin, elvisangelaccio
Subscribers: fabianr, cfeck, medhefgo, zzag, rkflx, kfm-devel, elvisangelaccio, abetts
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D12571
Summary: None of Dolphin's current usages of `KComboBox` use any of its additional features beyond `QComboBox`, so let's use `QComboBox` instead.
Test Plan: Tested all features that use comboboxes in Dolphin. No visual or functional changes or regressions.
Reviewers: #dolphin, elvisangelaccio, broulik
Reviewed By: #dolphin, elvisangelaccio
Subscribers: broulik, kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D13749
Summary:
A modal dialog that opens another modal dialog is bad UX and should be
avoided whenever possible. These days we have `KCollapsibleGroupBox`
that can be used to show advanced settings without cluttering the
default layout.
This change removes the `AdditionalInfoDialog` and uses a collapsible
groupbox instead. The `Apply` buttons gets enabled whenever a role gets
checked or unchecked, consistently with the existing checkboxes.
Test Plan: Change visible roles in the view properties dialog.
Reviewers: #dolphin, #vdg
Reviewed By: #vdg
Subscribers: ngraham, kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D13569
Summary: KDE apps generally (ha ha) have their {nav General} page at the top of the list, so it's the first thing the user sees when they open the {nav Settings} window, but Dolphin is an exception. It puts the {nav General} page //last!// This patch makes Dolphin consistent with other KDE apps by moving the {nav General} page up to the top.
Test Plan: {F5918590}
Reviewers: #dolphin, #kde_applications, elvisangelaccio, ltoscano
Reviewed By: elvisangelaccio, ltoscano
Subscribers: kde-doc-english, ltoscano, elvisangelaccio, kfm-devel
Tags: #dolphin, #documentation
Differential Revision: https://phabricator.kde.org/D13595
We call `markAsDirty(false)` at the end of `loadSettings()` but that's
not enough, because `m_isDirty` is initialized to false (as it should be).
This means `isDirtyChanged` is not emitted and the button is not disabled.
By disabling it explicitly, we make it consistent with the Apply button
in the settings dialog (which is also initially disabled).
Summary:
Commit 43da84eefc introduced the risk of entering an endless loop of
`FocusIn`/`FocusOut` events sent to two DolphinSearchBox instances when
opening a second tab (see D11871).
This happens because we deactivate the first tab when we open a new one, but
since the `setActive(true)` is delayed with a QTimer, both the old tab
and the new one become active and receive their own `FocusIn` event
(which starts the loop of focus in/out events).
To prevent this issue, we schedule the searchbox activation only if the
searchbox is not already active.
Test Plan:
- Search something in dolphin
- Open a new tab after the search ends
- Check that dolphin does not eat the CPU
Reviewers: #dolphin, anthonyfieroni
Subscribers: kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D13152
QVariant::toString() unwraps a QStringList with a single string to a QString, however a list with multiple entries returns a null string.
Explicitly check for KFileMetaData property type and convert accordingly.
BUG: 395033
FIXED-IN: 18.04.3
Differential Revision: https://phabricator.kde.org/D13349
Summary:
The `RenameDialog::slotResult()` slot is currently never called because
the dialog is deleted first, due to the usage of the `WA_DeleteOnClose`
attribute. This breaks the scroll-to-renamed-file feature when the
inline renaming is disabled.
Instead of deleting the dialog on close, we can use `deleteLater()` when
we are sure the dialog has actually finished its job, which is when the
KIO move job emits the `result` signal.
Test Plan:
- Disable inline renaming
- Rename a file so that it goes out of the view
- Check whether the view scrolls to the renamed file.
Reviewers: #dolphin, emateli
Subscribers: kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D13304
Connections to lambda slots without context/receiver argument can lead
to crashes, because if the receiver is deleted Qt won't delete the connection
as it normally would when the receiver is specified.
This patch moves the slot from the lambda in PlacesItem (which is not a QObject)
to PlacesItemSignalHandler. This fixes the `dolphinmainwindowtest` crash
we currently have on master, and should also fix bug #394507 which has
the very same stacktrace.
BUG: 394507
FIXED-IN: 18.04.2
Summary: This adds the 'Sort By' and 'View Mode' options into the context menu of Dolphin within the file browser. I keep looking for these option (especially sort by) in the Context Menu, and keep forgetting to go to the menu. It also makes the order of "View Mode" and "Sort By" options consistent in the control menu
Test Plan: Made sure that the options appeared when right clicking on an empty space.
Reviewers: #dolphin, ngraham, elvisangelaccio
Reviewed By: #dolphin, ngraham, elvisangelaccio
Subscribers: question, markg, elvisangelaccio, mmustac, rkflx, ngraham, kfm-devel, #dolphin
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D12911
Summary: Now that Dolphin can be run as the root user again, let's show a warning.
Test Plan:
When run with the root user account:
{F5882057}
Reviewers: #dolphin, markg, elvisangelaccio
Reviewed By: markg, elvisangelaccio
Subscribers: acooligan, anthonyfieroni, chinmoyr, kfm-devel, rikmills, emmanuelp, zzag, nicolasfella, elvisangelaccio, Fuchs, mmustac, markg
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D12732
Summary:
Prohibiting the use of Dolphin as the actual root user (not using `sudo` or `kdesu`) breaks legitimate use cases for using the root user. An example is Kali, a distro that logs in as the root user by default as a deliberate design choice.
In such an environment, there is no additional security vulnerability beyond what you're already potentially exposing yourself to. So, let's re-enable it.
BUG: 387974
FIXED-IN: 18.08.0
Test Plan:
- Log in as normal user and run `sudo dolphin`: you get an error message.
- Log in as normal user and run `kdesu dolphin`: you get an error message.
- Log in as the root user and run dolphin normally: it works.
Reviewers: markg, elvisangelaccio, #dolphin
Reviewed By: markg
Subscribers: chinmoyr, cfeck, elvisangelaccio, mmustac, Fuchs, markg, graesslin, nicolasfella, zzag, kfm-devel, emmanuelp
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D12795