summaryrefslogtreecommitdiffstats
path: root/libkonq/konq_propsview.cpp
diff options
context:
space:
mode:
authorVincent Reher <[email protected]>2022-03-05 15:14:32 -0800
committerMichele Calgaro <[email protected]>2022-07-02 16:02:09 +0900
commitd4e06b76962198eb64e6c2826d4695248102037c (patch)
tree2ab32e02df377eb96cc5ba0dc04729ae61c047e9 /libkonq/konq_propsview.cpp
parentd59c8ee79f91d41d0979bd09c5e50cc43916330c (diff)
downloadtdebase-d4e06b76962198eb64e6c2826d4695248102037c.tar.gz
tdebase-d4e06b76962198eb64e6c2826d4695248102037c.zip
Replace listview's binary "Case Insensitive Sort" option with 3 mutually exclusive options:
1. Unicode based (AB...ab) 2. Unicode based, case insensitive (aAbB) 2. Locale based This resolves issue #252. Signed-off-by: Vincent Reher <[email protected]>
Diffstat (limited to 'libkonq/konq_propsview.cpp')
-rw-r--r--libkonq/konq_propsview.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/libkonq/konq_propsview.cpp b/libkonq/konq_propsview.cpp
index af7a65eae..f72aee191 100644
--- a/libkonq/konq_propsview.cpp
+++ b/libkonq/konq_propsview.cpp
@@ -34,6 +34,8 @@
#include <ksimpleconfig.h>
+#include "konq_sort_constants.h"
+
static TQPixmap wallpaperPixmap( const TQString & _wallpaper )
{
TQString key = "wallpapers/";
@@ -65,10 +67,11 @@ static TQPixmap wallpaperPixmap( const TQString & _wallpaper )
struct KonqPropsView::Private
{
TQStringList* previewsToShow;
+ TextSortOrder textSortOrder;
bool previewsEnabled:1;
bool caseInsensitiveSort:1;
- bool hiddenfirst:1;
bool dirsfirst:1;
+ bool hiddenfirst:1;
bool descending:1;
TQString sortcriterion;
};
@@ -91,6 +94,7 @@ KonqPropsView::KonqPropsView( TDEInstance * instance, KonqPropsView * defaultPro
m_iIconSize = config->readNumEntry( "IconSize", 0 );
m_iItemTextPos = config->readNumEntry( "ItemTextPos", TQIconView::Bottom );
d->sortcriterion = config->readEntry( "SortingCriterion", "sort_nci" );
+ d->textSortOrder = (TextSortOrder) config->readNumEntry( "TextSortOrder", 1 );
d->dirsfirst = config->readBoolEntry( "SortDirsFirst", true );
d->hiddenfirst = config->readBoolEntry( "SortHiddenFirst", true );
d->descending = config->readBoolEntry( "SortDescending", false );
@@ -140,6 +144,11 @@ bool KonqPropsView::isCaseInsensitiveSort() const
return d->caseInsensitiveSort;
}
+TextSortOrder KonqPropsView::getSortOrder() const
+{
+ return d->textSortOrder;
+}
+
bool KonqPropsView::isDirsFirst() const
{
return d->dirsfirst;
@@ -206,6 +215,7 @@ bool KonqPropsView::enterDir( const KURL & dir )
m_iIconSize = m_defaultProps->iconSize();
m_iItemTextPos = m_defaultProps->itemTextPos();
d->sortcriterion = m_defaultProps->sortCriterion();
+ d->textSortOrder = m_defaultProps->getSortOrder();
d->dirsfirst = m_defaultProps->isDirsFirst();
d->hiddenfirst = m_defaultProps->isHiddenFirst();
d->descending = m_defaultProps->isDescending();
@@ -226,6 +236,7 @@ bool KonqPropsView::enterDir( const KURL & dir )
m_iIconSize = config->readNumEntry( "IconSize", m_iIconSize );
m_iItemTextPos = config->readNumEntry( "ItemTextPos", m_iItemTextPos );
d->sortcriterion = config->readEntry( "SortingCriterion" , d->sortcriterion );
+ d->textSortOrder = (TextSortOrder) config->readNumEntry( "TextSortOrder", d->textSortOrder );
d->dirsfirst = config->readBoolEntry( "SortDirsFirst", d->dirsfirst );
d->hiddenfirst = config->readBoolEntry( "SortHiddenFirst", d->hiddenfirst );
d->descending = config->readBoolEntry( "SortDescending", d->descending );
@@ -324,6 +335,20 @@ void KonqPropsView::setSortCriterion( const TQString &criterion )
}
}
+void KonqPropsView::setSortOrder( TextSortOrder order)
+{
+ d->textSortOrder = order;
+ if ( m_defaultProps && !m_bSaveViewPropertiesLocally ) {
+ m_defaultProps->setSortOrder( order );
+ }
+ else if (currentConfig())
+ {
+ TDEConfigGroupSaver cgs(currentConfig(), currentGroup());
+ currentConfig()->writeEntry( "TextSortOrder", d->textSortOrder );
+ currentConfig()->sync();
+ }
+}
+
void KonqPropsView::setDirsFirst( bool first)
{
d->dirsfirst = first;