+void DolphinColumnView::expandToActiveUrl()
+{
+ const KUrl& activeUrl = m_controller->url();
+ const KUrl baseUrl = m_dolphinModel->dirLister()->url();
+ if (baseUrl.isParentOf(activeUrl) && (baseUrl != activeUrl)) {
+ m_dolphinModel->expandToUrl(activeUrl);
+ reloadColumns();
+ }
+}
+
+void DolphinColumnView::triggerReloadColumns(const QModelIndex& index)
+{
+ Q_UNUSED(index);
+ disconnect(m_dolphinModel, SIGNAL(expand(const QModelIndex&)),
+ this, SLOT(triggerReloadColumns(const QModelIndex&)));
+ // the reloading of the columns may not be done in the context of this slot
+ QMetaObject::invokeMethod(this, "reloadColumns", Qt::QueuedConnection);
+}
+
+void DolphinColumnView::reloadColumns()
+{
+ const int count = m_columns.count() - 1; // ignore the last column
+ for (int i = 0; i < count; ++i) {
+ ColumnWidget* nextColumn = m_columns[i + 1];
+ const QModelIndex rootIndex = nextColumn->rootIndex();
+ if (!rootIndex.isValid()) {
+ const QModelIndex dirIndex = m_dolphinModel->indexForUrl(m_columns[i]->childUrl());
+ const QModelIndex proxyIndex = m_proxyModel->mapFromSource(dirIndex);
+ if (proxyIndex.isValid()) {
+ nextColumn->setRootIndex(proxyIndex);
+ nextColumn->show();
+ }
+ }
+ }
+}
+