┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/search
AgeCommit message (Collapse)Author
2020-04-27prevent a QFileInfo warningRené Bertin
DolphinSearchBox::init() can generate a terminal warning depending on the user's search history: QFileInfo::absolutePath: Constructed with empty filename The warning can seem to appear randomly if you don't use the search feature often, because of its dependency on previous search activity. Prevent this warning by adding a simple check if the current m_searchPath is valid or not. This check has no effect on the value returned by DolphinSearchBox::isIndexingEnabled() and is in line with the fact that m_searchPath == QUrl() indicates that no search path has been set. Differential Revision: https://phabricator.kde.org/D29194
2020-04-18Move from the searchbox to the results with the down arrow keyShlomi Fish
Summary: Move from the searchbox to the search results listbox/view using the down arrow key in addition to the existing methods using the tab key, return key, or the mouse. Test Plan: use ctrl+f to search in a directory tree, press down arrow key to go to the results Reviewers: ngraham, #dolphin Reviewed By: ngraham, #dolphin Subscribers: meven, elvisangelaccio, ngraham, iasensio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D26362
2020-01-19(search) Fix searching tags with spacesIsmael Asensio
Summary: Tags containing blank spaces were not handled properly in the search widget. Now we enclose them in quotes and strip the quotes before setting them to the widget. {F7854247} Test Plan: No artifacts when searching tags containing spaces Added test cases to `bin/dolphinquerytest` Reviewers: #dolphin, elvisangelaccio, ngraham, meven Reviewed By: #dolphin, elvisangelaccio, ngraham Subscribers: meven, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D26369
2020-01-06(search) Keep menu open when selecting tagsIsmael Asensio
Summary: Keeps the `Tags` menu open while selecting and deselecting tags in the search panel, saving many mouse clicks for multiple tags. It cannot be done natively on `QMenu` (https://bugreports.qt.io/browse/QTBUG-6635) but it is a one-liner and I haven't seen any bad behavior so far. Test Plan: {F7853717} - `Tags` menu does not close when selecting/deselecting tags - Tag search is consistent - Clicking anywhere else will close the menu Reviewers: #dolphin, elvisangelaccio, ngraham, #vdg Reviewed By: #dolphin, elvisangelaccio, #vdg Subscribers: #vdg, broulik, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D26343
2019-12-29Clean-up DolphinFacetsWidgetIsmael Asensio
Summary: Small refactor patch to clean-up some logic on setter and getter: - Search terms are previously splitted and set separately, so no need for extra splitting and `foreach` loop - Return search terms on a `QStringList` rather than join first Depends on: D26029 Test Plan: No behavior changes Reviewers: #dolphin, elvisangelaccio Reviewed By: #dolphin, elvisangelaccio Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D26150
2019-12-26Rename methods on DolphinFacetsWidgetIsmael Asensio
Summary: Small refactor patch to rename method names, from `ratingTerm` to `searchTerm`, since its scope has grown bigger. Test Plan: No behavior changes Reviewers: #dolphin, elvisangelaccio Reviewed By: #dolphin, elvisangelaccio Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D26029
2019-12-21fix(search): Correctly parse filename and/or content searchIsmael Asensio
Summary: Currently, the search url parsing does not detect if the search is based on Content or Filename, and it just keeps the last selection which can be inconsistent with the actual search. This patch add such detection, and since an advanced user can combine filename and content search (using the keyword `filename:`), now the parsing detects both items and handles the four possible cases: | Content | Filename | Search text | Search type | |---|---|------------------------|------------------| | T | T | abc filename:"xyz" | Content | | T | F | abc | Content | | F | T | xyz | Filename | | F | F | | do not set | Depends on: D25260 Test Plan: `bin/dolphinquerytest`: Added new test cases for searches with content text and/or filename Reviewers: elvisangelaccio, bruns, #dolphin Reviewed By: elvisangelaccio, #dolphin Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D25416
2019-12-15[dolphin/search] Search by (multiple) tagsIsmael Asensio
Summary: Adds a tag selector in the extended filters of the search box. Selected tag or tags are added to the search query along with the other filters (type, date, rating). FEATURE: 412564 CCBUG: 356062 Test Plan: - Menu shows the user tags - Picking any tag/s filters the search to that specific tag/s {F7727909} Reviewers: elvisangelaccio, ngraham, #dolphin, #vdg Reviewed By: elvisangelaccio, ngraham, #dolphin, #vdg Subscribers: kfm-devel Tags: #dolphin Maniphest Tasks: T9094 Differential Revision: https://phabricator.kde.org/D25130
2019-12-09Fix build with Qt 5.14 RCAntonio Rojas
Add needed Qt includes that are no longer pulled transitively. BUG: 414492 Differential Revision: https://phabricator.kde.org/D25783
2019-11-28fix(search): Fix baloo searchString parsingIsmael Asensio
Summary: Fix the parsing of Baloo query `searchString` to represent its parameters properly in the search box: # Baloo terms (`rating`, `modified`) are added to the user search text: {F7575590} # Extra quotes are added to the search text: https://bugs.kde.org/show_bug.cgi?id=412952 This revision supersedes D24422, by making the fixes on the new dolphin query model, instead of directly on the UI. BUG: 412952 FIXED IN: 19.11.90 Test Plan: - `bin/dolphinquerytest` passes without `XFAIL`s - Dolphin search box is not garbled by search terms or quotes Reviewers: elvisangelaccio, bruns, ngraham, #dolphin Reviewed By: elvisangelaccio Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D25260
2019-11-13fix(search): Allow to set empty typeIsmael Asensio
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`) Reviewers: elvisangelaccio, #dolphin Reviewed By: elvisangelaccio, #dolphin Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D25255
2019-11-13DolphinQuery: drop DOLPHIN_EXPORTElvis Angelaccio
DOLPHIN_EXPORT is only used by classes in the `dolphinprivate` target, while DolphinQuery is part of `dolphinstatic`. This should fix the failing Windows build on the CI.
2019-11-13refactor(search): De-couple baloo URL parsing logic from UIIsmael Asensio
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 Reviewers: #dolphin, elvisangelaccio, bruns Reviewed By: #dolphin, elvisangelaccio, bruns Subscribers: ngraham, bruns, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D25257
2019-11-09Remove unnecessary semicolons after Q_UNUSEDElvis Angelaccio
GIT_SILENT
2019-11-07Make the search box more compactIsmael Asensio
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'. CCBUG: 386754 Test Plan: BEFORE: {F7681182} AFTER: {F7681184} Reviewers: elvisangelaccio, ngraham, #dolphin, #vdg Reviewed By: elvisangelaccio, ngraham, #dolphin, #vdg Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D25028
2019-11-03Get rid of search "More Options" toggle buttonIsmael Asensio
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. CCBUG: 386754 Test Plan: Current: {F7681182} After: {F7687380} Along with D25029: {F7687385} Reviewers: elvisangelaccio, ngraham, #dolphin, #vdg Reviewed By: ngraham, #vdg Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D25057
2019-10-27New design for extended search optionsIsmael Asensio
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. BEFORE: {F7581883} AFTER: {F7580952} Test Plan: Same behavior with different aesthetics Reviewers: elvisangelaccio, #dolphin, #vdg Subscribers: ndavis, ngraham, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D24602
2019-10-20[dolphin/search] Reset search options when neededIsmael Asensio
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. Reviewers: #dolphin, elvisangelaccio, meven, ngraham Reviewed By: ngraham Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D24450
2019-10-20[dolphin/search] Fix search behavior when selecting "Your Files"Ismael Asensio
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 {F7575402} Reviewers: #dolphin, elvisangelaccio Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D24577
2019-10-13Hide search extra options when not availableIsmael Asensio
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 {F7531893} CCBUG: 396898 FEATURE: 318580 FEATURE: 408680 FIXED-IN: 19.11.80 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. Reviewers: #dolphin, elvisangelaccio, meven, ngraham Reviewed By: meven Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D24446
2019-10-08[dolphin/search] Add method isIndexEnabled()Ismael Asensio
Summary: Extracts the logic for checking if the current path is indexed to its own method. Test Plan: No behavior changes Reviewers: elvisangelaccio, ngraham, meven Reviewed By: ngraham, meven Subscribers: meven, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D24478
2019-10-07[dolphin/search] Avoid unnecesary reloads on setSearchPathIsmael Asensio
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 Reviewers: #dolphin, elvisangelaccio, meven, ngraham Reviewed By: #dolphin, ngraham Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D24449
2019-10-07[dolphin/search] Add missing parsing for type 'Folder'Ismael Asensio
Summary: Add missing parsing for type 'Folder' See D24422 Test Plan: dolphin --new-window 'baloosearch:?json=%7B%22type%22:[%22Folder%22]%7D' - `Folders` is selected in search options Reviewers: #dolphin, elvisangelaccio, meven, ngraham Reviewed By: #dolphin, ngraham Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D24448
2019-09-08GIT_SILENT: minor qstring optimizationLaurent Montel
2019-04-22Use placeholder for search actionCarl Schwan
Summary: See https://hig.kde.org/style/writing/placeholder.html Screenshot: Old: {F6691712} New: {F6698685} Test Plan: Compile and run Reviewers: #dolphin, #vdg, ngraham, elvisangelaccio Reviewed By: #dolphin, #vdg, ngraham Subscribers: GB_2, kde-doc-english, elvisangelaccio, ngraham, yurchor, kfm-devel Tags: #dolphin, #documentation Maniphest Tasks: T10258 Differential Revision: https://phabricator.kde.org/D19770
2019-04-09Make buttons in seach bar nicer (icon, tooltip, autoselect)Stefan Brüns
Summary: The "Everywhere" button actually selects the home directory, so use an appropriate label ("Your files") and add a "user-home" icon. Pre-select the right button when entering search, depending on the location where the "Find ..." action was triggered. Add tooltips for both buttons, stating where to look for files. Most importantly, this includes the full path for "From here". Canonicalize the path correctly (always strip trailing slash), otherwise QUrl::fileName() will be an empty string, resulting in "From Here (/)" Do not hide the buttons in case the url is non-local, as it is confusing: 1. The state depends on the previous search. When the user hits "Find" when browsing e.g an SMB share, the search was probably in the home dir. 2. The current search location was hidden 3. The user may want to do a local search, give the option to do so. Reviewers: #dolphin, ngraham, elvisangelaccio Reviewed By: #dolphin, ngraham, elvisangelaccio Subscribers: loh.tar, meven, elvisangelaccio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D20357
2019-02-27remove deprecated methodsLaurent Montel
2018-06-13Fix loop of FocusIn eventsElvis Angelaccio
Summary: Commit 43da84eefc7d 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
2018-03-04Remove unused #includeRoman Inflianskas
Summary: I used CLion inspection to hunt all unused #include Reviewers: #dolphin, elvisangelaccio, markg Reviewed By: #dolphin, elvisangelaccio, markg Subscribers: bcooksley, markg, elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D10985
2018-03-03Remove unused #includeRoman Inflianskas
Summary: I used CLion inspection to hunt all unused #include Reviewers: #dolphin, elvisangelaccio, markg Reviewed By: #dolphin, elvisangelaccio, markg Subscribers: markg, elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D10985
2017-12-14Use Kio::KPlacesModel as source model for PlacesItemModelRenato Araujo Oliveira Filho
Summary: Use Kio::KPlacesModel as source model for PlacesItemModel avoiding duplicated code. Depends on D8862 Depends on D8332 Depends on D8434 Depends on D8348 Depends on D8630 Test Plan: Unit test created Reviewers: elvisangelaccio, emmanuelp, mlaurent, mwolff Reviewed By: elvisangelaccio, mlaurent, mwolff Subscribers: mwolff, mlaurent, anthonyfieroni, nicolasfella, ngraham, #dolphin Differential Revision: https://phabricator.kde.org/D8855
2017-11-21Modernize: Use nullptr everywhereKevin Funk
2017-11-20Modernize: Use override where possibleKevin Funk
Also use override instead of Q_DECL_OVERRIDE
2017-11-03Use nullptr + add explicit keywordMontel Laurent
Test Plan: compile Reviewers: #dolphin, broulik Reviewed By: broulik Subscribers: #dolphin Differential Revision: https://phabricator.kde.org/D8637
2017-11-01Make Saved Search feature discoverableNathaniel Graham
Summary: FEATURE: 269332 Make Dolphin's Saved Search feature discoverable by adding a button inside the search field. The button only becomes enabled when there is a valid search term. When pushed, it saves the search to the Places panel, providing a visible-by-default way to do this to complement the existing implementation that is only visible in the context menu. Also harmonized the label text so that it's consistent no matter how you create a saved search (button or context menu) Test Plan: Tested in KDE Neon. Works great: {F5449508} Reviewers: #dolphin, broulik, dfaure, markg, emateli, elvisangelaccio Reviewed By: #dolphin, markg, emateli, elvisangelaccio Subscribers: anthonyfieroni, markg, emateli, elvisangelaccio, cfeck, #dolphin Tags: #dolphin Differential Revision: https://phabricator.kde.org/D8454
2017-10-04Move Folders item closer to the topNathaniel Graham
Summary: Move Folders item closer to the top in Dolphin's find panel. This seems like a more natural placment than after the document types. Also re-order variable placement to maintain consistency Test Plan: Tested in KDE Neon; works. Before: {F4631565} After: {F4631532} Reviewers: #dolphin, elvisangelaccio Reviewed By: #dolphin, elvisangelaccio Subscribers: #dolphin Differential Revision: https://phabricator.kde.org/D8132
2017-10-03Add option to only search for foldersXY Quadrat
This commit adds an option under "More options" at the search widget. It allows to only search for folders and filter out everything else, just like the other options (e.g. "Videos") above. FEATURE: 269334 REVIEW: 130159
2017-05-22Correct searchbox, split view transitions between tabsAnthony Fieroni
Differential Revision: https://phabricator.kde.org/D5864 BUG: 379135 BUG: 380032 FIXED-IN: 17.04.2 Signed-off-by: Anthony Fieroni <[email protected]>
2017-01-21DolphinSearchBox: Add a "More search tools..." menu buttonGregor Mi
Additionally, moves the "More/Fewer options" button from right to left to reduce the mouse travelling distance when the dolphin is maximized on a large screen (see screenshots) The current location url will be passed to the search tool to set the initial search root directory. REVIEW: 123883
2017-01-01[DolphinSearchBox] Stop search timer on hideAnthony Fieroni
REVIEW: 129705 Signed-off-by: Anthony Fieroni <[email protected]>
2016-03-16[CLAZY] Fixed all level 1 and level 2 warnings with small exceptionsArtur Puzio
REVIEW: 126771
2015-11-26Fix incorrect QString -> QUrl conversion.David Faure
2015-05-11Remove unneeded include to fix buildRaymond Wooninck
CCMAIL: [email protected]
2015-05-11Move away from Baloo::TermVishesh Handa
Baloo is set to become a framework and wants to only export the bare minimum number of classes as it will need to provide ABI + API guarentees forever. The Term class is now no longer exported. It can be added back again. REVIEW: 123643
2015-04-29SearchBox: Baloo now only searches through FilesVishesh Handa
We no longer need to explicitly state files
2015-02-26Port away from KDELibs4Support (we only use KDELibs4Support when baloo isn't ↵Emmanuel Pescosta
present, because KFileMetaDataWidget is in KDELibs4Support) Reviewed-By: Vishesh Handa
2015-02-26Next QUrl porting bug found: search include directoriesEmmanuel Pescosta
2015-02-26Revert "Use the Baloo Query Builder widget to add syntax-highlighting in ↵Emmanuel Pescosta
Dolphin search" The natural query parser is too unstable for the release atm, we'll readd the query parser when the code is mature enough. This reverts commit e3578ee3b770a1b8f359ed1a3cc6e3ac7f6c700e.
2014-11-11Fixed build error which was introduced by commit ↵Emmanuel Pescosta
7ed7cd97d084364d8ee61b35f5ffa3630c5277a4 CCMAIL: [email protected]
2014-11-10KLineEdit to QLineEditEmmanuel Pescosta