Commit e32bdeca authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Update search query from CollectionModifyJob

The Search query is in PersistentSearchAttribute, but the server
cannot inspect that. The Protocol already has properties to send
the search query as part of ModifyCollectionCommand, so let's
use that.

BUG: 365753
FIXED-IN: 5.5.0
parent cb63a24a
......@@ -25,6 +25,7 @@
#include "job_p.h"
#include "protocolhelper_p.h"
#include "private/protocol_p.h"
#include "persistentsearchattribute.h"
using namespace Akonadi;
......@@ -102,6 +103,12 @@ void CollectionModifyJob::doStart()
if (!d->mCollection.attributes().isEmpty()) {
cmd.setAttributes(ProtocolHelper::attributesToProtocol(d->mCollection));
}
if (auto attr = d->mCollection.attribute<Akonadi::PersistentSearchAttribute>()) {
cmd.setPersistentSearchCollections(attr->queryCollections().toVector());
cmd.setPersistentSearchQuery(attr->queryString());
cmd.setPersistentSearchRecursive(attr->isRecursive());
cmd.setPersistentSearchRemote(attr->isRemoteSearchEnabled());
}
if (!d->mCollection.d_ptr->mDeletedAttributes.isEmpty()) {
cmd.setRemovedAttributes(d->mCollection.d_ptr->mDeletedAttributes);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment