Index: /trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileModel.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileModel.cpp	(revision 75621)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileModel.cpp	(revision 75622)
@@ -53,13 +53,29 @@
         {
             if (pLeftItem->isDirectory() && !pRightItem->isDirectory())
-                return true && (sortOrder() == Qt::AscendingOrder);
+                return (sortOrder() == Qt::AscendingOrder);
             if (!pLeftItem->isDirectory() && pRightItem->isDirectory())
-                return false && (sortOrder() == Qt::AscendingOrder);
+                return (sortOrder() == Qt::DescendingOrder);
         }
         /* Up directory item should be always the first item: */
         if (pLeftItem->isUpDirectory())
-            return true && (sortOrder() == Qt::AscendingOrder);
+            return (sortOrder() == Qt::AscendingOrder);
         else if (pRightItem->isUpDirectory())
-            return false && (sortOrder() == Qt::AscendingOrder);
+            return (sortOrder() == Qt::DescendingOrder);
+
+        /* If the sort column is datatime than handle it correctly: */
+        if (sortColumn() == UIGuestControlFileModelColumn_ChangeTime)
+        {
+            QVariant dataLeft = pLeftItem->data(UIGuestControlFileModelColumn_ChangeTime);
+            QVariant dataRight = pRightItem->data(UIGuestControlFileModelColumn_ChangeTime);
+            /* Being a bit paranoid?: */
+            if (dataLeft.canConvert(QMetaType::QDateTime) &&
+                dataRight.canConvert(QMetaType::QDateTime))
+            {
+                QDateTime leftDateTime = dataLeft.toDateTime();
+                QDateTime rightDateTime = dataRight.toDateTime();
+                return (leftDateTime < rightDateTime);
+            }
+
+        }
     }
     return QSortFilterProxyModel::lessThan(left, right);
