Accepting request 487586 from KDE:Frameworks5

1

OBS-URL: https://build.opensuse.org/request/show/487586
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kio?expand=0&rev=45
This commit is contained in:
Dominique Leuenberger 2017-04-18 11:47:12 +00:00 committed by Git OBS Bridge
commit e073ce5d4e
3 changed files with 52 additions and 1 deletions

View File

@ -0,0 +1,40 @@
From 77d5fa131d695f4813c3f7834c1fd27632eac57e Mon Sep 17 00:00:00 2001
From: Wolfgang Bauer <wbauer@tmo.at>
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

View File

@ -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

View File

@ -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