D19490: Refactor FileSearchQuery and create base class SearchQuery

Daniel Vrátil noreply at phabricator.kde.org
Sun Mar 3 15:22:01 GMT 2019


dvratil requested changes to this revision.
dvratil added a comment.
This revision now requires changes to proceed.


  Again, C++11 allows us to force the compiler to generate code for us, so let's make use of that.

INLINE COMMENTS

> filesearchquery.cpp:125
>  {
> -    d->subqueries.append(query);
> -}
> -
> -bool FileSearchQuery::isEmpty() const
> -{
> -    return d->value.isNull() && d->subqueries.isEmpty();
> +    SearchQuery::addQuery(query);
>  }

If you just chain up to the parent implementation here, there's no need to have `FileSearchQuery::addQuery()` at all.

> searchquery.cpp:33
> +public:
> +    Private();
> +    Private(const Private &other);

` = default`

> searchquery.cpp:34
> +    Private();
> +    Private(const Private &other);
> +    ~Private();

` = default`

> searchquery.cpp:35
> +    Private(const Private &other);
> +    ~Private();
> +

` = default`

> searchquery.cpp:113
> +
> +SearchQuery::SearchQuery(const SearchQuery &other)
> +    : d(other.d)

` = default`

> searchquery.cpp:118
> +
> +SearchQuery::~SearchQuery()
> +{

`= default`

> searchquery.cpp:122
> +
> +SearchQuery &SearchQuery::operator=(const SearchQuery &other)
> +{

`= default`

REPOSITORY
  R477 KGAPI Library

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

To: barchiesi, dvratil
Cc: kde-pim, #libkgapi, barchiesi, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20190303/f49c074f/attachment.html>


More information about the kde-pim mailing list