dirLister->openUrl(rootUrl, false, true);
}
+void DolphinColumnView::invertSelection()
+{
+ // TODO: this approach of inverting the selection is quite slow. It should
+ // be possible to speedup the implementation by using QItemSelection, but
+ // all adempts have failed yet...
+
+ ColumnWidget* column = activeColumn();
+ QItemSelectionModel* selModel = column->selectionModel();
+
+ KDirLister* dirLister = m_dolphinModel->dirLister();
+ const KFileItemList list = dirLister->itemsForDir(column->url());
+ foreach (KFileItem* item, list) {
+ const QModelIndex index = m_dolphinModel->indexForUrl(item->url());
+ selModel->select(m_proxyModel->mapFromSource(index), QItemSelectionModel::Toggle);
+ }
+}
+
void DolphinColumnView::showColumn(const KUrl& url)
{
const KUrl& rootUrl = m_columns[0]->url();
m_index = columnIndex;
activeColumn()->setActive(true);
- expandToActiveUrl();
+ connect(dirLister, SIGNAL(completed()),
+ this, SLOT(expandToActiveUrl()));
+ dirLister->openUrl(rootUrl, false, true);
+}
+
+void DolphinColumnView::selectAll()
+{
+ activeColumn()->selectAll();
}
bool DolphinColumnView::isIndexHidden(const QModelIndex& index) const
void DolphinColumnView::expandToActiveUrl()
{
+ disconnect(m_dolphinModel->dirLister(), SIGNAL(completed()),
+ this, SLOT(expandToActiveUrl()));
+
const int lastIndex = m_columns.count() - 1;
Q_ASSERT(lastIndex >= 0);
const KUrl& activeUrl = m_columns[lastIndex]->url();
for (int i = 0; i <= end; ++i) {
ColumnWidget* nextColumn = m_columns[i + 1];
- KDirLister* dirLister = m_dolphinModel->dirLister();
- dirLister->updateDirectory(nextColumn->url());
-
const QModelIndex rootIndex = nextColumn->rootIndex();
if (rootIndex.isValid()) {
nextColumn->show();