Logo Search packages:      
Sourcecode: d3lphin version File versions  Download package

void Dolphin::refreshViews (  ) 

Refreshs the views of the main window by recreating them dependent from the given Dolphin settings.

Definition at line 170 of file dolphin.cpp.

References activeViewChanged(), ViewProperties::isShowHiddenFilesEnabled(), DolphinSettings::isViewSplit(), DolphinSettings::rightsidebar(), DolphinView::url(), and ViewProperties::viewMode().

Referenced by ItemEffectsManager::zoomIn(), and ItemEffectsManager::zoomOut().

{
    const bool split = DolphinSettings::instance().isViewSplit();
    const bool isPrimaryViewActive = (m_activeView == m_view[PrimaryIdx]);
    DolphinSettings& settings = DolphinSettings::instance();
    KURL url;
    for (int i = PrimaryIdx; i <= SecondaryIdx; ++i) {
       if (m_view[i] != 0) {
            url = m_view[i]->url();

            // delete view instance...
            m_view[i]->close();
            m_view[i]->deleteLater();
            m_view[i] = 0;
        }

        if (split || (i == PrimaryIdx)) {
            // ... and recreate it
            ViewProperties props(url);
            m_view[i] = new DolphinView(m_splitter,
                                        url,
                                        props.viewMode(),
                                        props.isShowHiddenFilesEnabled());
            m_view[i]->show();
        }

        rightSidebarSettings* rightsidebarSettings = settings.rightsidebar();
        assert(rightsidebarSettings != 0);
        if (rightsidebarSettings->isVisible()) {
            m_splitter->moveToLast(m_rightsidebar);
        }
    }

    m_activeView = isPrimaryViewActive ? m_view[PrimaryIdx] : m_view[SecondaryIdx];
    assert(m_activeView != 0);

    updateViewActions();
    emit activeViewChanged();
}


Generated by  Doxygen 1.6.0   Back to index