Commit bb67def1 authored by Heiko Becker's avatar Heiko Becker
Browse files

Revert "Configurable Show hidden files and folders last toggle"

This reverts commit 50149d6a.

It breaks the string freeze and I don't think it can count as a bug
fix, so it breaks the feature freeze, too.

CCMAIL: zrenfire@gmail.com
parent 272aa65b
......@@ -34,7 +34,6 @@ KFileItemModel::KFileItemModel(QObject* parent) :
KItemModelBase("text", parent),
m_dirLister(nullptr),
m_sortDirsFirst(true),
m_sortHiddenLast(true),
m_sortRole(NameRole),
m_sortingProgressPercent(-1),
m_roles(),
......@@ -213,19 +212,6 @@ bool KFileItemModel::sortDirectoriesFirst() const
return m_sortDirsFirst;
}
void KFileItemModel::setSortHiddenLast(bool hiddenLast)
{
if (hiddenLast != m_sortHiddenLast) {
m_sortHiddenLast = hiddenLast;
resortAllItems();
}
}
bool KFileItemModel::sortHiddenLast() const
{
return m_sortHiddenLast;
}
void KFileItemModel::setShowHiddenFiles(bool show)
{
m_dirLister->setShowingDotFiles(show);
......@@ -1748,14 +1734,12 @@ bool KFileItemModel::lessThan(const ItemData* a, const ItemData* b, const QColla
}
// Show hidden files and folders last
if (m_sortHiddenLast) {
const bool isHiddenA = a->item.isHidden();
const bool isHiddenB = b->item.isHidden();
if (isHiddenA && !isHiddenB) {
return false;
} else if (!isHiddenA && isHiddenB) {
return true;
}
const bool isHiddenA = a->item.isHidden();
const bool isHiddenB = b->item.isHidden();
if (isHiddenA && !isHiddenB) {
return false;
} else if (!isHiddenA && isHiddenB) {
return true;
}
if (m_sortDirsFirst || (DetailsModeSettings::directorySizeCount() && m_sortRole == SizeRole)) {
......
......@@ -80,12 +80,6 @@ public:
void setSortDirectoriesFirst(bool dirsFirst);
bool sortDirectoriesFirst() const;
/**
* Sets a separate sorting with hidden files and folders last (true) or not (false).
*/
void setSortHiddenLast(bool hiddenLast);
bool sortHiddenLast() const;
void setShowHiddenFiles(bool show);
bool showHiddenFiles() const;
......@@ -469,7 +463,6 @@ private:
QCollator m_collator;
bool m_naturalSorting;
bool m_sortDirsFirst;
bool m_sortHiddenLast;
RoleType m_sortRole;
int m_sortingProgressPercent; // Value of directorySortingProgress() signal
......
......@@ -57,11 +57,6 @@
<default>true</default>
</entry>
<entry name="SortHiddenLast" type="Bool" >
<label context="@label">Show hidden files and folders last</label>
<default>true</default>
</entry>
<entry name="VisibleRoles" type="StringList">
<label context="@label">Visible roles</label>
<default></default>
......
......@@ -44,7 +44,6 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
m_sortOrder(nullptr),
m_sorting(nullptr),
m_sortFoldersFirst(nullptr),
m_sortHiddenLast(nullptr),
m_previewsShown(nullptr),
m_showInGroups(nullptr),
m_showHiddenFiles(nullptr),
......@@ -83,7 +82,6 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
}
m_sortFoldersFirst = new QCheckBox(i18nc("@option:check", "Show folders first"));
m_sortHiddenLast = new QCheckBox(i18nc("@option:check", "Show hidden files last"));
m_previewsShown = new QCheckBox(i18nc("@option:check", "Show preview"));
m_showInGroups = new QCheckBox(i18nc("@option:check", "Show in groups"));
m_showHiddenFiles = new QCheckBox(i18nc("@option:check", "Show hidden files"));
......@@ -148,7 +146,6 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
layout->addRow(QString(), m_previewsShown);
layout->addRow(QString(), m_showInGroups);
layout->addRow(QString(), m_showHiddenFiles);
layout->addRow(QString(), m_sortHiddenLast);
connect(m_viewMode, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &ViewPropertiesDialog::slotViewModeChanged);
......@@ -158,8 +155,6 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
this, &ViewPropertiesDialog::slotSortOrderChanged);
connect(m_sortFoldersFirst, &QCheckBox::clicked,
this, &ViewPropertiesDialog::slotSortFoldersFirstChanged);
connect(m_sortHiddenLast, &QCheckBox::clicked,
this, &ViewPropertiesDialog::slotSortHiddenLastChanged);
connect(m_previewsShown, &QCheckBox::clicked,
this, &ViewPropertiesDialog::slotShowPreviewChanged);
connect(m_showInGroups, &QCheckBox::clicked,
......@@ -287,13 +282,6 @@ void ViewPropertiesDialog::slotSortFoldersFirstChanged()
markAsDirty(true);
}
void ViewPropertiesDialog::slotSortHiddenLastChanged()
{
const bool hiddenLast = m_sortHiddenLast->isChecked();
m_viewProps->setSortHiddenLast(hiddenLast);
markAsDirty(true);
}
void ViewPropertiesDialog::slotShowPreviewChanged()
{
const bool show = m_previewsShown->isChecked();
......@@ -395,7 +383,6 @@ void ViewPropertiesDialog::applyViewProperties()
m_dolphinView->setSortRole(m_viewProps->sortRole());
m_dolphinView->setSortOrder(m_viewProps->sortOrder());
m_dolphinView->setSortFoldersFirst(m_viewProps->sortFoldersFirst());
m_dolphinView->setSortHiddenLast(m_viewProps->sortHiddenLast());
m_dolphinView->setGroupedSorting(m_viewProps->groupedSorting());
m_dolphinView->setVisibleRoles(m_viewProps->visibleRoles());
m_dolphinView->setPreviewsShown(m_viewProps->previewsShown());
......@@ -431,7 +418,6 @@ void ViewPropertiesDialog::loadSettings()
m_sorting->setCurrentIndex(sortRoleIndex);
m_sortFoldersFirst->setChecked(m_viewProps->sortFoldersFirst());
m_sortHiddenLast->setChecked(m_viewProps->sortHiddenLast());
// Load show preview, show in groups and show hidden files settings
m_previewsShown->setChecked(m_viewProps->previewsShown());
......
......@@ -46,7 +46,6 @@ private Q_SLOTS:
void slotSortOrderChanged(int index);
void slotGroupedSortingChanged();
void slotSortFoldersFirstChanged();
void slotSortHiddenLastChanged();
void slotShowPreviewChanged();
void slotShowHiddenFilesChanged();
void slotItemChanged(QListWidgetItem *item);
......@@ -68,7 +67,6 @@ private:
QComboBox* m_sortOrder;
QComboBox* m_sorting;
QCheckBox* m_sortFoldersFirst;
QCheckBox* m_sortHiddenLast;
QCheckBox* m_previewsShown;
QCheckBox* m_showInGroups;
QCheckBox* m_showHiddenFiles;
......
......@@ -463,18 +463,6 @@ bool DolphinView::sortFoldersFirst() const
return m_model->sortDirectoriesFirst();
}
void DolphinView::setSortHiddenLast(bool hiddenLast)
{
if (sortHiddenLast() != hiddenLast) {
updateSortHiddenLast(hiddenLast);
}
}
bool DolphinView::sortHiddenLast() const
{
return m_model->sortHiddenLast();
}
void DolphinView::setVisibleRoles(const QList<QByteArray>& roles)
{
const QList<QByteArray> previousRoles = roles;
......@@ -1385,17 +1373,6 @@ void DolphinView::updateSortFoldersFirst(bool foldersFirst)
Q_EMIT sortFoldersFirstChanged(foldersFirst);
}
void DolphinView::updateSortHiddenLast(bool hiddenLast)
{
ViewProperties props(viewPropertiesUrl());
props.setSortHiddenLast(hiddenLast);
m_model->setSortHiddenLast(hiddenLast);
Q_EMIT sortHiddenLastChanged(hiddenLast);
}
QPair<bool, QString> DolphinView::pasteInfo() const
{
const QMimeData *mimeData = QApplication::clipboard()->mimeData();
......@@ -1926,12 +1903,6 @@ void DolphinView::applyViewProperties(const ViewProperties& props)
Q_EMIT sortFoldersFirstChanged(sortFoldersFirst);
}
const bool sortHiddenLast = props.sortHiddenLast();
if (sortHiddenLast != m_model->sortHiddenLast()) {
m_model->setSortHiddenLast(sortHiddenLast);
Q_EMIT sortHiddenLastChanged(sortHiddenLast);
}
const QList<QByteArray> visibleRoles = props.visibleRoles();
if (visibleRoles != m_visibleRoles) {
const QList<QByteArray> previousVisibleRoles = m_visibleRoles;
......
......@@ -206,10 +206,6 @@ public:
void setSortFoldersFirst(bool foldersFirst);
bool sortFoldersFirst() const;
/** Sets a separate sorting with hidden files and folders last (true) or not (false). */
void setSortHiddenLast(bool hiddenLast);
bool sortHiddenLast() const;
/** Sets the additional information which should be shown for the items. */
void setVisibleRoles(const QList<QByteArray>& roles);
......@@ -474,11 +470,6 @@ Q_SIGNALS:
*/
void sortFoldersFirstChanged(bool foldersFirst);
/**
* Is emitted if the sorting of hidden files has been changed.
*/
void sortHiddenLastChanged(bool hiddenLast);
/** Is emitted if the additional information shown for this view has been changed. */
void visibleRolesChanged(const QList<QByteArray>& current,
const QList<QByteArray>& previous);
......@@ -688,12 +679,6 @@ private Q_SLOTS:
*/
void updateSortFoldersFirst(bool foldersFirst);
/**
* Updates the view properties of the current URL to the
* sorting of hidden files given by \a hiddenLast.
*/
void updateSortHiddenLast(bool hiddenLast);
/**
* Indicates in the status bar that the delete operation
* of the job \a job has been finished.
......
......@@ -57,8 +57,6 @@ void DolphinViewActionHandler::setCurrentView(DolphinView* view)
this, &DolphinViewActionHandler::slotSortOrderChanged);
connect(view, &DolphinView::sortFoldersFirstChanged,
this, &DolphinViewActionHandler::slotSortFoldersFirstChanged);
connect(view, &DolphinView::sortHiddenLastChanged,
this, &DolphinViewActionHandler::slotSortHiddenLastChanged);
connect(view, &DolphinView::visibleRolesChanged,
this, &DolphinViewActionHandler::slotVisibleRolesChanged);
connect(view, &DolphinView::groupedSortingChanged,
......@@ -255,10 +253,6 @@ void DolphinViewActionHandler::createActions()
sortFoldersFirst->setText(i18nc("@action:inmenu Sort", "Folders First"));
connect(sortFoldersFirst, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleSortFoldersFirst);
KToggleAction* sortHiddenLast = m_actionCollection->add<KToggleAction>(QStringLiteral("hidden_last"));
sortHiddenLast->setText(i18nc("@action:inmenu Sort", "Hidden Files Last"));
connect(sortHiddenLast, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleSortHiddenLast);
// View -> Sort By
QActionGroup* sortByActionGroup = createFileItemRolesActionGroup(QStringLiteral("sort_by_"));
......@@ -293,7 +287,6 @@ void DolphinViewActionHandler::createActions()
sortByActionMenu->addAction(descendingAction);
sortByActionMenu->addSeparator();
sortByActionMenu->addAction(sortFoldersFirst);
sortByActionMenu->addAction(sortHiddenLast);
// View -> Additional Information
QActionGroup* visibleRolesGroup = createFileItemRolesActionGroup(QStringLiteral("show_"));
......@@ -488,7 +481,6 @@ void DolphinViewActionHandler::updateViewActions()
slotSortOrderChanged(m_currentView->sortOrder());
slotSortFoldersFirstChanged(m_currentView->sortFoldersFirst());
slotSortHiddenLastChanged(m_currentView->sortHiddenLast());
slotVisibleRolesChanged(m_currentView->visibleRoles(), QList<QByteArray>());
slotGroupedSortingChanged(m_currentView->groupedSorting());
slotSortRoleChanged(m_currentView->sortRole());
......@@ -524,12 +516,6 @@ void DolphinViewActionHandler::toggleSortFoldersFirst()
m_currentView->setSortFoldersFirst(!sortFirst);
}
void DolphinViewActionHandler::toggleSortHiddenLast()
{
const bool sortHiddenLast = m_currentView->sortHiddenLast();
m_currentView->setSortHiddenLast(!sortHiddenLast);
}
void DolphinViewActionHandler::slotSortOrderChanged(Qt::SortOrder order)
{
QAction* descending = m_actionCollection->action(QStringLiteral("descending"));
......@@ -544,11 +530,6 @@ void DolphinViewActionHandler::slotSortFoldersFirstChanged(bool foldersFirst)
m_actionCollection->action(QStringLiteral("folders_first"))->setChecked(foldersFirst);
}
void DolphinViewActionHandler::slotSortHiddenLastChanged(bool hiddenLast)
{
m_actionCollection->action(QStringLiteral("hidden_last"))->setChecked(hiddenLast);
}
void DolphinViewActionHandler::toggleVisibleRole(QAction* action)
{
Q_EMIT actionBeingHandled();
......
......@@ -136,16 +136,6 @@ private Q_SLOTS:
*/
void slotSortFoldersFirstChanged(bool foldersFirst);
/**
* Switches between showing hidden files last or not.
*/
void toggleSortHiddenLast();
/**
* Updates the state of the 'Sort Hidden Last' action.
*/
void slotSortHiddenLastChanged(bool hiddenLast);
/**
* Updates the state of the 'Sort by' actions.
*/
......
......@@ -245,19 +245,6 @@ bool ViewProperties::sortFoldersFirst() const
return m_node->sortFoldersFirst();
}
void ViewProperties::setSortHiddenLast(bool hiddenLast)
{
if (m_node->sortHiddenLast() != hiddenLast) {
m_node->setSortHiddenLast(hiddenLast);
update();
}
}
bool ViewProperties::sortHiddenLast() const
{
return m_node->sortHiddenLast();
}
void ViewProperties::setVisibleRoles(const QList<QByteArray>& roles)
{
if (roles == visibleRoles()) {
......@@ -366,7 +353,6 @@ void ViewProperties::setDirProperties(const ViewProperties& props)
setSortRole(props.sortRole());
setSortOrder(props.sortOrder());
setSortFoldersFirst(props.sortFoldersFirst());
setSortHiddenLast(props.sortHiddenLast());
setVisibleRoles(props.visibleRoles());
setHeaderColumnWidths(props.headerColumnWidths());
m_node->setVersion(props.m_node->version());
......
......@@ -62,9 +62,6 @@ public:
void setSortFoldersFirst(bool foldersFirst);
bool sortFoldersFirst() const;
void setSortHiddenLast(bool hiddenLast);
bool sortHiddenLast() const;
/**
* Sets the additional information for the current set view-mode.
* Note that the additional-info property is the only property where
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment