diff options
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; |
