fix: local dictionary file:/// support

This commit is contained in:
xiaoyifang 2023-02-16 15:58:44 +08:00
parent 1688481bc3
commit c5b9e48e0e

View file

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