┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dolphinmainwindow.cpp10
-rw-r--r--src/dolphinviewcontainer.cpp6
2 files changed, 15 insertions, 1 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 4eef2fad5..f6f4e5eee 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -830,7 +830,15 @@ void DolphinMainWindow::replaceLocation()
void DolphinMainWindow::goBack()
{
clearStatusBar();
- m_activeViewContainer->urlNavigator()->goBack();
+
+ KUrlNavigator* urlNavigator = m_activeViewContainer->urlNavigator();
+ urlNavigator->goBack();
+
+ if (urlNavigator->locationState().isEmpty()) {
+ // An empty location state indicates a redirection URL,
+ // which must be skipped too
+ urlNavigator->goBack();
+ }
}
void DolphinMainWindow::goForward()
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp
index fa6841538..28ffc23e4 100644
--- a/src/dolphinviewcontainer.cpp
+++ b/src/dolphinviewcontainer.cpp
@@ -433,7 +433,13 @@ void DolphinViewContainer::redirect(const KUrl& oldUrl, const KUrl& newUrl)
Q_UNUSED(oldUrl);
const bool block = m_urlNavigator->signalsBlocked();
m_urlNavigator->blockSignals(true);
+
+ // Assure that the location state is reset for redirection URLs. This
+ // allows to skip redirection URLs when going back or forward in the
+ // URL history.
+ m_urlNavigator->saveLocationState(QByteArray());
m_urlNavigator->setLocationUrl(newUrl);
+
m_urlNavigator->blockSignals(block);
}