summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <peter.penz19@gmail.com>2012-01-28 20:17:01 (GMT)
committerPeter Penz <peter.penz19@gmail.com>2012-01-28 21:11:51 (GMT)
commit803f50b4e78ca4de6b9fd6a6b4a6667c6d749a90 (patch)
tree7467da2d5bf2ee60e3be9dba28dcfe1706228d55
parentbc80a99ffa5a658ba1d7be00c681f5394e365790 (diff)
Fix regression: Respect "natural sorting" setting
BUG: 292270 FIXED-IN: 4.8.1
-rw-r--r--dolphin/src/kitemviews/kfileitemmodel.cpp11
-rw-r--r--dolphin/src/kitemviews/kfileitemmodel.h1
2 files changed, 11 insertions, 1 deletions
diff --git a/dolphin/src/kitemviews/kfileitemmodel.cpp b/dolphin/src/kitemviews/kfileitemmodel.cpp
index fb08907..163db82 100644
--- a/dolphin/src/kitemviews/kfileitemmodel.cpp
+++ b/dolphin/src/kitemviews/kfileitemmodel.cpp
@@ -21,6 +21,7 @@
#include <KDirLister>
#include <KDirModel>
+#include <KGlobalSettings>
#include <KLocale>
#include <KStringHandler>
#include <KDebug>
@@ -33,7 +34,7 @@
KFileItemModel::KFileItemModel(KDirLister* dirLister, QObject* parent) :
KItemModelBase("name", parent),
m_dirLister(dirLister),
- m_naturalSorting(true),
+ m_naturalSorting(KGlobalSettings::naturalSorting()),
m_sortFoldersFirst(true),
m_sortRole(NameRole),
m_roles(),
@@ -95,6 +96,8 @@ KFileItemModel::KFileItemModel(KDirLister* dirLister, QObject* parent) :
connect(m_resortAllItemsTimer, SIGNAL(timeout()), this, SLOT(resortAllItems()));
Q_ASSERT(m_minimumUpdateIntervalTimer->interval() <= m_maximumUpdateIntervalTimer->interval());
+
+ connect(KGlobalSettings::self(), SIGNAL(naturalSortingChanged()), this, SLOT(slotNaturalSortingChanged()));
}
KFileItemModel::~KFileItemModel()
@@ -862,6 +865,12 @@ void KFileItemModel::slotClear(const KUrl& url)
Q_UNUSED(url);
}
+void KFileItemModel::slotNaturalSortingChanged()
+{
+ m_naturalSorting = KGlobalSettings::naturalSorting();
+ resortAllItems();
+}
+
void KFileItemModel::dispatchPendingItemsToInsert()
{
if (!m_pendingItemsToInsert.isEmpty()) {
diff --git a/dolphin/src/kitemviews/kfileitemmodel.h b/dolphin/src/kitemviews/kfileitemmodel.h
index acb3eb1..6276dc2 100644
--- a/dolphin/src/kitemviews/kfileitemmodel.h
+++ b/dolphin/src/kitemviews/kfileitemmodel.h
@@ -186,6 +186,7 @@ private slots:
void slotRefreshItems(const QList<QPair<KFileItem, KFileItem> >& items);
void slotClear();
void slotClear(const KUrl& url);
+ void slotNaturalSortingChanged();
void dispatchPendingItemsToInsert();