From 4e02e4f951ee5b7b17a53b52abe5b7b77a807766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20E=2E=20Narv=C3=A1ez?= Date: Fri, 2 Sep 2011 07:03:11 -0500 Subject: Unify reloading methods All code paths for reloading methods and slots now end up at reloadTab and do proper handling of the about scheme REVIEW: 102481 --- src/mainview.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/mainview.cpp b/src/mainview.cpp index b5738944..ef4cfa73 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -201,16 +201,7 @@ void MainView::updateTabBar() void MainView::webReload() { - WebTab *webTab = currentWebTab(); - if (webTab->view()->url().scheme() != QL1S("about")) - { - QAction *action = webTab->view()->page()->action(QWebPage::Reload); - action->trigger(); - } - else - { - webTab->view()->setUrl(webTab->page()->loadingUrl()); - } + reloadTab(currentIndex()); } @@ -230,7 +221,16 @@ void MainView::reloadTab(int index) if (index < 0 || index >= count()) return; - webTab(index)->view()->reload(); + WebTab *reloadingTab = webTab(index); + if (reloadingTab->view()->url().scheme() != QL1S("about")) + { + QAction *action = reloadingTab->view()->page()->action(QWebPage::Reload); + action->trigger(); + } + else + { + reloadingTab->view()->setUrl(reloadingTab->page()->loadingUrl()); + } } @@ -369,7 +369,7 @@ void MainView::reloadAllTabs() { for (int i = 0; i < count(); ++i) { - webTab(i)->view()->reload(); + reloadTab(i); } } -- cgit v1.2.1