Ismael Asensio [Thu, 14 Nov 2019 21:48:26 +0000 (22:48 +0100)]
test(search): Add test case for baloo parsing model
Summary:
Adds a new test unit for the model which parses baloo search URLs
14/19 tests are set to `XFAIL` on current implementation, as they will be fixed in a final revision.
Ismael Asensio [Wed, 13 Nov 2019 21:48:45 +0000 (22:48 +0100)]
fix(search): Allow to set empty type
Summary:
This small patch allows to set and empty `type` to the extended options, which will set the `Any Type` option (index 0).
It doesn't make any change in current code, since this case is not called, but it helps simplifying follow-up patches.
Test Plan:
No behavior changes with current code.
Calling `setFacetsType(QString())` actually sets the first option (`Any Type`)
Ismael Asensio [Wed, 13 Nov 2019 21:16:35 +0000 (22:16 +0100)]
refactor(search): De-couple baloo URL parsing logic from UI
Summary:
Extracts the logic that parses `baloosearch:` urls into a new model class. The parser logic itself is kept as is.
The search box UI is later updated using the model fields.
This refactor has been proposed by @bruns in the review of D24422, as it largely simplifies the unit tests and further expansion/improvements.
Test Plan:
No behavior changes.
Test case is added in the follow-up revision: D25258
René Bertin [Tue, 12 Nov 2019 16:47:35 +0000 (17:47 +0100)]
make link with LLVM
This patch fixes a link failure when building with the LLVM toolchain
which does not discover the dependency on or pull in the private dolphin
library when linking dolphin itself.
Méven Car [Tue, 12 Nov 2019 12:48:32 +0000 (13:48 +0100)]
Allow dolphin to format DateTime at later stage than KBalooRolesProvider
Summary:
KFileItemListWidgetInformant::roleText expected imageDateTime value to be a QDateTime but KBalooRolesProvider formatted it to QString previously, preventing KFileItemListWidgetInformant::roleText to format properly the imageDateTime
PlacesItemModel: remove redundant set of properties
Summary:
The text, icon and url properties are already set in
`PlacesItem::setBookmark()`, so there is no need to set them here.
The `OnlyInApp` property is part of the KBookmark object that we are
going to set to the place item, so there is no need to set it here either.
Test Plan:
- Open both dolphin and the Plasma file dialog in some app
- Edit the text, url, icon and the "Only show when using this application" checkbox in some place item from the file dialog
- Check whether the place in dolphin keeps getting updated accordingly
Méven Car [Fri, 8 Nov 2019 15:40:08 +0000 (16:40 +0100)]
[Status Bar] Remove file status Timer, add text update delay
Summary:
Currently when hovering over a file we have its name, mimetype type and size display in the status bar for 1 second, after which the status of the folder is displayed.
This patch removes this timer making the status bar behavior more predictable and user friendly.
Instead there is a 50ms delay between when the status bar gets new text to display (for instance mouse hovering or keyboard navigation) and when the status bar displayed text is updated. This is to avoid flickering.
Ismael Asensio [Thu, 7 Nov 2019 00:34:19 +0000 (01:34 +0100)]
Make the search box more compact
Summary:
Reduce the spacing between widgets and remove the content margins on the extended search options to have a more compact and space-saving layout.
Currently, some widgets are not even aligned.
This will be even more important if we remove the toggle button for 'More Options'.
Ismael Asensio [Sun, 3 Nov 2019 22:00:36 +0000 (23:00 +0100)]
Get rid of search "More Options" toggle button
Summary:
With the new compact search filters (type/date/rating) it makes sense to show these options whenever available, and save some horizontal space on the main bar (specially for verbose languages).
These options will be hidden nevertheless if the search is non-indexed or Baloo is disabled.
For some nicer aesthetics D25029 should be also applied.
Ismael Asensio [Sun, 27 Oct 2019 21:38:15 +0000 (22:38 +0100)]
New design for extended search options
Summary:
Replace the arrays of radiobuttons in dolphin search box to more simple dropdown boxes.
This provides a leaner look, saving a lot user space on the main view and it is more consistent with the 'Search tools' in the most known sites (Google, DuckDuckGo, etc.)
There is room for improvement, as `QComboBox` doesn't match perfectly with the tool buttons used avobe, but I think it is an improvement over the current situation.
Méven Car [Sat, 26 Oct 2019 10:53:04 +0000 (12:53 +0200)]
When the selection is deselected, restart the keyboard search from the beginning
Summary:
BUG: 411538
FIXED-IN: 19.12
Test Plan:
Open a directory with 3 files starting with the same letter.
1. Press this letter key twice
2. The second file is selected
3. Deselect the file with the mouse or using Esc
4. Wait 1 second
5. Press the same key again
Alex Miranda [Mon, 21 Oct 2019 19:39:30 +0000 (21:39 +0200)]
Disable keyboard accelerators for the tabs widget
Summary:
Now that there are actions for switching to a specific tab with default
Alt + <number> shortcuts, automatically assigned keyboard accelerators
can result in ambiguous shortcuts when using specific tab names
containing numbers.
Not adding any accelerators for the tabs widget ensures the default
shortcuts work reliably regardless of tab names.
Test Plan:
- Verify there are no ambiguous shortcuts when browsing folders with
names containing only numbers
- Verify other keyboard accelerators still work (menu bar, context menu
and others)
Méven Car [Sun, 20 Oct 2019 10:35:52 +0000 (12:35 +0200)]
Avoid emitting twice twice selectionChanged when keyboard changes the selection, fix slotChangeCurrentItem
Summary:
In KItemListController::slotChangeCurrentItem searchFromNextItem use was bugged :
The two branches of `if (searchFromNextItem)` both looked for the next keyboard with indexForKeyboardSearch(text, currentIndex (the first one with just a +1 modulo).
But when searchFromNextItem is false, we are supposed to start to look for the next indexKeyboard from the start of the list `0`, not from the `currentIndex`
Alex Miranda [Sun, 20 Oct 2019 10:03:10 +0000 (12:03 +0200)]
Fix a bug where "Add to Places" remains disabled
Summary:
Fix a bug where "Add to Places" doesn't get re-enabled in the context
and file menus when nothing is selected after previously selecting a
single file that is not a directory or multiple files.
Test Plan: Verify the action remains enabled when appropiate
Ismael Asensio [Sun, 20 Oct 2019 09:51:59 +0000 (11:51 +0200)]
[dolphin/search] Reset search options when needed
Summary:
Adds a method to reset the options in `facetsWidget` in two cases: when disabled and before parsing a new search URL.
Otherwise, controls for a parameter (ex. `rating`) which are not found in the new URL would stay on the old positions, instead of the default "any".
See D24422
Test Plan: Controls on `facetsWidget` go back to the default in such two cases.
Ismael Asensio [Sun, 20 Oct 2019 09:43:32 +0000 (11:43 +0200)]
[dolphin/search] Fix search behavior when selecting "Your Files"
Summary:
Fix the search box forgetting the location where the user was previously searching into.
To do a search on "All Files" instead of setting the `m_searchPath` to `$HOME`, it checks the button state, so the "From Here" location is not lost.
As an added benefit, selecting "Your Files" when in a non-indexed folder will use the baloo search instead of a fully non-indexed search from $HOME.
This issue is the last remaining one of the series started with D24422, with the purpose of fixing the searchbox parsing and update.
Test Plan:
- Toggle between "From Here/Your Files" and navigate between locations
- The search box remembers the location and keeps a coherent state
Ismael Asensio [Sun, 13 Oct 2019 15:21:11 +0000 (17:21 +0200)]
Hide search extra options when not available
Summary:
Hide the search extra options when they are not available, because the current location is not indexed or Baloo is not enabled.
The button is disabled and shows a tooltip to provide feedback of why it's not available.
Depends on D24478
Test Plan:
- `Ctrl-F` on a non-indexed location
- `balooctl disable` and `Ctrl-F` on an indexed location
On both cases the extra options are not shown, the button is disabled and the reason is shown in the tooltip
The user selection is remembered between indexed locations.
Alex Miranda [Sun, 13 Oct 2019 14:37:00 +0000 (16:37 +0200)]
Add actions for switching to a specific tab
Summary:
Add actions to switch to each of the first 9 tabs and another action to
switch to the last tab.
This feature makes it much easier to quickly switch between tabs just
like you normally would be able to when using a web browser or other
applications.
Ismael Asensio [Mon, 7 Oct 2019 19:50:59 +0000 (21:50 +0200)]
[dolphin/search] Avoid unnecesary reloads on setSearchPath
Summary:
Check in `setSearchPath()` if the `url` passed is already the `searchPath`
This was causing an effect where reloading the same search URL results on buttons `From Here/Everywhere` toggling.
See D24422
Test Plan:
On your home folder press `Ctrl-F` several times
Buttons `From Here/Everywhere` should now not toggle each time
Ismael Asensio [Sun, 6 Oct 2019 09:34:30 +0000 (11:34 +0200)]
Fix crash when lauching dolphin with a search scheme
Summary: Widget objects are initialized in `DolphinSearchBox::init()`, which is called on `QEvent::Polish`, so we must set it visible before calling `fromSearchUrl`.
Ismael Asensio [Thu, 3 Oct 2019 20:00:24 +0000 (22:00 +0200)]
Update searchbox on URL changes (Fix D24369)
Summary:
In D24369 I introduced a regression: Where now the searchbox is updated on url changes for search urls, it is not updated anymore for regular folders. The effect is that not-indexed folders can have the extra options enabled or vice-versa. This patch fixes it, moving back the updating logic to `setSearchModeEnable`.
Test Plan: - Searchbox updates properly when changing between search urls and regular folders, either indexed or nor-indexed.
Ismael Asensio [Thu, 3 Oct 2019 20:00:24 +0000 (22:00 +0200)]
Update searchbox on URL changes (Fix D24369)
Summary:
In D24369 I introduced a regression: Where now the searchbox is updated on url changes for search urls, it is not updated anymore for regular folders. The effect is that not-indexed folders can have the extra options enabled or vice-versa. This patch fixes it, moving back the updating logic to `setSearchModeEnable`.
Test Plan: - Searchbox updates properly when changing between search urls and regular folders, either indexed or nor-indexed.
KXMLGUIFactoryPrivate::saveDefaultActionProperties(): Shortcut for action "go_forward" "&Forward" set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.
The fix is to call
actionCollection()->setDefaultShortcuts(m_forwardAction, m_forwardAction->shortcuts());
so that the default shortcuts are setup.
Ismael Asensio [Wed, 2 Oct 2019 20:57:32 +0000 (22:57 +0200)]
Update searchbar parameters on URL change
Summary:
Searchbar options (text and options) were only updated when toggling the search on, $
Main use case is when changing between stored search urls in Places panel.
Test Plan:
- Store two search urls in Places panel
- Navigate between them
- The searchbar text and parameters change accordingly
Nate Graham [Thu, 26 Sep 2019 18:31:05 +0000 (12:31 -0600)]
Expose full set of script execution options in settings window
Summary:
Right now the script execution setting is a checkbox, capable only of handling boolean
input. This is not appropriate because there are actually three options available.
Accordingly, this patch replaces the checkbox with a combobox (to save space compared
to radio buttons) that clearly exposes all three options.
- All three options do what they say they'll do
- All options get saved properly
- The combobox displays the correct option when the window is loaded
- The {nav Defaults} button resets it to "always ask" as expected
David Hallas [Thu, 11 Apr 2019 17:21:41 +0000 (19:21 +0200)]
Add navigation history to forward/back buttons
Summary:
Adds navigation history to forward/back buttons in the toolbar. This
changes the forward/back buttons in the toolbar to use the
KToolBarPopupAction class which provides access to a drop down menu.
Test Plan:
Browse some folders
Click the back drop down menu and navigate somewhere
Click the forward drop down menu and navigate somewhere
Summary:
Adds the capability to view animated images on the preview in the information panel.
This was a request from a user back in 2009 (https://bugs.kde.org/show_bug.cgi?id=182257), but I think nowadays with stickers/memes and what not, it's even more useful.
It keeps the size default transition of the preview viewer before starting the animation, so that the visual integration is smoother.
[KStandardItemListWidget] Request the pixmap size we want and let the icon loader scale it
I noticed that depending on the configured icon size it would spend a significant amount of time in KPixmapModifier::scale.
I don't see a point in requesting a fixed icon size and then scale it down manually as opposed to having the KIconLoader do the scaling for us.
Especially for SVGs it could then even serve us a properly rendered SVG for this size rather than a scaled down pixmap version.
Nazar Kalinowski [Sun, 15 Sep 2019 18:36:05 +0000 (20:36 +0200)]
Fix wrong window titles
Summary:
BUG: 389135
FIXED-IN: 19.11.80
Currently dolphin shows a folder's name instead of a "place" name if the current path has trailing slash and place's name doesn't, or vice versa.
This patch fixes this behavior, so that dolphin always shows a "place" name.
The QUrl::FullyEncoded string conversion is required because that's how
the places model stores the places URLs in the XML bookmarks file.
Test Plan:
Test configuration: https://imgur.com/a/U4zBp8c
Before (wrong window titles are in red): https://imgur.com/a/dB4xRwo
After (all window titles are correct): https://imgur.com/a/W7virBn
Nate Graham [Fri, 6 Sep 2019 16:08:58 +0000 (10:08 -0600)]
Clean up hamburger menu and viewport and single-folder context menus
Summary:
Dolphin's hamburger and context menus have grown organically over time,
becoming a bit messy and somewhat visually overwhelming. This makes them
harder to parse and more intimidating to use.
This patch cleans up the hamburger menu and viewport and single-folder context
menus to group items more logically, and remove items that aren't actually relevant
to the context.
The hamburger menu part of the patch is fairly significant, and draws from the
principle of only showing actions with a global scope that are not already accessible
from another visible method (e.g. via the default toolbar). In the end, it manages to be
shorter than the current hamburger menu with expose actions that are more relevant.
A visible method to display context-specific actions should be explored separately
(see https://bugs.kde.org/show_bug.cgi?id=411500).
Depends on D23945
Test Plan:
Before, hamburger menu: {F7334178}
After, hamburger menu: {F7350958}
Elvis Angelaccio [Tue, 10 Sep 2019 23:09:30 +0000 (01:09 +0200)]
DolphinTabWidget: cleanup index-by-URL API usage
Summary:
Follow-up of D23655 where we didn't have time to polish the code:
- add a couple of variables to make the code more clear.
- remove the `get` prefix which we usually don't use in Qt code.
- make the function private since it's very tied to implementation.
- add a new isUrlOpen public method as wrapper.
Nate Graham [Sat, 24 Aug 2019 20:33:00 +0000 (14:33 -0600)]
Fix ascending/descending choosers getting unchecked when re-selecting the same sort order
Summary:
When you select the same sort order that's already selected, the currently-checked
sort order description (the human-readable ascending/descending items) gets unchecked
in `slotSortTriggered()` yet the ascending/descending items items only get checked in
`slotSortOrderChanged()`. Because the order hasn't gotten changed, neither one gets
checked again.
This patch fixes the problem by not unchecking them in the first place.
BUG: 411223
FIXED-IN: 19.08.2
Test Plan:
1. Right-click > Sort By > Click the currently-selected sort order
2. Right-click > Sort By > See that the item for the current ascending/descending setting has not been changed
Unbreak context menu showing when right clicking on an empty area
In D22149, a request was made to remove a variable assignment ("action",
on line 389 in src/dolphincontextmenu.cpp. However the change went too
far, and it actually removed the exec() call, not just the assignment
which should have stayed.
This resulted in the context menu not being shown at all.
Adding back exec(m_pos) at least allows for the context menu to show.
Making sure that DBus objects are all created before the service
Summary:
Currently the DBus service is created before the MainWindow DBus object is
created. This can cause hangs if another service makes calls to a a method
in an object that's not been initialised, when the service is already published.
This patch defers the creation of the service until all DBus objects are
created.
Test Plan:
Tested in KDevelop. Have "open new folders in tabs" feature enabled.
Open several folders with Dolphin at once. Before this patch
there would be noticeable hanging. With this patch all tabs instantly open with
no hanging.