From daa1aa3a5fcdaad2a12925c7f4d0e8059c302a07 Mon Sep 17 00:00:00 2001 From: Xiao YiFang Date: Mon, 9 Jan 2023 21:22:13 +0800 Subject: [PATCH] clean code: remove useless code --- articleview.cc | 9 --------- articleview.hh | 4 ---- 2 files changed, 13 deletions(-) diff --git a/articleview.cc b/articleview.cc index 46af83cc..aa19da80 100644 --- a/articleview.cc +++ b/articleview.cc @@ -729,15 +729,8 @@ void ArticleView::tryMangleWebsiteClickedUrl( QUrl & url, Contexts & contexts ) } } -void ArticleView::saveHistoryUserData() -{ - ui.definition->setProperty("sx", ui.definition->page()->scrollPosition().x()); - ui.definition->setProperty("sy", ui.definition->page()->scrollPosition().y()); -} - void ArticleView::load( QUrl const & url ) { - saveHistoryUserData(); ui.definition->load( url ); } @@ -1614,7 +1607,6 @@ void ArticleView::back() // empty page if ( canGoBack() ) { - saveHistoryUserData(); currentActiveDictIds.clear(); historyMode = true; ui.definition->back(); @@ -1623,7 +1615,6 @@ void ArticleView::back() void ArticleView::forward() { - saveHistoryUserData(); currentActiveDictIds.clear(); historyMode = true; ui.definition->forward(); diff --git a/articleview.hh b/articleview.hh index 6cd08806..90897a57 100644 --- a/articleview.hh +++ b/articleview.hh @@ -396,10 +396,6 @@ private: /// url to the appropriate "contexts" entry. void tryMangleWebsiteClickedUrl( QUrl & url, Contexts & contexts ); - /// Saves current article and scroll position for the current history item. - /// Should be used when leaving the page. - void saveHistoryUserData(); - /// Loads a page at @p url into view. void load( QUrl const & url );