mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
Merge branch 'staged' into dev
This commit is contained in:
commit
a978569db9
|
@ -26,7 +26,7 @@ This code has been run and tested on Windows 10/11, Ubuntu Linux, Mac OS X.
|
|||
qtdeclarative5-dev libxtst-dev liblzo2-dev libbz2-dev \
|
||||
libao-dev libavutil-dev libavformat-dev libtiff5-dev libeb16-dev \
|
||||
libqt5svg5-dev libqt5x11extras5-dev qttools5-dev \
|
||||
qttools5-dev-tools qtmultimedia5-dev libqt5multimedia5-plugins
|
||||
qttools5-dev-tools qtmultimedia5-dev libqt5multimedia5-plugins libqt5webchannel5-dev qtwebengine5-dev
|
||||
|
||||
### Fedora 35
|
||||
```
|
||||
|
|
|
@ -446,6 +446,8 @@ void ArticleRequest::altSearchFinished()
|
|||
if ( altsDone )
|
||||
return;
|
||||
|
||||
emit GlobalBroadcaster::instance()->dictionaryClear( ActiveDictIds{word} );
|
||||
|
||||
// Check every request for finishing
|
||||
for( list< sptr< Dictionary::WordSearchRequest > >::iterator i =
|
||||
altSearches.begin(); i != altSearches.end(); )
|
||||
|
|
|
@ -360,6 +360,9 @@ ArticleView::ArticleView( QWidget * parent, ArticleNetworkAccessManager & nm, Au
|
|||
connect(GlobalBroadcaster::instance(), SIGNAL( dictionaryChanges(ActiveDictIds)), this,
|
||||
SLOT(setActiveDictIds(ActiveDictIds)));
|
||||
|
||||
connect( GlobalBroadcaster::instance(), &GlobalBroadcaster::dictionaryClear, this,
|
||||
&ArticleView::dictionaryClear );
|
||||
|
||||
channel = new QWebChannel(ui.definition->page());
|
||||
agent = new ArticleViewAgent(this);
|
||||
attachWebChannelToHtml();
|
||||
|
@ -2609,16 +2612,25 @@ void ArticleView::highlightAllFtsOccurences( QWebEnginePage::FindFlags flags )
|
|||
}
|
||||
|
||||
void ArticleView::setActiveDictIds(ActiveDictIds ad) {
|
||||
// ignore all other signals.
|
||||
qDebug() << "receive dicts, current word:" << currentWord << ad.word << ":" << ad.dictIds;
|
||||
if (ad.word == currentWord) {
|
||||
qDebug() << "receive dicts, current word accept:" << currentWord;
|
||||
// ignore all other signals.
|
||||
qDebug() << "receive dicts, current word:" << currentWord << ad.word << ":" << ad.dictIds;
|
||||
currentActiveDictIds << ad.dictIds;
|
||||
currentActiveDictIds.removeDuplicates();
|
||||
emit updateFoundInDictsList();
|
||||
}
|
||||
}
|
||||
|
||||
void ArticleView::dictionaryClear( ActiveDictIds ad )
|
||||
{
|
||||
// ignore all other signals.
|
||||
if( ad.word == currentWord )
|
||||
{
|
||||
qDebug() << "clear current dictionaries:" << currentWord;
|
||||
currentActiveDictIds.clear();
|
||||
}
|
||||
}
|
||||
|
||||
//todo ,futher refinement?
|
||||
void ArticleView::performFtsFindOperation( bool backwards )
|
||||
{
|
||||
|
|
|
@ -367,6 +367,8 @@ private slots:
|
|||
|
||||
void setActiveDictIds(ActiveDictIds);
|
||||
|
||||
void dictionaryClear( ActiveDictIds ad );
|
||||
|
||||
private:
|
||||
|
||||
/// Deduces group from the url. If there doesn't seem to be any group,
|
||||
|
|
|
@ -28,6 +28,7 @@ public:
|
|||
|
||||
signals:
|
||||
void dictionaryChanges( ActiveDictIds ad );
|
||||
void dictionaryClear( ActiveDictIds ad );
|
||||
};
|
||||
|
||||
#endif // GLOBAL_GLOBALBROADCASTER_H
|
||||
|
|
|
@ -54,7 +54,7 @@ void IframeSchemeHandler::requestStarted(QWebEngineUrlRequestJob *requestJob)
|
|||
// remove existed base tag
|
||||
articleString.remove( baseTag ) ;
|
||||
|
||||
QRegularExpression headTag( "<head\\s+.*?>",
|
||||
QRegularExpression headTag( "<head\\b.*?>",
|
||||
QRegularExpression::CaseInsensitiveOption
|
||||
| QRegularExpression::DotMatchesEverythingOption );
|
||||
auto match = headTag.match( articleString, 0 );
|
||||
|
|
Loading…
Reference in a new issue