Commit 410b6aff authored by Martin Straka's avatar Martin Straka

Minor refactoring in Files and Messages

parent 61faf775
......@@ -46,16 +46,16 @@
#include "src/crypto/crypto.h"
#endif
Files::Files(QObject *parent) : QObject(parent)
{
}
void Files::declareQML(void)
{
qmlRegisterType<Files>("cz.nic.mobileDatovka.files", 1, 0, "FileIdType");
qRegisterMetaType<Files::FileIdType>();
}
Files::Files(QObject *parent) : QObject(parent)
{
}
void Files::attachmentSavingNotification(const QString &destPath)
{
QFileInfo fi(destPath);
......@@ -598,6 +598,11 @@ void Files::deleteTmpFileFromStorage(const QString &filePath)
void Files::sendEmail(const QString &emailMessage, const QStringList &fileList,
const QString &subject, const QString &body, qint64 msgId)
{
Q_UNUSED(subject);
Q_UNUSED(body);
Q_UNUSED(emailMessage);
Q_UNUSED(msgId);
if (!fileList.isEmpty()) {
#if defined Q_OS_IOS
......@@ -619,11 +624,6 @@ void Files::sendEmail(const QString &emailMessage, const QStringList &fileList,
} else {
qWarning() << "Tmp file save error";
}
Q_UNUSED(subject);
Q_UNUSED(body);
Q_UNUSED(emailMessage);
Q_UNUSED(msgId);
}
QByteArray Files::getXmlFromCms(const QByteArray &rawData)
......
......@@ -45,6 +45,12 @@ public:
};
Q_ENUM(FileIdType)
/*!
* @brief Declare various properties to the QML system.
*/
static
void declareQML(void);
/*!
* @brief Constructor.
*
......@@ -52,12 +58,6 @@ public:
*/
explicit Files(QObject *parent = Q_NULLPTR);
/*!
* @brief Declare various properties to the QML system.
*/
static
void declareQML(void);
/*!
* @brief Generates a notification dialogue about the
* result of attachment saving.
......
......@@ -64,6 +64,9 @@
#include "ios/src/qt_app_delegate.h"
#endif
/* ACCOUNT DB filename */
#define ACNT_DB_NAME "accounts.db"
/* APPLICATION IDENTIFICATION */
#define APP_ORG_NAME "CZ.NIC, z.s.p.o."
#define APP_ORG_DOMAIN "cz.nic"
......
......@@ -60,16 +60,16 @@ enum MessageDb::MessageType enumToDbRepr(enum Messages::MessageType msgType)
}
}
Messages::Messages(QObject *parent) : QObject(parent)
{
}
void Messages::declareQML(void)
{
qmlRegisterType<Messages>("cz.nic.mobileDatovka.messages", 1, 0, "MessageType");
qRegisterMetaType<Messages::MessageType>();
}
Messages::Messages(QObject *parent) : QObject(parent)
{
}
void Messages::fillContactList(const QVariant &dbModelVariant,
const QString &userName, const QString &dbId)
{
......
......@@ -45,6 +45,12 @@ public:
Q_DECLARE_FLAGS(MessageTypes, MessageType)
Q_FLAG(MessageTypes)
/*!
* @brief Declare various properties to the QML system.
*/
static
void declareQML(void);
/*!
* @brief Constructor.
*
......@@ -52,12 +58,6 @@ public:
*/
Messages(QObject *parent = Q_NULLPTR);
/*!
* @brief Declare various properties to the QML system.
*/
static
void declareQML(void);
/*!
* @brief Load contacts from database and fill QML listview via model.
*
......
......@@ -30,9 +30,6 @@
#include "src/io/sqlite/db.h"
#include "src/net/db_wrapper.h"
/* ACCOUNT DB filename */
#define ACNT_DB_NAME "accounts.db"
/*!
* @brief Encapsulates account database.
*/
......
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