Commit 458bd028 authored by Rafael Fernández López's avatar Rafael Fernández López
Browse files

Dolphin has to react as Konqueror on KDE3. If we find files containing...

Dolphin has to react as Konqueror on KDE3. If we find files containing symbols, we wait for the first letter to categorize it. "((a.txt" goes on category "A", ")2.txt" 
goes on category "Others".

svn path=/trunk/KDE/kdebase/apps/; revision=677225
parent bc570c75
......@@ -111,7 +111,24 @@ QString DolphinItemCategorizer::categoryForItem(const QModelIndex& index,
else if (item->isHidden())
retString = data.toString().toUpper().at(0);
retString = i18n("Others");
bool validCategory = false;
const QChar* currA = data.toString().toUpper().unicode(); // iterator over a
while (!currA->isNull() && !validCategory) {
if (currA->isLetter())
validCategory = true;
else if (currA->isDigit())
return i18n("Others");
if (!validCategory)
retString = i18n("Others");
retString = *currA;
......@@ -133,7 +133,7 @@ bool DolphinSortFilterProxyModel::lessThanGeneralPurpose(const QModelIndex &left
// We don't care about case for building categories. We also don't
// want here to compare by a natural comparation
return QString::compare(leftFileName, rightFileName, Qt::CaseInsensitive) < 0;
return naturalCompare(leftFileName, rightFileName) < 0;
else if (sortRole() == DolphinView::SortBySize) { // If we are sorting by size
// If we are sorting by size, show folders first. We will sort them
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment