Commit 4ae34b4d authored by Karel Slaný's avatar Karel Slaný

Removed forgotten parameters when calling ttachmentModel.setFromDb() from QML.

parent b5241ed2
......@@ -84,7 +84,7 @@ Component {
messages.markMessageAsLocallyRead(messageModel, userName, msgId, true)
msgDescrHtml = messages.getMessageDetail(userName, zfoId)
attachmentModel.setFromDb(userName, zfoId, false) // false = real file size won't calculate
attachmentModel.setFromDb(userName, zfoId)
zfoType = MsgInfo.TYPE_MESSAGE
}
emptyList.visible = (attachmentList.count === 0)
......
......@@ -68,8 +68,8 @@ Item {
return filePath.replace(/^.*[\\\/]/, '')
}
/* Check if message has fill an attachment and check total size */
function checkAttachmentSizes() {
/* Check attachment number ans size. */
function attachmentSizeOk() {
attachmentsSizeLabel.color = datovkaPalette.text
var attachmentNumber = sendMsgAttachmentModel.rowCount()
if (attachmentNumber === 0) {
......@@ -140,9 +140,9 @@ Item {
dmRecipientRefNumber.text = isdsEnvelope.dmRecipientRefNumber
dmRecipientIdent.text = isdsEnvelope.dmRecipientIdent
setMandate(isdsEnvelope)
sendMsgAttachmentModel.setFromDb(userName, msgId, true) // true = real file size will calculate from file content
sendMsgAttachmentModel.setFromDb(userName, msgId)
totalAttachmentSizeBytes = sendMsgAttachmentModel.dataSizeSum()
checkAttachmentSizes()
attachmentSizeOk()
}
/* Set message forward data and add ZFO file to model */
......@@ -288,7 +288,7 @@ Item {
/* Enable send message button if all required fields are filled */
function areReguiredFieldsFilled() {
actionButton.enabled = (checkAttachmentSizes() && (dmAnnotation.text.toString() !== "") && (recipBoxModel.rowCount() > 0))
actionButton.enabled = (attachmentSizeOk() && (dmAnnotation.text.toString() !== "") && (recipBoxModel.rowCount() > 0))
}
TabBar {
......
......@@ -537,10 +537,7 @@ bool Files::setAttachmentModel(FileListModel &attachModel,
logErrorNL("%s", "Cannot access file database.");
return false;
}
attachModel.clearAll();
/* Set file model without file content and real file size. */
fDb->setFileModelFromDb(attachModel, msgId);
return 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