From c5b9e48e0e86cdf6ac02f02268a321abd80693de Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Thu, 16 Feb 2023 15:58:44 +0800 Subject: [PATCH 1/2] fix: local dictionary file:/// support --- website.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/website.cc b/website.cc index 77655e1e..30f378b0 100644 --- a/website.cc +++ b/website.cc @@ -42,16 +42,18 @@ public: netMgr( netMgr_ ), experimentalIframe(false) { - QString temp=urlTemplate_; - if(temp.endsWith("##")){ - temp.chop(2); + if( urlTemplate_.startsWith( "http://" ) || urlTemplate_.startsWith( "https://" ) ) + { + experimentalIframe = true; } - //make this default. - experimentalIframe = true; + //else file:/// local dictionary file path - urlTemplate = QUrl( temp ).toEncoded() ; - dictionaryDescription = temp; + if(experimentalIframe) + urlTemplate = QUrl( urlTemplate_ ).toEncoded() ; + + + dictionaryDescription = urlTemplate_; } string getName() noexcept override From 84c6b792177dab865726d51b15a1e8a1d755281c Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Thu, 16 Feb 2023 16:11:27 +0800 Subject: [PATCH 2/2] fix: local dictionary file:/// support --- website.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/website.cc b/website.cc index 30f378b0..bb2f933e 100644 --- a/website.cc +++ b/website.cc @@ -48,11 +48,7 @@ public: } //else file:/// local dictionary file path - - if(experimentalIframe) - urlTemplate = QUrl( urlTemplate_ ).toEncoded() ; - - + urlTemplate = QUrl( urlTemplate_ ).toEncoded() ; dictionaryDescription = urlTemplate_; }