opt: support to open image in system viewer (#1309)

* opt: open image in external

fix have to wait the resource downloaded

* [autofix.ci] apply automated fixes

---------

Co-authored-by: YiFang Xiao <yifang.xiao@noreply.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
xiaoyifang 2023-12-06 09:44:17 +08:00 committed by GitHub
parent 64f69d2235
commit 9c5e25971b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {