Skip to content

Commit

Permalink
opt: support to open image in system viewer (#1309)
Browse files Browse the repository at this point in the history
* opt: open image in external

fix have to wait the resource downloaded

* [autofix.ci] apply automated fixes

---------

Co-authored-by: YiFang Xiao <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 6, 2023
1 parent 64f69d2 commit 9c5e259
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/ui/articleview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1772,8 +1772,16 @@ void ArticleView::contextMenuRequested( QPoint const & pos )

if ( !fileName.isEmpty() ) {
QFileInfo fileInfo( fileName );
saveResource( url, webview->url(), fileName );
QDesktopServices::openUrl( fileName );
auto handler = saveResource( url, webview->url(), fileName );

if ( !handler->isEmpty() ) {
connect( handler, &ResourceToSaveHandler::done, this, [ fileName ]() {
QDesktopServices::openUrl( fileName );
} );
}
else {
QDesktopServices::openUrl( fileName );
}
}
}
else {
Expand Down

0 comments on commit 9c5e259

Please sign in to comment.