From 245923a084353a620d63cd063e82a00f29e40e6b Mon Sep 17 00:00:00 2001 From: YiFang Xiao Date: Mon, 9 Oct 2023 20:37:09 +0800 Subject: [PATCH] fix: allow video to be dragged around --- src/dict/mdx.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/dict/mdx.cc b/src/dict/mdx.cc index de8c3508..d55e8a10 100644 --- a/src/dict/mdx.cc +++ b/src/dict/mdx.cc @@ -976,17 +976,17 @@ void MdxDictionary::replaceLinks( QString & id, QString & article ) match = RX::Mdx::srcRe.match( linkTxt ); if ( match.hasMatch() ) { QString newText; - if ( linkType.at( 1 ) == 'o' ) // "source" tag - { - QString filename = match.captured( 3 ); - QString newName = getCachedFileName( filename ); - newName.replace( '\\', '/' ); - newText = match.captured( 1 ) + match.captured( 2 ) + "file:///" + newName + match.captured( 2 ); + QString scheme; + // "source" tag + if ( linkType.compare( "source" ) == 0 ) { + scheme = "gdvideo://"; } else { - newText = match.captured( 1 ) + match.captured( 2 ) + "bres://" + id + "/" + match.captured( 3 ) - + match.captured( 2 ); + scheme = "bres://"; } + newText = + match.captured( 1 ) + match.captured( 2 ) + scheme + id + "/" + match.captured( 3 ) + match.captured( 2 ); + newLink = linkTxt.replace( match.capturedStart(), match.capturedLength(), newText ); } else