┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/search/dolphinquery.cpp
AgeCommit message (Collapse)Author
2026-01-22clang-tidy: avoid copy, use const referencesMéven Car
2025-09-23GIT_SILENT: Don't duplicate headers between .h/.cppLaurent Montel
2025-09-03Fix several user-facing and non-user-facing typosKunda Ki
Found via `codespell -S "*.desktop,*.po,*.svg,*.xml,./po" -L aparent,childs,goup,lokal`
2025-06-05DolphinQuery: Use prettier URL particularly for local pathsKai Uwe Broulik
Use toLocalFile() to avoid the 'file://' prefix and use KShell::tildeCollapse that collapses the home path into ~ as is done in many other places. Also strip trailing slash for the other URLs.
2025-04-07Rewrite search integrationFelix Ernst
This huge commit is a nearly complete rewrite of the Dolphin search code. It implements most of the improved Dolphin search UI/UX as designed and discussed in a collaborative effort by Kristen McWilliam, Jin Liu, Andy Betts, Tagwerk, a few others and me. See https://invent.kde.org/system/dolphin/-/issues/46. # Notable changes - A toggle to change the search tool is provided as most contributors deemed that useful in https://invent.kde.org/system/dolphin/-/merge_requests/642#note_985112. - The default search is changed to filenamesearch for maximum reliability. - Removing all search parameters will take users back to the view state prior to starting a search instead of keeping the search results open. - The UI for choosing file types or modification dates has been made more powerful with more granularity and more options. - Most search parameters can be configured from a popup menu which gives us extra space for extra clarity. - Labels and help buttons as well as hyperlinks to settings makes sure the user always knows why some search parameters are unavailable in some contexts. - Chips show important search parameters while the popup is closed. They allow quickly removing filters. - The titles of the search and the input field placeholder message change to make clear whether file names or file contents are searched. - When the user actively switches the search tool, whether content should be searched, or whether to search everywhere, this is preserved for the initial state of the search bar when the user opens it the next time after restarting Dolphin. # Architecture - The new DolphinQuery class is independent of the UI and contains all search parameters modifiable in Dolphin as easy setters and getters. - DolphinQuery objects are also used to update the states of every component in the search UI. There is now a clear separation of UI and search configuration/DolphinQuery. - DolphinQuery is responsible for exporting to and importing from search URLs. - The search UI always reflects the currently configured DolphinQuery no matter if the user changed the UI to change the DolphinQuery or loaded a DolphinQuery/older search URL which then is reflected in the UI. - I tried to simplify all classes and their interaction between each other as much as possible. - I added some tests BUG: 386754 CCBUG: 435119 CCBUG: 458761 BUG: 446387 BUG: 470136 CCBUG: 471556 CCBUG: 475439 CCBUG: 477969 BUG: 480001 BUG: 483578 BUG: 488047 BUG: 488845 BUG: 500103 FIXED-IN: 25.08
2023-08-29Fix a bunch of clazy warningsMéven Car
2023-02-05Add clang-format and format code as in FrameworksSerg Podtynnyi
2022-06-15Cleanup config-dolphin.h includesAhmad Samir
2022-06-15Use cmakedefine01Ahmad Samir
This way we get a build time warning if the var isn't defined at all, e.g. a missing check_include_files() CMake call.
2022-06-15Use one config-dolphin.h.cmake configuration fileAhmad Samir
2020-10-23Compile without foreachAlexander Lohnau
2020-08-25Output of licensedigger + manual cleanup afterwards.Elvis Angelaccio
Unfortunately licensedigger does not strip the trailing * characters. While at it, use a common style for all source files.
2020-07-11Add support to tags: scheme in DolphinQueryIsmael Asensio
It allows to start a search from a `tags:/mytag/` view. The use case is to refine a search on additional terms (another tags, ratings, etc)
2020-07-05[search] Fix corner cases when using quotes in filenamesIsmael Asensio
The `filename` term in a search query is enclosed into quotes. As the user can have additional quotes in the search term, there were several corner cases where the parsing would fail to correctly split the terms New test cases have been added to cover this possibility Previous tests still passes to avoid regressions BEFORE: ``` (filename/quoted) Compared values are not the same Actual (query.text()): "xyz\"\"" Expected (expectedText): "\"abc xyz\"" (filename/mixed) Compared values are not the same Actual (query.text()): "xyz\" tuv\"" Expected (expectedText): "\"abc xyz\" tuv" (content+filename/quoted) Compared values are not the same Actual (query.text()): "abc xyz xyz\"\"" Expected (expectedText): "abc xyz filename:\"\"abc xyz\"\"" ```
2020-06-22Expand DolphinQuery to support different Url schemesIsmael Asensio
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
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-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-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