src/gui/dialogs/qfilesystemmodel_p.h
branchRCL_3
changeset 4 3b1da2848fc7
parent 0 1918ee327afb
--- a/src/gui/dialogs/qfilesystemmodel_p.h	Tue Feb 02 00:43:10 2010 +0200
+++ b/src/gui/dialogs/qfilesystemmodel_p.h	Fri Feb 19 23:40:16 2010 +0200
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
@@ -238,15 +238,15 @@
     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)
+        if (sortOrder != Qt::AscendingOrder) {
+            if (parent->dirtyChildrenIndex == -1)
+                return parent->visibleChildren.count() - row - 1;
+
+            if (row < parent->dirtyChildrenIndex)
                 return parent->dirtyChildrenIndex - row - 1;
-            else
-                return parent->visibleChildren.count() - row - 1;
-        else
-            return row;
+        }
+
+        return row;
     }
 
     inline static QString myComputer() {