Commit f140fe22 authored by Karel Slaný's avatar Karel Slaný

Files::parseXmlData() takes its argument by value, removed reference.

parent 6a886b2f
......@@ -45,6 +45,7 @@
#include "src/crypto/crypto.h"
#endif
/* TODO -- These MUST be removed. */
QStack<QList<Files::File>> stackFileList;
QStack<QString> stackMessageDetail;
......@@ -252,8 +253,7 @@ void Files::openAttachmentFromDb(const QString &userName,
}
if (isAttachmentZfoFile(fileName)) {
QByteArray xmlData = decodeZfoFile(file.content);
parseXmlData(xmlData);
parseXmlData(decodeZfoFile(file.content));
return;
}
......@@ -272,8 +272,7 @@ void Files::openAttachment(const QString &fileName, const QString &content)
}
if (isAttachmentZfoFile(fileName)) {
QByteArray xmlData = decodeZfoFile(content);
parseXmlData(xmlData);
parseXmlData(decodeZfoFile(content));
return;
}
......@@ -668,7 +667,7 @@ QByteArray Files::decodeZfoFile(const QString &content)
return decodeCmsData(cmsData);
}
bool Files::parseXmlData(QByteArray &data)
bool Files::parseXmlData(QByteArray data)
{
qDebug("%s()", __func__);
......@@ -843,9 +842,7 @@ bool Files::openZfoFileFromStorage(const QString &filePath)
return ret;
}
QByteArray content = file.readAll();
content = decodeCmsData(content);
ret = parseXmlData(content);
ret = parseXmlData(decodeCmsData(file.readAll()));
return ret;
}
......@@ -34,8 +34,12 @@ class Files : public QObject {
Q_OBJECT
public:
explicit Files(QObject* parent = 0);
/*!
* @brief Contructor.
*
* @param[in] parent Parent object.
*/
explicit Files(QObject *parent = Q_NULLPTR);
/*!
* @brief Load files from databse and fill QML listview via model.
......@@ -228,7 +232,7 @@ private:
* @param[in] data Xml file data.
* @return true if success.
*/
bool parseXmlData(QByteArray &data);
bool parseXmlData(QByteArray data);
};
#endif // FILES_H
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