+ // let the column widget be aware about its URL...
+ KUrl columnUrl;
+ if (viewport()->children().count() == 0) {
+ // For the first column widget the directory lister has not been started
+ // yet, hence use the URL from the controller instead.
+ columnUrl = m_controller->url();
+ } else {
+ const QAbstractProxyModel* proxyModel = static_cast<const QAbstractProxyModel*>(model());
+ const KDirModel* dirModel = static_cast<const KDirModel*>(proxyModel->sourceModel());
+
+ const QModelIndex dirModelIndex = proxyModel->mapToSource(index);
+ KFileItem* fileItem = dirModel->itemForIndex(dirModelIndex);
+ if (fileItem != 0) {
+ columnUrl = fileItem->url();
+ }
+ }
+
+ ColumnWidget* view = new ColumnWidget(viewport(), this, columnUrl);