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.