akonadi
20 #include "searchresultjob_p.h"
22 #include "protocolhelper_p.h"
24 #include <akonadi/private/protocol_p.h>
33 SearchResultJobPrivate( SearchResultJob *parent );
38 QVector<QByteArray> rid;
41 SearchResultJobPrivate::SearchResultJobPrivate( SearchResultJob *parent)
49 using namespace Akonadi;
51 SearchResultJob::SearchResultJob(
const QByteArray &searchId,
const Collection &collection, QObject *parent )
52 :
Job(new SearchResultJobPrivate( this ), parent )
54 Q_D( SearchResultJob );
55 Q_ASSERT( collection.
isValid() );
57 d->searchId = searchId;
58 d->collection = collection;
61 SearchResultJob::~SearchResultJob()
65 void SearchResultJob::setSearchId(
const QByteArray &searchId )
67 Q_D( SearchResultJob );
68 d->searchId = searchId;
71 QByteArray SearchResultJob::searchId()
const
73 return d_func()->searchId;
76 void SearchResultJob::setResult(
const ImapSet &set )
78 Q_D( SearchResultJob );
83 void SearchResultJob::setResult(
const QVector<qint64> &ids )
85 Q_D( SearchResultJob );
91 void SearchResultJob::setResult(
const QVector<QByteArray> &remoteIds )
93 Q_D( SearchResultJob );
98 void SearchResultJob::doStart()
100 Q_D( SearchResultJob );
102 QByteArray command = d->newTag() +
' ';
104 if ( !d->rid.isEmpty() ) {
105 command += AKONADI_CMD_RID;
107 command += AKONADI_CMD_UID;
110 command +=
" SEARCH_RESULT " + d->searchId +
" " + QByteArray::number( d->collection.id() ) +
" (";
112 if ( !d->rid.isEmpty() ) {
113 command += ImapParser::join( d->rid.toList(),
" " );
114 }
else if ( !d->uid.isEmpty() ) {
115 command += d->uid.toImapSequenceSet();
120 d->writeData( command );
Represents a collection of PIM items.
Base class for all actions in the Akonadi storage.
bool isValid() const
Returns whether the entity is valid.
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Mon Jul 21 2014 08:03:55 by
doxygen 1.8.6 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.