summary refs log tree commit diff
path: root/src/timeline/TimelineModel.cpp
diff options
context:
space:
mode:
authorAdasauce <adasauce@with.parts>2020-03-20 10:05:12 -0300
committerAdasauce <adasauce@with.parts>2020-03-20 10:10:53 -0300
commitd0a1e81f43b44235c86e46cb6cd19653834b4084 (patch)
treeb81ff7d93511e4403141d002987a25765b6ade52 /src/timeline/TimelineModel.cpp
parentMerge pull request #146 from Alch-Emi/priority-sort (diff)
downloadnheko-d0a1e81f43b44235c86e46cb6cd19653834b4084.tar.xz
Better image overlay handling when downloading
 - hides the overlay when prompting for download location
 - cancel re-shows the dialog
 - success closes the overlay
 - would be nice to have a return code from the download fn in
 mtxclient.

Closes #140
Diffstat (limited to 'src/timeline/TimelineModel.cpp')
-rw-r--r--src/timeline/TimelineModel.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp

index ec98da23..ef01f068 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp
@@ -1271,7 +1271,7 @@ TimelineModel::addPendingMessage(mtx::events::collections::TimelineEvents event) emit nextPendingMessage(); } -void +bool TimelineModel::saveMedia(QString eventId) const { mtx::events::collections::TimelineEvents event = events.value(eventId); @@ -1309,7 +1309,7 @@ TimelineModel::saveMedia(QString eventId) const manager_->getWidget(), dialogTitle, openLocation, filterString); if (filename.isEmpty()) - return; + return false; const auto url = mxcUrl.toStdString(); @@ -1340,10 +1340,13 @@ TimelineModel::saveMedia(QString eventId) const file.write(QByteArray(temp.data(), (int)temp.size())); file.close(); + + return; } catch (const std::exception &e) { nhlog::ui()->warn("Error while saving file to: {}", e.what()); } }); + return true; } void