open link content duplicated in all the tabs.

This commit is contained in:
yifang 2021-12-28 21:49:32 +08:00
parent 8e6f4c2c10
commit e7218fc12b
2 changed files with 8 additions and 3 deletions

View file

@ -276,14 +276,14 @@ public slots:
/// Selects an entire text of the current article
void selectCurrentArticle();
void linkClicked( QUrl const & );
private slots:
void loadFinished( bool ok );
void handleTitleChanged( QString const & title );
void handleUrlChanged( QUrl const & url );
void attachToJavaScript();
void linkClicked( QUrl const & );
void linkHovered( const QString & link);
void contextMenuRequested( QPoint const & );

View file

@ -1672,7 +1672,12 @@ ArticleView * MainWindow::createNewTab( bool switchToIt,
connect( view, SIGNAL( zoomIn()), this, SLOT( zoomin() ) );
connect( view, SIGNAL( zoomOut()), this, SLOT( zoomout() ) );
connect (wuri,SIGNAL(linkClicked(QUrl)),view,SLOT(linkClicked(QUrl)));
connect(wuri, &WebUrlRequestInterceptor::linkClicked, view, [=](QUrl url) {
ArticleView *active = getCurrentArticleView();
if (active == view) {
view->linkClicked(url);
}
});
view->setSelectionBySingleClick( cfg.preferences.selectWordBySingleClick );