This commit is contained in:
xiaoyifang 2021-11-26 21:05:42 +08:00 committed by yifang
parent 68dcf436fe
commit e7779e5302
3 changed files with 6 additions and 47 deletions

View file

@ -670,7 +670,6 @@ void ArticleRequest::bodyFinished()
}
}
//todo ,gdArticleContents need refractor in the future?
string jsVal = Html::escapeForJavaScript( dictId );
head += "<script type=\"text/javascript\">var gdArticleContents; "
"if ( !gdArticleContents ) gdArticleContents = \"" + jsVal +" \"; "

View file

@ -661,25 +661,8 @@ unsigned ArticleView::getGroup( QUrl const & url )
}
QStringList ArticleView::getArticlesList()
{
// //todo dictid
// QStringList dictList;
// for (unsigned i = 0; i < allDictionaries.size(); i++)
// {
// dictList.append( allDictionaries[i]->getId().c_str());
// }
// QStringList mutedDictionaries = getMutedDictionaries(Instances::Group::AllGroupId);
// for (int i=0;i<mutedDictionaries.size();i++)
// {
// dictList.removeOne(mutedDictionaries[i]);
// }
// return dictList;
return runJavaScriptSync( ui.definition->page(), "gdArticleContents" )
.trimmed().split( ' ', QString::SkipEmptyParts );
{
return runJavaScriptSync( ui.definition->page(), "gdArticleContents" ).split( ' ', QString::SkipEmptyParts );
}
QString ArticleView::getActiveArticleId()
@ -796,25 +779,7 @@ void ArticleView::tryMangleWebsiteClickedUrl( QUrl & url, Contexts & contexts )
void ArticleView::updateCurrentArticleFromCurrentFrame( QWebEnginePage * frame ,QPoint * point)
{
//todo
qDebug("updateCurrentArticleFromCurrentFrame");
// if ( !frame )
// frame = ui.definition->page()->currentFrame();
// for( ; frame; frame = frame->parentFrame() )
// {
// QString frameName = frame->frameName();
// if ( frameName.startsWith( "gdexpandframe-" ) )
// {
// QString newCurrent = "gdfrom-" + frameName.mid( 14 );
// if ( getCurrentArticle() != newCurrent )
// setCurrentArticle( newCurrent, false );
// break;
// }
// }
}
void ArticleView::saveHistoryUserData()
@ -1681,12 +1646,10 @@ void ArticleView::forward()
bool ArticleView::hasSound()
{
//todo ,just return true;need futher effort
return true;
// QVariant v = runJavaScriptSync( ui.definition->page(),"gdAudioLinks.first" );
// if ( v.type() == QVariant::String )
// return !v.toString().isEmpty();
// return false;
QVariant v = runJavaScriptSync( ui.definition->page(),"gdAudioLinks.first" );
if ( v.type() == QVariant::String )
return !v.toString().isEmpty();
return false;
}
//todo ,need further effort
@ -1763,7 +1726,6 @@ void ArticleView::contextMenuRequested( QPoint const & pos )
QAction * saveImageAction = 0;
QAction * saveSoundAction = 0;
//todo url();?
QUrl targetUrl( r->url() );
Contexts contexts;
@ -2670,7 +2632,6 @@ QString ArticleView::getWebPageTextSync(QWebEnginePage * page){
return planText;
}
//todo ,futher refinement?
void ArticleView::performFtsFindOperation( bool backwards )
{
if( !ftsSearchIsOpened )

1
dsl.cc
View file

@ -2322,7 +2322,6 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
// Skip the article's body
for( ; ; )
{
//todo ,return headword only?
hasString = haveLine ? true : scanner.readNextLineWithoutComments( curString, curOffset);
haveLine = false;