From e7218fc12be4f7c9a56228d9f30ffd125ee49fb3 Mon Sep 17 00:00:00 2001 From: yifang Date: Tue, 28 Dec 2021 21:49:32 +0800 Subject: [PATCH] open link content duplicated in all the tabs. --- articleview.hh | 4 ++-- mainwindow.cc | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/articleview.hh b/articleview.hh index 6ff6926f..b47b26e1 100644 --- a/articleview.hh +++ b/articleview.hh @@ -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 & ); diff --git a/mainwindow.cc b/mainwindow.cc index 002f6bdf..abd9b660 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -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 );