Full-text search: Fix handling of some DSL headwords

This commit is contained in:
Abs62 2014-04-21 20:20:24 +04:00
parent df94e2ee80
commit e7477cfd24
2 changed files with 20 additions and 2 deletions

View file

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

@ -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 );
}