mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
Full-text search: Fix handling of some DSL headwords
This commit is contained in:
parent
df94e2ee80
commit
e7477cfd24
|
@ -887,8 +887,15 @@ void ArticleView::openLink( QUrl const & url, QUrl const & ref,
|
|||
else
|
||||
if ( url.scheme().compare( "bword" ) == 0 )
|
||||
{
|
||||
showDefinition( url.path(),
|
||||
getGroup( ref ), scrollTo, contexts );
|
||||
if( ref.hasQueryItem( "dictionaries" ) )
|
||||
{
|
||||
QStringList dictsList = ref.queryItemValue( "dictionaries" )
|
||||
.split( ",", QString::SkipEmptyParts );
|
||||
showDefinition( url.path(), dictsList );
|
||||
}
|
||||
else
|
||||
showDefinition( url.path(),
|
||||
getGroup( ref ), scrollTo, contexts );
|
||||
}
|
||||
else
|
||||
if ( url.scheme() == "gdlookup" ) // Plain html links inherit gdlookup scheme
|
||||
|
@ -900,6 +907,15 @@ void ArticleView::openLink( QUrl const & url, QUrl const & ref,
|
|||
}
|
||||
else
|
||||
{
|
||||
if( ref.hasQueryItem( "dictionaries" ) )
|
||||
{
|
||||
// Specific dictionary group from full-text search
|
||||
QStringList dictsList = ref.queryItemValue( "dictionaries" )
|
||||
.split( ",", QString::SkipEmptyParts );
|
||||
showDefinition( url.path().mid( 1 ), dictsList );
|
||||
return;
|
||||
}
|
||||
|
||||
QString newScrollTo( scrollTo );
|
||||
if( url.hasQueryItem( "dict" ) )
|
||||
{
|
||||
|
|
2
dsl.cc
2
dsl.cc
|
@ -1309,6 +1309,7 @@ void DslDictionary::getArticleText( uint32_t articleAddress, QString & headword,
|
|||
{
|
||||
// This is full headword - store it
|
||||
unescapeDsl( head );
|
||||
normalizeHeadword( head );
|
||||
headword = gd::toQString( head );
|
||||
}
|
||||
// If '~' presented, leave headword empty,
|
||||
|
@ -1318,6 +1319,7 @@ void DslDictionary::getArticleText( uint32_t articleAddress, QString & headword,
|
|||
else
|
||||
{
|
||||
unescapeDsl( articleHeadword );
|
||||
normalizeHeadword( articleHeadword );
|
||||
headword = gd::toQString( articleHeadword );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue