diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/dialogs/qfilesystemmodel_p.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/dialogs/qfilesystemmodel_p.h b/src/gui/dialogs/qfilesystemmodel_p.h index 175159ff0f..68e19dcc54 100644 --- a/src/gui/dialogs/qfilesystemmodel_p.h +++ b/src/gui/dialogs/qfilesystemmodel_p.h @@ -238,15 +238,15 @@ public: void sortChildren(int column, const QModelIndex &parent); inline int translateVisibleLocation(QFileSystemNode *parent, int row) const { - if (sortOrder == Qt::AscendingOrder) - return row; - if (parent->dirtyChildrenIndex == -1 || row < parent->dirtyChildrenIndex) - if (parent->dirtyChildrenIndex != -1) - return parent->dirtyChildrenIndex - row - 1; - else + if (sortOrder != Qt::AscendingOrder) { + if (parent->dirtyChildrenIndex == -1) return parent->visibleChildren.count() - row - 1; - else - return row; + + if (row < parent->dirtyChildrenIndex) + return parent->dirtyChildrenIndex - row - 1; + } + + return row; } inline static QString myComputer() { |