summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGES3
-rw-r--r--examples/qtmail/app/emailclient.cpp12
-rw-r--r--src/libraries/qmfclient/CHANGES.qdoc14
-rw-r--r--src/libraries/qmfclient/qmailmessageserver.cpp220
-rw-r--r--src/libraries/qmfclient/qmailmessageserver.h14
-rw-r--r--src/libraries/qmfclient/qmailserviceaction.cpp209
-rw-r--r--src/libraries/qmfclient/qmailserviceaction.h14
-rw-r--r--src/libraries/qmfclient/qmailserviceaction_p.h24
-rw-r--r--src/tools/messageserver/mailmessageclient.cpp28
-rw-r--r--src/tools/messageserver/mailmessageclient.h14
-rw-r--r--src/tools/messageserver/messageserver.cpp28
-rw-r--r--src/tools/messageserver/servicehandler.cpp44
-rw-r--r--src/tools/messageserver/servicehandler.h28
-rw-r--r--tests/tst_qmailserviceaction/tst_qmailserviceaction.cpp10
14 files changed, 425 insertions, 237 deletions
diff --git a/CHANGES b/CHANGES
index c2b17298..651f2a05 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
Latest Changes
---------------
+201201_1
+ * Made API renaming changes as documented in src/libraries/qmfclient/CHANGES.qdoc item 51.
+
201201
* Use QNetworkProxy::applicationProxy() requires qt 4.8
* Revert removal emission of IPC notification
diff --git a/examples/qtmail/app/emailclient.cpp b/examples/qtmail/app/emailclient.cpp
index 6420bf03..1619ac36 100644
--- a/examples/qtmail/app/emailclient.cpp
+++ b/examples/qtmail/app/emailclient.cpp
@@ -1749,7 +1749,7 @@ void EmailClient::deleteSelectedMessages()
deleteList = (deleteList.toSet().subtract(localOnlyIds.toSet())).toList();
}
if(!deleteList.isEmpty())
- storageAction("Deleting messages..")->deleteMessages(deleteList);
+ storageAction("Deleting messages..")->onlineDeleteMessages(deleteList);
}
else
{
@@ -1792,7 +1792,7 @@ void EmailClient::copySelectedMessagesTo(const QMailFolderId &destination)
// handle copied messages
copyToFolder(copyList,destination);
#else
- storageAction("Copying messages")->copyMessages(copyList, destination);
+ storageAction("Copying messages")->onlineCopyMessages(copyList, destination);
#endif
AcknowledgmentBox::show(tr("Copying"), tr("Copying %n message(s)", "%1: number of messages", copyList.count()));
@@ -1938,7 +1938,7 @@ void EmailClient::emptyTrashFolder()
if (confirmDelete(this, "Empty trash", tr("all messages in the trash"))) {
AcknowledgmentBox::show(tr("Deleting"), tr("Deleting %n message(s)", "%1: number of messages", trashIds.count()));
- storageAction("Deleting messages")->deleteMessages(trashIds);
+ storageAction("Deleting messages")->onlineDeleteMessages(trashIds);
}
}
@@ -2108,7 +2108,7 @@ void EmailClient::deleteFolder()
if(QMessageBox::question(this, tr("Delete"), tr("Are you sure you wish to delete the folder %1 and all its contents?").arg(folderName), QMessageBox::Ok, QMessageBox::Cancel) != QMessageBox::Ok)
return;
- storageAction("Deleting folder ")->deleteFolder(selectedFolderId);
+ storageAction("Deleting folder ")->onlineDeleteFolder(selectedFolderId);
}
void EmailClient::createFolder()
@@ -2118,7 +2118,7 @@ void EmailClient::createFolder()
if(name.isEmpty())
return;
- storageAction("Creating folder ")->createFolder(name, selectedAccountId, selectedFolderId);
+ storageAction("Creating folder ")->onlineCreateFolder(name, selectedAccountId, selectedFolderId);
}
@@ -2132,7 +2132,7 @@ void EmailClient::renameFolder()
if(newName.isEmpty())
return;
- storageAction("Renaming folder")->renameFolder(selectedFolderId, newName);
+ storageAction("Renaming folder")->onlineRenameFolder(selectedFolderId, newName);
}
}
diff --git a/src/libraries/qmfclient/CHANGES.qdoc b/src/libraries/qmfclient/CHANGES.qdoc
index dd5bf3c1..704fb726 100644
--- a/src/libraries/qmfclient/CHANGES.qdoc
+++ b/src/libraries/qmfclient/CHANGES.qdoc
@@ -203,6 +203,20 @@ Changes since the QMF-1.0 release on 15/05/09:
50. Added 'static QByteArray QMailCodec::bestCompatibleCharset(const QByteArray& charset, bool translateAscii)' function.
+51. Renamed 'void QMailStorageAction::deleteMessages(const QMailMessageIdList &ids)' to onlineDeleteMessages,
+ 'void QMailStorageAction::copyMessages(const QMailMessageIdList &ids, const QMailFolderId &destinationId)' to onlineCopyMessages,
+ 'void QMailStorageAction::moveMessages(const QMailMessageIdList &ids, const QMailFolderId &destinationId)' to onlineMoveMessages,
+ 'void QMailStorageAction::flagMessages(const QMailMessageIdList &ids, quint64 setMask, quint64 unsetMask)' to onlineFlagMessages,
+ 'void QMailStorageAction::createFolder(const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId)' to onlineCreateFolder,
+ 'void QMailStorageAction::renameFolder(const QMailFolderId &folderId, const QString &name)' to onlineRenameFolder,
+ 'void QMailStorageAction::deleteFolder(const QMailFolderId &folderId)' to onlineDeleteFolder.
+ 'void QMailMessageServer::deleteMessages(const QMailMessageIdList &ids)' to onlineDeleteMessages,
+ 'void QMailMessageServer::copyMessages(const QMailMessageIdList &ids, const QMailFolderId &destinationId)' to onlineCopyMessages,
+ 'void QMailMessageServer::moveMessages(const QMailMessageIdList &ids, const QMailFolderId &destinationId)' to onlineMoveMessages,
+ 'void QMailMessageServer::flagMessages(const QMailMessageIdList &ids, quint64 setMask, quint64 unsetMask)' to onlineFlagMessages,
+ 'void QMailMessageServer::createFolder(const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId)' to onlineCreateFolder,
+ 'void QMailMessageServer::renameFolder(const QMailFolderId &folderId, const QString &name)' to onlineRenameFolder,
+ 'void QMailMessageServer::deleteFolder(const QMailFolderId &folderId)' to onlineDeleteFolder.
*****************************************************************************
diff --git a/src/libraries/qmfclient/qmailmessageserver.cpp b/src/libraries/qmfclient/qmailmessageserver.cpp
index dbdaf40c..1229cdf2 100644
--- a/src/libraries/qmfclient/qmailmessageserver.cpp
+++ b/src/libraries/qmfclient/qmailmessageserver.cpp
@@ -80,21 +80,21 @@ signals:
void synchronize(quint64, const QMailAccountId &accountId);
- void copyMessages(quint64, const QMailMessageIdList& mailList, const QMailFolderId &destination);
- void moveMessages(quint64, const QMailMessageIdList& mailList, const QMailFolderId &destination);
- void flagMessages(quint64, const QMailMessageIdList& mailList, quint64 setMask, quint64 unsetMask);
+ void onlineCopyMessages(quint64, const QMailMessageIdList& mailList, const QMailFolderId &destination);
+ void onlineMoveMessages(quint64, const QMailMessageIdList& mailList, const QMailFolderId &destination);
+ void onlineFlagMessagesAndMoveToStandardFolder(quint64, const QMailMessageIdList& mailList, quint64 setMask, quint64 unsetMask);
void addMessages(quint64, const QString &filename);
void addMessages(quint64, const QMailMessageMetaDataList &list);
void updateMessages(quint64, const QString &filename);
void updateMessages(quint64, const QMailMessageMetaDataList &list);
- void createFolder(quint64, const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId);
- void renameFolder(quint64, const QMailFolderId &folderId, const QString &name);
- void deleteFolder(quint64, const QMailFolderId &folderId);
+ void onlineCreateFolder(quint64, const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId);
+ void onlineRenameFolder(quint64, const QMailFolderId &folderId, const QString &name);
+ void onlineDeleteFolder(quint64, const QMailFolderId &folderId);
void cancelTransfer(quint64);
- void deleteMessages(quint64, const QMailMessageIdList& id, QMailStore::MessageRemovalOption);
+ void onlineDeleteMessages(quint64, const QMailMessageIdList& id, QMailStore::MessageRemovalOption);
void searchMessages(quint64, const QMailMessageKey& filter, const QString& bodyText, QMailSearchAction::SearchSpecification spec, const QMailMessageSortKey &sort);
void searchMessages(quint64, const QMailMessageKey& filter, const QString& bodyText, QMailSearchAction::SearchSpecification spec, quint64 limit, const QMailMessageSortKey &sort);
@@ -151,14 +151,14 @@ QMailMessageServerPrivate::QMailMessageServerPrivate(QMailMessageServer* parent)
adaptor, MESSAGE(synchronize(quint64, QMailAccountId)));
connectIpc(this, SIGNAL(cancelTransfer(quint64)),
adaptor, MESSAGE(cancelTransfer(quint64)));
- connectIpc(this, SIGNAL(copyMessages(quint64, QMailMessageIdList, QMailFolderId)),
- adaptor, MESSAGE(copyMessages(quint64, QMailMessageIdList, QMailFolderId)));
- connectIpc(this, SIGNAL(moveMessages(quint64, QMailMessageIdList, QMailFolderId)),
- adaptor, MESSAGE(moveMessages(quint64, QMailMessageIdList, QMailFolderId)));
- connectIpc(this, SIGNAL(deleteMessages(quint64, QMailMessageIdList, QMailStore::MessageRemovalOption)),
- adaptor, MESSAGE(deleteMessages(quint64, QMailMessageIdList, QMailStore::MessageRemovalOption)));
- connectIpc(this, SIGNAL(flagMessages(quint64, QMailMessageIdList, quint64, quint64)),
- adaptor, MESSAGE(flagMessages(quint64, QMailMessageIdList, quint64, quint64)));
+ connectIpc(this, SIGNAL(onlineCopyMessages(quint64, QMailMessageIdList, QMailFolderId)),
+ adaptor, MESSAGE(onlineCopyMessages(quint64, QMailMessageIdList, QMailFolderId)));
+ connectIpc(this, SIGNAL(onlineMoveMessages(quint64, QMailMessageIdList, QMailFolderId)),
+ adaptor, MESSAGE(onlineMoveMessages(quint64, QMailMessageIdList, QMailFolderId)));
+ connectIpc(this, SIGNAL(onlineDeleteMessages(quint64, QMailMessageIdList, QMailStore::MessageRemovalOption)),
+ adaptor, MESSAGE(onlineDeleteMessages(quint64, QMailMessageIdList, QMailStore::MessageRemovalOption)));
+ connectIpc(this, SIGNAL(onlineFlagMessagesAndMoveToStandardFolder(quint64, QMailMessageIdList, quint64, quint64)),
+ adaptor, MESSAGE(onlineFlagMessagesAndMoveToStandardFolder(quint64, QMailMessageIdList, quint64, quint64)));
connectIpc(this, SIGNAL(addMessages(quint64, QString)),
adaptor, MESSAGE(addMessages(quint64, QString)));
connectIpc(this, SIGNAL(addMessages(quint64, QMailMessageMetaDataList)),
@@ -167,12 +167,12 @@ QMailMessageServerPrivate::QMailMessageServerPrivate(QMailMessageServer* parent)
adaptor, MESSAGE(updateMessages(quint64, QString)));
connectIpc(this, SIGNAL(updateMessages(quint64, QMailMessageMetaDataList)),
adaptor, MESSAGE(updateMessages(quint64, QMailMessageMetaDataList)));
- connectIpc(this, SIGNAL(createFolder(quint64, QString, QMailAccountId, QMailFolderId)),
- adaptor, MESSAGE(createFolder(quint64, QString, QMailAccountId, QMailFolderId)));
- connectIpc(this, SIGNAL(renameFolder(quint64, QMailFolderId, QString)),
- adaptor, MESSAGE(renameFolder(quint64, QMailFolderId, QString)));
- connectIpc(this, SIGNAL(deleteFolder(quint64, QMailFolderId)),
- adaptor, MESSAGE(deleteFolder(quint64, QMailFolderId)));
+ connectIpc(this, SIGNAL(onlineCreateFolder(quint64, QString, QMailAccountId, QMailFolderId)),
+ adaptor, MESSAGE(onlineCreateFolder(quint64, QString, QMailAccountId, QMailFolderId)));
+ connectIpc(this, SIGNAL(onlineRenameFolder(quint64, QMailFolderId, QString)),
+ adaptor, MESSAGE(onlineRenameFolder(quint64, QMailFolderId, QString)));
+ connectIpc(this, SIGNAL(onlineDeleteFolder(quint64, QMailFolderId)),
+ adaptor, MESSAGE(onlineDeleteFolder(quint64, QMailFolderId)));
connectIpc(this, SIGNAL(searchMessages(quint64, QMailMessageKey, QString, QMailSearchAction::SearchSpecification, QMailMessageSortKey)),
adaptor, MESSAGE(searchMessages(quint64, QMailMessageKey, QString, QMailSearchAction::SearchSpecification, QMailMessageSortKey)));
connectIpc(this, SIGNAL(searchMessages(quint64, QMailMessageKey, QString, QMailSearchAction::SearchSpecification, quint64, QMailMessageSortKey)),
@@ -261,8 +261,8 @@ QMailMessageServerPrivate::~QMailMessageServerPrivate()
\ingroup messaginglibrary
- Qt Extended messaging applications can send and receive messages of various types by
- communicating with the external MessageServer application. The MessageServer application
+ QMF client messaging applications can send and receive messages of various types by
+ communicating with the MessageServer. The MessageServer
is a separate process, communicating with clients via inter-process messages.
QMailMessageServer acts as a proxy object for the server process, providing an
interface for communicating with the MessageServer by the use of signals and slots
@@ -273,16 +273,6 @@ QMailMessageServerPrivate::~QMailMessageServerPrivate()
For most messaging client applications, the QMailServiceAction objects offer a simpler
interface for requesting actions from the messageserver, and assessing their results.
- \section1 New Messages
-
- When a client initiates communication with the MessageServer, the server informs the
- client of the number and type of 'new' messages, via the newCountChanged() signal.
- 'New' messages are those that arrive without the client having first requested their
- retrieval. The client may choose to invalidate the 'new' status of these messages;
- if the acknowledgeNewMessages() slot is invoked, the count of 'new' messages is reset
- to zero for the nominated message types. If the count of 'new' messages changes while
- a client is active, the newCountChanged() signal is emitted with the updated information.
-
\section1 Sending Messages
To send messages, the client should construct instances of the QMailMessage class
@@ -299,7 +289,7 @@ QMailMessageServerPrivate::~QMailMessageServerPrivate()
store by the message server, from where clients can retrieve their meta data or
content.
- An instance of QMailRetrievalAction should be used to request retrievel of
+ An instance of QMailRetrievalAction should be used to request retrieval of
folders and messages.
\sa QMailServiceAction, QMailStore
@@ -337,6 +327,8 @@ QMailMessageServerPrivate::~QMailMessageServerPrivate()
\fn void QMailMessageServer::newCountChanged(const QMailMessageCountMap& counts);
Emitted when the count of 'new' messages changes; the new count is described by \a counts.
+
+ \deprecated
\sa acknowledgeNewMessages()
*/
@@ -381,7 +373,7 @@ QMailMessageServerPrivate::~QMailMessageServerPrivate()
Emitted when the messages identified by \a list have been deleted from the mail store,
in response to the request identified by \a action.
- \sa deleteMessages()
+ \sa onlineDeleteMessages()
*/
/*!
@@ -390,7 +382,7 @@ QMailMessageServerPrivate::~QMailMessageServerPrivate()
Emitted when the messages identified by \a list have been copied to the destination
folder on the external service, in response to the request identified by \a action.
- \sa copyMessages()
+ \sa onlineCopyMessages()
*/
/*!
@@ -399,7 +391,7 @@ QMailMessageServerPrivate::~QMailMessageServerPrivate()
Emitted when the messages identified by \a list have been moved to the destination
folder on the external service, in response to the request identified by \a action.
- \sa moveMessages()
+ \sa onlineMoveMessages()
*/
/*!
@@ -408,7 +400,7 @@ QMailMessageServerPrivate::~QMailMessageServerPrivate()
Emitted when the messages identified by \a list have been flagged with the specified
set of status flags, in response to the request identified by \a action.
- \sa flagMessages()
+ \sa onlineFlagMessagesAndMoveToStandardFolder()
*/
/*!
@@ -417,7 +409,7 @@ QMailMessageServerPrivate::~QMailMessageServerPrivate()
Emitted when the folder identified by \a folderId has been created, in response to the request
identified by \a action.
- \sa createFolder()
+ \sa onlineCreateFolder()
*/
/*!
@@ -426,7 +418,7 @@ QMailMessageServerPrivate::~QMailMessageServerPrivate()
Emitted when the folder identified by \a folderId has been renamed, in response to the request
identified by \a action.
- \sa renameFolder()
+ \sa onlineRenameFolder()
*/
/*!
@@ -435,7 +427,7 @@ QMailMessageServerPrivate::~QMailMessageServerPrivate()
Emitted when the folder identified by \a folderId has been deleted, in response to the request
identified by \a action.
- \sa deleteFolder()
+ \sa onlineDeleteFolder()
*/
/*!
@@ -443,7 +435,7 @@ QMailMessageServerPrivate::~QMailMessageServerPrivate()
Emitted when the storage operation identified by \a action is completed.
- \sa deleteMessages(), copyMessages(), moveMessages(), flagMessages()
+ \sa onlineDeleteMessages(), onlineCopyMessages(), onlineMoveMessages(), onlineFlagMessagesAndMoveToStandardFolder()
*/
/*!
@@ -538,6 +530,9 @@ QMailMessageServer::~QMailMessageServer()
account identified by \a accountId that are currently in the Outbox folder.
The request has the identifier \a action.
+ This function requires the device to be online, it may initiate communication
+ with external servers.
+
\sa transmissionCompleted()
*/
void QMailMessageServer::transmitMessages(quint64 action, const QMailAccountId &accountId)
@@ -551,6 +546,11 @@ void QMailMessageServer::transmitMessages(quint64 action, const QMailAccountId &
the search should also recursively retrieve the folders available within the previously retrieved folders.
The request has the identifier \a action.
+ The request has the identifier \a action.
+
+ This function requires the device to be online, it may initiate communication
+ with external servers.
+
\sa retrievalCompleted()
*/
void QMailMessageServer::retrieveFolderList(quint64 action, const QMailAccountId &accountId, const QMailFolderId &folderId, bool descending)
@@ -572,6 +572,9 @@ void QMailMessageServer::retrieveFolderList(quint64 action, const QMailAccountId
The request has the identifier \a action.
+ This function requires the device to be online, it may initiate communication
+ with external servers.
+
\sa retrievalCompleted()
*/
void QMailMessageServer::retrieveMessageList(quint64 action, const QMailAccountId &accountId, const QMailFolderId &folderId, uint minimum, const QMailMessageSortKey &sort)
@@ -580,7 +583,7 @@ void QMailMessageServer::retrieveMessageList(quint64 action, const QMailAccountI
}
/*!
- Requests that the message server retrieve the list of messages available for the account \a accountId.
+ Requests that the messageserver retrieve the list of messages available for the account \a accountId.
If \a folderIdList is not empty, then only messages within those folders should be retrieved; otherwise
no messages should be retrieved. If a folder messages are being
retrieved from contains at least \a minimum messages then the messageserver should ensure that at
@@ -593,6 +596,9 @@ void QMailMessageServer::retrieveMessageList(quint64 action, const QMailAccountI
The request has the identifier \a action.
+ This function requires the device to be online, it may initiate communication
+ with external servers.
+
\sa retrievalCompleted()
*/
void QMailMessageServer::retrieveMessageLists(quint64 action, const QMailAccountId &accountId, const QMailFolderIdList &folderIds, uint minimum, const QMailMessageSortKey &sort)
@@ -617,6 +623,9 @@ void QMailMessageServer::retrieveMessageLists(quint64 action, const QMailAccount
The request has the identifier \a action.
+ This function requires the device to be online, it may initiate communication
+ with external servers.
+
\sa retrievalCompleted()
*/
void QMailMessageServer::retrieveMessages(quint64 action, const QMailMessageIdList &messageIds, QMailRetrievalAction::RetrievalSpecification spec)
@@ -627,8 +636,12 @@ void QMailMessageServer::retrieveMessages(quint64 action, const QMailMessageIdLi
/*!
Requests that the message server retrieve the message part that is indicated by the
location \a partLocation.
+
The request has the identifier \a action.
+ This function requires the device to be online, it may initiate communication
+ with external servers.
+
\sa retrievalCompleted()
*/
void QMailMessageServer::retrieveMessagePart(quint64 action, const QMailMessagePart::Location &partLocation)
@@ -641,6 +654,9 @@ void QMailMessageServer::retrieveMessagePart(quint64 action, const QMailMessageP
at least \a minimum bytes are available from the mail store.
The request has the identifier \a action.
+ This function requires the device to be online, it may initiate communication
+ with external servers.
+
\sa retrievalCompleted()
*/
void QMailMessageServer::retrieveMessageRange(quint64 action, const QMailMessageId &messageId, uint minimum)
@@ -654,6 +670,9 @@ void QMailMessageServer::retrieveMessageRange(quint64 action, const QMailMessage
bytes are available from the mail store.
The request has the identifier \a action.
+ This function requires the device to be online, it may initiate communication
+ with external servers.
+
\sa retrievalCompleted()
*/
void QMailMessageServer::retrieveMessagePartRange(quint64 action, const QMailMessagePart::Location &partLocation, uint minimum)
@@ -666,6 +685,9 @@ void QMailMessageServer::retrieveMessagePartRange(quint64 action, const QMailMes
for the account \a accountId.
The request has the identifier \a action.
+ This function requires the device to be online, it may initiate communication
+ with external servers.
+
\sa retrievalCompleted()
*/
void QMailMessageServer::retrieveAll(quint64 action, const QMailAccountId &accountId)
@@ -682,6 +704,9 @@ void QMailMessageServer::retrieveAll(quint64 action, const QMailAccountId &accou
external server.
The request has the identifier \a action.
+ This function requires the device to be online, it may initiate communication
+ with external servers.
+
\sa retrievalCompleted()
*/
void QMailMessageServer::exportUpdates(quint64 action, const QMailAccountId &accountId)
@@ -692,13 +717,18 @@ void QMailMessageServer::exportUpdates(quint64 action, const QMailAccountId &acc
/*!
Requests that the message server synchronize the messages and folders in the account
identified by \a accountId.
+
Newly discovered messages should have their meta data retrieved,
local changes to \l QMailMessage::Read, and \l QMailMessage::Important message status
flags should be exported to the external server, and messages that have been removed
locally using the \l QMailStore::CreateRemovalRecord option should be removed from the
external server.
+
The request has the identifier \a action.
+ This function requires the device to be online, it may initiate communication
+ with external servers.
+
\sa retrievalCompleted()
*/
void QMailMessageServer::synchronize(quint64 action, const QMailAccountId &accountId)
@@ -709,21 +739,29 @@ void QMailMessageServer::synchronize(quint64 action, const QMailAccountId &accou
/*!
Requests that the MessageServer create a copy of each message listed in \a mailList
in the folder identified by \a destinationId.
+
The request has the identifier \a action.
+
+ This function requires the device to be online, it may initiate communication
+ with external servers.
*/
-void QMailMessageServer::copyMessages(quint64 action, const QMailMessageIdList& mailList, const QMailFolderId &destinationId)
+void QMailMessageServer::onlineCopyMessages(quint64 action, const QMailMessageIdList& mailList, const QMailFolderId &destinationId)
{
- emit d->copyMessages(action, mailList, destinationId);
+ emit d->onlineCopyMessages(action, mailList, destinationId);
}
/*!
Requests that the MessageServer move each message listed in \a mailList from its
current location to the folder identified by \a destinationId.
+
The request has the identifier \a action.
+
+ This function requires the device to be online, it may initiate communication
+ with external servers.
*/
-void QMailMessageServer::moveMessages(quint64 action, const QMailMessageIdList& mailList, const QMailFolderId &destinationId)
+void QMailMessageServer::onlineMoveMessages(quint64 action, const QMailMessageIdList& mailList, const QMailFolderId &destinationId)
{
- emit d->moveMessages(action, mailList, destinationId);
+ emit d->onlineMoveMessages(action, mailList, destinationId);
}
/*!
@@ -734,16 +772,23 @@ void QMailMessageServer::moveMessages(quint64 action, const QMailMessageIdList&
The protocol must ensure that the local message records are appropriately modified,
although the external changes may be buffered and effected at the next invocation
of exportUpdates().
+
+ The request has the identifier \a action.
+
+ This function requires the device to be online, it may initiate communication
+ with external servers.
*/
-void QMailMessageServer::flagMessages(quint64 action, const QMailMessageIdList& mailList, quint64 setMask, quint64 unsetMask)
+void QMailMessageServer::onlineFlagMessagesAndMoveToStandardFolder(quint64 action, const QMailMessageIdList& mailList, quint64 setMask, quint64 unsetMask)
{
- emit d->flagMessages(action, mailList, setMask, unsetMask);
+ emit d->onlineFlagMessagesAndMoveToStandardFolder(action, mailList, setMask, unsetMask);
}
/*!
Requests that the MessageServer add the messages in
\a filename to the message store.
+ The request has the identifier \a action.
+
\deprecated
*/
void QMailMessageServer::addMessages(quint64 action, const QString& filename)
@@ -754,6 +799,8 @@ void QMailMessageServer::addMessages(quint64 action, const QString& filename)
/*!
Requests that the MessageServer update the list of \a messages
in the message store, and ensure the durability of the content of \messages.
+
+ The request has the identifier \a action.
*/
void QMailMessageServer::addMessages(quint64 action, const QMailMessageMetaDataList& messages)
{
@@ -764,8 +811,9 @@ void QMailMessageServer::addMessages(quint64 action, const QMailMessageMetaDataL
Requests that the MessageServer update the messages in
\a filename to the message store.
- \deprecated
+ The request has the identifier \a action.
+ \deprecated
*/
void QMailMessageServer::updateMessages(quint64 action, const QString& filename)
{
@@ -775,6 +823,8 @@ void QMailMessageServer::updateMessages(quint64 action, const QString& filename)
/*!
Requests that the MessageServer add the list of \a messages
to the message store, and ensure the durability of the content of \messages..
+
+ The request has the identifier \a action.
*/
void QMailMessageServer::updateMessages(quint64 action, const QMailMessageMetaDataList& messages)
{
@@ -786,39 +836,52 @@ void QMailMessageServer::updateMessages(quint64 action, const QMailMessageMetaDa
/*!
Requests that the MessageServer create a new folder named \a name, created in the
account identified by \a accountId.
+
If \a parentId is a valid folder identifier the new folder will be a child of the parent;
otherwise the folder will be have no parent and will be created at the highest level.
The request has the identifier \a action.
- \sa deleteFolder()
+ This function requires the device to be online, it may initiate communication
+ with external servers.
+
+ \sa onlineDeleteFolder()
*/
-void QMailMessageServer::createFolder(quint64 action, const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId)
+void QMailMessageServer::onlineCreateFolder(quint64 action, const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId)
{
- emit d->createFolder(action, name, accountId, parentId);
+ emit d->onlineCreateFolder(action, name, accountId, parentId);
}
/*!
Requests that the MessageServer rename the folder identified by \a folderId to \a name.
The request has the identifier \a action.
- \sa createFolder()
+ The request has the identifier \a action.
+
+ This function requires the device to be online, it may initiate communication
+ with external servers.
+
+ \sa onlineCreateFolder()
*/
-void QMailMessageServer::renameFolder(quint64 action, const QMailFolderId &folderId, const QString &name)
+void QMailMessageServer::onlineRenameFolder(quint64 action, const QMailFolderId &folderId, const QString &name)
{
- emit d->renameFolder(action, folderId, name);
+ emit d->onlineRenameFolder(action, folderId, name);
}
/*!
Requests that the MessageServer delete the folder identified by \a folderId.
Any existing folders or messages contained by the folder will also be deleted.
+
The request has the identifier \a action.
- \sa createFolder(), renameFolder()
+ This function requires the device to be online, it may initiate communication
+ with external servers.
+
+ \sa onlineCreateFolder(), onlineRenameFolder()
*/
-void QMailMessageServer::deleteFolder(quint64 action, const QMailFolderId &folderId)
+void QMailMessageServer::onlineDeleteFolder(quint64 action, const QMailFolderId &folderId)
{
- emit d->deleteFolder(action, folderId);
+ emit d->onlineDeleteFolder(action, folderId);
}
/*!
@@ -834,6 +897,8 @@ void QMailMessageServer::cancelTransfer(quint64 action)
/*!
Requests that the MessageServer reset the counts of 'new' messages to zero, for
each message type listed in \a types.
+
+ \deprecated
\sa newCountChanged()
*/
@@ -844,21 +909,21 @@ void QMailMessageServer::acknowledgeNewMessages(const QMailMessageTypeList& type
/*!
Requests that the MessageServer delete the messages in \a mailList from the external
- server, if necessary for the relevant message type. If \a option is
+ server, if necessary for the relevant message type.
+
+ If \a option is
\l{QMailStore::CreateRemovalRecord}{CreateRemovalRecord} then a QMailMessageRemovalRecord
- will be created in the mail store for each deleted message.
+ will be created in the mail store for each deleted message. In this case
+ the function requires the device to be online, it may initiate communication
+ with external servers.
+
The request has the identifier \a action.
- Deleting messages using this slot does not initiate communication with any external
- server; instead the information needed to delete the messages is recorded. Deletion
- from the external server will occur when messages are next retrieved from that server.
- Invoking this slot does not remove a message from the mail store.
-
\sa QMailStore::removeMessage()
*/
-void QMailMessageServer::deleteMessages(quint64 action, const QMailMessageIdList& mailList, QMailStore::MessageRemovalOption option)
+void QMailMessageServer::onlineDeleteMessages(quint64 action, const QMailMessageIdList& mailList, QMailStore::MessageRemovalOption option)
{
- emit d->deleteMessages(action, mailList, option);
+ emit d->onlineDeleteMessages(action, mailList, option);
}
/*!
@@ -870,9 +935,12 @@ void QMailMessageServer::deleteMessages(quint64 action, const QMailMessageIdList
If \a sort is not empty, the external service will return matching messages in
the ordering indicated by the sort criterion if possible.
+ The identifiers of all matching messages are returned via matchingMessageIds() signals.
+
The request has the identifier \a action.
- The identifiers of all matching messages are returned via matchingMessageIds() signals.
+ If a remote search is specified then this function requires the device to be online,
+ it may initiate communication with external servers.
\sa matchingMessageIds(), messagesCount(), remainingMessagesCount()
*/
@@ -893,9 +961,12 @@ void QMailMessageServer::searchMessages(quint64 action, const QMailMessageKey& f
If \a sort is not empty, the external service will return matching messages in
the ordering indicated by the sort criterion if possible.
+ The identifiers of all matching messages are returned via matchingMessageIds() signals.
+
The request has the identifier \a action.
- The identifiers of all matching messages are returned via matchingMessageIds() signals.
+ If a remote search is specified then this function requires the device to be online,
+ it may initiate communication with external servers.
\sa matchingMessageIds(), messagesCount(), remainingMessagesCount()
*/
@@ -906,12 +977,15 @@ void QMailMessageServer::searchMessages(quint64 action, const QMailMessageKey& f
/*!
Requests that the MessageServer counts the number of messages that match the criteria
- specified by \a filter. If \a bodyText is non-empty, messages containing the specified text
- in their content will also be matched.
+ specified by \a filter by on the device and remote servers. If \a bodyText is non-empty,
+ messages containing the specified text in their content will also be matched.
+
+ The count of all matching messages is returned via a messagesCount() signal.
The request has the identifier \a action.
- The count of all matching messages is returned via a messagesCount() signal.
+ This function requires the device to be online, it may initiate communication
+ with external servers.
\sa messagesCount()
*/
diff --git a/src/libraries/qmfclient/qmailmessageserver.h b/src/libraries/qmfclient/qmailmessageserver.h
index e1eeac1e..32cfd7c8 100644
--- a/src/libraries/qmfclient/qmailmessageserver.h
+++ b/src/libraries/qmfclient/qmailmessageserver.h
@@ -133,21 +133,21 @@ public slots:
void synchronize(quint64, const QMailAccountId &accountId);
- void copyMessages(quint64, const QMailMessageIdList& mailList, const QMailFolderId &destinationId);
- void moveMessages(quint64, const QMailMessageIdList& mailList, const QMailFolderId &destinationId);
- void flagMessages(quint64, const QMailMessageIdList& mailList, quint64 setMask, quint64 unsetMask);
+ void onlineCopyMessages(quint64, const QMailMessageIdList& mailList, const QMailFolderId &destinationId);
+ void onlineMoveMessages(quint64, const QMailMessageIdList& mailList, const QMailFolderId &destinationId);
+ void onlineFlagMessagesAndMoveToStandardFolder(quint64, const QMailMessageIdList& mailList, quint64 setMask, quint64 unsetMask);
void addMessages(quint64, const QString &filename);
void addMessages(quint64, const QMailMessageMetaDataList &messages);
void updateMessages(quint64, const QString &filename);
void updateMessages(quint64, const QMailMessageMetaDataList &messages);
- void createFolder(quint64, const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId);
- void renameFolder(quint64, const QMailFolderId &folderId, const QString &name);
- void deleteFolder(quint64, const QMailFolderId &folderId);
+ void onlineCreateFolder(quint64, const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId);
+ void onlineRenameFolder(quint64, const QMailFolderId &folderId, const QString &name);
+ void onlineDeleteFolder(quint64, const QMailFolderId &folderId);
void cancelTransfer(quint64);
- void deleteMessages(quint64, const QMailMessageIdList& mailList, QMailStore::MessageRemovalOption);
+ void onlineDeleteMessages(quint64, const QMailMessageIdList& mailList, QMailStore::MessageRemovalOption);
void searchMessages(quint64, const QMailMessageKey& filter, const QString& bodyText, QMailSearchAction::SearchSpecification spec, const QMailMessageSortKey &sort);
void searchMessages(quint64, const QMailMessageKey& filter, const QString& bodyText, QMailSearchAction::SearchSpecification spec, quint64 limit, const QMailMessageSortKey &sort);
diff --git a/src/libraries/qmfclient/qmailserviceaction.cpp b/src/libraries/qmfclient/qmailserviceaction.cpp
index c46732ea..48054c4a 100644
--- a/src/libraries/qmfclient/qmailserviceaction.cpp
+++ b/src/libraries/qmfclient/qmailserviceaction.cpp
@@ -548,13 +548,16 @@ template void QMailServiceAction::Status::deserialize(QDataStream &);
A user may attempt to cancel an operation after it has been initiated. The cancelOperation()
slot is provided for this purpose.
- A QMailServiceAction instance supports only a single request at any time. An application
- may, however, use multiple QMailServiceAction instances to send independent requests concurrently.
- Each QMailServiceAction instance will report only the changes pertaining to the request
- that instance delivered. Whether or not concurrent requests are concurrently serviced by
- the message server depends on whether those requests must be serviced by the same
- QMailMessageService instance.
-
+ A QMailServiceAction instance supports only a single request at any time. Attempting
+ to initiate an operation on a QMailServiceAction instace while another operation is already
+ in progress for that action is not supported.
+
+ An application may however use multiple QMailServiceAction instances to send independent
+ requests concurrently. Each QMailServiceAction instance will report only the changes
+ pertaining to the request that instance delivered. Whether or not concurrent requests are
+ concurrently serviced by the messageserver depends on whether those requests must be
+ serviced by the same QMailMessageService instance.
+
\sa QMailMessageService
*/
@@ -806,7 +809,7 @@ void QMailRetrievalActionPrivate::synchronize(const QMailAccountId &accountId, u
{
Q_ASSERT(!_pendingActions.count());
newAction();
-
+
QMailRetrievalAction *exportAction = new QMailRetrievalAction();
QMailExportUpdatesCommand *exportCommand = new QMailExportUpdatesCommand(exportAction->impl(exportAction), accountId);
appendSubAction(exportAction, QSharedPointer<QMailServiceActionCommand>(exportCommand));
@@ -859,6 +862,19 @@ void QMailRetrievalActionPrivate::retrievalCompleted(quint64 action)
The exportUpdates() function allows a client to push local changes such as message-read notifications
and pending disconnected operations to the external server.
+
+ All of these functions require the device to be online, they may initiate communication
+ with external servers.
+
+ A QMailRetrievalAction instance supports only a single request at any time. Attempting
+ to initiate an operation on a QMailRetrievalAction instace while another operation is already
+ in progress for that action is not supported.
+
+ An application may however use multiple QMailRetrievalAction instances to send independent
+ requests concurrently. Each QMailServiceAction instance will report only the changes
+ pertaining to the request that instance delivered. Whether or not concurrent requests are
+ concurrently serviced by the messageserver depends on whether those requests must be
+ serviced by the same QMailMessageService instance.
*/
/*!
@@ -903,6 +919,9 @@ QMailRetrievalAction::~QMailRetrievalAction()
folder that is searched for child folders; these properties are not updated
for folders that are merely discovered by searching.
+ This function requires the device to be online, it may initiate communication
+ with external servers.
+
\sa retrieveMessageList(), retrieveMessageLists()
*/
void QMailRetrievalAction::retrieveFolderList(const QMailAccountId &accountId, const QMailFolderId &folderId, bool descending)
@@ -937,6 +956,9 @@ void QMailRetrievalAction::retrieveFolderList(const QMailAccountId &accountId, c
in the mail store but found to be no longer available are marked with the
\l QMailMessage::Removed status flag.
+ This function requires the device to be online, it may initiate communication
+ with external servers.
+
\sa QMailAccount::lastSynchronized()
*/
void QMailRetrievalAction::retrieveMessageList(const QMailAccountId &accountId, const QMailFolderId &folderId, uint minimum, const QMailMessageSortKey &sort)
@@ -971,6 +993,9 @@ void QMailRetrievalAction::retrieveMessageList(const QMailAccountId &accountId,
in the mail store but found to be no longer available are marked with the
\l QMailMessage::Removed status flag.
+ This function requires the device to be online, it may initiate communication
+ with external servers.
+
\sa QMailAccount::lastSynchronized()
*/
void QMailRetrievalAction::retrieveMessageLists(const QMailAccountId &accountId, const QMailFolderIdList &folderIds, uint minimum, const QMailMessageSortKey &sort)
@@ -1003,6 +1028,9 @@ void QMailRetrievalAction::retrieveMessageLists(const QMailAccountId &accountId,
The QMailFolder::serverCount(), QMailFolder::serverUnreadCount() and
QMailFolder::serverUndiscoveredCount() properties will be updated for each folder
from which messages are retrieved.
+
+ This function requires the device to be online, it may initiate communication
+ with external servers.
*/
void QMailRetrievalAction::retrieveMessages(const QMailMessageIdList &messageIds, RetrievalSpecification spec)
{
@@ -1016,6 +1044,9 @@ void QMailRetrievalAction::retrieveMessages(const QMailMessageIdList &messageIds
The QMailFolder::serverCount(), QMailFolder::serverUnreadCount() and
QMailFolder::serverUndiscoveredCount() properties will be updated for the folder
from which the part is retrieved.
+
+ This function requires the device to be online, it may initiate communication
+ with external servers.
*/
void QMailRetrievalAction::retrieveMessagePart(const QMailMessagePart::Location &partLocation)
{
@@ -1029,6 +1060,9 @@ void QMailRetrievalAction::retrieveMessagePart(const QMailMessagePart::Location
The QMailFolder::serverCount(), QMailFolder::serverUnreadCount() and
QMailFolder::serverUndiscoveredCount() properties will be updated for the folder
from which the message is retrieved.
+
+ This function requires the device to be online, it may initiate communication
+ with external servers.
*/
void QMailRetrievalAction::retrieveMessageRange(const QMailMessageId &messageId, uint minimum)
{
@@ -1046,6 +1080,9 @@ void QMailRetrievalAction::retrieveMessageRange(const QMailMessageId &messageId,
The QMailFolder::serverCount(), QMailFolder::serverUnreadCount() and
QMailFolder::serverUndiscoveredCount() properties will be updated for the folder
from which the part is retrieved.
+
+ This function requires the device to be online, it may initiate communication
+ with external servers.
*/
void QMailRetrievalAction::retrieveMessagePartRange(const QMailMessagePart::Location &partLocation, uint minimum)
{
@@ -1068,6 +1105,9 @@ void QMailRetrievalAction::retrieveMessagePartRange(const QMailMessagePart::Loca
marked with the \l QMailMessage::New status flag. Messages that are no longer
available will be marked with the \l QMailMessage::Removed status flag.
+ This function requires the device to be online, it may initiate communication
+ with external servers.
+
\sa retrieveFolderList(), retrieveMessageList(), retrieveMessageLists()
*/
void QMailRetrievalAction::retrieveAll(const QMailAccountId &accountId)
@@ -1083,6 +1123,9 @@ void QMailRetrievalAction::retrieveAll(const QMailAccountId &accountId)
using the \l QMailStore::CreateRemovalRecord option should be removed from the
external server, and any flag, copy or move operations that have been applied
using \l QMailDisconnected should be applied to the external server.
+
+ This function requires the device to be online, it may initiate communication
+ with external servers.
*/
void QMailRetrievalAction::exportUpdates(const QMailAccountId &accountId)
{
@@ -1118,6 +1161,9 @@ void QMailRetrievalAction::exportUpdates(const QMailAccountId &accountId)
the external server. The QMailFolder::serverCount(), QMailFolder::serverUnreadCount() and
QMailFolder::serverUndiscoveredCount() properties will be updated for each folder.
+ This function requires the device to be online, it may initiate communication
+ with external servers.
+
\sa retrieveFolderList(), retrieveMessageList(), retrieveMessageLists(), exportUpdates()
*/
void QMailRetrievalAction::synchronizeAll(const QMailAccountId &accountId)
@@ -1135,6 +1181,9 @@ void QMailRetrievalAction::synchronizeAll(const QMailAccountId &accountId)
On a successful synchronization the lastSynchronized() value of the account should be updated.
+ This function requires the device to be online, it may initiate communication
+ with external servers.
+
\sa exportUpdates(), retrieveMessageList(), retrieveFolderList(), QMailAccount::lastSynchronized()
*/
void QMailRetrievalAction::synchronize(const QMailAccountId &accountId, uint minimum)
@@ -1207,6 +1256,16 @@ void QMailTransmitActionPrivate::transmissionCompleted(quint64 action)
The send() slot requests that the message server transmit each identified message to the
external service associated with each messages' account.
+ A QMailTransmitAction instance supports only a single request at any time. Attempting
+ to initiate an operation on a QMailTransmitAction instace while another operation is already
+ in progress for that action is not supported.
+
+ An application may however use multiple QMailTransmitAction instances to send independent
+ requests concurrently. Each QMailServiceAction instance will report only the changes
+ pertaining to the request that instance delivered. Whether or not concurrent requests are
+ concurrently serviced by the messageserver depends on whether those requests must be
+ serviced by the same QMailMessageService instance.
+
Note: the slots exported by QMailTransmitAction are expected to change in future releases, as
the message server is extended to provide a finer-grained interface for message transmission.
*/
@@ -1253,6 +1312,9 @@ QMailTransmitAction::~QMailTransmitAction()
by \a accountId that is currently scheduled for transmission (located in the Outbox folder).
Any message successfully transmitted will be moved to the account's Sent folder.
+
+ This function requires the device to be online, it may initiate communication
+ with external servers.
*/
void QMailTransmitAction::transmitMessages(const QMailAccountId &accountId)
{
@@ -1281,47 +1343,47 @@ QMailStorageActionPrivate::QMailStorageActionPrivate(QMailStorageAction *i)
init();
}
-void QMailStorageActionPrivate::deleteMessagesHelper(const QMailMessageIdList &ids)
+void QMailStorageActionPrivate::onlineDeleteMessagesHelper(const QMailMessageIdList &ids)
{
- _server->deleteMessages(newAction(), ids, QMailStore::CreateRemovalRecord);
+ _server->onlineDeleteMessages(newAction(), ids, QMailStore::CreateRemovalRecord);
// Successful as long as ids have been deleted,
// this action doesn't have to be the one to have deleted them
_ids.clear();
emitChanges();
}
-void QMailStorageActionPrivate::deleteMessages(const QMailMessageIdList &ids)
+void QMailStorageActionPrivate::onlineDeleteMessages(const QMailMessageIdList &ids)
{
Q_ASSERT(!_pendingActions.count());
- deleteMessagesHelper(ids);
+ onlineDeleteMessagesHelper(ids);
}
void QMailStorageActionPrivate::discardMessages(const QMailMessageIdList &ids)
{
- _server->deleteMessages(newAction(), ids, QMailStore::NoRemovalRecord);
+ _server->onlineDeleteMessages(newAction(), ids, QMailStore::NoRemovalRecord);
_ids = ids;
emitChanges();
}
-void QMailStorageActionPrivate::copyMessages(const QMailMessageIdList &ids, const QMailFolderId &destination)
+void QMailStorageActionPrivate::onlineCopyMessages(const QMailMessageIdList &ids, const QMailFolderId &destination)
{
- _server->copyMessages(newAction(), ids, destination);
+ _server->onlineCopyMessages(newAction(), ids, destination);
_ids = ids;
emitChanges();
}
-void QMailStorageActionPrivate::moveMessages(const QMailMessageIdList &ids, const QMailFolderId &destination)
+void QMailStorageActionPrivate::onlineMoveMessages(const QMailMessageIdList &ids, const QMailFolderId &destination)
{
- _server->moveMessages(newAction(), ids, destination);
+ _server->onlineMoveMessages(newAction(), ids, destination);
_ids = ids;
emitChanges();
}
-void QMailStorageActionPrivate::flagMessages(const QMailMessageIdList &ids, quint64 setMask, quint64 unsetMask)
+void QMailStorageActionPrivate::onlineFlagMessagesAndMoveToStandardFolder(const QMailMessageIdList &ids, quint64 setMask, quint64 unsetMask)
{
// Ensure that nothing is both set and unset
setMask &= ~unsetMask;
- _server->flagMessages(newAction(), ids, setMask, unsetMask);
+ _server->onlineFlagMessagesAndMoveToStandardFolder(newAction(), ids, setMask, unsetMask);
_ids = ids;
emitChanges();
@@ -1454,28 +1516,28 @@ void QMailStorageActionPrivate::updateMessages(const QMailMessageMetaDataList &l
emitChanges();
}
-void QMailStorageActionPrivate::createFolder(const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId)
+void QMailStorageActionPrivate::onlineCreateFolder(const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId)
{
- _server->createFolder(newAction(), name, accountId, parentId);
+ _server->onlineCreateFolder(newAction(), name, accountId, parentId);
emitChanges();
}
-void QMailStorageActionPrivate::renameFolder(const QMailFolderId &folderId, const QString &name)
+void QMailStorageActionPrivate::onlineRenameFolder(const QMailFolderId &folderId, const QString &name)
{
- _server->renameFolder(newAction(), folderId, name);
+ _server->onlineRenameFolder(newAction(), folderId, name);
emitChanges();
}
-void QMailStorageActionPrivate::deleteFolderHelper(const QMailFolderId &folderId)
+void QMailStorageActionPrivate::onlineDeleteFolderHelper(const QMailFolderId &folderId)
{
- _server->deleteFolder(newAction(), folderId);
+ _server->onlineDeleteFolder(newAction(), folderId);
emitChanges();
}
-void QMailStorageActionPrivate::deleteFolder(const QMailFolderId &folderId)
+void QMailStorageActionPrivate::onlineDeleteFolder(const QMailFolderId &folderId)
{
Q_ASSERT(!_pendingActions.count());
- deleteFolderHelper(folderId);
+ onlineDeleteFolderHelper(folderId);
}
void QMailStorageActionPrivate::init()
@@ -1530,15 +1592,20 @@ void QMailStorageActionPrivate::storageActionCompleted(quint64 action)
server move or copy messages within an external message service. The storage action object
reports on the progress and outcome of its activities via the signals inherited from QMailServiceAction.
- The copyMessages() slot requests that the message server create a copy of each identified
- message in the nominated destination folder. The moveMessages() slot requests that the
+ The onlineCopyMessages() slot requests that the message server create a copy of each identified
+ message in the nominated destination folder. The onlineMoveMessages() slot requests that the
message server move each identified message from its current location to the nominated destination
folder. Messages cannot be moved or copied between accounts.
- A QMailServiceAction instance supports only a single request at a time. Attempting
- to initiate an operation on a QMailServiceAction while another operation is already
- in progress for that action is not supported. Instead clients should use multiple
- QMailServiceAction instances to initiate a queue of requests.
+ A QMailStorageAction instance supports only a single request at any time. Attempting
+ to initiate an operation on a QMailStorageAction instace while another operation is already
+ in progress for that action is not supported.
+
+ An application may however use multiple QMailStorageAction instances to send independent
+ requests concurrently. Each QMailServiceAction instance will report only the changes
+ pertaining to the request that instance delivered. Whether or not concurrent requests are
+ concurrently serviced by the messageserver depends on whether those requests must be
+ serviced by the same QMailMessageService instance.
*/
/*!
@@ -1563,10 +1630,12 @@ QMailStorageAction::~QMailStorageAction()
Requests that the message server delete the messages listed in \a ids, both from the local device
and the external message source. Whether the external messages resources are actually removed is
at the discretion of the relevant QMailMessageSource object.
+
+ This function requires the device to be online, it may initiate communication with external servers.
*/
-void QMailStorageAction::deleteMessages(const QMailMessageIdList &ids)
+void QMailStorageAction::onlineDeleteMessages(const QMailMessageIdList &ids)
{
- impl(this)->deleteMessages(ids);
+ impl(this)->onlineDeleteMessages(ids);
}
/*!
@@ -1580,19 +1649,23 @@ void QMailStorageAction::discardMessages(const QMailMessageIdList &ids)
/*!
Requests that the message server create a new copy of each message listed in \a ids within the folder
identified by \a destinationId.
+
+ This function requires the device to be online, it may initiate communication with external servers.
*/
-void QMailStorageAction::copyMessages(const QMailMessageIdList &ids, const QMailFolderId &destinationId)
+void QMailStorageAction::onlineCopyMessages(const QMailMessageIdList &ids, const QMailFolderId &destinationId)
{
- impl(this)->copyMessages(ids, destinationId);
+ impl(this)->onlineCopyMessages(ids, destinationId);
}
/*!
Requests that the message server move each message listed in \a ids from its current location
to the folder identified by \a destinationId.
+
+ This function requires the device to be online, it may initiate communication with external servers.
*/
-void QMailStorageAction::moveMessages(const QMailMessageIdList &ids, const QMailFolderId &destinationId)
+void QMailStorageAction::onlineMoveMessages(const QMailMessageIdList &ids, const QMailFolderId &destinationId)
{
- impl(this)->moveMessages(ids, destinationId);
+ impl(this)->onlineMoveMessages(ids, destinationId);
}
/*!
@@ -1603,11 +1676,13 @@ void QMailStorageAction::moveMessages(const QMailMessageIdList &ids, const QMail
The service implementing the account may choose to take further actions in response to flag
changes, such as moving or deleting messages.
+ This function requires the device to be online, it may initiate communication with external servers.
+
\sa QMailMessage::setStatus(), QMailStore::updateMessagesMetaData()
*/
-void QMailStorageAction::flagMessages(const QMailMessageIdList &ids, quint64 setMask, quint64 unsetMask)
+void QMailStorageAction::onlineFlagMessagesAndMoveToStandardFolder(const QMailMessageIdList &ids, quint64 setMask, quint64 unsetMask)
{
- impl(this)->flagMessages(ids, setMask, unsetMask);
+ impl(this)->onlineFlagMessagesAndMoveToStandardFolder(ids, setMask, unsetMask);
}
/*!
@@ -1676,32 +1751,38 @@ QMailMessageIdList QMailStorageAction::messagesUpdated() const
If \a parentId is a valid folder identifier the new folder will be a child of the parent;
otherwise the folder will be have no parent and will be created at the highest level.
- \sa deleteFolder()
+ This function requires the device to be online, it may initiate communication with external servers.
+
+ \sa onlineDeleteFolder()
*/
-void QMailStorageAction::createFolder(const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId)
+void QMailStorageAction::onlineCreateFolder(const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId)
{
- impl(this)->createFolder(name, accountId, parentId);
+ impl(this)->onlineCreateFolder(name, accountId, parentId);
}
/*!
Requests that the message server rename the folder identified by \a folderId to \a name.
- \sa createFolder()
+ This function requires the device to be online, it may initiate communication with external servers.
+
+ \sa onlineCreateFolder()
*/
-void QMailStorageAction::renameFolder(const QMailFolderId &folderId, const QString &name)
+void QMailStorageAction::onlineRenameFolder(const QMailFolderId &folderId, const QString &name)
{
- impl(this)->renameFolder(folderId, name);
+ impl(this)->onlineRenameFolder(folderId, name);
}
/*!
Requests that the message server delete the folder identified by \a folderId.
Any existing folders or messages contained by the folder will also be deleted.
- \sa createFolder(), renameFolder()
+ This function requires the device to be online, it may initiate communication with external servers.
+
+ \sa onlineCreateFolder(), onlineRenameFolder()
*/
-void QMailStorageAction::deleteFolder(const QMailFolderId &folderId)
+void QMailStorageAction::onlineDeleteFolder(const QMailFolderId &folderId)
{
- impl(this)->deleteFolder(folderId);
+ impl(this)->onlineDeleteFolder(folderId);
}
@@ -1816,6 +1897,16 @@ void QMailSearchActionPrivate::finaliseSearch()
meta data. For a textual content criterion, the message server will search locally where
the message content is held locally, and on the external server for messages whose content
has not been retrieved (provided the external service provides a search facility).
+
+ A QMailSearchAction instance supports only a single request at any time. Attempting
+ to initiate an operation on a QMailSearchAction instace while another operation is already
+ in progress for that action is not supported.
+
+ An application may however use multiple QMailSearchAction instances to send independent
+ requests concurrently. Each QMailServiceAction instance will report only the changes
+ pertaining to the request that instance delivered. Whether or not concurrent requests are
+ concurrently serviced by the messageserver depends on whether those requests must be
+ serviced by the same QMailMessageService instance.
*/
/*!
@@ -1853,8 +1944,9 @@ QMailSearchAction::~QMailSearchAction()
specified by \a filter. If \a bodyText is non-empty then messages that
contain the supplied text in their content will also be identified.
- If \a spec is \l{QMailSearchAction::Remote}{Remote}, then the external service
- will be requested to perform the search for messages not stored locally.
+ If \a spec is \l{QMailSearchAction::Remote}{Remote}, then the device must be,
+ online and an external service will be requested to perform the search for
+ messages not stored locally.
If \a sort is not empty, the external service will return matching messages in
the ordering indicated by the sort criterion if possible.
@@ -1869,8 +1961,9 @@ void QMailSearchAction::searchMessages(const QMailMessageKey &filter, const QStr
specified by \a filter. If \a bodyText is non-empty then messages that
contain the supplied text in their content will also be identified.
- If \a spec is \l{QMailSearchAction::Remote}{Remote}, then the external service
- will be requested to perform the search for messages not stored locally.
+ If \a spec is \l{QMailSearchAction::Remote}{Remote}, then the device must be,
+ online and an external service will be requested to perform the search for
+ messages not stored locally.
A maximum of \a limit messages will be retrieved from the remote server.
@@ -1884,8 +1977,12 @@ void QMailSearchAction::searchMessages(const QMailMessageKey &filter, const QStr
/*!
Requests that the message server count all messages that match the criteria
- specified by \a filter. If \a bodyText is non-empty then messages that
- contain the supplied text in their content will also be matched and counted.
+ specified by \a filter, both local and on remote servers. If \a bodyText
+ is non-empty then messages that contain the supplied text in their content
+ will also be matched and counted.
+
+ This function requires the device to be online, it may initiate communication
+ with external servers.
*/
void QMailSearchAction::countMessages(const QMailMessageKey &filter, const QString &bodyText)
{
diff --git a/src/libraries/qmfclient/qmailserviceaction.h b/src/libraries/qmfclient/qmailserviceaction.h
index 9cb08973..d54ee995 100644
--- a/src/libraries/qmfclient/qmailserviceaction.h
+++ b/src/libraries/qmfclient/qmailserviceaction.h
@@ -233,20 +233,20 @@ public:
QMailMessageIdList messagesUpdated() const;
public slots:
- void deleteMessages(const QMailMessageIdList &ids);
+ void onlineDeleteMessages(const QMailMessageIdList &ids);
void discardMessages(const QMailMessageIdList &ids);
- void copyMessages(const QMailMessageIdList &ids, const QMailFolderId &destinationId);
- void moveMessages(const QMailMessageIdList &ids, const QMailFolderId &destinationId);
+ void onlineCopyMessages(const QMailMessageIdList &ids, const QMailFolderId &destinationId);
+ void onlineMoveMessages(const QMailMessageIdList &ids, const QMailFolderId &destinationId);
- void flagMessages(const QMailMessageIdList &ids, quint64 setMask, quint64 unsetMask);
+ void onlineFlagMessagesAndMoveToStandardFolder(const QMailMessageIdList &ids, quint64 setMask, quint64 unsetMask);
void addMessages(const QMailMessageList &list);
void updateMessages(const QMailMessageList &list);
void updateMessages(const QMailMessageMetaDataList &list);
- void createFolder(const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId);
- void renameFolder(const QMailFolderId &folderId, const QString &name);
- void deleteFolder(const QMailFolderId &folderId);
+ void onlineCreateFolder(const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId);
+ void onlineRenameFolder(const QMailFolderId &folderId, const QString &name);
+ void onlineDeleteFolder(const QMailFolderId &folderId);
};
diff --git a/src/libraries/qmfclient/qmailserviceaction_p.h b/src/libraries/qmfclient/qmailserviceaction_p.h
index 6b1d6ef8..1bee0afd 100644
--- a/src/libraries/qmfclient/qmailserviceaction_p.h
+++ b/src/libraries/qmfclient/qmailserviceaction_p.h
@@ -251,21 +251,21 @@ class QMailStorageActionPrivate : public QMailServiceActionPrivate
public:
QMailStorageActionPrivate(QMailStorageAction *i);
- void deleteMessages(const QMailMessageIdList &ids);
- void deleteMessagesHelper(const QMailMessageIdList &ids);
+ void onlineDeleteMessages(const QMailMessageIdList &ids);
+ void onlineDeleteMessagesHelper(const QMailMessageIdList &ids);
void discardMessages(const QMailMessageIdList &ids);
- void copyMessages(const QMailMessageIdList &ids, const QMailFolderId &destination);
- void moveMessages(const QMailMessageIdList &ids, const QMailFolderId &destination);
- void flagMessages(const QMailMessageIdList &ids, quint64 setMask, quint64 unsetMask);
+ void onlineCopyMessages(const QMailMessageIdList &ids, const QMailFolderId &destination);
+ void onlineMoveMessages(const QMailMessageIdList &ids, const QMailFolderId &destination);
+ void onlineFlagMessagesAndMoveToStandardFolder(const QMailMessageIdList &ids, quint64 setMask, quint64 unsetMask);
void addMessages(const QMailMessageList &list);
void updateMessages(const QMailMessageList &list);
void updateMessages(const QMailMessageMetaDataList &list);
- void createFolder(const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId);
- void renameFolder(const QMailFolderId &id, const QString &name);
- void deleteFolder(const QMailFolderId &id);
- void deleteFolderHelper(const QMailFolderId &id);
+ void onlineCreateFolder(const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId);
+ void onlineRenameFolder(const QMailFolderId &id, const QString &name);
+ void onlineDeleteFolder(const QMailFolderId &id);
+ void onlineDeleteFolderHelper(const QMailFolderId &id);
protected:
virtual void init();
@@ -287,7 +287,7 @@ class QMailDeleteFolderCommand : public QMailServiceActionCommand
{
public:
QMailDeleteFolderCommand(QMailStorageActionPrivate *action, const QMailFolderId &folderId) :_action(action), _folderId(folderId) {};
- void execute() { _action->deleteFolderHelper(_folderId); }
+ void execute() { _action->onlineDeleteFolderHelper(_folderId); }
private:
QMailStorageActionPrivate *_action;
QMailFolderId _folderId;
@@ -298,7 +298,7 @@ class QMailMoveCommand : public QMailServiceActionCommand
public:
QMailMoveCommand(QMailStorageActionPrivate *action, const QMailMessageIdList &ids, const QMailFolderId &destinationId)
:_action(action), _ids(ids), _folderId(destinationId) {};
- void execute() { _action->moveMessages(_ids, _folderId); }
+ void execute() { _action->onlineMoveMessages(_ids, _folderId); }
private:
QMailStorageActionPrivate *_action;
QMailMessageIdList _ids;
@@ -309,7 +309,7 @@ class QMailDeleteMessagesCommand : public QMailServiceActionCommand
{
public:
QMailDeleteMessagesCommand(QMailStorageActionPrivate *action, const QMailMessageIdList &ids) :_action(action), _ids(ids) {};
- void execute() { _action->deleteMessagesHelper(_ids); }
+ void execute() { _action->onlineDeleteMessagesHelper(_ids); }
private:
QMailStorageActionPrivate *_action;
QMailMessageIdList _ids;
diff --git a/src/tools/messageserver/mailmessageclient.cpp b/src/tools/messageserver/mailmessageclient.cpp
index b81f75dd..258e9b2e 100644
--- a/src/tools/messageserver/mailmessageclient.cpp
+++ b/src/tools/messageserver/mailmessageclient.cpp
@@ -128,14 +128,14 @@ MailMessageClient::MailMessageClient(QObject* parent)
this, SIGNAL(exportUpdates(quint64, QMailAccountId)));
connectIpc(adaptor, MESSAGE(synchronize(quint64, QMailAccountId)),
this, SIGNAL(synchronize(quint64, QMailAccountId)));
- connectIpc(adaptor, MESSAGE(deleteMessages(quint64, QMailMessageIdList, QMailStore::MessageRemovalOption)),
- this, SIGNAL(deleteMessages(quint64, QMailMessageIdList, QMailStore::MessageRemovalOption)));
- connectIpc(adaptor, MESSAGE(copyMessages(quint64, QMailMessageIdList, QMailFolderId)),
- this, SIGNAL(copyMessages(quint64, QMailMessageIdList, QMailFolderId)));
- connectIpc(adaptor, MESSAGE(moveMessages(quint64, QMailMessageIdList, QMailFolderId)),
- this, SIGNAL(moveMessages(quint64, QMailMessageIdList, QMailFolderId)));
- connectIpc(adaptor, MESSAGE(flagMessages(quint64, QMailMessageIdList, quint64, quint64)),
- this, SIGNAL(flagMessages(quint64, QMailMessageIdList, quint64, quint64)));
+ connectIpc(adaptor, MESSAGE(onlineDeleteMessages(quint64, QMailMessageIdList, QMailStore::MessageRemovalOption)),
+ this, SIGNAL(onlineDeleteMessages(quint64, QMailMessageIdList, QMailStore::MessageRemovalOption)));
+ connectIpc(adaptor, MESSAGE(onlineCopyMessages(quint64, QMailMessageIdList, QMailFolderId)),
+ this, SIGNAL(onlineCopyMessages(quint64, QMailMessageIdList, QMailFolderId)));
+ connectIpc(adaptor, MESSAGE(onlineMoveMessages(quint64, QMailMessageIdList, QMailFolderId)),
+ this, SIGNAL(onlineMoveMessages(quint64, QMailMessageIdList, QMailFolderId)));
+ connectIpc(adaptor, MESSAGE(onlineFlagMessagesAndMoveToStandardFolder(quint64, QMailMessageIdList, quint64, quint64)),
+ this, SIGNAL(onlineFlagMessagesAndMoveToStandardFolder(quint64, QMailMessageIdList, quint64, quint64)));
connectIpc(adaptor, MESSAGE(addMessages(quint64,QString)),
this, SIGNAL(addMessages(quint64, QString)));
connectIpc(adaptor, MESSAGE(addMessages(quint64,QMailMessageMetaDataList)),
@@ -144,12 +144,12 @@ MailMessageClient::MailMessageClient(QObject* parent)
this, SIGNAL(updateMessages(quint64, QString)));
connectIpc(adaptor, MESSAGE(updateMessages(quint64,QMailMessageMetaDataList)),
this, SIGNAL(updateMessages(quint64, QMailMessageMetaDataList)));
- connectIpc(adaptor, MESSAGE(createFolder(quint64, QString, QMailAccountId, QMailFolderId)),
- this, SIGNAL(createFolder(quint64,QString,QMailAccountId,QMailFolderId)));
- connectIpc(adaptor, MESSAGE(renameFolder(quint64, QMailFolderId, QString)),
- this, SIGNAL(renameFolder(quint64,QMailFolderId,QString)));
- connectIpc(adaptor, MESSAGE(deleteFolder(quint64, QMailFolderId)),
- this, SIGNAL(deleteFolder(quint64,QMailFolderId)));
+ connectIpc(adaptor, MESSAGE(onlineCreateFolder(quint64, QString, QMailAccountId, QMailFolderId)),
+ this, SIGNAL(onlineCreateFolder(quint64,QString,QMailAccountId,QMailFolderId)));
+ connectIpc(adaptor, MESSAGE(onlineRenameFolder(quint64, QMailFolderId, QString)),
+ this, SIGNAL(onlineRenameFolder(quint64,QMailFolderId,QString)));
+ connectIpc(adaptor, MESSAGE(onlineDeleteFolder(quint64, QMailFolderId)),
+ this, SIGNAL(onlineDeleteFolder(quint64,QMailFolderId)));
connectIpc(adaptor, MESSAGE(cancelTransfer(quint64)),
this, SIGNAL(cancelTransfer(quint64)));
connectIpc(adaptor, MESSAGE(cancelSearch(quint64)),
diff --git a/src/tools/messageserver/mailmessageclient.h b/src/tools/messageserver/mailmessageclient.h
index 72fdf56f..2a9ba81c 100644
--- a/src/tools/messageserver/mailmessageclient.h
+++ b/src/tools/messageserver/mailmessageclient.h
@@ -84,19 +84,19 @@ signals:
void synchronize(quint64, const QMailAccountId &accountId);
- void deleteMessages(quint64, const QMailMessageIdList&, QMailStore::MessageRemovalOption);
+ void onlineDeleteMessages(quint64, const QMailMessageIdList&, QMailStore::MessageRemovalOption);
- void copyMessages(quint64, const QMailMessageIdList&, const QMailFolderId&);
- void moveMessages(quint64, const QMailMessageIdList&, const QMailFolderId&);
- void flagMessages(quint64, const QMailMessageIdList&, quint64 setMask, quint64 unsetMask);
+ void onlineCopyMessages(quint64, const QMailMessageIdList&, const QMailFolderId&);
+ void onlineMoveMessages(quint64, const QMailMessageIdList&, const QMailFolderId&);
+ void onlineFlagMessagesAndMoveToStandardFolder(quint64, const QMailMessageIdList&, quint64 setMask, quint64 unsetMask);
void addMessages(quint64, const QString &filename);
void addMessages(quint64, const QMailMessageMetaDataList &metadata);
void updateMessages(quint64, const QString &filename);
void updateMessages(quint64, const QMailMessageMetaDataList &metadata);
- void createFolder(quint64, const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId);
- void renameFolder(quint64, const QMailFolderId &folderId, const QString &name);
- void deleteFolder(quint64, const QMailFolderId &folderId);
+ void onlineCreateFolder(quint64, const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId);
+ void onlineRenameFolder(quint64, const QMailFolderId &folderId, const QString &name);
+ void onlineDeleteFolder(quint64, const QMailFolderId &folderId);
void cancelTransfer(quint64);
diff --git a/src/tools/messageserver/messageserver.cpp b/src/tools/messageserver/messageserver.cpp
index 16cf63f0..4c868579 100644
--- a/src/tools/messageserver/messageserver.cpp
+++ b/src/tools/messageserver/messageserver.cpp
@@ -185,14 +185,14 @@ MessageServer::MessageServer(QObject *parent)
handler, SLOT(exportUpdates(quint64, QMailAccountId)));
connect(client, SIGNAL(synchronize(quint64, QMailAccountId)),
handler, SLOT(synchronize(quint64, QMailAccountId)));
- connect(client, SIGNAL(deleteMessages(quint64, QMailMessageIdList, QMailStore::MessageRemovalOption)),
- handler, SLOT(deleteMessages(quint64, QMailMessageIdList, QMailStore::MessageRemovalOption)));
- connect(client, SIGNAL(copyMessages(quint64, QMailMessageIdList, QMailFolderId)),
- handler, SLOT(copyMessages(quint64, QMailMessageIdList, QMailFolderId)));
- connect(client, SIGNAL(moveMessages(quint64, QMailMessageIdList, QMailFolderId)),
- handler, SLOT(moveMessages(quint64, QMailMessageIdList, QMailFolderId)));
- connect(client, SIGNAL(flagMessages(quint64, QMailMessageIdList, quint64, quint64)),
- handler, SLOT(flagMessages(quint64, QMailMessageIdList, quint64, quint64)));
+ connect(client, SIGNAL(onlineDeleteMessages(quint64, QMailMessageIdList, QMailStore::MessageRemovalOption)),
+ handler, SLOT(onlineDeleteMessages(quint64, QMailMessageIdList, QMailStore::MessageRemovalOption)));
+ connect(client, SIGNAL(onlineCopyMessages(quint64, QMailMessageIdList, QMailFolderId)),
+ handler, SLOT(onlineCopyMessages(quint64, QMailMessageIdList, QMailFolderId)));
+ connect(client, SIGNAL(onlineMoveMessages(quint64, QMailMessageIdList, QMailFolderId)),
+ handler, SLOT(onlineMoveMessages(quint64, QMailMessageIdList, QMailFolderId)));
+ connect(client, SIGNAL(onlineFlagMessagesAndMoveToStandardFolder(quint64, QMailMessageIdList, quint64, quint64)),
+ handler, SLOT(onlineFlagMessagesAndMoveToStandardFolder(quint64, QMailMessageIdList, quint64, quint64)));
connect(client, SIGNAL(addMessages(quint64, QString)),
handler, SLOT(addMessages(quint64, QString)));
connect(client, SIGNAL(updateMessages(quint64, QString)),
@@ -201,12 +201,12 @@ MessageServer::MessageServer(QObject *parent)
handler, SLOT(addMessages(quint64, QMailMessageMetaDataList)));
connect(client, SIGNAL(updateMessages(quint64, QMailMessageMetaDataList)),
handler, SLOT(updateMessages(quint64, QMailMessageMetaDataList)));
- connect(client, SIGNAL(createFolder(quint64, QString, QMailAccountId, QMailFolderId)),
- handler, SLOT(createFolder(quint64, QString, QMailAccountId, QMailFolderId)));
- connect(client, SIGNAL(renameFolder(quint64, QMailFolderId, QString)),
- handler, SLOT(renameFolder(quint64, QMailFolderId, QString)));
- connect(client, SIGNAL(deleteFolder(quint64, QMailFolderId)),
- handler, SLOT(deleteFolder(quint64, QMailFolderId)));
+ connect(client, SIGNAL(onlineCreateFolder(quint64, QString, QMailAccountId, QMailFolderId)),
+ handler, SLOT(onlineCreateFolder(quint64, QString, QMailAccountId, QMailFolderId)));
+ connect(client, SIGNAL(onlineRenameFolder(quint64, QMailFolderId, QString)),
+ handler, SLOT(onlineRenameFolder(quint64, QMailFolderId, QString)));
+ connect(client, SIGNAL(onlineDeleteFolder(quint64, QMailFolderId)),
+ handler, SLOT(onlineDeleteFolder(quint64, QMailFolderId)));
connect(client, SIGNAL(cancelTransfer(quint64)),
handler, SLOT(cancelTransfer(quint64)));
connect(client, SIGNAL(protocolRequest(quint64, QMailAccountId, QString, QVariant)),
diff --git a/src/tools/messageserver/servicehandler.cpp b/src/tools/messageserver/servicehandler.cpp
index 2b1fc5be..08756eb7 100644
--- a/src/tools/messageserver/servicehandler.cpp
+++ b/src/tools/messageserver/servicehandler.cpp
@@ -1735,7 +1735,7 @@ bool ServiceHandler::dispatchSynchronize(quint64 action, const QByteArray &data)
return true;
}
-void ServiceHandler::deleteMessages(quint64 action, const QMailMessageIdList& messageIds, QMailStore::MessageRemovalOption option)
+void ServiceHandler::onlineDeleteMessages(quint64 action, const QMailMessageIdList& messageIds, QMailStore::MessageRemovalOption option)
{
QSet<QMailMessageService*> sources;
@@ -1749,7 +1749,7 @@ void ServiceHandler::deleteMessages(quint64 action, const QMailMessageIdList& me
reportFailure(action, QMailServiceAction::Status::ErrNoConnection, tr("Unable to delete messages for unconfigured account"));
} else {
QString description(tr("Deleting messages"));
- enqueueRequest(action, serialize(messageLists), sources, &ServiceHandler::dispatchDeleteMessages, &ServiceHandler::storageActionCompleted, DeleteMessagesRequestType);
+ enqueueRequest(action, serialize(messageLists), sources, &ServiceHandler::dispatchOnlineDeleteMessages, &ServiceHandler::storageActionCompleted, DeleteMessagesRequestType);
}
}
}
@@ -1780,7 +1780,7 @@ bool ServiceHandler::dispatchDiscardMessages(quint64 action, const QByteArray &d
return true;
}
-bool ServiceHandler::dispatchDeleteMessages(quint64 action, const QByteArray &data)
+bool ServiceHandler::dispatchOnlineDeleteMessages(quint64 action, const QByteArray &data)
{
QMap<QMailAccountId, QMailMessageIdList> messageLists;
@@ -1806,7 +1806,7 @@ bool ServiceHandler::dispatchDeleteMessages(quint64 action, const QByteArray &da
return true;
}
-void ServiceHandler::copyMessages(quint64 action, const QMailMessageIdList& messageIds, const QMailFolderId &destination)
+void ServiceHandler::onlineCopyMessages(quint64 action, const QMailMessageIdList& messageIds, const QMailFolderId &destination)
{
QSet<QMailAccountId> accountIds(folderAccount(destination));
@@ -1821,12 +1821,12 @@ void ServiceHandler::copyMessages(quint64 action, const QMailMessageIdList& mess
} else if (sources.count() > 1) {
reportFailure(action, QMailServiceAction::Status::ErrFrameworkFault, tr("Unable to copy messages to multiple destination accounts!"));
} else {
- enqueueRequest(action, serialize(messageIds, destination), sources, &ServiceHandler::dispatchCopyMessages, &ServiceHandler::storageActionCompleted, CopyMessagesRequestType);
+ enqueueRequest(action, serialize(messageIds, destination), sources, &ServiceHandler::dispatchOnlineCopyMessages, &ServiceHandler::storageActionCompleted, CopyMessagesRequestType);
}
}
}
-bool ServiceHandler::dispatchCopyMessages(quint64 action, const QByteArray &data)
+bool ServiceHandler::dispatchOnlineCopyMessages(quint64 action, const QByteArray &data)
{
QMailMessageIdList messageIds;
QMailFolderId destination;
@@ -1897,7 +1897,7 @@ bool ServiceHandler::dispatchCopyToLocal(quint64 action, const QByteArray &data)
return true;
}
-void ServiceHandler::moveMessages(quint64 action, const QMailMessageIdList& messageIds, const QMailFolderId &destination)
+void ServiceHandler::onlineMoveMessages(quint64 action, const QMailMessageIdList& messageIds, const QMailFolderId &destination)
{
QSet<QMailMessageService*> sources;
@@ -1906,11 +1906,11 @@ void ServiceHandler::moveMessages(quint64 action, const QMailMessageIdList& mess
if (sources.isEmpty()) {
reportFailure(action, QMailServiceAction::Status::ErrNoConnection, tr("Unable to move messages for unconfigured account"));
} else {
- enqueueRequest(action, serialize(messageLists, destination), sources, &ServiceHandler::dispatchMoveMessages, &ServiceHandler::storageActionCompleted, MoveMessagesRequestType);
+ enqueueRequest(action, serialize(messageLists, destination), sources, &ServiceHandler::dispatchOnlineMoveMessages, &ServiceHandler::storageActionCompleted, MoveMessagesRequestType);
}
}
-bool ServiceHandler::dispatchMoveMessages(quint64 action, const QByteArray &data)
+bool ServiceHandler::dispatchOnlineMoveMessages(quint64 action, const QByteArray &data)
{
QMap<QMailAccountId, QMailMessageIdList> messageLists;
QMailFolderId destination;
@@ -1938,7 +1938,7 @@ bool ServiceHandler::dispatchMoveMessages(quint64 action, const QByteArray &data
return true;
}
-void ServiceHandler::flagMessages(quint64 action, const QMailMessageIdList& messageIds, quint64 setMask, quint64 unsetMask)
+void ServiceHandler::onlineFlagMessagesAndMoveToStandardFolder(quint64 action, const QMailMessageIdList& messageIds, quint64 setMask, quint64 unsetMask)
{
QSet<QMailMessageService*> sources;
@@ -1947,7 +1947,7 @@ void ServiceHandler::flagMessages(quint64 action, const QMailMessageIdList& mess
if (sources.isEmpty()) {
reportFailure(action, QMailServiceAction::Status::ErrNoConnection, tr("Unable to flag messages for unconfigured account"));
} else {
- enqueueRequest(action, serialize(messageLists, setMask, unsetMask), sources, &ServiceHandler::dispatchFlagMessages, &ServiceHandler::storageActionCompleted, FlagMessagesRequestType);
+ enqueueRequest(action, serialize(messageLists, setMask, unsetMask), sources, &ServiceHandler::dispatchOnlineFlagMessagesAndMoveToStandardFolder, &ServiceHandler::storageActionCompleted, FlagMessagesRequestType);
}
}
@@ -2110,7 +2110,7 @@ void ServiceHandler::updateMessages(quint64 action, const QMailMessageMetaDataLi
emit storageActionCompleted(action);
}
-bool ServiceHandler::dispatchFlagMessages(quint64 action, const QByteArray &data)
+bool ServiceHandler::dispatchOnlineFlagMessagesAndMoveToStandardFolder(quint64 action, const QByteArray &data)
{
QMap<QMailAccountId, QMailMessageIdList> messageLists;
quint64 setMask;
@@ -2140,19 +2140,19 @@ bool ServiceHandler::dispatchFlagMessages(quint64 action, const QByteArray &data
return true;
}
-void ServiceHandler::createFolder(quint64 action, const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId)
+void ServiceHandler::onlineCreateFolder(quint64 action, const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId)
{
if(accountId.isValid()) {
QSet<QMailAccountId> accounts = folderAccount(parentId);
QSet<QMailMessageService *> sources(sourceServiceSet(accounts));
- enqueueRequest(action, serialize(name, accountId, parentId), sources, &ServiceHandler::dispatchCreateFolder, &ServiceHandler::storageActionCompleted, CreateFolderRequestType);
+ enqueueRequest(action, serialize(name, accountId, parentId), sources, &ServiceHandler::dispatchOnlineCreateFolder, &ServiceHandler::storageActionCompleted, CreateFolderRequestType);
} else {
reportFailure(action, QMailServiceAction::Status::ErrInvalidData, tr("Unable to create folder for invalid account"));
}
}
-bool ServiceHandler::dispatchCreateFolder(quint64 action, const QByteArray &data)
+bool ServiceHandler::dispatchOnlineCreateFolder(quint64 action, const QByteArray &data)
{
QString name;
QMailAccountId accountId;
@@ -2177,19 +2177,19 @@ bool ServiceHandler::dispatchCreateFolder(quint64 action, const QByteArray &data
}
}
-void ServiceHandler::renameFolder(quint64 action, const QMailFolderId &folderId, const QString &name)
+void ServiceHandler::onlineRenameFolder(quint64 action, const QMailFolderId &folderId, const QString &name)
{
if(folderId.isValid()) {
QSet<QMailAccountId> accounts = folderAccount(folderId);
QSet<QMailMessageService *> sources(sourceServiceSet(accounts));
- enqueueRequest(action, serialize(folderId, name), sources, &ServiceHandler::dispatchRenameFolder, &ServiceHandler::storageActionCompleted, RenameFolderRequestType);
+ enqueueRequest(action, serialize(folderId, name), sources, &ServiceHandler::dispatchOnlineRenameFolder, &ServiceHandler::storageActionCompleted, RenameFolderRequestType);
} else {
reportFailure(action, QMailServiceAction::Status::ErrInvalidData, tr("Unable to rename invalid folder"));
}
}
-bool ServiceHandler::dispatchRenameFolder(quint64 action, const QByteArray &data)
+bool ServiceHandler::dispatchOnlineRenameFolder(quint64 action, const QByteArray &data)
{
QMailFolderId folderId;
QString newFolderName;
@@ -2213,19 +2213,19 @@ bool ServiceHandler::dispatchRenameFolder(quint64 action, const QByteArray &data
}
}
-void ServiceHandler::deleteFolder(quint64 action, const QMailFolderId &folderId)
+void ServiceHandler::onlineDeleteFolder(quint64 action, const QMailFolderId &folderId)
{
if(folderId.isValid()) {
QSet<QMailAccountId> accounts = folderAccount(folderId);
QSet<QMailMessageService *> sources(sourceServiceSet(accounts));
- enqueueRequest(action, serialize(folderId), sources, &ServiceHandler::dispatchDeleteFolder, &ServiceHandler::storageActionCompleted, DeleteFolderRequestType);
+ enqueueRequest(action, serialize(folderId), sources, &ServiceHandler::dispatchOnlineDeleteFolder, &ServiceHandler::storageActionCompleted, DeleteFolderRequestType);
} else {
reportFailure(action, QMailServiceAction::Status::ErrInvalidData, tr("Unable to delete invalid folder"));
}
}
-bool ServiceHandler::dispatchDeleteFolder(quint64 action, const QByteArray &data)
+bool ServiceHandler::dispatchOnlineDeleteFolder(quint64 action, const QByteArray &data)
{
QMailFolderId folderId;
@@ -2438,7 +2438,7 @@ void ServiceHandler::actionCompleted(bool success, QMailMessageService *service,
enqueueRequest(newLocalActionId(),
serialize(groupedMessages, setMask, unsetMask),
sourceServiceSet(service->accountId()),
- &ServiceHandler::dispatchFlagMessages,
+ &ServiceHandler::dispatchOnlineFlagMessagesAndMoveToStandardFolder,
&ServiceHandler::storageActionCompleted,
FlagMessagesRequestType);
}
diff --git a/src/tools/messageserver/servicehandler.h b/src/tools/messageserver/servicehandler.h
index ad1648d8..ab87e2e9 100644
--- a/src/tools/messageserver/servicehandler.h
+++ b/src/tools/messageserver/servicehandler.h
@@ -77,17 +77,17 @@ public slots:
void retrieveAll(quint64, const QMailAccountId &accountId);
void exportUpdates(quint64, const QMailAccountId &accountId);
void synchronize(quint64, const QMailAccountId &accountId);
- void deleteMessages(quint64 action, const QMailMessageIdList& mailList, QMailStore::MessageRemovalOption);
- void copyMessages(quint64 action, const QMailMessageIdList& mailList, const QMailFolderId &destination);
- void moveMessages(quint64 action, const QMailMessageIdList& mailList, const QMailFolderId &destination);
- void flagMessages(quint64 action, const QMailMessageIdList& mailList, quint64 setMask, quint64 unsetMask);
+ void onlineDeleteMessages(quint64 action, const QMailMessageIdList& mailList, QMailStore::MessageRemovalOption);
+ void onlineCopyMessages(quint64 action, const QMailMessageIdList& mailList, const QMailFolderId &destination);
+ void onlineMoveMessages(quint64 action, const QMailMessageIdList& mailList, const QMailFolderId &destination);
+ void onlineFlagMessagesAndMoveToStandardFolder(quint64 action, const QMailMessageIdList& mailList, quint64 setMask, quint64 unsetMask);
void addMessages(quint64 action, const QString &filename);
void addMessages(quint64 action, const QMailMessageMetaDataList &messages);
void updateMessages(quint64 action, const QString &filename);
void updateMessages(quint64 action, const QMailMessageMetaDataList &messages);
- void createFolder(quint64 action, const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId);
- void renameFolder(quint64 action, const QMailFolderId &folderId, const QString &name);
- void deleteFolder(quint64 action, const QMailFolderId &folderId);
+ void onlineCreateFolder(quint64 action, const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId);
+ void onlineRenameFolder(quint64 action, const QMailFolderId &folderId, const QString &name);
+ void onlineDeleteFolder(quint64 action, const QMailFolderId &folderId);
void cancelTransfer(quint64 action);
void searchMessages(quint64 action, const QMailMessageKey &filter, const QString &bodyText, QMailSearchAction::SearchSpecification spec, const QMailMessageSortKey &sort);
void searchMessages(quint64 action, const QMailMessageKey &filter, const QString &bodyText, QMailSearchAction::SearchSpecification spec, quint64 limit, const QMailMessageSortKey &sort);
@@ -252,14 +252,14 @@ private:
bool dispatchExportUpdates(quint64, const QByteArray &data);
bool dispatchSynchronize(quint64, const QByteArray &data);
bool dispatchDiscardMessages(quint64 action, const QByteArray &data);
- bool dispatchDeleteMessages(quint64 action, const QByteArray &data);
- bool dispatchCopyMessages(quint64 action, const QByteArray &data);
+ bool dispatchOnlineDeleteMessages(quint64 action, const QByteArray &data);
+ bool dispatchOnlineCopyMessages(quint64 action, const QByteArray &data);
bool dispatchCopyToLocal(quint64 action, const QByteArray &data);
- bool dispatchMoveMessages(quint64 action, const QByteArray &data);
- bool dispatchFlagMessages(quint64 action, const QByteArray &data);
- bool dispatchCreateFolder(quint64 action, const QByteArray &data);
- bool dispatchDeleteFolder(quint64 action, const QByteArray &data);
- bool dispatchRenameFolder(quint64 action, const QByteArray &data);
+ bool dispatchOnlineMoveMessages(quint64 action, const QByteArray &data);
+ bool dispatchOnlineFlagMessagesAndMoveToStandardFolder(quint64 action, const QByteArray &data);
+ bool dispatchOnlineCreateFolder(quint64 action, const QByteArray &data);
+ bool dispatchOnlineDeleteFolder(quint64 action, const QByteArray &data);
+ bool dispatchOnlineRenameFolder(quint64 action, const QByteArray &data);
bool dispatchSearchMessages(quint64 action, const QByteArray &data);
bool dispatchProtocolRequest(quint64 action, const QByteArray &data);
diff --git a/tests/tst_qmailserviceaction/tst_qmailserviceaction.cpp b/tests/tst_qmailserviceaction/tst_qmailserviceaction.cpp
index d238076a..df72e73c 100644
--- a/tests/tst_qmailserviceaction/tst_qmailserviceaction.cpp
+++ b/tests/tst_qmailserviceaction/tst_qmailserviceaction.cpp
@@ -445,12 +445,12 @@ void tst_QMailServiceAction::test_storageaction()
{
QMailStorageAction action;
- action.copyMessages(QMailMessageIdList()<<inboxMessage1, archivedId1);
- action.moveMessages(QMailMessageIdList()<<inboxMessage2, savedId2);
+ action.onlineCopyMessages(QMailMessageIdList()<<inboxMessage1, archivedId1);
+ action.onlineMoveMessages(QMailMessageIdList()<<inboxMessage2, savedId2);
- action.createFolder("saved1child", accountId1, savedId1);
- action.renameFolder(savedId1, "saved1new");
- action.deleteFolder(archivedId2);
+ action.onlineCreateFolder("saved1child", accountId1, savedId1);
+ action.onlineRenameFolder(savedId1, "saved1new");
+ action.onlineDeleteFolder(archivedId2);
action.addMessages(QMailMessageList() << QMailMessage());
action.updateMessages(QMailMessageList() << QMailMessage());