Since d383961719 dragging the
highlighted row of already selected items in the details view mode
will begin a drag operation of all selected items.
As a unintended side-effect of this change, dragging the row of a
previously unselected item while holding the control key would also
begin a drag operation.
After this commit, dragging the row of a previously unselected item
while holding the control key in details view mode will instead
create a rubberband. Ctrl-dragging the item's icon or text directly will drag the item as expected.
With this change, using multiple rubberbands to select scattered
items among a list of items should be as convenient as it was
previously.
BUG: 452181
This reverts commit 3ce9d1d19e.
This reverts commit ddba4f5fd8.
Aside from the two bugs mentioned below, this also fixes another
regression: The spacing on the left of the view does now once again
follow the size of its column header.
BUG: 451704
BUG: 451341
This mostly red MR should have no visible effect. It is part of my work towards !273.
There are two calls necessary to open the DolphinContextMenu:
One to construct it and one to execute/show it.
Before this commit, the actual populating of the ContextMenu was
done on execute. This meant that the actions of the ContextMenu
couldn't be looked at or changed without first showing the Menu
to the user. It also meant that the construction itself didn't
actually do much constructing/populating at all which might seem
a bit unintuitive.
This commit changes this behaviour so the DolphinContextMenu is
actually populated fully on construction. The executing/showing of
the ContextMenu now does just that and nothing more.
Previously, some actions in the context menu were actually not
wired up to anything and instead the DolphinContextMenu or the
DolphinMainWindow executed some code after the user had clicked
such a dummy action from the ContextMenu. Now all the actions are
properly constructed beforehand and no special handling is
necessary when the ContextMenu hides itself.
This commit removes the pos parameter from the DolphinContextMenu
constructor. This parameter contained the position where the Menu
would be shown later. This information isn't necessary to have on
construction and was already part of the exec(pos) call in the
first place. The variable m_pos that stored the value is removed.
This commit also removes a "customActions" functionality that can
supposedly be used to add further custom actions to the
DolphinContextMenu but this functionality isn't ever used
anywhere so its usefulness is questionable. It also wouldn't be
difficult to re-add this functionality if it was ever required for
something.
This commit also addresses an old TODO in dolphinpart.cpp that
asked for the calls for opening the DolphinContextMenu to actually
contain the information for which items the DolphinContextMenu is
supposed to be constructed. Before this, only the item that was
directly clicked was transmitted and then DolphinContextMenu
retrieved the currently selected set of items by itself.
It makes more sense that DolphinContextMenu would be informed on
construction which items it is supposed to show context actions
for.
Most of this is necessary so we are able to show the contextual
actions anywhere else than in the ContextMenu in the future.
I am targeting 22.08 with this MR because it makes no sense to merge a refactor for the upcoming release already.
Since KIO 5.85, this new file location is preferred over the
KServiceTypeTrader results.
With this change, single desktop files from the KDE store are installed
in the correct location. If however a custom install script is used,
developers need to adjust their scripts.
Because the "kio/servicemenus" locations is different than the one
KAuthorized allows by default, we have to mark the file as executable.
Task: https://phabricator.kde.org/T14543
This reverts b7fbd19a76 but creates the
widget only once and then reuses it.
However, ownership of a parent-less widget is transferred to the
`KToolTipWidget` but since we first request metadata, then show the
tooltip (or won't if the mouse moved on since), we cannot rely on
the `KToolTipWidget` exclusively.
Instead, when we still delete the widget ourself until we have
shown the `KToolTipWidget` once at which point it will handle the
life time for us.
This fixes parenting the widget to `DolphinView` which would make
it appear as a broken line in the top left of the window.
This adds the following additional special view modes (some of them were
already there but broken because they weren't applied, or were
changed to have better defaults now that they are actually used):
* Recent Files and Recent Documents, timeline:
Details view with grouped sorting enabled and Name, Path, Modified
* Search For Images:
Icon view with Name, Dimensions, Date Time of the Picture
* Search For Audio:
Details view with Name, Artist, Album, Duration
* Search For Videos:
Icon view with just Name
* Search For everything else, including Documents:
Details view with Name, Path, Modified
* Trash:
Details view with Name, (Original) Path, Deletion Time
BUG: 400969
BUG: 340393
BUG: 186376
FIXED-IN: 22.04.0
Currently any time we hover the mouse over a file we create a new DolphinFileMetaDataWidget (even when we don't actually show a tooltip).
That is quite wasteful
Instead we can reuse the existing instance and only change the URL
This commit allows us to very explicitly refer to any set of items
in text. This way buttons don't need to be labeled generically
like "Permanently Delete" but can be enriched to be labeled
"Permanently Delete "FileName"" or "Copy 7 Selected Folders" or
"Copy 6 Files" or "Rename "file1", "file2", "file3", "file4" and
"folder5"".
This commit tries to save translators a lot of work by using a
translation puzzle. This might be problematic for some languages.
The alternative on the other hand would mean that any label which
wants to be explicit would need to have over 10 translations just
for one label which seems quite bad as well.
A fallback is to be implemented for languages that can't really
accommodate for any specific word puzzle. This is explained in the
documentation.
Adds a compact label based on the closes place similar to the
address bar (e.g. instead of /home/user/Pictures/Holidays it will
show Pictures/Holidays), unless "show full path in address bar"
is enabled.
Also, add the folder icon
Indicate that you cannot drop here.
Avoids a "Cannot drop file" or "not supported" error when
dropping files ontop of a search or timeline URL.
It is done in Dolphin rather than the library as there we cannot
assume what a consumer might be doing with the drop.
If we have directory "a" and "a/b" and expand both, then collapse "a" we
tell KDirWatcher to stop watching both these directories.
However, KDirWatcher keeps them in the listersCurrentlyHolding list as
well as the listersCurrentlyListing list and will still notify of
changes. If a new file appears in "a/b/" we will still get change
notifications.
When dolphin processes these changes we cannot find the relevant parent
node. It then gets confused and inserts the item into the root directory
from the POV of the model notifications. When we then open the relevant
folder the model knows a node with that URL exists and fails to add it
correctly.
This can also be reproduced by continually downloading files into a
subdirectory tree and rapidly expanding and collapsing folders a few
levels deep.
There is an unintended side-effect in
d383961719 which this MR fixes.
Normally in Dolphin, when clicking on an item to open/activate it,
it is both selected by the click and opened/activated.
Prior to this MR, the item wasn't selected when all of these
conditions were met:
- Use ActivateItemOnSingleClick also knwon as single-click mode
- Have more than one item selected already
- Click on an item that was previously not selected
Prior to this MR, the click would deselect all items and
activate the clicked item but not select it.
With this MR, the click will deselect all items, activate
the clicked item and also select it and move the anchor there.
When testing this with folders, make sure to navigate back after activating the folder. The folder should then still be selected.
This is then consistent with the behaviour when the specific
conditions mentioned above are not met.
When displaying the KCMs in another application's configuration dialog
(for example, in Konqueror), the Apply, Ok and Reset buttons aren't
shown. This issue is caused by a missing Apply flag in the call to
setButtons in the KCModule constructor.
the fact that in the call to setButtons
from the KCModule constructor, the Apply flag is missing.
BUG: 448352
Avoids a text rect taller than the area that actually contains text,
as can be seen by hovering files in a folder with "additional roles"
that a given file does not contain.
Current implementation of the zooming animation is a bit buggy.
This MR fixes the following issues:
* in the Icon view mode, the icons sometimes "jump"
* in the Compact view mode, the labels sometimes are cut off
BUG: 449179
When passing an URL like ftp://foo/bar.txt OpenUrlJob opens it in the default handler for ftp urls, not the one for txt files, which would be more appropriate here
By passing along the mimetype we can change that behavior to what we want
BUG: 443253
When opening tags:/ we show 'No tags' when there are no tags found.
When opening a tag that exists but doesn't have any files associated we show the same message, which isnt't appropriate.
Instead show "No files tagged with 'foo'", which makes more sense
This reverts commit 7908aff3b5.
Reverting this commit will fix the issue of not being able to rename
the last file in Details View and will also make the items in Details
View and Compact View have the same height.
BUG: 447215
FIXED-IN: 21.12.2
This commit implements full-row selection and hover highlights for the
details view mode.
This commit also contains fixes for 444680, 444753, both uncovered
during this change.
BUG: 181438
BUG: 444680
BUG: 444753
FIXED-IN: 22.04
This is a replacement for the KServiceTypeTrader loading.
Because third parties still use the KServiceTypeTrader file location, we need to
support both for the time being.
Now that you can get elevated privileges while using the app, we can
display a more useful and descriptive error message when people try to
run Dolphin using `sudo` or `kdesu`.
Also bump the frameworks dependency to 5.90 since that's the KIO
version that includes this change, so we can be sure that the message is
always accurate.
The previous default of allowing an unlimited number of text lines to be
displayed in icon view can lead to very large, inconsistent, and
unattractive gaps between rows. Capping this by default makes things
look much neater.
By defining the KF_DISABLE_DEPRECATED_BEFORE_AND_AT and QT_DISABLE_DEPRECATED_BEFOREvalues,
the deprecated overloads are hidden. This way we only have the un-deprecated one visible.
As the method impl suggests, the left value is preferred if all the values are the same.
This is the case for the given layout.
```cpp
int QLayout::margin() const
{
int left, top, right, bottom;
getContentsMargins(&left, &top, &right, &bottom);
if (left == top && top == right && right == bottom) {
return left;
} else {
return -1;
}
}
```
This is safe to change without a fallback icon explicitly specified
because if it doesn't exist in the active icon theme, it will fall back
to edit-copy which is a standard FreeDesktop icon name present in
every icon theme ever.
CCBUG: 423937
"Extensions" is additions to the status bar like free space bar
and zoom slider which should hide while loading.
The status bar itself should only show/hide based on the global setting.
BUG: 443132
The methods slotRefreshItems(), slotItemsAdded() and slotItemsDeleted()
are adapted so they are now compatible with the new behavior of
filtering expanded folders achieved in
ed83f37f06. The new behavior is that
expanded folders are hidden from view if neither the folder itself
nor any of its contents passes the filter. Previously expanded folders
would always stay visible no matter the filter.
A bug where the parent expanded folder would disappear after adding
or refreshing an item while filtering is also fixed.
Tests are added to make sure these behavior changes won't regress.
BUG: 442275
FIXED-IN: 22.04
Folder thumbnails are not cached as we cannot know whether something
inside a folder changed. Moreover, they are also a collage of several
files and might even traverse into subdirectories. This takes time.
This MR fixes an issue where the window and tab titles don't properly handle creating/deleting/renaming items in the places bar, as well as switching to the Search mode.
Macros should be avoided if possible. Instead this commit replaces
the usage of macros with an std::variant of the ViewModeSettings.
As part of this cleanup, code that belongs to the VideModeSettings
class is moved there. Some parameters are also renamed to be more
in line with typical naming conventions.
Add "recentlyused" to the URL schemes recognised by ViewProperties as
needing special handling. User-set view properties for the
recentlyused: kio are then saved under view_properties/recentlyused in
dolphin's app data directory.
(Previously, the recentlyused: kio was treated, by default, as if it was
a remote location for the purposes of view properties. Since it
displays somewhat specialised results (files/directories from various
locations), users might find it useful to set particular view properties
and have them remembered.)
tells you to restart to apply those settings. This commit changes that by asking you
if you would like to restart now or later.
FEATURE: 441192
FIXED-IN: 21.12
The code reads the icon from the relevant application and uses that for the action
When the user has configured one manually in the toolbar settings that is overridden
To avoid this only change the icon if it is the default one (search)
BUG: 442815
(cherry picked from commit d3f427a6da)
The code reads the icon from the relevant application and uses that for the action
When the user has configured one manually in the toolbar settings that is overridden
To avoid this only change the icon if it is the default one (search)
BUG: 442815
Dolphin still uses KToolInvocation::invokeTerminal() which is
deprecated and requires KInit. However Dolphin was ported away from
requiring it in other ways, so it is now possible to have Dolphin
running but not KInit, which breaks the "Open in Terminal"
functionality.
Using KTerminalLauncherJob fixes this. It was introduced in Frameworks
5.83, so the CMake dependency version is accordingly increased.
BUG: 441072
FIXED-IN: 21.12
KIO::iconForUrl relies on filename to find the icon for remote files.
Appending / at the end of the filename allows it to interpret it as
a folder.
This causes inconsistent tab icons.
To reproduce:
Open in a tab a url on a smb or sftp folder, i.e sftp:/my-server/photos
Before:
Icon is a cloud.
After:
Icon is a folder
Previously a folder icon could be presented if the tab was first opened
with a url with a trailing /
In Dolphin on wayland currently, if you right clicks a file and create a
zip file from it, Dolphin makes a new window.
What we want to happen is Dolphin to focus the window we have with the
file selected.
This patches Dolphin's dbusinterface.cpp to call
KWindowSystem::setCurrentXdgActivationToken()
with the startupID
Returns from function as soon as we encounter a decisive comparison,
while ensuring the fallbacks provide a stable sorting. Added comment
to clarify the situation.
This reverts commit 996e430b62.
The accompanying feature to make the behavior configurable and disable
it by default was reverted in 21.08, so we need to revert the feature
itself as well and only ship it in 21.12, to avoid changing people's
setting back and forth, which is often not well-received.
This reverts commit 50149d6abb.
It breaks the string freeze and I don't think it can count as a bug
fix, so it breaks the feature freeze, too.
CCMAIL: zrenfire@gmail.com
Previously, when passing file URLs with the --select option,
Dolphin would open the file in its corresponding application, as
well as opening an empty tab in Dolphin as if the file were a
directory. This happens specifically when trying to restore a
session.
This commit prevents Dolphin from opening a file in an application
and from opening an empty tab while passing the --select option,
and selects the URLs instead.
BUG: 436584
Before this commit un-maximizing or to be more precise instantly
changing the size of the window by a large amount could potentially
change the width of the sidebars, the viewContainers and the window
itself to unexpected/undesired widths.
This happened because the spacing calculation is triggered when the
primary ViewContainer is resized but at this point in time some of
the other widgets, especially the secondary ViewContainer and the
navigatorsWidget have generally not been resized yet. Therefore the
width and spacing calculations are based on partly updated and
partly outdated values leading to wrong results.
This commit makes it so calculation of spacings is delayed until
all widths have been updated.
Yes, spacing probably should not have the power to resize the
window but unfortunately the spacing can not be set to be less
forceful when taking space because otherwise the UrlNavigators
will take all space they can get with their
QSizePolicy::MinimumExpanding.
BUG: 430521
FIXED-IN: 21.08
This reverts commit c733b3aa97.
There are people who prefer the old behavior of session-restoring all
paths including the ones which are currently inaccessible. The idea is
that Dolphin is like a web browser; if a website is not currently
available, the browser tells you that instead of silently discarding the
URL and showing you the homepage. Doing this can be considered a form
of data loss.
In addition, the reason for the change was to prevent Dolphin from
showing invalid paths on launch for unmounted removable disks, but that
specific case was fixed separately by switching to ~ for any tabs/views
that were showing locations on a just-unmounted removable disk. So you
will never run into the problem if yo unmount a disk in Dolphin and then
close it.
Accordingly, let's revert the change because it causes more problems than
it resolves.
BUG: 439864
CCBUG: 427619
FIXED-IN: 21.08
This MR removes the horizontal scrollbar of the Places panel. For titles that don't fit in the panel, their elided versions will be used (i.e., with ...).
BUG: 301758
(cherry picked from commit deaf5916f2)
Since KIO 5.82, KCoreDirLister (the base class of KDirLister) emits a jobError()
signal when the ListJob used internally emits an error.
Drop KFileItemModelDirLister class, now redundant.
This also bump the KF version to 5.82.
Under some conditions, when zooming, only the size of the icon is changed, but not the entire item, which visually doesn't look good. The main idea of this MR is that when scaling the whole element should be resized, not just the icon, so I came up with some zoom levels for the main icon sizes. With this commit, zooming will resize the entire element, even if the resizing of the icon doesn't affect the size of the entire element.
This MR removes the horizontal scrollbar of the Places panel. For titles that don't fit in the panel, their elided versions will be used (i.e., with ...).
BUG: 301758
An empty folder within the Trash bin previously had the placeholder
label "Trash is empty". This label should only appear in top-most
Trash/ url, and "Folder is empty" otherwise.
BUG: 439952
Folders with equal size caused the sort operation to become unstable,
as the result of lessThan was non-deterministic.
We need the fallback mechanisms at the bottom of the function to
resovle the situation and provide a stable sort order.
This also fixes expanding the contents of a folder into the wrong
parent.
BUG: 433247
FIXED-IN: 21.08
I am trying to run Dolphin on a minimal FreeBSD CHERI-RISC-V QEMU
instance and I haven't got DBus running. Without this change, KDBusService
causes dolphin to exit immediately since the default behaviour is to
exit if it can't connect to DBus.
I am trying to run Dolphin on a minimal FreeBSD CHERI-RISC-V QEMU
instance and I haven't got DBus running. Without this change, I get
crashes because QDBusConnection::sessionBus().interface() returns NULL
if DBus isn't running.
With https://invent.kde.org/frameworks/kio/-/merge_requests/411 the
plugin instances can be reused during the lifetime of the
KFileItemActions object. This improves performance and also allows
the plugins to emit errors, even if they run async.
QAbstractItemModel::match() under the hood uses QRegExp::exactMatch(),
so with QRegularExpression we need to use anchoredPattern() on the pattern.
Regression spotted by a failing dolphinmainwindowtest.
Use KActionMenu and KToolBarPopupAction::setPopupMode()
methods instead of setDelayed() and setStickyMenu().
Are available since KF 5.77 and KF 5.78 respectively,
which is already required by Dolphin.
Since a placeholder text is being used when the folder is empty, it
also makes sense to show a similar placeholder text when the view is
still loading, especially now that the status bar which previously
contained a loading indicator now disappears when a folder is loading.
When folders size is available and unless sort dir first is set, folders
and files can be grouped together in the regular size groups.
Without this you can end up with multiple groups being added each time a
folder size alternates with a file size.
Relates to d520b417c97bdbdfece2a497dac8b5384a80b597
This should have belonged to my previous merge
480b3067d2 but somehow I managed to
miss this one line.
It was written by Derek Christ as part of
dc3beae3ab.
Before this patch, the shift-action modifier in context menus did not
work when a sub-context menu is open, that does not have the main
context menu as its parent.
The new fix installs an event filter on QApplication whenever a new
context menu is opened to make the context menu aware of shift-presses
even when a sub-context menu is in focus.
BUG: 425997
FIXED-IN: 21.04
This way they're more correct, which means they can work with KHelpCenter
and when falling back to opening the relevant page at docs.kde.org in any
web browser.
See https://invent.kde.org/graphics/okular/-/merge_requests/441 for more
details.
(cherry picked from commit 5e79f27aec)
This way they're more correct, which means they can work with KHelpCenter
and when falling back to opening the relevant page at docs.kde.org in any
web browser.
See https://invent.kde.org/graphics/okular/-/merge_requests/441 for more
details.
This commit removes the "toggle_filter" action from the default
toolbar configuration. It is not quite important enough to be
always visible on the toolbar by default. Instead it is easily
accessible through the hamburger menu and the menu bar.
The filter is only really necessary if one has a lot of items in
the current location and one knows exactly how to identify a
certain item among them by the name which probably isn't how most
people browse their files.
There are also some more advanced use-cases but advanced users
will be able to either learn the keyboard shortcut or move this
action back to the toolbar.
People seem to use the "Sort By" menu often enough that it should
be available through the hamburger menu.
Before this change one could only sort the view through the right-
click context menu, using the details view mode or by using the
actions from the menu bar.
adds a method to ask what's the sorting strategy (column and order) for a particular Url, as Dolphin can have directory-specific sorting strategies
This makes possible for other apps that have lists of files, like Gwenview to use the same sorting when invoked from dolphin, ie opening an image
CCBUG:236059
In case there are custom, old plugin lying around they can't be loaded
anyways, because the version does not match. In case that gets fixed one
could just port the plugin to JSON metadata.
Also the mechanism that is used is about to be deprecated.
For some reason on Wayland `QClipboad::dataChanged` can be emitted after
the main window gets deleted. In particular this happens when closing the
main window while another dialog is open.
Since we are closing the window, we can just disconnect this signal and
prevent this crash from ever happening.
This patch makes the Places panel to use SmallMedium icon size as default, making it easier to read. It also removes extra spacing from items with small icons (reverts e9a39700 and 56888a56).
BUG: 437345
Right now this action is using the "document-new" icon, which depicts
creating a new file. This is inaccurate, as the menu provides options for
creating more than just files: it has one option to create folders and
three for creating different types of links. In fact, depending on the
set of installed software, there may not be any options to create new
documents at all!
To fix this, the icon would need to be made either more specific or
more generic.
There is no such icon that depicts being able to create a folder, a
document, or a link; such a thing is too specific to be able to
represent with a small icon. So our only real option is to use a more
generic icon.
This commit does that.
This commit fixes a bug which made it so an UrlNavigator that was
disconnected from a viewContainer would still indirectly control
the viewContainer because of a dubious connection created in
DolphinMainWindow.
Instead the internal UrlNavigator of the viewContainer is used
which is always connected to its own viewContainer.
This way the the supposedly disconnected primary UrlNavigator will
actually not affect the old disconnected viewContainer that is
currently being closed.
BUG: 437080
FIXED-IN: 21.08