Commit 0ba311ff authored by Martin Straka's avatar Martin Straka

Added get message list task and download complete message task

parent f8ebb5ba
...@@ -118,7 +118,11 @@ SOURCES += \ ...@@ -118,7 +118,11 @@ SOURCES += \
src/sqlite/file_db.cpp \ src/sqlite/file_db.cpp \
src/sqlite/message_db_container.cpp \ src/sqlite/message_db_container.cpp \
src/sqlite/message_db.cpp \ src/sqlite/message_db.cpp \
src/worker/pool.cpp src/worker/pool.cpp \
src/worker/task.cpp \
src/worker/task_download_message.cpp \
src/worker/task_download_message_list.cpp \
src/worker/task_keep_alive.cpp
HEADERS += \ HEADERS += \
src/accounts.h \ src/accounts.h \
...@@ -157,7 +161,11 @@ HEADERS += \ ...@@ -157,7 +161,11 @@ HEADERS += \
src/sqlite/file_db.h \ src/sqlite/file_db.h \
src/sqlite/message_db_container.h \ src/sqlite/message_db_container.h \
src/sqlite/message_db.h \ src/sqlite/message_db.h \
src/worker/pool.h src/worker/pool.h \
src/worker/task.h \
src/worker/task_download_message.h \
src/worker/task_download_message_list.h \
src/worker/task_keep_alive.h
android { android {
SOURCES += \ SOURCES += \
......
...@@ -79,5 +79,19 @@ ...@@ -79,5 +79,19 @@
#define OTP_ERROR_NOT_SEND "authentication.info.totpNotSended" #define OTP_ERROR_NOT_SEND "authentication.info.totpNotSended"
#define OTP_ERROR_NOT_ORDERED "authentication.info.totpNotOrdered" #define OTP_ERROR_NOT_ORDERED "authentication.info.totpNotOrdered"
/*!
* @brief Maximum length of message list to be downloaded.
*/
#define MESSAGE_LIST_LIMIT 100000
/*!
* @brief ISDS filter value to download only newer messages.
*/
#define DOWNLOAD_NEW_MESSAGES 1022
/*!
* @brief ISDS filter value to download all messages (include long term storage).
*/
#define DOWNLOAD_ALL_MESSAGES 2046
#endif // _ISDS_CONST_H_ #endif // _ISDS_CONST_H_
...@@ -28,6 +28,10 @@ ...@@ -28,6 +28,10 @@
#include "src/models/accountmodel.h" #include "src/models/accountmodel.h"
#include "src/models/messagemodel.h" #include "src/models/messagemodel.h"
#include "src/settings.h" #include "src/settings.h"
#include "src/worker/task_download_message.h"
#include "src/worker/task_download_message_list.h"
#include "src/worker/task_keep_alive.h"
IsdsWrapper::IsdsWrapper(QObject *parent) IsdsWrapper::IsdsWrapper(QObject *parent)
: QObject(parent), : QObject(parent),
...@@ -81,6 +85,8 @@ bool IsdsWrapper::syncOneAccount(const QVariant &acntModelVariant, ...@@ -81,6 +85,8 @@ bool IsdsWrapper::syncOneAccount(const QVariant &acntModelVariant,
bool IsdsWrapper::syncSingleAccountReceived(const QVariant &acntModelVariant, bool IsdsWrapper::syncSingleAccountReceived(const QVariant &acntModelVariant,
const QVariant &msgModelVariant, const QString &userName) const QVariant &msgModelVariant, const QString &userName)
{ {
qDebug("%s()", __func__);
if (userName.isEmpty()) { if (userName.isEmpty()) {
Dialogues::errorMessage(Dialogues::CRITICAL, Dialogues::errorMessage(Dialogues::CRITICAL,
tr("Error"), tr("Empty user name"), tr("Internal error")); tr("Error"), tr("Empty user name"), tr("Internal error"));
...@@ -96,12 +102,20 @@ bool IsdsWrapper::syncSingleAccountReceived(const QVariant &acntModelVariant, ...@@ -96,12 +102,20 @@ bool IsdsWrapper::syncSingleAccountReceived(const QVariant &acntModelVariant,
emit statusBarTextChanged(tr("%1: downloading received").arg(userName), emit statusBarTextChanged(tr("%1: downloading received").arg(userName),
true, true); true, true);
QList<qint64> receivedMsgIds; TaskDownloadMessageList *task;
task = new (std::nothrow) TaskDownloadMessageList(
m_isdsSession.isdsCtxMap[userName], &m_netLayer, &m_dbWrapper,
Messages::TYPE_RECEIVED,
(globSet.downloadOnlyNewMsgs) ? DOWNLOAD_NEW_MESSAGES : DOWNLOAD_ALL_MESSAGES,
1, MESSAGE_LIST_LIMIT);
task->setAutoDelete(false);
m_workPool.runSingle(task);
/* I don't like the following function. */ QList<qint64> receivedMsgIds = task->m_msgIds;
if (!m_xmlLayer.isdsGetReceivedMessageList( bool success = TaskDownloadMessageList::DL_SUCCESS == task->m_result;
m_isdsSession.isdsCtxMap[userName], delete task;
globSet.downloadOnlyNewMsgs, receivedMsgIds)) {
if (!success) {
Dialogues::errorMessage(Dialogues::CRITICAL, Dialogues::errorMessage(Dialogues::CRITICAL,
tr("%1: received messages").arg(userName), tr("%1: received messages").arg(userName),
tr("Failed to download list of received messages for user name '%1'.").arg(userName), tr("Failed to download list of received messages for user name '%1'.").arg(userName),
...@@ -120,8 +134,14 @@ bool IsdsWrapper::syncSingleAccountReceived(const QVariant &acntModelVariant, ...@@ -120,8 +134,14 @@ bool IsdsWrapper::syncSingleAccountReceived(const QVariant &acntModelVariant,
} }
foreach (qint64 msgId, receivedMsgIds) { foreach (qint64 msgId, receivedMsgIds) {
downloadMessage(messageModel, userName,
MessageDb::TYPE_RECEIVED, msgId); TaskDownloadMessage *task;
task = new (std::nothrow) TaskDownloadMessage(
m_isdsSession.isdsCtxMap[userName], &m_netLayer,
&m_dbWrapper, msgId,
Messages::TYPE_RECEIVED, messageModel);
task->setAutoDelete(true);
m_workPool.assignLo(task, WorkerPool::PREPEND);
} }
} }
...@@ -141,7 +161,7 @@ bool IsdsWrapper::syncSingleAccountReceived(const QVariant &acntModelVariant, ...@@ -141,7 +161,7 @@ bool IsdsWrapper::syncSingleAccountReceived(const QVariant &acntModelVariant,
} }
} }
return true; return success;
} }
bool IsdsWrapper::syncSingleAccountSent(const QVariant &acntModelVariant, bool IsdsWrapper::syncSingleAccountSent(const QVariant &acntModelVariant,
...@@ -162,11 +182,20 @@ bool IsdsWrapper::syncSingleAccountSent(const QVariant &acntModelVariant, ...@@ -162,11 +182,20 @@ bool IsdsWrapper::syncSingleAccountSent(const QVariant &acntModelVariant,
emit statusBarTextChanged(tr("%1: downloading sent").arg(userName), emit statusBarTextChanged(tr("%1: downloading sent").arg(userName),
true, true); true, true);
QList<qint64> sentMsgIds; TaskDownloadMessageList *task;
task = new (std::nothrow) TaskDownloadMessageList(
m_isdsSession.isdsCtxMap[userName], &m_netLayer, &m_dbWrapper,
Messages::TYPE_SENT,
(globSet.downloadOnlyNewMsgs) ? DOWNLOAD_NEW_MESSAGES : DOWNLOAD_ALL_MESSAGES,
1, MESSAGE_LIST_LIMIT);
task->setAutoDelete(false);
m_workPool.runSingle(task);
QList<qint64> sentMsgIds = task->m_msgIds;
bool success = TaskDownloadMessageList::DL_SUCCESS == task->m_result;
delete task;
if (!m_xmlLayer.isdsGetSentMessageList( if (!success) {
m_isdsSession.isdsCtxMap[userName],
globSet.downloadOnlyNewMsgs, sentMsgIds)) {
Dialogues::errorMessage(Dialogues::CRITICAL, Dialogues::errorMessage(Dialogues::CRITICAL,
tr("%1: sent messages").arg(userName), tr("%1: sent messages").arg(userName),
tr("Failed to download list of sent messages for user name %1.").arg(userName), tr("Failed to download list of sent messages for user name %1.").arg(userName),
...@@ -185,8 +214,14 @@ bool IsdsWrapper::syncSingleAccountSent(const QVariant &acntModelVariant, ...@@ -185,8 +214,14 @@ bool IsdsWrapper::syncSingleAccountSent(const QVariant &acntModelVariant,
} }
foreach (qint64 msgId, sentMsgIds) { foreach (qint64 msgId, sentMsgIds) {
downloadMessage(messageModel, userName,
MessageDb::TYPE_SENT, msgId); TaskDownloadMessage *task;
task = new (std::nothrow) TaskDownloadMessage(
m_isdsSession.isdsCtxMap[userName], &m_netLayer,
&m_dbWrapper, msgId,
Messages::TYPE_SENT, messageModel);
task->setAutoDelete(true);
m_workPool.assignHi(task);
} }
} }
...@@ -206,12 +241,13 @@ bool IsdsWrapper::syncSingleAccountSent(const QVariant &acntModelVariant, ...@@ -206,12 +241,13 @@ bool IsdsWrapper::syncSingleAccountSent(const QVariant &acntModelVariant,
} }
} }
return true; return success;
} }
bool IsdsWrapper::getAccountInfo(const QString &userName, bool isFirstLogin) bool IsdsWrapper::getAccountInfo(const QString &userName, bool isFirstLogin)
{ {
qDebug("%s()", __func__); qDebug("%s()", __func__);
bool success = true; bool success = true;
QString errTxt = tr("Wrong username"); QString errTxt = tr("Wrong username");
...@@ -495,14 +531,20 @@ void IsdsWrapper::downloadMessage(MessageListModel *messageModel, ...@@ -495,14 +531,20 @@ void IsdsWrapper::downloadMessage(MessageListModel *messageModel,
emit statusBarTextChanged(tr("Downloading message %1"). emit statusBarTextChanged(tr("Downloading message %1").
arg(QString::number(msgId)), true, true); arg(QString::number(msgId)), true, true);
bool success = false;
if (messageType == MessageDb::TYPE_RECEIVED) { if (messageType == MessageDb::TYPE_RECEIVED) {
/* TaskDownloadMessage *task;
* NOTE: Method isdsGetCompleteMsgWithoutCms() is obsolete task = new (std::nothrow) TaskDownloadMessage(
* according ISDS specification. Not used now. m_isdsSession.isdsCtxMap[userName], &m_netLayer, &m_dbWrapper,
* The isdsGetCompleteReceivedMsgWithCms() method is used. msgId, Messages::TYPE_RECEIVED, messageModel);
*/ task->setAutoDelete(false);
if (!m_xmlLayer.isdsGetCompleteReceivedMsgWithCms( m_workPool.runSingle(task);
m_isdsSession.isdsCtxMap[userName], msgId)) {
success = TaskDownloadMessage::DL_SUCCESS == task->m_result;
delete task;
if (!success) {
Dialogues::errorMessage(Dialogues::CRITICAL, Dialogues::errorMessage(Dialogues::CRITICAL,
tr("Downloading message: %1").arg(userName), tr("Downloading message: %1").arg(userName),
tr("Failed to download complete received message %1.").arg(msgId), tr("Failed to download complete received message %1.").arg(msgId),
...@@ -510,8 +552,18 @@ void IsdsWrapper::downloadMessage(MessageListModel *messageModel, ...@@ -510,8 +552,18 @@ void IsdsWrapper::downloadMessage(MessageListModel *messageModel,
return; return;
} }
} else { } else {
if (!m_xmlLayer.isdsGetCompleteSentMsgWithCms(
m_isdsSession.isdsCtxMap[userName], msgId)) { TaskDownloadMessage *task;
task = new (std::nothrow) TaskDownloadMessage(
m_isdsSession.isdsCtxMap[userName], &m_netLayer, &m_dbWrapper,
msgId, Messages::TYPE_SENT, messageModel);
task->setAutoDelete(false);
m_workPool.runSingle(task);
success = TaskDownloadMessage::DL_SUCCESS == task->m_result;
delete task;
if (!success) {
Dialogues::errorMessage(Dialogues::CRITICAL, Dialogues::errorMessage(Dialogues::CRITICAL,
tr("Downloading message: %1").arg(userName), tr("Downloading message: %1").arg(userName),
tr("Failed to download complete sent message %1.").arg(msgId), tr("Failed to download complete sent message %1.").arg(msgId),
...@@ -520,11 +572,6 @@ void IsdsWrapper::downloadMessage(MessageListModel *messageModel, ...@@ -520,11 +572,6 @@ void IsdsWrapper::downloadMessage(MessageListModel *messageModel,
} }
} }
/* Downloading complete message succeeded. */
if (messageModel != Q_NULLPTR) {
messageModel->overrideDownloaded(msgId, true);
}
m_xmlLayer.isdsGetMsgAuthorInfo(m_isdsSession.isdsCtxMap[userName], msgId); m_xmlLayer.isdsGetMsgAuthorInfo(m_isdsSession.isdsCtxMap[userName], msgId);
m_xmlLayer.isdsMarkMsgAsDownloaded(m_isdsSession.isdsCtxMap[userName], m_xmlLayer.isdsMarkMsgAsDownloaded(m_isdsSession.isdsCtxMap[userName],
msgId); msgId);
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <QObject> #include <QObject>
#include "src/net/isds_const.h"
#include "src/net/isds_session.h" #include "src/net/isds_session.h"
#include "src/net/xml_layer.h" #include "src/net/xml_layer.h"
#include "src/worker/pool.h" #include "src/worker/pool.h"
...@@ -250,12 +251,18 @@ private: ...@@ -250,12 +251,18 @@ private:
bool loginToIsds(IsdsSession::IsdsContext &ctx); bool loginToIsds(IsdsSession::IsdsContext &ctx);
/*! /*!
* @brief Instance of XmlLayer class (xml_layer.h). * @brief Instance of DbWrapper class (db_wrapper.h).
* *
* Class IsdsSession realizes XML layer over netmanager. * Object DbWrapper stores response data to database.
* Creates SOAP envelopes of services and parse SOAP responses.
*/ */
XmlLayer m_xmlLayer; DbWrapper m_dbWrapper;
/*!
* @brief Instance of NetLayer class (net_layer.h).
*
* Object NetLayer realizes POST/GET requests and net management.
*/
NetLayer m_netLayer;
/*! /*!
* @brief Instance of IsdsSession class (isds_session.h). * @brief Instance of IsdsSession class (isds_session.h).
...@@ -268,6 +275,12 @@ private: ...@@ -268,6 +275,12 @@ private:
* @brief Worker pool instance. * @brief Worker pool instance.
*/ */
WorkerPool m_workPool; WorkerPool m_workPool;
/*!
* TODO - will be removed in the future.
*/
XmlLayer m_xmlLayer;
}; };
#endif // _ISDS_WRAPPER_H_ #endif // _ISDS_WRAPPER_H_
...@@ -192,6 +192,39 @@ bool XmlLayer::isdsGetReceivedMessageList(IsdsSession::IsdsContext &ctx, ...@@ -192,6 +192,39 @@ bool XmlLayer::isdsGetReceivedMessageList(IsdsSession::IsdsContext &ctx,
ctx.last_isds_msg); ctx.last_isds_msg);
} }
QByteArray XmlLayer::xmlCreateGetMessageListSoapRequest(
enum Messages::MessageType msgDirect, uint dmStatusFilter, uint dmOffset,
uint dmLimit)
{
QString xmlBodyContent;
if (Messages::TYPE_RECEIVED == msgDirect) {
xmlBodyContent.append("<GetListOfReceivedMessages xmlns=\"");
} else {
xmlBodyContent.append("<GetListOfSentMessages xmlns=\"");
}
xmlBodyContent.append(ISDS_NS);
xmlBodyContent.append("\"><dmFromTime/><dmToTime/>");
if (Messages::TYPE_RECEIVED == msgDirect) {
xmlBodyContent.append("<dmRecipientOrgUnitNum/>");
} else {
xmlBodyContent.append("<dmSenderOrgUnitNum/>");
}
xmlBodyContent.append(QString("<dmStatusFilter>%1</dmStatusFilter>").arg(dmStatusFilter));
xmlBodyContent.append(QString("<dmOffset>%1</dmOffset>").arg(dmOffset));
xmlBodyContent.append(QString("<dmLimit>%1</dmLimit>").arg(dmLimit));
if (Messages::TYPE_RECEIVED == msgDirect) {
xmlBodyContent.append("</GetListOfReceivedMessages>");
} else {
xmlBodyContent.append("</GetListOfSentMessages>");
}
return createEnvelope(xmlBodyContent);
}
bool XmlLayer::isdsGetSentMessageList(IsdsSession::IsdsContext &ctx, bool XmlLayer::isdsGetSentMessageList(IsdsSession::IsdsContext &ctx,
bool only90Days, QList<qint64> &msgIds) bool only90Days, QList<qint64> &msgIds)
{ {
...@@ -278,6 +311,31 @@ bool XmlLayer::isdsGetCompleteMsgWithoutCms(IsdsSession::IsdsContext &ctx, ...@@ -278,6 +311,31 @@ bool XmlLayer::isdsGetCompleteMsgWithoutCms(IsdsSession::IsdsContext &ctx,
fileList, ctx.last_isds_msg); fileList, ctx.last_isds_msg);
} }
QByteArray XmlLayer::xmlCreateDownloadMessageSoapRequest(qint64 msgID,
enum Messages::MessageType msgDirect)
{
QString xmlBodyContent;
if (Messages::TYPE_RECEIVED == msgDirect) {
xmlBodyContent.append("<SignedMessageDownload xmlns=\"");
} else {
xmlBodyContent.append("<SignedSentMessageDownload xmlns=\"");
}
xmlBodyContent.append(ISDS_NS);
xmlBodyContent.append("\"><dmID>");
xmlBodyContent.append(QString::number(msgID));
xmlBodyContent.append("</dmID>");
if (Messages::TYPE_RECEIVED == msgDirect) {
xmlBodyContent.append("</SignedMessageDownload>");
} else {
xmlBodyContent.append("</SignedSentMessageDownload>");
}
return createEnvelope(xmlBodyContent);
}
bool XmlLayer::isdsGetCompleteReceivedMsgWithCms(IsdsSession::IsdsContext &ctx, bool XmlLayer::isdsGetCompleteReceivedMsgWithCms(IsdsSession::IsdsContext &ctx,
qint64 msgID) qint64 msgID)
{ {
......
...@@ -94,6 +94,16 @@ public: ...@@ -94,6 +94,16 @@ public:
bool isdsGetReceivedMessageList(IsdsSession::IsdsContext &ctx, bool isdsGetReceivedMessageList(IsdsSession::IsdsContext &ctx,
bool only90Days, QList<qint64> &msgIds); bool only90Days, QList<qint64> &msgIds);
static
QByteArray xmlCreateGetMessageListSoapRequest(
enum Messages::MessageType msgDirect, uint dmStatusFilter,
uint dmOffset, uint dmLimit);
static
QByteArray xmlCreateDownloadMessageSoapRequest(qint64 msgID,
enum Messages::MessageType msgDirect);
/*! /*!
* @brief Get list of outcoming (addressed from you) messages. * @brief Get list of outcoming (addressed from you) messages.
* *
...@@ -211,6 +221,7 @@ public: ...@@ -211,6 +221,7 @@ public:
* @param[out] fileList List of files structure. * @param[out] fileList List of files structure.
* @return true if success. * @return true if success.
*/ */
static
bool completeMessageParse(QXmlStreamReader &xml, Messages::Message &msg, bool completeMessageParse(QXmlStreamReader &xml, Messages::Message &msg,
QList<Files::File> &fileList); QList<Files::File> &fileList);
...@@ -220,16 +231,16 @@ public: ...@@ -220,16 +231,16 @@ public:
* @param[in] xml Xml data for parsing. * @param[in] xml Xml data for parsing.
* @return Event structure. * @return Event structure.
*/ */
static
Messages::Event parseEvent(QXmlStreamReader &xml); Messages::Event parseEvent(QXmlStreamReader &xml);
private:
/*! /*!
* @brief Create xml envelope. * @brief Create xml envelope.
* *
* @param[in] xmlBodyContent Content body. * @param[in] xmlBodyContent Content body.
* @return Xml bytearray with envelope. * @return Xml bytearray with envelope.
*/ */
static
QByteArray createEnvelope(const QString &xmlBodyContent); QByteArray createEnvelope(const QString &xmlBodyContent);
/*! /*!
...@@ -238,6 +249,7 @@ private: ...@@ -238,6 +249,7 @@ private:
* @param[in] userName Account username. * @param[in] userName Account username.
* @return true if success. * @return true if success.
*/ */
static
QString getFileSizeFromBase64(int fileLen); QString getFileSizeFromBase64(int fileLen);
/*! /*!
...@@ -246,6 +258,7 @@ private: ...@@ -246,6 +258,7 @@ private:
* @param[in] fileName Filename with ext. * @param[in] fileName Filename with ext.
* @return true icon filename. * @return true icon filename.
*/ */
static
QString getFileIconFromFileName(QString fileName); QString getFileIconFromFileName(QString fileName);
/*! /*!
...@@ -255,6 +268,7 @@ private: ...@@ -255,6 +268,7 @@ private:
* @param[out] txt Error description if something failed. * @param[out] txt Error description if something failed.
* @return true if login success. * @return true if login success.
*/ */
static
bool parseDmStatusFromXml(const QByteArray &xmlData, QString &txt); bool parseDmStatusFromXml(const QByteArray &xmlData, QString &txt);
/*! /*!
...@@ -264,6 +278,7 @@ private: ...@@ -264,6 +278,7 @@ private:
* @param[out] txt Error description if something failed. * @param[out] txt Error description if something failed.
* @return true if login success. * @return true if login success.
*/ */
static
bool parseDbStatusFromXml(const QByteArray &xmlData, QString &txt); bool parseDbStatusFromXml(const QByteArray &xmlData, QString &txt);
/*! /*!
...@@ -273,6 +288,7 @@ private: ...@@ -273,6 +288,7 @@ private:
* @param[out] txt Error description if something failed. * @param[out] txt Error description if something failed.
* @return true if login success. * @return true if login success.
*/ */
static
bool parseLoginResponse(const QByteArray &xmlData, QString &txt); bool parseLoginResponse(const QByteArray &xmlData, QString &txt);
/*! /*!
...@@ -283,6 +299,7 @@ private: ...@@ -283,6 +299,7 @@ private:
* @param[out] txt Error description if something failed. * @param[out] txt Error description if something failed.
* @return true if success. * @return true if success.
*/ */
static
bool parseGetListOfMessagesResponse(enum MessageDb::MessageType messageType, bool parseGetListOfMessagesResponse(enum MessageDb::MessageType messageType,
const QByteArray &xmlData, QList<Messages::Message> &messages, const QByteArray &xmlData, QList<Messages::Message> &messages,
QString &txt); QString &txt);
...@@ -296,6 +313,7 @@ private: ...@@ -296,6 +313,7 @@ private:
* @param[out] txt Error description if something failed. * @param[out] txt Error description if something failed.
* @return true if success. * @return true if success.
*/ */
static
bool parseMessageDownloadResponse(const QByteArray &xmlData, bool parseMessageDownloadResponse(const QByteArray &xmlData,
Messages::Message &msg, QList<Files::File> &fileList, QString &txt); Messages::Message &msg, QList<Files::File> &fileList, QString &txt);
...@@ -308,6 +326,7 @@ private: ...@@ -308,6 +326,7 @@ private:
* @param[out] txt Error description if something failed. * @param[out] txt Error description if something failed.
* @return true if success. * @return true if success.
*/ */
static
bool parseSignedMessageDownloadResponse(const QByteArray &xmlData, bool parseSignedMessageDownloadResponse(const QByteArray &xmlData,
Messages::Message &msg, QList<Files::File> &fileList, QString &txt); Messages::Message &msg, QList<Files::File> &fileList, QString &txt);
...@@ -319,6 +338,7 @@ private: ...@@ -319,6 +338,7 @@ private:
* @param[out] txt Error description if something failed. * @param[out] txt Error description if something failed.
* @return true if success. * @return true if success.
*/ */
static
bool parseGetOwnerInfoFromLogin(const QByteArray &xmlData, bool parseGetOwnerInfoFromLogin(const QByteArray &xmlData,
DbWrapper::AccountInfo &accountInfo, QString &txt); DbWrapper::AccountInfo &accountInfo, QString &txt);
...@@ -330,6 +350,7 @@ private: ...@@ -330,6 +350,7 @@ private:
* @param[out] txt Error description if something failed. * @param[out] txt Error description if something failed.
* @return true if success. * @return true if success.
*/ */
static
bool parseGetUserInfoFromLogin(const QByteArray &xmlData, bool parseGetUserInfoFromLogin(const QByteArray &xmlData,
DbWrapper::UserInfo &userInfo, QString &txt); DbWrapper::UserInfo &userInfo, QString &txt);
...@@ -341,6 +362,7 @@ private: ...@@ -341,6 +362,7 @@ private:
* @param[out] txt Error description if something failed. * @param[out] txt Error description if something failed.
* @return true if success. * @return true if success.
*/ */
static
bool parseGetPasswordInfo(const QByteArray &xmlData, bool parseGetPasswordInfo(const QByteArray &xmlData,
QString &expirDate, QString &txt); QString &expirDate, QString &txt);
...@@ -351,6 +373,7 @@ private: ...@@ -351,6 +373,7 @@ private:
* @param[out] accountInfo Account info structures. * @param[out] accountInfo Account info structures.
* @return true if success. * @return true if success.
*/ */
static
bool dbOwnerInfoParse(QXmlStreamReader &xml, bool dbOwnerInfoParse(QXmlStreamReader &xml,
DbWrapper::AccountInfo &accountInfo); DbWrapper::AccountInfo &accountInfo);
...@@ -362,6 +385,7 @@ private: ...@@ -362,6 +385,7 @@ private:
* @param[out] txt Error description if something failed. * @param[out] txt Error description if something failed.
* @return true if success. * @return true if success.
*/ */
static
bool dbUserInfoParse(QXmlStreamReader &xml, bool dbUserInfoParse(QXmlStreamReader &xml,
DbWrapper::UserInfo &userInfo); DbWrapper::UserInfo &userInfo);
...@@ -374,6 +398,7 @@ private: ...@@ -374,6 +398,7 @@ private:
* @param[out] txt Error description if something failed. * @param[out] txt Error description if something failed.
* @return true if success. * @return true if success.
*/ */
static
bool parseGetAuthorInfo(const QByteArray &xmlData, QString &userType, bool parseGetAuthorInfo(const QByteArray &xmlData, QString &userType,
QString &authorName, QString &txt); QString &authorName, QString &txt);
...@@ -385,6 +410,7 @@ private: ...@@ -385,6 +410,7 @@ private:
* @param[out] txt Error description if something failed. * @param[out] txt Error description if something failed.
* @return true if success. * @return true if success.
*/ */
static
bool parseGetMsgDeliveryInfoResponse(const QByteArray &xmlData, bool parseGetMsgDeliveryInfoResponse(const QByteArray &xmlData,
QList<Messages::Event> &eventList, QString &txt); QList<Messages::Event> &eventList, QString &txt);
...@@ -396,6 +422,7 @@ private: ...@@ -396,6 +422,7 @@ private:
* @param[out] txt Error description if something failed. * @param[out] txt Error description if something failed.
* @return true if success. * @return true if success.
*/ */
static
bool parseGetSignedMsgDeliveryInfoResponse(const QByteArray &xmlData, bool parseGetSignedMsgDeliveryInfoResponse(const QByteArray &xmlData,
QList<Messages::Event> &eventList, QString &txt); QList<Messages::Event> &eventList, QString &txt);
...@@ -406,6 +433,7 @@ private: ...@@ -406,6 +433,7 @@ private:
* @param[in] messageType Message type. * @param[in] messageType Message type.
* @return Message envelope structure. * @return Message envelope structure.
*/ */
static
Messages::Message msgEnvelopeParse(QXmlStreamReader &xml, Messages::Message msgEnvelopeParse(QXmlStreamReader &xml,
enum MessageDb::MessageType messageType); enum MessageDb::MessageType messageType);
...@@ -417,6 +445,7 @@ private: ...@@ -417,6 +445,7 @@ private:
* @param[in] downloadDate Datetime when complete message was downloaded. * @param[in] downloadDate Datetime when complete message was downloaded.
* @return File structure. * @return File structure.
*/ */
static
Files::File parseFile(QXmlStreamReader &xml, const qint64 msgId, Files::File parseFile(QXmlStreamReader &xml, const qint64 msgId,
const QString &downloadDate); const QString &downloadDate);
......
...@@ -108,7 +108,7 @@ void WorkerPool::wait(void) ...@@ -108,7 +108,7 @@ void WorkerPool::wait(void)
void WorkerPool::assignLo(QRunnable *task, enum WorkerPool::EnqueueOrder order) void WorkerPool::assignLo(QRunnable *task, enum WorkerPool::EnqueueOrder order)
{ {
if (0 == task) { if (Q_NULLPTR == task) {
return; return;
} }
...@@ -124,7 +124,7 @@ void WorkerPool::assignLo(QRunnable *task, enum WorkerPool::EnqueueOrder order) ...@@ -124,7 +124,7 @@ void WorkerPool::assignLo(QRunnable *task, enum WorkerPool::EnqueueOrder order)
void WorkerPool::assignHi(QRunnable *task, enum WorkerPool::EnqueueOrder order) void WorkerPool::assignHi(QRunnable *task, enum WorkerPool::EnqueueOrder order)
{ {
if (0 == task) { if (Q_NULLPTR == task) {
return; return;
} }
...@@ -140,7 +140,7 @@ void WorkerPool::assignHi(QRunnable *task, enum WorkerPool::EnqueueOrder order) ...@@ -140,7 +140,7 @@ void WorkerPool::assignHi(QRunnable *task, enum WorkerPool::EnqueueOrder order)
void WorkerPool::runSingle(QRunnable *task) void WorkerPool::runSingle(QRunnable *