- const int index = m_urlNavigator->historyIndex();
- if (index > 0) {
- // The "Go Forward" action is enabled. Try to mark
- // the previous directory as active item:
- const KUrl url = m_urlNavigator->locationUrl(index - 1);
- m_view->activateItem(url);
+ QByteArray locationState = m_urlNavigator->locationState();
+
+ if (!locationState.isEmpty()) {
+ QDataStream stream(&locationState, QIODevice::ReadOnly);
+ m_view->restoreState(stream);