From 95053a811c0695dc8fde1e77be9edbcc85e30fb3 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Sun, 18 Aug 2024 14:52:14 +0800 Subject: [PATCH 5/6] qfilesystemmodel.cpp: fix for macOS --- src/gui/dialogs/qfilesystemmodel.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp index 14973e9df..a9debbe98 100644 --- a/src/gui/dialogs/qfilesystemmodel.cpp +++ b/src/gui/dialogs/qfilesystemmodel.cpp @@ -617,7 +617,11 @@ QString QFileSystemModelPrivate::size(const QModelIndex &index) const return QString(); const QFileSystemNode *n = node(index); if (n->isDir()) { +#ifdef Q_OS_MAC + return QLatin1String("--"); +#else return QLatin1String(""); +#endif // Konqueror - "4 KB" // Nautilus - "9 items" (the number of children) } @@ -787,7 +791,11 @@ QVariant QFileSystemModel::headerData(int section, Qt::Orientation orientation, break; } case 2: { +#ifdef Q_OS_MAC + returnValue = tr("Kind"); +#else returnValue = tr("Type"); +#endif break; } // Konqueror - File Type @@ -933,11 +941,13 @@ public: { switch (sortColumn) { case 0: { +#ifndef Q_OS_MAC // place directories before files bool left = l->isDir(); bool right = r->isDir(); if (left ^ right) return left; +#endif return QFileSystemModelPrivate::naturalCompare(l->fileName, r->fileName, Qt::CaseInsensitive) < 0; } -- 2.49.0