summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid E. Narváez <david.narvaez@computer.org>2011-09-02 07:03:11 -0500
committerDavid E. Narváez <david.narvaez@computer.org>2011-09-02 07:03:11 -0500
commit4e02e4f951ee5b7b17a53b52abe5b7b77a807766 (patch)
tree844a81259644106705b0554e979ba33fc68e473f
parentFix data insert in the home page setting dialog (diff)
downloadrekonq-4e02e4f951ee5b7b17a53b52abe5b7b77a807766.tar.xz
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
-rw-r--r--src/mainview.cpp24
1 files changed, 12 insertions, 12 deletions
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);
}
}