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 ); string jsVal = Html::escapeForJavaScript( dictId );
head += "<script type=\"text/javascript\">var gdArticleContents; " head += "<script type=\"text/javascript\">var gdArticleContents; "
"if ( !gdArticleContents ) gdArticleContents = \"" + jsVal +" \"; " "if ( !gdArticleContents ) gdArticleContents = \"" + jsVal +" \"; "

View file

@ -662,24 +662,7 @@ unsigned ArticleView::getGroup( QUrl const & url )
QStringList ArticleView::getArticlesList() QStringList ArticleView::getArticlesList()
{ {
// //todo dictid return runJavaScriptSync( ui.definition->page(), "gdArticleContents" ).split( ' ', QString::SkipEmptyParts );
// 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 );
} }
QString ArticleView::getActiveArticleId() QString ArticleView::getActiveArticleId()
@ -796,25 +779,7 @@ void ArticleView::tryMangleWebsiteClickedUrl( QUrl & url, Contexts & contexts )
void ArticleView::updateCurrentArticleFromCurrentFrame( QWebEnginePage * frame ,QPoint * point) void ArticleView::updateCurrentArticleFromCurrentFrame( QWebEnginePage * frame ,QPoint * point)
{ {
//todo
qDebug("updateCurrentArticleFromCurrentFrame"); 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() void ArticleView::saveHistoryUserData()
@ -1681,12 +1646,10 @@ void ArticleView::forward()
bool ArticleView::hasSound() bool ArticleView::hasSound()
{ {
//todo ,just return true;need futher effort QVariant v = runJavaScriptSync( ui.definition->page(),"gdAudioLinks.first" );
return true; if ( v.type() == QVariant::String )
// QVariant v = runJavaScriptSync( ui.definition->page(),"gdAudioLinks.first" ); return !v.toString().isEmpty();
// if ( v.type() == QVariant::String ) return false;
// return !v.toString().isEmpty();
// return false;
} }
//todo ,need further effort //todo ,need further effort
@ -1763,7 +1726,6 @@ void ArticleView::contextMenuRequested( QPoint const & pos )
QAction * saveImageAction = 0; QAction * saveImageAction = 0;
QAction * saveSoundAction = 0; QAction * saveSoundAction = 0;
//todo url();?
QUrl targetUrl( r->url() ); QUrl targetUrl( r->url() );
Contexts contexts; Contexts contexts;
@ -2670,7 +2632,6 @@ QString ArticleView::getWebPageTextSync(QWebEnginePage * page){
return planText; return planText;
} }
//todo ,futher refinement?
void ArticleView::performFtsFindOperation( bool backwards ) void ArticleView::performFtsFindOperation( bool backwards )
{ {
if( !ftsSearchIsOpened ) if( !ftsSearchIsOpened )

1
dsl.cc
View file

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