mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
Update size order for folders
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
242ddbb7e1
commit
29d32f0d9a
9 changed files with 15 additions and 19 deletions
|
|
@ -79,7 +79,7 @@ static void removeThePrefix(QString& string)
|
|||
string = string.trimmed();
|
||||
}
|
||||
|
||||
int Resource::compare(const Resource& other, SortType type, Qt::SortOrder order) const
|
||||
int Resource::compare(const Resource& other, SortType type) const
|
||||
{
|
||||
switch (type) {
|
||||
default:
|
||||
|
|
@ -105,12 +105,11 @@ int Resource::compare(const Resource& other, SortType type, Qt::SortOrder order)
|
|||
return -1;
|
||||
break;
|
||||
case SortType::SIZE: {
|
||||
auto order_op = order == Qt::SortOrder::AscendingOrder ? 1 : -1;
|
||||
if (this->type() != other.type()) {
|
||||
if (this->type() == ResourceType::FOLDER)
|
||||
return -1 * order_op;
|
||||
return -1;
|
||||
if (other.type() == ResourceType::FOLDER)
|
||||
return 1 * order_op;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (sizeInfo() > other.sizeInfo())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue