From d307d0c6c369f1415fc1a7d9d5bde02a72b42da81b3a4ba21265c573e9df827d Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Wed, 12 Apr 2017 13:54:30 +0000 Subject: [PATCH] Accepting request 487557 from home:wolfi323:test - Add enable-natural-sorting-in-KDirSortFilterProxyModel.patch to use natural sorting by default in the KDE file dialog and gwenview, configurable via the "NaturalSorting" option in kdeglobals (boo#1033668, kde#343452) OBS-URL: https://build.opensuse.org/request/show/487557 OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kio?expand=0&rev=176 --- ...-sorting-in-KDirSortFilterProxyModel.patch | 40 +++++++++++++++++++ kio.changes | 8 ++++ kio.spec | 5 ++- 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 enable-natural-sorting-in-KDirSortFilterProxyModel.patch diff --git a/enable-natural-sorting-in-KDirSortFilterProxyModel.patch b/enable-natural-sorting-in-KDirSortFilterProxyModel.patch new file mode 100644 index 0000000..86ae12c --- /dev/null +++ b/enable-natural-sorting-in-KDirSortFilterProxyModel.patch @@ -0,0 +1,40 @@ +From 77d5fa131d695f4813c3f7834c1fd27632eac57e Mon Sep 17 00:00:00 2001 +From: Wolfgang Bauer +Date: Wed, 12 Apr 2017 14:06:37 +0200 +Subject: [PATCH] Enable natural sorting on QCollator in + KDirSortFilterProxyModel + +KDirSortFilterProxyModel is advertised in the header as performing a +"natural sort", ie. "7 8 9 10 11", instead of a lexical "10 11 7 8 9". +However, as far as I can tell this was never true from the start, since +the collator responsible for the actual sorting did not have the +requisite numeric mode enabled, and this setting has always been off by +default as far back as I can find docs for it (Qt 5.2). + +(Dolphin, which offers "natural sort", did not run into this issue +because it does not actually use +KDirSortFilterProxyModel.) + +BUG: 343452 +REVIEW: 128574 +--- + src/filewidgets/kdirsortfilterproxymodel.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/filewidgets/kdirsortfilterproxymodel.cpp b/src/filewidgets/kdirsortfilterproxymodel.cpp +index 89505acf..494999ae 100644 +--- a/src/filewidgets/kdirsortfilterproxymodel.cpp ++++ b/src/filewidgets/kdirsortfilterproxymodel.cpp +@@ -76,6 +76,9 @@ void KDirSortFilterProxyModel::KDirSortFilterProxyModelPrivate::slotNaturalSorti + { + KConfigGroup g(KSharedConfig::openConfig(), "KDE"); + m_naturalSorting = g.readEntry("NaturalSorting", true); ++ if (m_naturalSorting) { ++ m_collator.setNumericMode(true); ++ } + } + + KDirSortFilterProxyModel::KDirSortFilterProxyModel(QObject *parent) +-- +2.12.0 + diff --git a/kio.changes b/kio.changes index e022bae..54e0e84 100644 --- a/kio.changes +++ b/kio.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Apr 12 10:03:26 UTC 2017 - wbauer@tmo.at + +- Add enable-natural-sorting-in-KDirSortFilterProxyModel.patch to + use natural sorting by default in the KDE file dialog and + gwenview, configurable via the "NaturalSorting" option in + kdeglobals (boo#1033668, kde#343452) + ------------------------------------------------------------------- Mon Mar 20 15:24:03 UTC 2017 - lbeltrame@kde.org diff --git a/kio.spec b/kio.spec index d287c18..a58a021 100644 --- a/kio.spec +++ b/kio.spec @@ -75,6 +75,8 @@ Source: http://download.kde.org/stable/frameworks/%{_tar_path}/%{name}-% Source1: baselibs.conf # PATCH-FIX-OPENSUSE kio_help-fallback-to-kde4-docs.patch -- allow kio_help to see into kde4 documentation, needed especially for khelpcenter5 Patch0: kio_help-fallback-to-kde4-docs.patch +# PATCH-FIX-UPSTREAM enable-natural-sorting-in-KDirSortFilterProxyModel.patch wbauer@tmo.at boo#1033668, kde#343452 -- use natural sorting by default in the KDE file dialog and gwenview +Patch1: enable-natural-sorting-in-KDirSortFilterProxyModel.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -84,8 +86,8 @@ file dialog also uses this to provide its network-enabled file management. %package core Summary: Network transparent access to files and data -# core subpackage created with 5.9.0 Group: System/GUI/KDE +# core subpackage created with 5.9.0 Conflicts: kio <= 5.8.0 %description core @@ -121,6 +123,7 @@ Development files. %prep %setup -q %patch0 -p1 +%patch1 -p1 %build %cmake_kf5 -d build