D25257: refactor(search): De-couple baloo URL parsing logic from UI

Stefan BrĂ¼ns noreply at phabricator.kde.org
Mon Nov 11 14:11:53 GMT 2019


bruns added a comment.


  This definitely goes in the right direction, thanks!

INLINE COMMENTS

> dolphinquerymodel.cpp:33
> +#ifdef HAVE_BALOO
> +    if (searchUrl.scheme() != QLatin1String("baloosearch")) {
> +        return model;

not necessary, as already done by `Baloo::Query::fromSearchUrl()`

> dolphinquerymodel.cpp:61
> +{
> +    static const QList<QLatin1String> searchTokens = QList<QLatin1String>()
> +        << QLatin1String("modified>=")

Use a plain C array instead of a QList.

> dolphinquerymodel.cpp:66
> +    for (const auto &searchToken : searchTokens)
> +    {
> +        if (term.startsWith(searchToken)) {

`{` goes on the line above

> dolphinquerymodel.h:45
> +
> +    static bool isSearchTerm(const QString& term);
> +

Does not access `DolphinQueryModel`, so can be deleted here and declared in an anonymous namespace in `dolphinquerymodel.cpp`

> dolphinquerymodel.h:50
> +    QString m_searchText;
> +    QString m_searchType;
> +    QStringList m_searchTerms;

`m_fileType`

REPOSITORY
  R318 Dolphin

REVISION DETAIL
  https://phabricator.kde.org/D25257

To: iasensio, #dolphin, elvisangelaccio, bruns
Cc: bruns, kfm-devel, pberestov, iasensio, fprice, MrPepe, fbampaloukas, alexde, Codezela, feverfew, meven, spoorun, navarromorales, firef, ngraham, andrebarros, emmanuelp, mikesomov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20191111/c1d1fb98/attachment.htm>


More information about the kfm-devel mailing list