mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
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:
parent
64f69d2235
commit
9c5e25971b
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue