diff options
| author | Rafael Fernández López <[email protected]> | 2007-06-18 17:58:25 +0000 |
|---|---|---|
| committer | Rafael Fernández López <[email protected]> | 2007-06-18 17:58:25 +0000 |
| commit | 61583adb4122db83309dd1120b4c6cd2722d1a68 (patch) | |
| tree | 5a813e3ad737ab6ae7451041c0a14610bdc0b1a5 /src/dolphinitemcategorizer.cpp | |
| parent | e92bbbe27ca39a1329ae3f2d6ecae128dd71855b (diff) | |
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
Diffstat (limited to 'src/dolphinitemcategorizer.cpp')
| -rw-r--r-- | src/dolphinitemcategorizer.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/dolphinitemcategorizer.cpp b/src/dolphinitemcategorizer.cpp index 8d9405dda..88e6733c9 100644 --- a/src/dolphinitemcategorizer.cpp +++ b/src/dolphinitemcategorizer.cpp @@ -111,7 +111,24 @@ QString DolphinItemCategorizer::categoryForItem(const QModelIndex& index, else if (item->isHidden()) retString = data.toString().toUpper().at(0); else - 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"); + else + ++currA; + } + + if (!validCategory) + retString = i18n("Others"); + else + retString = *currA; + } } break; |
