+ }
+}
+
+void DolphinView::loadDirectory(const KUrl& url, bool reload)
+{
+ if (!url.isValid()) {
+ const QString location(url.pathOrUrl());
+ if (location.isEmpty()) {
+ emit errorMessage(i18nc("@info:status", "The location is empty."));
+ } else {
+ emit errorMessage(i18nc("@info:status", "The location '%1' is invalid.", location));
+ }
+ return;
+ }
+
+ m_loadingDirectory = true;
+
+ m_dirLister->stop();
+ m_dirLister->openUrl(url, reload ? KDirLister::Reload : KDirLister::NoFlags);
+
+ if (isColumnViewActive()) {
+ // adjusting the directory lister is not enough in the case of the
+ // column view, as each column has its own directory lister internally...
+ if (reload) {
+ m_columnView->reload();
+ } else {
+ m_columnView->showColumn(url);
+ }
+ }
+}
+
+KUrl DolphinView::viewPropertiesUrl() const
+{
+ if (isColumnViewActive()) {
+ return m_columnView->rootUrl();
+ }
+
+ return url();
+}
+
+void DolphinView::applyViewProperties(const KUrl& url)
+{
+ if (m_ignoreViewProperties) {
+ return;
+ }
+
+ if (isColumnViewActive() && rootUrl().isParentOf(url)) {
+ // The column view is active, hence don't apply the view properties
+ // of sub directories (represented by columns) to the view. The
+ // view always represents the properties of the first column.
+ return;
+ }
+
+ const ViewProperties props(url);
+
+ const Mode mode = props.viewMode();
+ if (m_mode != mode) {
+ const int oldZoomLevel = m_controller->zoomLevel();
+
+ m_mode = mode;
+ createView();
+ emit modeChanged();
+
+ updateZoomLevel(oldZoomLevel);
+ }
+ if (itemView() == 0) {
+ createView();
+ }
+ Q_ASSERT(itemView() != 0);
+ Q_ASSERT(m_fileItemDelegate != 0);
+
+ const bool showHiddenFiles = props.showHiddenFiles();
+ if (showHiddenFiles != m_dirLister->showingDotFiles()) {
+ m_dirLister->setShowingDotFiles(showHiddenFiles);
+ emit showHiddenFilesChanged();
+ }
+
+ m_storedCategorizedSorting = props.categorizedSorting();
+ const bool categorized = m_storedCategorizedSorting && supportsCategorizedSorting();
+ if (categorized != m_proxyModel->isCategorizedModel()) {
+ m_proxyModel->setCategorizedModel(categorized);
+ emit categorizedSortingChanged();