Skip to content
Snippets Groups Projects
Unverified Commit c34607b4 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

callbackshandler: get exceptions from getAccountInfo

As the account can be destroyed while a signal is treated

Change-Id: I16201dc917a14184f57ba15f0e6c1ddd4b1f5311
parent fbd2477e
No related branches found
No related tags found
No related merge requests found
...@@ -569,9 +569,13 @@ CallbacksHandler::slotDataTransferEvent(const QString& accountId, ...@@ -569,9 +569,13 @@ CallbacksHandler::slotDataTransferEvent(const QString& accountId,
api::datatransfer::Info info; api::datatransfer::Info info;
if (conversationId.isEmpty()) { if (conversationId.isEmpty()) {
parent.getAccountModel().getAccountInfo(accountId).dataTransferModel->transferInfo(accountId, try {
fileId, parent.getAccountModel()
info); .getAccountInfo(accountId)
.dataTransferModel->transferInfo(accountId, fileId, info);
} catch (...) {
return;
}
} else { } else {
info.uid = fileId; info.uid = fileId;
info.status = convertDataTransferEvent(event); info.status = convertDataTransferEvent(event);
...@@ -579,8 +583,12 @@ CallbacksHandler::slotDataTransferEvent(const QString& accountId, ...@@ -579,8 +583,12 @@ CallbacksHandler::slotDataTransferEvent(const QString& accountId,
info.accountId = accountId; info.accountId = accountId;
qlonglong totalSize, progress; qlonglong totalSize, progress;
QString path; QString path;
parent.getAccountModel().getAccountInfo(accountId).dataTransferModel->fileTransferInfo( try {
accountId, conversationId, fileId, path, totalSize, progress); parent.getAccountModel().getAccountInfo(accountId).dataTransferModel->fileTransferInfo(
accountId, conversationId, fileId, path, totalSize, progress);
} catch (...) {
return;
}
auto fi = QFileInfo(path); auto fi = QFileInfo(path);
if (fi.isSymLink()) { if (fi.isSymLink()) {
path = fi.symLinkTarget(); path = fi.symLinkTarget();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment