void DeclarativeWebContainer::goBack()
{
    if (m_canGoBack && m_webPage) {
        m_canGoBack = false;
        emit canGoBackChanged();

        if (!m_canGoForward) {
            m_canGoForward = true;
            emit canGoForwardChanged();
        }

        m_webPage->setBackForwardNavigation(true);
        m_realNavigation = m_webPage->canGoBack();
        // When executing non real back navigation, we're adding
        // an entry to forward history of the engine. For instance, in sequence like
        // link X, link Y, restart browser, and navigate back. This sequence triggers
        // an url loading when going back. This means that there is a clean
        // back history in engine. If you now navigate forward, we load the url and not
        // use engine's forward.
        // After this back/forward starts working correctly. As loading indicator can
        // be visible also when using engine navigation it makes this error to hard to spot.
        // In addition, as history is based on browser side database, user cannot navigate
        // beyond back history from user interface. However, JavaScript functions maybe do harm.
        // TODO: We should resurrect the back forward history for page instance
        // when a new tab is created.
        DBManager::instance()->goBack(m_webPage->tabId());
        if (m_realNavigation) {
            m_webPage->goBack();
        }
    }
}
void DeclarativeWebContainer::goForward()
{
    if (m_canGoForward && m_webPage) {
        m_canGoForward = false;
        emit canGoForwardChanged();

        if (!m_canGoBack) {
            m_canGoBack = true;
            emit canGoBackChanged();
        }

        m_webPage->setBackForwardNavigation(true);
        m_realNavigation = m_webPage->canGoForward();
        DBManager::instance()->goForward(m_webPage->tabId());
        if (m_realNavigation) {
            m_webPage->goForward();
        }
    }
}
Esempio n. 3
0
/*!
 * \brief DirModel::setPathFromCurrentLocation() changes current Path using current Location
 *
 *  Used in \ref cdUp() and \ref cdIntoIndex()
 */
void DirModel::setPathFromCurrentLocation()
{
    mAwaitingResults = true;
    emit awaitingResultsChanged();
#if DEBUG_MESSAGES
    qDebug() << Q_FUNC_INFO << this << "Changing to " << mCurLocation->urlPath();
#endif

    clear();

    mCurLocation->fetchItems(currentDirFilter(), mIsRecursive);

    mCurrentDir = mCurLocation->urlPath();
    if (mPathList.count() == 0 || mPathList.last() != mCurrentDir)
    {
        mPathList.append(mCurrentDir);
    }

    emit canGoBackChanged();
    emit pathChanged(mCurLocation->urlPath());
}