#define KFILEITEMMODEL_DEBUG
KFileItemModel::KFileItemModel(KDirLister* dirLister, QObject* parent) :
- KItemModelBase(QByteArray(), "name", parent),
+ KItemModelBase("name", parent),
m_dirLister(dirLister),
m_naturalSorting(true),
m_sortFoldersFirst(true),
- m_groupRole(NoRole),
m_sortRole(NameRole),
m_caseSensitivity(Qt::CaseInsensitive),
m_sortedItems(),
return false;
}
-bool KFileItemModel::supportsGrouping() const
-{
- return true;
-}
-
-bool KFileItemModel::supportsSorting() const
-{
- return true;
-}
-
void KFileItemModel::setSortFoldersFirst(bool foldersFirst)
{
if (foldersFirst != m_sortFoldersFirst) {
return descr;
}
+QList<QPair<int, QVariant> > KFileItemModel::groups() const
+{
+ // TODO:
+ QPair<int, QVariant> group1(0, "Group 1");
+ QPair<int, QVariant> group2(5, "Group 2");
+ QPair<int, QVariant> group3(10, "Group 3");
+
+ QList<QPair<int, QVariant> > groups;
+ groups.append(group1);
+ groups.append(group2);
+ groups.append(group3);
+ return groups;
+}
+
KFileItem KFileItemModel::fileItem(int index) const
{
if (index >= 0 && index < count()) {
m_restoredExpandedUrls = urls;
}
-void KFileItemModel::onGroupRoleChanged(const QByteArray& current, const QByteArray& previous)
+void KFileItemModel::onGroupedSortingChanged(bool current)
{
- Q_UNUSED(previous);
- m_groupRole = roleIndex(current);
+ Q_UNUSED(current);
}
void KFileItemModel::onSortRoleChanged(const QByteArray& current, const QByteArray& previous)
virtual QHash<QByteArray, QVariant> data(int index) const;
virtual bool setData(int index, const QHash<QByteArray, QVariant>& values);
- /**
- * @return True
- * @reimp
- */
- virtual bool supportsGrouping() const;
-
- /**
- * @return True
- * @reimp
- */
- virtual bool supportsSorting() const;
-
/**
* Sets a separate sorting with folders first (true) or a mixed sorting of files and folders (false).
*/
/** @reimp */
virtual QString roleDescription(const QByteArray& role) const;
+ /** @reimp */
+ virtual QList<QPair<int, QVariant> > groups() const;
+
/**
* @return The file-item for the index \a index. If the index is in a valid
* range it is assured that the file-item is not null. The runtime
void loadingCompleted();
protected:
- virtual void onGroupRoleChanged(const QByteArray& current, const QByteArray& previous);
+ virtual void onGroupedSortingChanged(bool current);
virtual void onSortRoleChanged(const QByteArray& current, const QByteArray& previous);
virtual void onSortOrderChanged(Qt::SortOrder current, Qt::SortOrder previous);
bool m_naturalSorting;
bool m_sortFoldersFirst;
- Role m_groupRole;
Role m_sortRole;
Qt::CaseSensitivity m_caseSensitivity;
}
}
+void KItemListView::slotGroupedSortingChanged(bool current)
+{
+ m_grouped = current;
+}
+
void KItemListView::slotCurrentChanged(int current, int previous)
{
Q_UNUSED(previous);
this, SLOT(slotItemsRemoved(KItemRangeList)));
disconnect(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)),
this, SLOT(slotItemsMoved(KItemRange,QList<int>)));
+ disconnect(m_model, SIGNAL(groupedSortingChanged(bool)),
+ this, SLOT(slotGroupedSortingChanged(bool)));
}
m_model = model;
m_layouter->setModel(model);
- m_grouped = !model->groupRole().isEmpty();
+ m_grouped = model->groupedSorting();
if (m_model) {
connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
this, SLOT(slotItemsRemoved(KItemRangeList)));
connect(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)),
this, SLOT(slotItemsMoved(KItemRange,QList<int>)));
+ connect(m_model, SIGNAL(groupedSortingChanged(bool)),
+ this, SLOT(slotGroupedSortingChanged(bool)));
}
onModelChanged(model, previous);
const QSet<QByteArray>& roles);
private slots:
+ void slotGroupedSortingChanged(bool current);
void slotCurrentChanged(int current, int previous);
void slotSelectionChanged(const QSet<int>& current, const QSet<int>& previous);
void slotAnimationFinished(QGraphicsWidget* widget,
m_maximumItemOffset = 0;
}
- m_grouped = !m_model->groupRole().isEmpty();
- /*if (m_grouped) {
+ m_grouped = m_model->groupedSorting();
+ if (m_grouped) {
createGroupHeaders();
const int lastGroupItemCount = m_model->count() - m_groups.last().firstItemIndex;
- m_maximumOffset = m_groups.last().y + (lastGroupItemCount / m_columnCount) * m_rowHeight;
+ m_maximumScrollOffset = m_groups.last().y + (lastGroupItemCount / m_columnCount) * itemSize.height();
if (lastGroupItemCount % m_columnCount != 0) {
- m_maximumOffset += m_rowHeight;
+ m_maximumScrollOffset += itemSize.height();
}
- } else {*/
- // m_maximumOffset = m_minimumRowHeight * rowCount;
- //}
+ }
#ifdef KITEMLISTVIEWLAYOUTER_DEBUG
kDebug() << "[TIME] doLayout() for " << m_model->count() << "items:" << timer.elapsed();
m_lastVisibleIndex = nextGroupIndex - 1;
}
}
- //Q_ASSERT(m_lastVisibleIndex < m_model->count());
m_lastVisibleIndex = qBound(0, m_lastVisibleIndex, maxIndex);
m_visibleIndexesDirty = false;
m_groups.clear();
m_groupIndexes.clear();
- // TODO:
- QList<int> numbers;
- numbers << 0 << 5 << 6 << 13 << 20 << 25 << 30 << 35 << 50;
+ const QList<QPair<int, QVariant> > groups = m_model->groups();
qreal y = 0;
- for (int i = 0; i < numbers.count(); ++i) {
+ for (int i = 0; i < groups.count(); ++i) {
+ const int firstItemIndex = groups.at(i).first;
if (i > 0) {
- const int previousGroupItemCount = numbers[i] - m_groups.last().firstItemIndex;
+ const int previousGroupItemCount = firstItemIndex - m_groups.last().firstItemIndex;
int previousGroupRowCount = previousGroupItemCount / m_columnCount;
if (previousGroupItemCount % m_columnCount != 0) {
++previousGroupRowCount;
y += HeaderHeight;
ItemGroup itemGroup;
- itemGroup.firstItemIndex = numbers[i];
+ itemGroup.firstItemIndex = firstItemIndex;
itemGroup.y = y;
m_groups.append(itemGroup);
- m_groupIndexes.insert(itemGroup.firstItemIndex);
+ m_groupIndexes.insert(firstItemIndex);
}
}
KItemModelBase::KItemModelBase(QObject* parent) :
QObject(parent),
- m_groupRole(),
+ m_groupedSorting(false),
m_sortRole(),
m_sortOrder(Qt::AscendingOrder)
{
}
-KItemModelBase::KItemModelBase(const QByteArray& groupRole, const QByteArray& sortRole, QObject* parent) :
+KItemModelBase::KItemModelBase(const QByteArray& sortRole, QObject* parent) :
QObject(parent),
- m_groupRole(groupRole),
+ m_groupedSorting(false),
m_sortRole(sortRole),
m_sortOrder(Qt::AscendingOrder)
{
return false;
}
-bool KItemModelBase::supportsGrouping() const
+void KItemModelBase::setGroupedSorting(bool grouped)
{
- return false;
-}
-
-void KItemModelBase::setGroupRole(const QByteArray& role)
-{
- if (supportsGrouping() && role != m_groupRole) {
- const QByteArray previous = m_groupRole;
- m_groupRole = role;
- onGroupRoleChanged(role, previous);
- emit groupRoleChanged(role, previous);
+ if (m_groupedSorting != grouped) {
+ m_groupedSorting = grouped;
+ onGroupedSortingChanged(grouped);
+ emit groupedSortingChanged(grouped);
}
}
-QByteArray KItemModelBase::groupRole() const
-{
- return m_groupRole;
-}
-
-bool KItemModelBase::supportsSorting() const
+bool KItemModelBase::groupedSorting() const
{
- return false;
+ return m_groupedSorting;
}
void KItemModelBase::setSortRole(const QByteArray& role)
{
- if (supportsSorting() && role != m_sortRole) {
+ if (role != m_sortRole) {
const QByteArray previous = m_sortRole;
m_sortRole = role;
onSortRoleChanged(role, previous);
void KItemModelBase::setSortOrder(Qt::SortOrder order)
{
- if (supportsSorting() && order != m_sortOrder) {
+ if (order != m_sortOrder) {
const Qt::SortOrder previous = m_sortOrder;
m_sortOrder = order;
onSortOrderChanged(order, previous);
return role;
}
+QList<QPair<int, QVariant> > KItemModelBase::groups() const
+{
+ return QList<QPair<int, QVariant> >();
+}
+
QMimeData* KItemModelBase::createMimeData(const QSet<int>& indexes) const
{
Q_UNUSED(indexes);
return false;
}
-void KItemModelBase::onGroupRoleChanged(const QByteArray& current, const QByteArray& previous)
+void KItemModelBase::onGroupedSortingChanged(bool current)
{
Q_UNUSED(current);
- Q_UNUSED(previous);
}
void KItemModelBase::onSortRoleChanged(const QByteArray& current, const QByteArray& previous)
*
* One item consists of a variable number of role/value-pairs.
*
- * A model can optionally provide sorting- and/or grouping-capabilities.
+ * A model can optionally provide sorting- and grouping-capabilities.
*/
class LIBDOLPHINPRIVATE_EXPORT KItemModelBase : public QObject
{
public:
KItemModelBase(QObject* parent = 0);
- KItemModelBase(const QByteArray& groupRole, const QByteArray& sortRole, QObject* parent = 0);
+ KItemModelBase(const QByteArray& sortRole, QObject* parent = 0);
virtual ~KItemModelBase();
/** @return The number of items. */
virtual bool setData(int index, const QHash<QByteArray, QVariant>& values);
/**
- * @return True if the model supports grouping of data. Per default false is returned.
- * If the model should support grouping it is necessary to overwrite
- * this method to return true and to implement KItemModelBase::onGroupRoleChanged().
+ * Enables/disables the grouped sorting. The method KItemModelBase::onGroupedSortingChanged() will be
+ * called so that model-implementations can react on the grouped-sorting change. Afterwards the
+ * signal groupedSortingChanged() will be emitted. If the grouped sorting is enabled, the method
+ * KItemModelBase::groups() must be implemented.
*/
- virtual bool supportsGrouping() const;
-
- /**
- * Sets the group-role to \a role. The method KItemModelBase::onGroupRoleChanged() will be
- * called so that model-implementations can react on the group-role change. Afterwards the
- * signal groupRoleChanged() will be emitted.
- */
- void setGroupRole(const QByteArray& role);
- QByteArray groupRole() const;
-
- /**
- * @return True if the model supports sorting of data. Per default false is returned.
- * If the model should support sorting it is necessary to overwrite
- * this method to return true and to implement KItemModelBase::onSortRoleChanged().
- */
- virtual bool supportsSorting() const;
+ void setGroupedSorting(bool grouped);
+ bool groupedSorting() const;
/**
* Sets the sort-role to \a role. The method KItemModelBase::onSortRoleChanged() will be
*/
virtual QString roleDescription(const QByteArray& role) const;
+ virtual QList<QPair<int, QVariant> > groups() const;
+
/**
* @return MIME-data for the items given by \a indexes. The default implementation
* returns 0. The ownership of the returned instance is in the hand of the
void itemsChanged(const KItemRangeList& itemRanges, const QSet<QByteArray>& roles);
- void groupRoleChanged(const QByteArray& current, const QByteArray& previous);
+ void groupedSortingChanged(bool current);
void sortRoleChanged(const QByteArray& current, const QByteArray& previous);
void sortOrderChanged(Qt::SortOrder current, Qt::SortOrder previous);
protected:
/**
- * Is invoked if the group role has been changed by KItemModelBase::setGroupRole(). Allows
- * to react on the changed group role before the signal groupRoleChanged() will be emitted.
- * The implementation must assure that the items are sorted in a way that they are grouped
- * by the role given by \a current. Usually the most efficient way is to emit a
- * itemsRemoved() signal for all items, reorder the items internally and to emit a
- * itemsInserted() signal afterwards.
+ * Is invoked if the grouped sorting has been changed by KItemModelBase::setGroupedSorting(). Allows
+ * to react on the changed grouped sorting before the signal groupedSortingChanged() will be emitted.
*/
- virtual void onGroupRoleChanged(const QByteArray& current, const QByteArray& previous);
+ virtual void onGroupedSortingChanged(bool current);
/**
* Is invoked if the sort role has been changed by KItemModelBase::setSortRole(). Allows
virtual void onSortOrderChanged(Qt::SortOrder current, Qt::SortOrder previous);
private:
- QByteArray m_groupRole;
+ bool m_groupedSorting;
QByteArray m_sortRole;
Qt::SortOrder m_sortOrder;
};
<default>false</default>
</entry>
- <entry name="CategorizedSorting" type="Bool" >
- <label context="@label">Categorized Sorting</label>
- <whatsthis context="@info:whatsthis">When this option is enabled, the sorted items are summarized by their category.</whatsthis>
+ <entry name="GroupedSorting" type="Bool" >
+ <label context="@label">Grouped Sorting</label>
+ <whatsthis context="@info:whatsthis">When this option is enabled, the sorted items are categorized into groups.</whatsthis>
<default>false</default>
</entry>
void ViewPropertiesDialog::slotCategorizedSortingChanged()
{
- m_viewProps->setCategorizedSorting(m_showInGroups->isChecked());
+ m_viewProps->setGroupedSorting(m_showInGroups->isChecked());
markAsDirty(true);
}
m_dolphinView->setSorting(m_viewProps->sorting());
m_dolphinView->setSortOrder(m_viewProps->sortOrder());
m_dolphinView->setSortFoldersFirst(m_viewProps->sortFoldersFirst());
- m_dolphinView->setCategorizedSorting(m_viewProps->categorizedSorting());
+ m_dolphinView->setGroupedSorting(m_viewProps->groupedSorting());
m_dolphinView->setAdditionalInfoList(m_viewProps->additionalInfoList());
m_dolphinView->setPreviewsShown(m_viewProps->previewsShown());
m_dolphinView->setHiddenFilesShown(m_viewProps->hiddenFilesShown());
// load show preview, show in groups and show hidden files settings
m_previewsShown->setChecked(m_viewProps->previewsShown());
- m_showInGroups->setChecked(m_viewProps->categorizedSorting());
+ m_showInGroups->setChecked(m_viewProps->groupedSorting());
m_showInGroups->setEnabled(index == DolphinView::IconsView); // only the icons view supports categorized sorting
m_showHiddenFiles->setChecked(m_viewProps->hiddenFilesShown());
void testDefaultRoles();
void testDefaultSortRole();
- void testDefaultGroupRole();
+ void testDefaultGroupedSorting();
void testNewItems();
void testRemoveItems();
void testModelConsistencyWhenInsertingItems();
QCOMPARE(m_model->data(2)["name"].toString(), QString("c.txt"));
}
-void KFileItemModelTest::testDefaultGroupRole()
+void KFileItemModelTest::testDefaultGroupedSorting()
{
- QVERIFY(m_model->groupRole().isEmpty());
+ QCOMPARE(m_model->groupedSorting(), false);
}
void KFileItemModelTest::testNewItems()
return m_mode;
}
+void DolphinView::setPreviewsShown(bool show)
+{
+ if (previewsShown() == show) {
+ return;
+ }
+
+ ViewProperties props(url());
+ props.setPreviewsShown(show);
+
+ m_container->setPreviewsShown(show);
+ emit previewsShownChanged(show);
+}
+
bool DolphinView::previewsShown() const
{
return m_container->previewsShown();
}
+void DolphinView::setHiddenFilesShown(bool show)
+{
+ if (m_dirLister->showingDotFiles() == show) {
+ return;
+ }
+
+ const KFileItemList itemList = selectedItems();
+ m_selectedUrls.clear();
+ m_selectedUrls = itemList.urlList();
+
+ ViewProperties props(url());
+ props.setHiddenFilesShown(show);
+
+ m_dirLister->setShowingDotFiles(show);
+ m_dirLister->emitChanges();
+ emit hiddenFilesShownChanged(show);
+}
+
bool DolphinView::hiddenFilesShown() const
{
return m_dirLister->showingDotFiles();
}
-bool DolphinView::categorizedSorting() const
+void DolphinView::setGroupedSorting(bool grouped)
+{
+ if (grouped == groupedSorting()) {
+ return;
+ }
+
+ ViewProperties props(url());
+ props.setGroupedSorting(grouped);
+ props.save();
+
+ m_container->controller()->model()->setGroupedSorting(grouped);
+
+ emit groupedSortingChanged(grouped);
+}
+
+bool DolphinView::groupedSorting() const
{
- return false; //m_storedCategorizedSorting;
+ return fileItemModel()->groupedSorting();
}
KFileItemList DolphinView::items() const
}
}
-void DolphinView::setPreviewsShown(bool show)
-{
- if (previewsShown() == show) {
- return;
- }
-
- ViewProperties props(url());
- props.setPreviewsShown(show);
-
- m_container->setPreviewsShown(show);
- emit previewsShownChanged(show);
-}
-
-void DolphinView::setHiddenFilesShown(bool show)
-{
- if (m_dirLister->showingDotFiles() == show) {
- return;
- }
-
- const KFileItemList itemList = selectedItems();
- m_selectedUrls.clear();
- m_selectedUrls = itemList.urlList();
-
- ViewProperties props(url());
- props.setHiddenFilesShown(show);
-
- m_dirLister->setShowingDotFiles(show);
- m_dirLister->emitChanges();
- emit hiddenFilesShownChanged(show);
-}
-
-void DolphinView::setCategorizedSorting(bool categorized)
-{
- if (categorized == categorizedSorting()) {
- return;
- }
-
- ViewProperties props(url());
- props.setCategorizedSorting(categorized);
- props.save();
-
- //m_viewAccessor.proxyModel()->setCategorizedModel(categorized);
-
- emit categorizedSortingChanged(categorized);
-}
-
bool DolphinView::eventFilter(QObject* watched, QEvent* event)
{
switch (event->type()) {
emit hiddenFilesShownChanged(hiddenFilesShown);
}
-/* m_storedCategorizedSorting = props.categorizedSorting();
- const bool categorized = m_storedCategorizedSorting && supportsCategorizedSorting();
- if (categorized != m_viewAccessor.proxyModel()->isCategorizedModel()) {
- m_viewAccessor.proxyModel()->setCategorizedModel(categorized);
- emit categorizedSortingChanged();
- }*/
+ KFileItemModel* model = fileItemModel();
+
+ const bool groupedSorting = props.groupedSorting();
+ if (groupedSorting != model->groupedSorting()) {
+ model->setGroupedSorting(groupedSorting);
+ emit groupedSortingChanged(groupedSorting);
+ }
const DolphinView::Sorting sorting = props.sorting();
- KFileItemModel* model = fileItemModel();
const QByteArray newSortRole = sortRoleForSorting(sorting);
if (newSortRole != model->sortRole()) {
model->setSortRole(newSortRole);
void setMode(Mode mode);
Mode mode() const;
- /** See setPreviewsShown */
+ /**
+ * Turns on the file preview for the all files of the current directory,
+ * if \a show is true.
+ * If the view properties should be remembered for each directory
+ * (GeneralSettings::globalViewProps() returns false), then the
+ * preview setting will be stored automatically.
+ */
+ void setPreviewsShown(bool show);
bool previewsShown() const;
- /** See setShowHiddenFiles */
+ /**
+ * Shows all hidden files of the current directory,
+ * if \a show is true.
+ * If the view properties should be remembered for each directory
+ * (GeneralSettings::globalViewProps() returns false), then the
+ * show hidden file setting will be stored automatically.
+ */
+ void setHiddenFilesShown(bool show);
bool hiddenFilesShown() const;
- /** See setCategorizedSorting */
- bool categorizedSorting() const;
+ /**
+ * Turns on sorting by groups if \a enable is true.
+ */
+ void setGroupedSorting(bool grouped);
+ bool groupedSorting() const;
/**
* Returns the items of the view.
*/
void pasteIntoFolder();
- /**
- * Turns on the file preview for the all files of the current directory,
- * if \a show is true.
- * If the view properties should be remembered for each directory
- * (GeneralSettings::globalViewProps() returns false), then the
- * preview setting will be stored automatically.
- */
- void setPreviewsShown(bool show);
-
- /**
- * Shows all hidden files of the current directory,
- * if \a show is true.
- * If the view properties should be remembered for each directory
- * (GeneralSettings::globalViewProps() returns false), then the
- * show hidden file setting will be stored automatically.
- */
- void setHiddenFilesShown(bool show);
-
- /**
- * Summarizes all sorted items by their category \a categorized
- * is true.
- * If the view properties should be remembered for each directory
- * (GeneralSettings::globalViewProps() returns false), then the
- * categorized sorting setting will be stored automatically.
- */
- void setCategorizedSorting(bool categorized);
-
/** Activates the view if the item list container gets focus. */
virtual bool eventFilter(QObject* watched, QEvent* event);
/** Is emitted if the 'show hidden files' property has been changed. */
void hiddenFilesShownChanged(bool shown);
- /** Is emitted if the 'categorized sorting' property has been changed. */
- void categorizedSortingChanged(bool sortCategorized);
+ /** Is emitted if the 'grouped sorting' property has been changed. */
+ void groupedSortingChanged(bool groupedSorting);
/** Is emitted if the sorting by name, size or date has been changed. */
void sortingChanged(DolphinView::Sorting sorting);
this, SLOT(slotAdditionalInfoListChanged(QList<DolphinView::AdditionalInfo>,
QList<DolphinView::AdditionalInfo>)));
connect(view, SIGNAL(categorizedSortingChanged(bool)),
- this, SLOT(slotCategorizedSortingChanged(bool)));
+ this, SLOT(slotGroupedSortingChanged(bool)));
connect(view, SIGNAL(hiddenFilesShownChanged(bool)),
this, SLOT(slotHiddenFilesShownChanged(bool)));
connect(view, SIGNAL(sortingChanged(DolphinView::Sorting)),
KToggleAction* showInGroups = m_actionCollection->add<KToggleAction>("show_in_groups");
showInGroups->setText(i18nc("@action:inmenu View", "Show in Groups"));
- connect(showInGroups, SIGNAL(triggered(bool)), this, SLOT(toggleSortCategorization(bool)));
+ connect(showInGroups, SIGNAL(triggered(bool)), this, SLOT(toggleGroupedSorting(bool)));
KToggleAction* showHiddenFiles = m_actionCollection->add<KToggleAction>("show_hidden_files");
showHiddenFiles->setText(i18nc("@action:inmenu View", "Show Hidden Files"));
slotSortOrderChanged(m_currentView->sortOrder());
slotSortFoldersFirstChanged(m_currentView->sortFoldersFirst());
slotAdditionalInfoListChanged(m_currentView->additionalInfoList(), QList<DolphinView::AdditionalInfo>());
- slotCategorizedSortingChanged(m_currentView->categorizedSorting());
+ slotGroupedSortingChanged(m_currentView->groupedSorting());
slotSortingChanged(m_currentView->sorting());
slotZoomLevelChanged(m_currentView->zoomLevel(), -1);
}
}
-void DolphinViewActionHandler::toggleSortCategorization(bool categorizedSorting)
+void DolphinViewActionHandler::toggleGroupedSorting(bool grouped)
{
- m_currentView->setCategorizedSorting(categorizedSorting);
+ m_currentView->setGroupedSorting(grouped);
}
-void DolphinViewActionHandler::slotCategorizedSortingChanged(bool sortCategorized)
+void DolphinViewActionHandler::slotGroupedSortingChanged(bool groupedSorting)
{
QAction* showInGroupsAction = m_actionCollection->action("show_in_groups");
- showInGroupsAction->setChecked(sortCategorized);
+ showInGroupsAction->setChecked(groupedSorting);
}
void DolphinViewActionHandler::toggleShowHiddenFiles(bool show)
showHiddenFilesAction->setChecked(shown);
}
-
KToggleAction* DolphinViewActionHandler::iconsModeAction()
{
KToggleAction* iconsView = m_actionCollection->add<KToggleAction>("icons");
const QList<DolphinView::AdditionalInfo>& previous);
/**
- * Switches between sorting by categories or not.
+ * Switches between sorting by groups or not.
*/
- void toggleSortCategorization(bool);
+ void toggleGroupedSorting(bool);
/**
* Updates the state of the 'Categorized sorting' menu action.
*/
- void slotCategorizedSortingChanged(bool sortCategorized);
+ void slotGroupedSortingChanged(bool sortCategorized);
/**
* Switches between showing and hiding of hidden marked files
}
}
-void ViewProperties::setCategorizedSorting(bool categorized)
+void ViewProperties::setGroupedSorting(bool grouped)
{
- if (m_node->categorizedSorting() != categorized) {
- m_node->setCategorizedSorting(categorized);
+ if (m_node->groupedSorting() != grouped) {
+ m_node->setGroupedSorting(grouped);
update();
}
}
-bool ViewProperties::categorizedSorting() const
+bool ViewProperties::groupedSorting() const
{
- return m_node->categorizedSorting();
+ return m_node->groupedSorting();
}
bool ViewProperties::hiddenFilesShown() const
setViewMode(props.viewMode());
setPreviewsShown(props.previewsShown());
setHiddenFilesShown(props.hiddenFilesShown());
- setCategorizedSorting(props.categorizedSorting());
+ setGroupedSorting(props.groupedSorting());
setSorting(props.sorting());
setSortOrder(props.sortOrder());
setSortFoldersFirst(props.sortFoldersFirst());
void setHiddenFilesShown(bool show);
bool hiddenFilesShown() const;
- void setCategorizedSorting(bool categorized);
- bool categorizedSorting() const;
+ void setGroupedSorting(bool grouped);
+ bool groupedSorting() const;
void setSorting(DolphinView::Sorting sorting);
DolphinView::Sorting sorting() const;