Commit 815b5d73 authored by Martin Straka's avatar Martin Straka

Fixed open zfo file from database in send page

parent c23dd8e5
......@@ -405,7 +405,7 @@ Item {
anchors.fill: parent
onClicked: {
// fileId is set and is valid, use files from database
if (rFileId != FileIdType.NO_FILE_ID) {
if (rFileId > 0) {
if (files.isZfoFile(rFileName)) {
pageView.push(pageMessageDetail, {
"pageView": pageView,
......@@ -415,6 +415,12 @@ Item {
} else {
files.openAttachmentFromDb(userName, msgId, rFileId)
}
} else if (rFileId == FileIdType.DB_ZFO_ID) {
pageView.push(pageMessageDetail, {
"pageView": pageView,
"statusBar": statusBar,
"fromLocalDb": false,
"rawZfoContent": zfo.getZfoContentFromDb(userName, msgId)})
} else {
if (files.isZfoFile(getFileNameFromPath(rFilePath))) {
pageView.push(pageMessageDetail, {
......
......@@ -29,6 +29,12 @@ Zfo::Zfo(QObject *parent) : QObject(parent)
{
}
QByteArray Zfo::getZfoContentFromDb(const QString &userName, qint64 msgId)
{
return QByteArray::fromBase64(globZfoDbPtr->getZfoContentFromDb(msgId,
AccountListModel::globAccounts[userName].isTestAccount()));
}
int Zfo::getZfoSizeFromDb(const QString &userName, qint64 msgId)
{
return globZfoDbPtr->getZfoSizeFromDb(msgId,
......
......@@ -41,6 +41,16 @@ public:
*/
explicit Zfo(QObject *parent = Q_NULLPTR);
/*!
* @brief Get Zfo content.
*
* @param[in] userName User name identifying account.
* @param[in] msgId String with message id.
* @return Zfo content.
*/
Q_INVOKABLE static
QByteArray getZfoContentFromDb(const QString &userName, qint64 msgId);
/*!
* @brief Get Zfo size in bytes.
*
......
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