Commit 458700b1 authored by Martin Straka's avatar Martin Straka

Added the compute of total attachment size in send message

parent 4e77a0a8
......@@ -480,6 +480,7 @@ void IsdsWrapper::sendMessage(const QString &userName,
msg.dmSenderIdent = dmSenderIdent;
msg.dmAllowSubstDelivery = dmAllowSubstDelivery;
msg.dmPersonalDelivery =dmPersonalDelivery;
int totalAttachmentSizeKBs = 0;
QList<Files::File> attachList;
/* Load file contents from storage (path) to file structure */
......@@ -487,6 +488,7 @@ void IsdsWrapper::sendMessage(const QString &userName,
Files::File attach;
QFileInfo fi(file);
attach.dmFileDescr = fi.fileName();
totalAttachmentSizeKBs += fi.size() / 1024;
QFile fin(file);
if (!fin.open(QIODevice::ReadOnly)) {
continue;
......@@ -500,6 +502,8 @@ void IsdsWrapper::sendMessage(const QString &userName,
attachList.append(attach);
}
msg.dmAttachmentSize = totalAttachmentSizeKBs;
emit statusBarTextChanged(tr("%1: sending message").arg(userName),
true, true);
......
......@@ -108,7 +108,6 @@ enum TaskSendMessage::Result TaskSendMessage::sendMessage(
/* Fill missing message envelope data */
msg.dmID = msgID;
msg.dmQTimestamp = "";
msg.dmAttachmentSize = 1;
msg.dmMessageStatus = 1;
msg._dmCustomData = "";
msg._dmReadLocally = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment