From 791da9164565146406cb5a5569ca028d53318258 Mon Sep 17 00:00:00 2001
From: YiFang Xiao
Date: Wed, 30 Aug 2023 23:10:19 +0800
Subject: [PATCH] fix: navigate through epwing dictionary restricted to certain
dictionary
---
src/article_maker.cc | 3 ++-
src/dict/epwing.cc | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/article_maker.cc b/src/article_maker.cc
index 1f4dfa05..ac1fc90d 100644
--- a/src/article_maker.cc
+++ b/src/article_maker.cc
@@ -387,9 +387,10 @@ sptr< Dictionary::DataRequest > ArticleMaker::makeDefinitionFor( QString const &
unmutedDicts.reserve( activeDicts.size() );
- for ( unsigned x = 0; x < activeDicts.size(); ++x )
+ for ( unsigned x = 0; x < activeDicts.size(); ++x ) {
if ( !mutedDicts.contains( QString::fromStdString( activeDicts[ x ]->getId() ) ) )
unmutedDicts.push_back( activeDicts[ x ] );
+ }
return std::make_shared< ArticleRequest >(
word,
diff --git a/src/dict/epwing.cc b/src/dict/epwing.cc
index a5e2d647..86bf619c 100644
--- a/src/dict/epwing.cc
+++ b/src/dict/epwing.cc
@@ -312,7 +312,8 @@ string Epwing::EpwingDictionary::epwing_previous_button( const int & articlePage
{
QString previousButton = QString( "p%1At%2" ).arg( articlePage ).arg( articleOffset );
string previousLink = R"(" + tr( "Previous Page" ).toStdString() + "
";
+ + previousButton.toStdString() + "?dictionaries=" + getId() + "\">" + tr( "Previous Page" ).toStdString()
+ + "
";
return previousLink;
}
@@ -348,7 +349,7 @@ void EpwingDictionary::loadArticleNextPage( string & articleHeadword,
string Epwing::EpwingDictionary::epwing_next_button( const int & articlePage, const int & articleOffset )
{
QString refLink = QString( "r%1At%2" ).arg( articlePage ).arg( articleOffset );
- string nextLink = R"("
+ string nextLink = R"("
+ tr( "Next Page" ).toStdString() + "
";
return nextLink;