Commit 1d7c83fc authored by Karel Slaný's avatar Karel Slaný

Deleted global FileListModel globFilesModel.

parent 9e1de371
......@@ -41,6 +41,7 @@ Component {
property string userName
property int msgType
property string msgId
property var attachmentModel: null /* The QVariant holds actually a pointer to the model. */
property int myWidht: mainLayout.width - 2 * defaultMargin
Rectangle {
......@@ -182,7 +183,9 @@ Component {
files.saveAttachmentsToDiskDb(userName, msgId)
} else if (index == 3) {
if (files.deleteAttachmentsFromDb(userName, msgId)) {
files.clearFileModel()
if (attachmentModel != null) {
attachmentModel.clearAll()
}
}
}
pageView.pop(StackView.Immediate)
......
......@@ -221,7 +221,8 @@ Component {
"acntName": acntName,
"userName": userName,
"msgType": msgType,
"msgId": zfoId
"msgId": zfoId,
"attachmentModel" : attachmentModel
}, StackView.Immediate)
}
}
......
......@@ -136,11 +136,6 @@ Files::Files(QObject *parent) : QObject(parent)
{
}
void Files::clearFileModel(void)
{
globFilesModel.clearAll();
}
/*!
* @brief Set attachment model content.
*
......
......@@ -65,11 +65,6 @@ public:
Q_INVOKABLE void sendAttachmentsWithEmailFromDb(const QString &userName,
qint64 msgId);
/*!
* @brief Clear attachment model.
*/
Q_INVOKABLE void clearFileModel(void);
/*!
* @brief Delete file database.
*/
......
......@@ -269,8 +269,6 @@ int main(int argc, char *argv[])
globAccountsModelPtr);
ctx->setContextProperty(globMessagesModel.objectName(),
&globMessagesModel);
globFilesModel.setObjectName("fileListModel");
ctx->setContextProperty(globFilesModel.objectName(), &globFilesModel);
/* Localise description in tables. */
accntinfTbl.reloadLocalisedDescription();
......
......@@ -91,8 +91,6 @@ void FileListModel::Entry::setFileContent(const QString &fileContent)
m_fileContent = fileContent;
}
FileListModel globFilesModel;
void FileListModel::declareQML(void)
{
qmlRegisterType<FileListModel>("cz.nic.mobileDatovka.models", 1, 0, "FileListModel");
......
......@@ -143,6 +143,7 @@ public:
/*!
* @brief Clears the model.
*/
Q_INVOKABLE
void clearAll(void);
/*!
......@@ -187,6 +188,4 @@ private:
/* QML passes its arguments via QVariant. */
Q_DECLARE_METATYPE(FileListModel)
extern FileListModel globFilesModel;
#endif /* _FILEMODEL_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