mirror of
https://invent.kde.org/system/dolphin
synced 2024-07-04 17:30:55 +00:00
Reverted an incorrect change
This commit is contained in:
parent
9aaf305410
commit
9167b30a35
|
@ -979,6 +979,7 @@ void KFileItemModel::onSortOrderChanged(Qt::SortOrder current, Qt::SortOrder pre
|
||||||
{
|
{
|
||||||
Q_UNUSED(current)
|
Q_UNUSED(current)
|
||||||
Q_UNUSED(previous)
|
Q_UNUSED(previous)
|
||||||
|
resortAllItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
void KFileItemModel::onGroupRoleChanged(const QByteArray ¤t, const QByteArray &previous, bool resortItems)
|
void KFileItemModel::onGroupRoleChanged(const QByteArray ¤t, const QByteArray &previous, bool resortItems)
|
||||||
|
@ -1008,6 +1009,7 @@ void KFileItemModel::onGroupOrderChanged(Qt::SortOrder current, Qt::SortOrder pr
|
||||||
{
|
{
|
||||||
Q_UNUSED(current)
|
Q_UNUSED(current)
|
||||||
Q_UNUSED(previous)
|
Q_UNUSED(previous)
|
||||||
|
resortAllItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
void KFileItemModel::loadSortingSettings()
|
void KFileItemModel::loadSortingSettings()
|
||||||
|
@ -1032,7 +1034,7 @@ void KFileItemModel::loadSortingSettings()
|
||||||
// Workaround for bug https://bugreports.qt.io/browse/QTBUG-69361
|
// Workaround for bug https://bugreports.qt.io/browse/QTBUG-69361
|
||||||
// Force the clean state of QCollator in single thread to avoid thread safety problems in sort
|
// Force the clean state of QCollator in single thread to avoid thread safety problems in sort
|
||||||
m_collator.compare(QString(), QString());
|
m_collator.compare(QString(), QString());
|
||||||
m_dirSizeMode = ContentDisplaySettings::directorySizeMode();
|
ContentDisplaySettings::self();
|
||||||
}
|
}
|
||||||
|
|
||||||
void KFileItemModel::resortAllItems()
|
void KFileItemModel::resortAllItems()
|
||||||
|
@ -2100,7 +2102,7 @@ bool KFileItemModel::lessThan(const ItemData *a, const ItemData *b, const QColla
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (m_sortDirsFirst || (m_dirSizeMode == ContentDisplaySettings::EnumDirectorySizeMode::ContentCount && m_sortRole == SizeRole)) {
|
if (m_sortDirsFirst || (ContentDisplaySettings::directorySizeMode() == ContentDisplaySettings::EnumDirectorySizeMode::ContentCount && m_sortRole == SizeRole)) {
|
||||||
const bool isDirA = a->item.isDir();
|
const bool isDirA = a->item.isDir();
|
||||||
const bool isDirB = b->item.isDir();
|
const bool isDirB = b->item.isDir();
|
||||||
if (isDirA && !isDirB) {
|
if (isDirA && !isDirB) {
|
||||||
|
@ -2154,7 +2156,7 @@ int KFileItemModel::sortRoleCompare(const ItemData *a, const ItemData *b, const
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SizeRole: {
|
case SizeRole: {
|
||||||
if (m_dirSizeMode == ContentDisplaySettings::EnumDirectorySizeMode::ContentCount && itemA.isDir()) {
|
if (ContentDisplaySettings::directorySizeMode() == ContentDisplaySettings::EnumDirectorySizeMode::ContentCount && itemA.isDir()) {
|
||||||
// folders first then
|
// folders first then
|
||||||
// items A and B are folders thanks to lessThan checks
|
// items A and B are folders thanks to lessThan checks
|
||||||
auto valueA = a->values.value("count");
|
auto valueA = a->values.value("count");
|
||||||
|
@ -2512,7 +2514,7 @@ KFileItemModel::ItemGroupInfo KFileItemModel::sizeRoleGroup(const ItemData *item
|
||||||
|
|
||||||
groupInfo.comparable = -1; // None
|
groupInfo.comparable = -1; // None
|
||||||
if (!item.isNull() && item.isDir()) {
|
if (!item.isNull() && item.isDir()) {
|
||||||
if (m_dirSizeMode != ContentDisplaySettings::EnumDirectorySizeMode::ContentSize) {
|
if (ContentDisplaySettings::directorySizeMode() != ContentDisplaySettings::EnumDirectorySizeMode::ContentSize) {
|
||||||
groupInfo.comparable = 0; // Folders
|
groupInfo.comparable = 0; // Folders
|
||||||
} else {
|
} else {
|
||||||
fileSize = itemData->values.value("size").toULongLong();
|
fileSize = itemData->values.value("size").toULongLong();
|
||||||
|
|
|
@ -580,7 +580,6 @@ private:
|
||||||
bool m_naturalSorting;
|
bool m_naturalSorting;
|
||||||
bool m_sortDirsFirst;
|
bool m_sortDirsFirst;
|
||||||
bool m_sortHiddenLast;
|
bool m_sortHiddenLast;
|
||||||
int m_dirSizeMode;
|
|
||||||
|
|
||||||
RoleType m_sortRole;
|
RoleType m_sortRole;
|
||||||
RoleType m_groupRole;
|
RoleType m_groupRole;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user