svn path=/trunk/KDE/kdebase/apps/; revision=647264
// sort by the user visible string for now
setSortRole(Qt::DisplayRole);
setSortCaseSensitivity(Qt::CaseInsensitive);
// sort by the user visible string for now
setSortRole(Qt::DisplayRole);
setSortCaseSensitivity(Qt::CaseInsensitive);
- sort(KDirModel::Name, Qt::Ascending);
}
DolphinSortFilterProxyModel::~DolphinSortFilterProxyModel()
}
DolphinSortFilterProxyModel::~DolphinSortFilterProxyModel()
// KDirModel::ModelColumns. We will keep the sortOrder.
Q_ASSERT(static_cast<int>(sorting) >= 0 && static_cast<int>(sorting) < dolphinMapSize);
sort(dolphinViewToDirModelColumn[static_cast<int>(sorting)],
// KDirModel::ModelColumns. We will keep the sortOrder.
Q_ASSERT(static_cast<int>(sorting) >= 0 && static_cast<int>(sorting) < dolphinMapSize);
sort(dolphinViewToDirModelColumn[static_cast<int>(sorting)],
}
void DolphinSortFilterProxyModel::setSortOrder(Qt::SortOrder sortOrder)
}
void DolphinSortFilterProxyModel::setSortOrder(Qt::SortOrder sortOrder)
QSortFilterProxyModel::sort(column, sortOrder);
}
QSortFilterProxyModel::sort(column, sortOrder);
}
+bool DolphinSortFilterProxyModel::hasChildren(const QModelIndex& parent) const
+{
+ const QModelIndex sourceParent = mapToSource(parent);
+ return sourceModel()->hasChildren(sourceParent);
+}
+
+bool DolphinSortFilterProxyModel::canFetchMore(const QModelIndex& parent) const
+{
+ const QModelIndex sourceParent = mapToSource(parent);
+ return sourceModel()->canFetchMore(sourceParent);
+}
+
DolphinView::Sorting DolphinSortFilterProxyModel::sortingForColumn(int column)
{
if ((column >= 0) && (column < dolphinMapSize)) {
DolphinView::Sorting DolphinSortFilterProxyModel::sortingForColumn(int column)
{
if ((column >= 0) && (column < dolphinMapSize)) {
virtual void sort(int column,
Qt::SortOrder order = Qt::AscendingOrder);
virtual void sort(int column,
Qt::SortOrder order = Qt::AscendingOrder);
+ /** Reimplemented from QAbstractItemModel. Returns true for directories. */
+ virtual bool hasChildren(const QModelIndex& parent = QModelIndex()) const;
+
+ /** Reimplemented from QAbstractItemModel. Returns true for empty directories. */
+ virtual bool canFetchMore(const QModelIndex& parent) const;
+
/**
* Helper method to get the DolphinView::Sorting type for a given
* column \a column. If the column is smaller 0 or greater than the
/**
* Helper method to get the DolphinView::Sorting type for a given
* column \a column. If the column is smaller 0 or greater than the