]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Forward port of SVN commit 1147596: Skip redirection URLs when going back or forward...
authorPeter Penz <peter.penz19@gmail.com>
Thu, 8 Jul 2010 19:46:56 +0000 (19:46 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Thu, 8 Jul 2010 19:46:56 +0000 (19:46 +0000)
back won't be possible for the user, as a redirection will occur again).

CCBUG: 212293

svn path=/trunk/KDE/kdebase/apps/; revision=1147597

src/dolphinmainwindow.cpp
src/dolphinviewcontainer.cpp

index 4eef2fad5a7d6413839bc6cd90dc4ceb7e48e4ed..f6f4e5eee6e83605c60904dd4c16f75369535dbe 100644 (file)
@@ -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()
index fa68415387daa5b50a34ec8b882a0aefc51117d6..28ffc23e45dd4c5d2eaee8a8d5e526470b15c109 100644 (file)
@@ -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);
 }