fix(search): Correctly parse filename and/or content search
ClosedPublic

Authored by iasensio on Nov 19 2019, 9:16 PM.

Details

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:

ContentFilenameSearch textSearch type
TTabc filename:"xyz"Content
TFabcContent
FTxyzFilename
FFdo not set

Depends on: D25260

Test Plan

bin/dolphinquerytest: Added new test cases for searches with content text and/or filename

Diff Detail

Repository
R318 Dolphin
Branch
filename_content
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 19885
Build 19903: arc lint + arc unit
iasensio created this revision.Nov 19 2019, 9:16 PM
Restricted Application added a subscriber: kfm-devel. · View Herald TranscriptNov 19 2019, 9:16 PM
iasensio requested review of this revision.Nov 19 2019, 9:16 PM
iasensio updated this revision to Diff 70187.Nov 22 2019, 10:18 PM

Respect quotes when splitting terms

src/search/dolphinquery.cpp
49

Coding style: opening brace to the next line

60

Same here

65

Space after while

iasensio updated this revision to Diff 70209.Nov 23 2019, 12:45 PM
iasensio marked 3 inline comments as done.

Fix coding style

Friendly ping

LGTM otherwise.

src/search/dolphinquery.cpp
114

QStringLiteral

iasensio updated this revision to Diff 71605.Dec 15 2019, 3:27 PM
iasensio marked an inline comment as done.
  • Use QStringLiteral
iasensio updated this revision to Diff 71611.Dec 15 2019, 4:46 PM
  • Rebase and adapt tests

LGTM otherwise.

May I take that as an acceptance? I will wait though, just in case :)

This revision is now accepted and ready to land.Dec 21 2019, 6:05 PM
This revision was automatically updated to reflect the committed changes.