mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-12-17 23:04:06 +00:00
fix: epwing dictionary reference navigation restrict to certain dictionary
This commit is contained in:
parent
8313d93469
commit
74a21e7e26
|
@ -839,7 +839,7 @@ QString EpwingBook::getPreviousTextWithLength( int page, int offset, int total,
|
|||
if ( buf.length() > TextSizeLimit ) {
|
||||
error_string = "Data too large";
|
||||
currentPosition.page = 0;
|
||||
return QString();
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1373,6 +1373,7 @@ void EpwingBook::finalizeText( QString & text )
|
|||
url.setHost( "localhost" );
|
||||
|
||||
url.setPath( Utils::Url::ensureLeadingSlash( QString( "r%1At%2" ).arg( ebpos.page ).arg( ebpos.offset ) ) );
|
||||
url.setQuery( "dictionaries=" + dictID );
|
||||
|
||||
QString link = "<a href=\"" + url.toEncoded() + "\">";
|
||||
|
||||
|
|
|
@ -1010,6 +1010,14 @@ void ArticleView::openLink( QUrl const & url, QUrl const & ref, QString const &
|
|||
return;
|
||||
}
|
||||
|
||||
if ( Utils::Url::hasQueryItem( url, "dictionaries" ) ) {
|
||||
// Specific dictionary group from full-text search
|
||||
QStringList dictsList = Utils::Url::queryItemValue( url, "dictionaries" ).split( ",", Qt::SkipEmptyParts );
|
||||
|
||||
showDefinition( word, dictsList, QRegExp(), getGroup( url ), false );
|
||||
return;
|
||||
}
|
||||
|
||||
QString newScrollTo( scrollTo );
|
||||
if ( Utils::Url::hasQueryItem( url, "dict" ) ) {
|
||||
// Link to other dictionary
|
||||
|
|
Loading…
Reference in a new issue