By default, the search filters widget calculates its
`minimumSizeHint` as the sum of its components' minimum widths.
This minimum width hint will scale up the widgets hierarchy,
finally imposing a minimum width to the contents view, which
in certain conditions can take the space from the side panels.
Let's set a minimum width hint of 0, so it is the filters widget
which always adapts to the available view size instead.
BUG: 466796
FIXED-IN: 23.04
We only load them in Konqueror, there are only the name, icon and doc path used.
The ServiceTypes are only a leftover from before the json conversion
Task: https://phabricator.kde.org/T14730
Do not read m_hoveredColumnHearderRoleIndex before it has been
initialised.
.6 0x00007fe00632182c in QList<KFileItemModel::RoleInfo>::Node::t
(this=<optimized out>, this=<optimized out>) at
/usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h:153
.7 QList<KFileItemModel::RoleInfo>::at (i=3080252, this=0x7ffdf2e9bba8)
at /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h:572
.8 DolphinView::eventFilter (this=0x5584bef25160,
watched=0x5584bef8a300, event=0x7ffdf2e9bd30) at
./src/views/dolphinview.cpp:978
.9 0x00007fe003ebbdda in
QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*,
QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
.10 0x00007fe004b6c782 in QApplicationPrivate::notify_helper(QObject*,
QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
.11 0x00007fe004b75411 in QApplication::notify(QObject*, QEvent*) ()
from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
.12 0x00007fe003ebc07a in QCoreApplication::notifyInternal2(QObject*,
QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
.13 0x00007fe004b72269 in QApplication::event(QEvent*) () from
/lib/x86_64-linux-gnu/libQt5Widgets.so.5
.14 0x00007fe004b6c793 in QApplicationPrivate::notify_helper(QObject*,
QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
.15 0x00007fe003ebc07a in QCoreApplication::notifyInternal2(QObject*,
QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
.16 0x00007fe003f14e0b in QTimerInfoList::activateTimers() () from
/lib/x86_64-linux-gnu/libQt5Core.so.5
.17 0x00007fe003f15754 in ?? () from
/lib/x86_64-linux-gnu/libQt5Core.so.5
.18 0x00007fe001d20d3b in g_main_context_dispatch () from
/lib/x86_64-linux-gnu/libglib-2.0.so.0
.19 0x00007fe001d756c8 in ?? () from
/lib/x86_64-linux-gnu/libglib-2.0.so.0
.20 0x00007fe001d1e3e3 in g_main_context_iteration () from
/lib/x86_64-linux-gnu/libglib-2.0.so.0
.21 0x00007fe003f15ad8 in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
() from /lib/x86_64-linux-gnu/libQt5Core.so.5
.22 0x00007fe003eba99b in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from
/lib/x86_64-linux-gnu/libQt5Core.so.5
.23 0x00007fe003ec2f34 in QCoreApplication::exec() () from
/lib/x86_64-linux-gnu/libQt5Core.so.5
.24 0x00005584bd2a9aad in main (argc=<optimized out>, argv=<optimized
out>) at ./src/main.cpp:249
BUG: 466110
We do not read the metadata anywhere, consequently we can allow empty metadata.
Consumers now don't have to provide a file and we do no spend time parsing the JSON.
Task: https://phabricator.kde.org/T14538
Ability to configure column for the file/dir permissions in
Numeric(Octal)/Textual/Combined style and update field display style to be right-alighed.
Add toolips to column menu items
BUG: 227745
Links are not always local files, e.g. 'remote:/zeroconf' links to 'zeroconf:/'
The current code fails there
Instead of using QFile API that does not work on non-local URLs use QUrl::resolved to resolve relative links
Furthermore, QFile::exists doesn't work for non-local URLs. Instead do a KIO stat to check whether the target exists
Since the Back action already has two standard shortcuts, a third one appended
to the list will be invisible in the UI, which shows only the first two. This
leaves users unable to reassign it.
We therefore make it the first shortcut in the list, so that the hidden third
entry will be the dedicated Back button, which users are far less likely to
want reassigned.
BUG: 371130
This makes the behavior of kernel cifs/nfs mounts the same as with kio's
smb://. It also helps reduce the chance of the UI hanging due to
opendir/readdir slowing down stat calls on the UI thread.
Signed-off-by: Andrew Gunnerson <accounts+kde@chiller3.com>
* This commit fixes the right click context menu not being shown
whenever the click is made right on the placeholderLabel text
Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
The old expected behaviour was that pressing Space would select
the current item. We now trigger selection mode instead and don't
select. At some point in the future we might want to instead have
Space trigger a "QuickLook" feature for quick viewing of full
files. In any case, the old behaviour of having Space select is
no longer expected, but Ctrl+Space can still be used for this.
It might also make sense to have Space trigger the old selection
behaviour if both selection mode and "QuickLook" are disabled, but
that is very low priority and will cause more code complexity than
the non-default benefits are worth.
Before this commit, the "Space" keyboard shortcut was bound to
triggering selection mode by default. After this commit, pressing
"Space" will only trigger selection mode when the file view area
has keyboard focus.
Pros:
+ Other buttons in the UI can be triggered with Space once again
just like it is expected from an accessibility point of view.
+ "Type-ahead" searching works once more when typing the space
char for file names containing such a space char.
Cons:
- "Space" can no longer be used to add the currently underlined
item to the selection. Instead "Ctrl+Space" needs to be used.
(However, this is the current status anyway unless a user has
manually unbound "Space" as a shortcut from Selection Mode.)
- The Selection Mode action will no longer show "Space" as its
shortcut in menus.
Overall, I see solutions to all of these problems, but they seem
over-engineered for the issues they are trying to solve, so I
believe this somewhat small commit is the best solution for now.
BUG: 458282
BUG: 458281
CCBUG: 463048
FIXED-IN: 23.04
Symlink contents should not be visited for the purpose of displaying sizes.
Not only is potentially misleading because the storage is actually used
elsewhere (the target location), it can be completely wrong as contents can
be visited multiple times, even recursively.
BUG: 434125
(cherry picked from commit 491068a440)
The `break` that is replaced by a `return` here would only break
out of the innermost while loop so the std::vector::end could still
become accessed after that. By returning here we completely exit
out of both nested loops and therefore don't access the
std::vector::end.
When one instance of Dolphin activates another it passes a startupId (X11) / activation token (wayland) along.
On X11 this is passed using the DESKTOP_STARTUP_ID environment variable. The code tries to read that through KStartupInfo::startupId().
That doesn't work though, since Qt at startup reads the environment variable afterwards. However, it is nice enough to allow us to access
it through QX11Info::nextStartupId(). Use that to read the token in the first instance and pass it to the second instance like we do on Wayland
The user-facing impact of this is minimal since KStartupInfo::setNewStartupId internally falls back to KWindowSystem::forceActiveWindow when no
startupId is passed.
While building dolphin, a warning comes up about KStandardGuiItem::yes()
being deprecated, and that another action verb should be using instead.
This commit fixes the warning by replacing KStandardGuiItem::yes() with
a KGuiItem constructor in the file src/views/dolphinview.cpp.
The icon for the "Rename and Hide" button has also been changed from a
check mark (dialog-ok) to an eye with a cross (view-hidden) to make the
button look more unique and grab the attention of the user.
When the current view mode is different from the view mode for
which settings were changed in Dolphin's settings dialog, those
changes were sometimes not present when then changing the view
mode of a view to the view mode for which settings were changed.
This commit fixes this by always loading the settings for all view
modes in the DolphinItemListView even if the view is currently
using only one of those view modes.
This commit changes how the setting to switch between full row
highlight and the old way of only having the icons and names be
activatable in details mode is presented on the settings page.
Before this commit a singular checkbox is used that talks about
the highlight effect.
But the highlight effect isn't actually what users should be
interested in. They mostly care how much of the area can be used to
activate an item. To make this clear this commit uses radio buttons
instead that give a distinctive choice between activation areas.
When not using the full row highlight, the text of non-name columns
in details view mode was wrongly colored in a way that pretended
that the full row selection highlight was active.
When it isn't active we use the normal color that we generally use
when the additional information is not within the selection
highlight.
In d383961719 the details view mode
was changed in a way that made the full row of an item the click
target instead of only having the item's icon and text be the
representative clickable area of an item.
This commit makes this new behaviour optional through a setting
which can be changed in Dolphin's settings dialog.
The explanation for introducing yet another setting in this case is
as follows:
While the introduced change is an improvement for many typical
workflows, there are some workflows for which this new behaviour
is problematic. Quite prominently a usage of Dolphin that tries
to maximise information density is made worse by the change because
now side padding is necessary to click the view's background. While
the side padding is and was optional, disabling it made switching
the active view in split view mode more difficult among other
things. For a more complete discussion about the issues, please
check out the bug report(s) and the discussion in Dolphin's gitlab
issue with number 34.
Co-authored-by: Ivan Čukić <ivan.cukic@kde.org>
BUG: 453700
FIXED-IN: 22.12
This one liner changes the signal that is emitted when the
"Dismiss" button is pressed on the Paste bottom bar in selection
mode. Before this commit, the `leaveSelectionModeRequested()`
signal was used but it had no effect because technically the
selection mode isn't active anymore when the paste bar is shown.
Everything works as expected if instead
`barVisibilityChangeRequested()` is emitted.
The application launching Dolphin passes a token via the XDG_ACTIVATION_TOKEN environment variable
We need to pass that to the running instance so that it can use it to raise itself
This commit introduces the private getter
DolphinTabWidget::viewContainerAt(ViewIndex)
and another private method
DolphinTabWidget::activateViewContainerAt(ViewIndex).
Both methods return nullptr if there is no valid
DolphinViewContainer at the specified ViewIndex.
Before this commit, even items that are distant children of
currently open views were considered selectable. This lead to the
bug that items meant to be highlighted through DBus would not be
highlighted if any ancestor of the item was open in any view.
This was fixed by only considering items in view if they can be
seen by scrolling. Main difficulty here was to make this also work
for the details view mode which allows expanding.
To implement this cleanly, some refactoring seemed necessary
because the logic to determine if an item is already in view
was previously intertwined with the logic to identify already open
directories.
This commit also contains the following refactorings aiming to
make the code more readable:
- A magic value (-1) is replaced using std::optional.
- A boolean trap is removed.
- A QPair is replaced by a struct with named variables.
- More and improved documentation
on long touch (and not on mouse press) don't pop up the context menu
anymore but enter selection mode, similar behavior to mobile applications.
the full context menu is still available from the actions toolbar
appearing in selection mode
Sending SIGINT can be destructive, for example if we interrupt the
loading of the shell init files (e.g. .bashrc) and clobber history
preservation settings. Follow the example of Kate and send a Ctrl-E
Ctrl-U to clear the prompt instead.
BUG: 279614
Signed-off-by: John Brooks <john@fastquake.com>
Improve the test by also testing the various selection mode bars.
No combination of bars should lead to a resize of the paces panel.
This commit also helps with increasing code coverage by making all
possible selection mode bars appear.
@broulik noticed an issue in the code. This commit fixes it.
-------------------
Before this commit there was a `QObject::disconnect` call that did
nothing (because it had `nullptr` as the first parameter) and there was a `QObject::connect` call that created
the same connections multiple times because of this.
This had no effect on end users. However such code can lead to
issues in the future e.g. if we ever had a situation in which the selection mode could be toggled for an inactive view container.
This commit solves this by replacing the `QObject::disconnect` call
with one that works. The `QObject::connect` call is moved so
there won't be multiple connections of the same type.
Deleting DolphinView deletes KItemListContainer, which deletes
KItemListController, which emits modelChanged, which causes a
signal delivery to the already destroyed DolphinView
This is never good, and in Qt6 causes an assert
(https://codereview.qt-project.org/c/qt/qtbase/+/381860).
Co-authored-by: Nicolas Fella <nicolas.fella@gmx.de>
click-and-holding with a pointing device like a mouse.
This functionality was originally implemented because it seemed
useful to save users the effort of entering selection mode
explicitly by using its corresponding action.
However, click-and-holding to trigger anything is not really an
expected behaviour. (This contrasts with touch devices where
press-and-holding is common to trigger something.)
Aside from the above reasoning, the click-and-hold behaviour was
also buggy so that selection mode was entered in a couple of
situations that weren't strictly about click-and-holding.
So this commit removes the functionality and the bugs.
BUG: 457973
BUG: 458129
CCBUG: 457975
There were two changes in framework that triggered this commit:
KHamburgerMenu and KToolTipHelper.
When the Dolphin-specific hamburger menu was replaced by
KHamburgerMenu, I didn't clean everything up correctly. Not
anymore!
Help texts also weren't updated accordingly. This commit replaces
any mention of the old hamburger menu which was called "Control"
with text that reflects the current application state.
The other framework change "KToolTipHelper" takes responsibility
for opening links in help texts. So we won't need code to do this
in Dolphin anymore. This means we can also get rid of some
duplicate help texts which only existed because links didn't work
correctly in some places.
If this role isn't in the model yet, it would be `QVariant::Invalid`
which is obviously a distinct type from an empty string list.
This means `KFileItemModel::setData` treats them non-equal and
potentially does expensive operations on the model, which is
called every time a role is resolved in `KFileItemModelRolesUpdater`.
With this change, the number of pointless layout calculations is
significantly reduced.
In selection mode, a bottom bar with contextual actions appears
when at least one item is selected. This commit makes it so this
bottom bar also contains the "Invert Selection" and "Select All"
actions so users have more complete control over changing what is
and isn't selected while in selection mode.
- Make Esc leave selection mode and have it only clear selection
when already outside selection mode.
- Let translators know that the "More" overflow button should only
have a short text on it.
- Fix a crash that happened when any code tried to exit selection
mode even though selection mode had never been enabled to begin
with.
- Various code improvements
- Smoother animations
- The bottom bar in General Mode only becomes visible if items are
currently selected
- Removed the selection mode action from the default toolbar since
it can already be toggled in various ways
- More documentation
- Some cleaning
The selection mode action is a checkable toggle action named
"Select Files and Folders" which has "Space" as the default
shortcut.
In selection mode a bottom bar with contextual actions is shown.
These should mostly mirror the actions which are available through
the right-click context menu aka DolphinContextMenu.
Resizing of the window might make a overflow button appear in the
bottom selection mode bar.
This commit makes press and hold in the view activate selection
mode. This behaviour is not triggered if the press and hold is
used to either start a rubberband selection or a drag operation
within a short time. The length of the short timeframe is defined
by a QStyleHint. This is currently not implemented in touch
because I can't test it.
Mix the selection mode bars' background colors using a nice
combination of colors from the current color scheme
BUG: 427202